销毁机制修改 [Experimental]
This commit is contained in:
parent
c328de748f
commit
e7d22b9cd1
|
@ -71,12 +71,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
fullskin:true,
|
||||
type:'basic',
|
||||
enable:false,
|
||||
global:'ying_destory',
|
||||
destroy:'discardPile',
|
||||
getYing:function(count){
|
||||
var cards=[];
|
||||
if(typeof count!='number') count=1;
|
||||
while(count--){
|
||||
cards.push(game.createCard('ying','spade',1));
|
||||
let card=game.createCard('ying','spade',1);
|
||||
card.destroyed='discardPile';
|
||||
cards.push(card);
|
||||
}
|
||||
return cards;
|
||||
},
|
||||
|
@ -95,24 +97,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
skill:{
|
||||
//江山如故·转
|
||||
//白牌
|
||||
ying_destory:{
|
||||
trigger:{
|
||||
player:'loseAfter',
|
||||
global:['loseAsyncAfter','cardsDiscardAfter','equipAfter'],
|
||||
},
|
||||
cardSkill:true,
|
||||
forced:true,
|
||||
popup:false,
|
||||
filter:function(event,player){
|
||||
return event.getd().some(i=>get.name(i,false)=='ying'&&get.position(i,true)=='d');
|
||||
},
|
||||
content:function(){
|
||||
var cards=trigger.getd().filter(i=>get.name(i,false)=='ying'&&get.position(i,true)=='d');
|
||||
game.cardsGotoSpecial(cards);
|
||||
game.log(cards,'被移出了游戏');
|
||||
},
|
||||
},
|
||||
//404郭嘉
|
||||
jsrgqingzi:{
|
||||
audio:2,
|
||||
|
|
|
@ -11609,7 +11609,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
return 7-get.value(card);
|
||||
},
|
||||
content:function(){
|
||||
player.addSkill('pyzhuren_destroy');
|
||||
//player.addSkill('pyzhuren_destroy');
|
||||
if(!_status.pyzhuren) _status.pyzhuren={};
|
||||
var rand=0.85;
|
||||
var num=get.number(cards[0]);
|
||||
|
@ -11627,7 +11627,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
}
|
||||
else{
|
||||
_status.pyzhuren[name]=true;
|
||||
player.gain(game.createCard(name,cards[0].name=='shandian'?'spade':cards[0].suit,1),'gain2')
|
||||
var card=game.createCard(name,cards[0].name=='shandian'?'spade':cards[0].suit,1);
|
||||
card.destroyed='discardPile';
|
||||
player.gain(card,'gain2')
|
||||
}
|
||||
},
|
||||
ai:{
|
||||
|
@ -11637,32 +11639,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
},
|
||||
},
|
||||
},
|
||||
pyzhuren_destroy:{
|
||||
trigger:{global:['loseEnd','cardsDiscardEnd']},
|
||||
forced:true,
|
||||
charlotte:true,
|
||||
filter:function(event,player){
|
||||
var cs=event.cards;
|
||||
for(var i=0;i<cs.length;i++){
|
||||
if(cs[i].name.indexOf('pyzhuren_')==0&&get.position(cs[i],true)=='d') return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
forceDie:true,
|
||||
content:function(){
|
||||
if(!_status.pyzhuren) _status.pyzhuren={};
|
||||
var list=[];
|
||||
var cs=trigger.cards;
|
||||
for(var i=0;i<cs.length;i++){
|
||||
if(cs[i].name.indexOf('pyzhuren_')==0&&get.position(cs[i],true)=='d'){
|
||||
_status.pyzhuren[cs[i].name]=false;
|
||||
list.push(cs[i]);
|
||||
}
|
||||
}
|
||||
game.log(list,'已被移出游戏');
|
||||
game.cardsGotoSpecial(list);
|
||||
},
|
||||
},
|
||||
pyzhuren_heart:{
|
||||
audio:true,
|
||||
trigger:{source:'damageSource'},
|
||||
|
|
73
game/game.js
73
game/game.js
|
@ -12744,15 +12744,10 @@
|
|||
event.finish();
|
||||
return;
|
||||
}
|
||||
if(card.destroyed){
|
||||
if(player.hasSkill(card.destroyed)){
|
||||
delete card.destroyed;
|
||||
}
|
||||
else{
|
||||
if(card.willBeDestroyed('equip',player,event)){
|
||||
event.finish();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if(event.owner){
|
||||
if(event.owner.getCards('hejsx').contains(card)){
|
||||
event.finish();
|
||||
|
@ -13723,6 +13718,10 @@
|
|||
game.getGlobalHistory().cardMove.push(event);
|
||||
var withPile=false;
|
||||
for(var i=0;i<cards.length;i++){
|
||||
if(cards[i].willBeDestroyed('discardPile',null,event)){
|
||||
cards[i].splice(i--,1);
|
||||
continue;
|
||||
}
|
||||
if(get.position(cards[i],true)=='c') withPile=true;
|
||||
cards[i].discard();
|
||||
}
|
||||
|
@ -13739,6 +13738,10 @@
|
|||
game.getGlobalHistory().cardMove.push(event);
|
||||
var withPile=false;
|
||||
for(var i=0;i<cards.length;i++){
|
||||
if(cards[i].willBeDestroyed('ordering',null,event)){
|
||||
cards[i].splice(i--,1);
|
||||
continue;
|
||||
}
|
||||
if(get.position(cards[i],true)=='c') withPile=true;
|
||||
cards[i].fix();
|
||||
ui.ordering.appendChild(cards[i]);
|
||||
|
@ -13758,6 +13761,10 @@
|
|||
game.getGlobalHistory().cardMove.push(event);
|
||||
var withPile=false;
|
||||
for(var i=0;i<cards.length;i++){
|
||||
if(cards[i].willBeDestroyed('special',null,event)){
|
||||
cards[i].splice(i--,1);
|
||||
continue;
|
||||
}
|
||||
if(get.position(cards[i],true)=='c') withPile=true;
|
||||
cards[i].fix();
|
||||
ui.special.appendChild(cards[i]);
|
||||
|
@ -19256,14 +19263,9 @@
|
|||
}
|
||||
"step 1"
|
||||
for(var i=0;i<cards.length;i++){
|
||||
if(cards[i].destroyed){
|
||||
if(player.hasSkill(cards[i].destroyed)){
|
||||
delete cards[i].destroyed;
|
||||
}
|
||||
else{
|
||||
if(cards[i].willBeDestroyed('handcard',player,event)){
|
||||
cards.splice(i--,1);
|
||||
}
|
||||
}
|
||||
else if(event.losing_map){
|
||||
for(var id in event.losing_map){
|
||||
if(event.losing_map[id][0].contains(cards[i])){
|
||||
|
@ -19455,14 +19457,9 @@
|
|||
}
|
||||
"step 1"
|
||||
for(var i=0;i<cards.length;i++){
|
||||
if(cards[i].destroyed){
|
||||
if(player.hasSkill(cards[i].destroyed)){
|
||||
delete cards[i].destroyed;
|
||||
}
|
||||
else{
|
||||
if(cards[i].willBeDestroyed('expansion',player,event)){
|
||||
cards.splice(i--,1);
|
||||
}
|
||||
}
|
||||
else if(event.losing_map){
|
||||
for(var id in event.losing_map){
|
||||
if(event.losing_map[id][0].contains(cards[i])){
|
||||
|
@ -19674,9 +19671,10 @@
|
|||
cards[i].recheck();
|
||||
|
||||
var info=lib.card[cards[i].name];
|
||||
if(info.destroy||cards[i]._destroy){
|
||||
var destroyInfo=cards[i].hasOwnProperty('_destroy')?cards[i]._destroy:info.destroy;
|
||||
if(destroyInfo){
|
||||
cards[i].delete();
|
||||
cards[i].destroyed=info.destroy||cards[i]._destroy;
|
||||
cards[i].destroyed=destroyInfo;
|
||||
}
|
||||
else if(event.position){
|
||||
if(_status.discarded){
|
||||
|
@ -19801,7 +19799,7 @@
|
|||
"step 4"
|
||||
if(event.toRenku){
|
||||
_status.renku.addArray(cards.filter(function(card){
|
||||
return !card.destroyed;
|
||||
return !card.willBeDestroyed('renku',null,event);
|
||||
}));
|
||||
if(_status.renku.length>6){
|
||||
var cards=_status.renku.splice(0,_status.renku.length-6);
|
||||
|
@ -20336,15 +20334,10 @@
|
|||
else if(get.position(cards[0])=='c') event.updatePile=true;
|
||||
}
|
||||
"step 1"
|
||||
if(cards[0].destroyed){
|
||||
if(player.hasSkill(cards[0].destroyed)){
|
||||
delete cards[0].destroyed;
|
||||
}
|
||||
else{
|
||||
if(cards[0].willBeDestroyed('judge',player,event)){
|
||||
event.finish();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if(event.relatedLose){
|
||||
var owner=event.relatedLose.player;
|
||||
if(owner.getCards('hejsx').contains(card)){
|
||||
|
@ -29910,6 +29903,26 @@
|
|||
buildIntro(noclick){
|
||||
if(!noclick) lib.setIntro(this);
|
||||
}
|
||||
//判断一张牌进入某个区域后是否会被销毁
|
||||
willBeDestroyed(targetPosition,player,event){
|
||||
const destroyed=this.destroyed;
|
||||
if(typeof destroyed=='function'){
|
||||
return destroyed(card,targetPosition,player,event);
|
||||
}
|
||||
else if(lib.skill[destroyed]){
|
||||
if(player){
|
||||
if(player.hasSkill(destroyed)){
|
||||
delete this.destroyed;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if(typeof destroyed=='string'){
|
||||
return (destroyed==targetPosition);
|
||||
}
|
||||
return destroyed;
|
||||
}
|
||||
hasNature(nature,player){
|
||||
return game.hasNature(this,nature,player);
|
||||
}
|
||||
|
@ -30511,7 +30524,7 @@
|
|||
if(this._uncheck.length==0) this.classList.remove('uncheck');
|
||||
}
|
||||
discard(bool){
|
||||
if(!this.destroyed){
|
||||
if(!this.willBeDestroyed('discardPile',null,event)){
|
||||
ui.discardPile.appendChild(this);
|
||||
}
|
||||
this.fix();
|
||||
|
@ -36286,6 +36299,10 @@
|
|||
const cards=event.cards;
|
||||
const pile=ui.cardPile;
|
||||
for(let i=0;i<cards.length;i++){
|
||||
if(cards[i].willBeDestroyed('cardPile',null,event)){
|
||||
cards[i].splice(i--,1);
|
||||
continue;
|
||||
}
|
||||
if(event.insert_index){
|
||||
cards[i].fix();
|
||||
pile.insertBefore(cards[i],event.insert_index(event,cards[i]));
|
||||
|
|
Loading…
Reference in New Issue