diff --git a/game/game.js b/game/game.js index ae53d82c1..f0927ae5e 100644 --- a/game/game.js +++ b/game/game.js @@ -18474,7 +18474,7 @@ new Promise(resolve=>{ }, moveCard:function(){ 'step 0' - if(!player.canMoveCard(null,event.nojudge,event.sourceTargets,event.aimTargets,event.filter)){ + if(!player.canMoveCard(null,event.nojudge,event.sourceTargets,event.aimTargets,event.filter,event.canReplace?'canReplace':'noReplace')){ event.finish(); return; } @@ -18491,7 +18491,7 @@ new Promise(resolve=>{ if(target.isMin()) return false; var es=from.getCards('e',filterCard); for(var i=0;i{ })) return 14; if(target.countCards('e',function(card){ return get.value(card,target)<0&&game.hasPlayer(function(current){ - return current!=target&&get.attitude(player,current)<0&¤t.canEquip(card)&&get.effect(target,card,player,player)<0; + return current!=target&&get.attitude(player,current)<0&¤t.canEquip(card,_status.event.canReplace)&&get.effect(target,card,player,player)<0; }); })>0) return 9; } @@ -18525,7 +18525,7 @@ new Promise(resolve=>{ if(current!=target&&get.attitude(player,current)>0){ var es=target.getCards('e'); for(var i=0;i0&¤t.canEquip(es[i])&&get.effect(current,es[i],player,player)>0) return true; + if(get.value(es[i],target)>0&¤t.canEquip(es[i],_status.event.canReplace)&&get.effect(current,es[i],player,player)>0) return true; } } })){ @@ -18541,7 +18541,7 @@ new Promise(resolve=>{ if(sgnatt!=0&&att2!=0&&sgnatt!=att2&& get.sgn(get.value(es[i],ui.selected.targets[0]))==-att2&& get.sgn(get.effect(target,es[i],player,target))==sgnatt&& - target.canEquip(es[i])){ + target.canEquip(es[i],_status.event.canReplace)){ return Math.abs(att); } } @@ -18558,6 +18558,7 @@ new Promise(resolve=>{ next.set('filter',event.filter); next.set('sourceTargets',event.sourceTargets||game.filterPlayer()); next.set('aimTargets',event.aimTargets||game.filterPlayer()); + next.set('canReplace',event.canReplace); if(event.prompt2) next.set('prompt2',event.prompt2); if(event.forced) next.set('forced',true); 'step 1' @@ -18594,9 +18595,9 @@ new Promise(resolve=>{ return targets1.canAddJudge(button.link); } else{ - return targets1.canEquip(button.link); + return targets1.canEquip(button.link,_status.event.canReplace); } - }).set('filter',event.filter); + }).set('filter',event.filter).set('canReplace',event.canReplace); } else{ event.finish(); @@ -25128,7 +25129,7 @@ new Promise(resolve=>{ canMoveCard(withatt,nojudge){ const player=this; const args=Array.from(arguments).slice(2); - let sourceTargets,aimTargets,filterCard; + let sourceTargets,aimTargets,filterCard,canReplace; args.forEach(arg=>{ if(get.itemtype(arg)=='players'){ if(!sourceTargets) sourceTargets=arg; @@ -25144,6 +25145,9 @@ new Promise(resolve=>{ else if(typeof arg=='object'&&arg){ filterCard=get.filter(arg); } + else if(arg=='canReplace'){ + canReplace=true; + } }); if(!sourceTargets) sourceTargets=game.filterPlayer(); if(!aimTargets) aimTargets=game.filterPlayer(); @@ -25158,7 +25162,7 @@ new Promise(resolve=>{ var att2=get.sgn(get.attitude(player,current2)); if(att==att2||att2!=get.sgn(get.effect(current2,es[i],player,current2))) return false; } - return current!=current2&&!current2.isMin()&¤t2.canEquip(es[i]); + return current!=current2&&!current2.isMin()&¤t2.canEquip(es[i],canReplace); })){ return true; } @@ -25196,7 +25200,12 @@ new Promise(resolve=>{ else if(!next.aimTargets) next.aimTargets=[arguments[i]]; } else if(typeof arguments[i]=='string'){ - get.evtprompt(next,arguments[i]); + if(arguments[i]=='canReplace'){ + next.canReplace=true; + } + else{ + get.evtprompt(next,arguments[i]); + } } else if(Array.isArray(arguments[i])){ for(var j=0;j{ if(typeof obj=='string') obj={name:obj}; if(typeof obj!='object') return; var name=get.name(obj,player); - if(!lib.card[name]) return; + if(!lib.card[name]){ + if(!name.startsWith('sha_')) return; + if(name.slice(4).split('_').every(n=>lib.nature.has(n))) return lib.card['sha'].type; + } if(method=='trick'&&lib.card[name].type=='delay') return 'trick'; return lib.card[name].type; },