diff --git a/card/standard.js b/card/standard.js index ab99d5ce1..07a473079 100644 --- a/card/standard.js +++ b/card/standard.js @@ -235,7 +235,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ if(get.cardtag(card,'yingbian_hit')){ hit=true; if(targets.some(target=>{ - return target.mayHaveShan(viewer,'use',target.getCards(i=>{ + return target.mayHaveShan(viewer,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))&&get.attitude(viewer,target)<0&&get.damageEffect(target,player,viewer,get.natureList(card))>0; })) base+=5; @@ -247,7 +247,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ } if(get.cardtag(card,'yingbian_damage')){ if(targets.some(target=>{ - return get.attitude(player,target)<0&&(hit||!target.mayHaveShan(viewer,'use',target.getCards(i=>{ + return get.attitude(player,target)<0&&(hit||!target.mayHaveShan(viewer,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))||player.hasSkillTag('directHit_ai',true,{ target:target, @@ -309,7 +309,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ if(!player.hasSkillTag('directHit_ai',true,{ target:target, card:card, - },true)) odds-=0.7*target.mayHaveShan(player,'use',target.getCards(i=>{ + },true)) odds-=0.7*target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }),'odds'); _status.event.putTempCache('sha_result','eff',{ diff --git a/character/diy.js b/character/diy.js index 0103bd2b1..10926cbce 100755 --- a/character/diy.js +++ b/character/diy.js @@ -3516,7 +3516,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ list.remove(player.storage.kyou_zhidian); player.chooseControl(list).set('prompt','掷典:请为'+get.translation(trigger.card)+'选择一种效果').set('choice',function(){ if(list.includes('不计入次数')&&player.hasSha()) return '不计入次数'; - if(list.includes('不可被响应')&&trigger.target.mayHaveShan(player,'use',trigger.target.getCards(i=>{ + if(list.includes('不可被响应')&&trigger.target.mayHaveShan(player,'use',trigger.target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))) return '不可被响应'; if(list.includes('伤害+1')) return '伤害+1'; diff --git a/character/extra.js b/character/extra.js index 4181a436d..bd169dfdc 100755 --- a/character/extra.js +++ b/character/extra.js @@ -1261,7 +1261,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } } var hasRuanshizi=game.hasPlayer(function(target){ - return target!=player&&player.canUse('sha',target,null,true)&&!target.mayHaveShan(player,'use',target.getCards(i=>{ + return target!=player&&player.canUse('sha',target,null,true)&&!target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))&&get.attitude(player,target)<0&&get.effect(target,{name:'sha'},player,player)>0; }) diff --git a/character/huicui.js b/character/huicui.js index 2e9bb500f..bdb4c7225 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -11109,7 +11109,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ let ph=player.countCards('h'); if(game.hasPlayer(i=>{ if(!player.canUse('sha',i,true,true)||get.effect(i,{name:'sha'},player,player)<=0) return false; - return !ph||!i.mayHaveShan(player,'use',i.getCards(i=>{ + return !ph||!i.mayHaveShan(player,'use',i.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); })); })) return 1; diff --git a/character/jsrg.js b/character/jsrg.js index 7d55c92d6..2e6d32c4c 100644 --- a/character/jsrg.js +++ b/character/jsrg.js @@ -4270,7 +4270,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ result:{ target:function(player,target){ var eff=get.effect(target,{name:'sha',nature:'fire'},player,target)/30; - if(!target.mayHaveShan(player,'use',target.getCards(i=>{ + if(!target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))) eff*=2; var del=target.countCards('h')-player.countCards('h')+1.5; @@ -7124,7 +7124,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(_status.event.all) return 1; if(ui.selected.buttons.length) return 0; return Math.random(); - }).set('all',!target.mayHaveShan(player,'use',target.getCards(i=>{ + }).set('all',!target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))&&Math.random()<0.75).set('forceAuto',true); 'step 1' diff --git a/character/mobile.js b/character/mobile.js index 9ae621558..e46866bd2 100644 --- a/character/mobile.js +++ b/character/mobile.js @@ -9137,7 +9137,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ]).set('ai',function(){ var target=_status.event.getTrigger().target; var player=_status.event.player; - var num=target.mayHaveShan(player,'use',target.getCards(i=>{ + var num=target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))?0:1; if(get.attitude(player,target)>0) num=1-num; diff --git a/character/offline.js b/character/offline.js index 7f3019a92..bb204584c 100644 --- a/character/offline.js +++ b/character/offline.js @@ -168,7 +168,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ d1=true; if(trigger.player.hasSkill('jueqing')||trigger.player.hasSkill('gangzhi')) d1=false; for(var target of trigger.targets){ - if(!target.mayHaveShan(player,'use',target.getCards(i=>{ + if(!target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))||trigger.player.hasSkillTag('directHit_ai',true,{ target:target, @@ -299,7 +299,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var effect=0; for(var target of trigger.targets){ var eff=get.effect(target,trigger.card,trigger.player,player); - if(!target.mayHaveShan(player,'use',target.getCards(i=>{ + if(!target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))||trigger.player.hasSkillTag('directHit_ai',true,{ target:target, diff --git a/character/refresh.js b/character/refresh.js index efd96ef7a..de6503b6c 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -11142,7 +11142,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!target.isHealthy()) club+=2; if(!club&&!spade) return 1; if(name==='sha'){ - if(!target.mayHaveShan(player,'use',target.getCards(i=>{ + if(!target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))) return; } diff --git a/character/shenhua.js b/character/shenhua.js index dc2054c5a..8762ece9a 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -3676,7 +3676,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ai:{ effect:{ target:function(card,player,target,current){ - if(typeof card==='object'&&get.name(card)==='sha'&&target.mayHaveShan(player,'use',target.getCards(i=>{ + if(typeof card==='object'&&get.name(card)==='sha'&&target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))) return [0.6,0.75]; if(!target.hasFriend()&&!player.hasUnknown()) return; @@ -6221,7 +6221,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!target.isHealthy()) club+=2; if(!club&&!spade) return 1; if(card.name==='sha'){ - if(!target.mayHaveShan(player,'use',target.getCards(i=>{ + if(!target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))) return; } @@ -7209,7 +7209,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return get.attitude(target,current)<0&&get.damageEffect(current,target,target,'thunder')>0; })){ if(card.name==='sha'){ - if(!target.mayHaveShan(player,'use',target.getCards(i=>{ + if(!target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))) return; } diff --git a/character/sp.js b/character/sp.js index 28aaed999..75acc6de9 100755 --- a/character/sp.js +++ b/character/sp.js @@ -5479,7 +5479,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!player.hasSkillTag('directHit_ai',true,{ target:target, card:card, - },true)) odds-=0.7*target.mayHaveShan(player,'use',target.getCards(i=>{ + },true)) odds-=0.7*target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }),'odds'); _status.event.putTempCache('sha_result','eff',{ @@ -7275,7 +7275,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } else{ var target=trigger.target; - if(trigger.targets.length>1||target.mayHaveShan(player,'use',target.getCards(i=>{ + if(trigger.targets.length>1||target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))) return 0; } @@ -14777,7 +14777,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ else if(get.tag(card,'respondShan')>0){ if(current<0&&used==target.getAttackRange()-1){ if(card.name==='sha'){ - if(!target.mayHaveShan(player,'use',target.getCards(i=>{ + if(!target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))) return; } diff --git a/character/sp2.js b/character/sp2.js index decad8e61..2a919a7a3 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -5030,7 +5030,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ })) return 3; return Math.sqrt(target.countCards('he')); } - if(target.mayHaveShan(player,'use',target.getCards(i=>{ + if(target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))&&player.countCards('hs',function(card){ return !ui.selected.cards.includes(card)&&get.name(card)=='sha'&&player.canUse(card,target)&&get.effect(target,card,player,player)!=0; @@ -5364,7 +5364,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.addSkill('mouni2'); player.chooseTarget(get.prompt2('mouni'),lib.filter.notMe).set('ai',function(target){ var player=_status.event.player,cards=player.getCards('h','sha'); - if(get.attitude(player,target)>=0||!player.canUse(cards[0],target,false)||(!player.hasJudge('lebu')&&target.mayHaveShan(player,'use',target.getCards(i=>{ + if(get.attitude(player,target)>=0||!player.canUse(cards[0],target,false)||(!player.hasJudge('lebu')&&target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))&&!player.hasSkillTag('directHit_ai',true,{ target:target, diff --git a/character/tw.js b/character/tw.js index 8ae68a048..226a042eb 100644 --- a/character/tw.js +++ b/character/tw.js @@ -1095,7 +1095,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }).set('goon',function(){ var d1=true; if(player.hasSkill('jueqing')||player.hasSkill('gangzhi')) d1=false; - if(!target.mayHaveShan(player,'use',target.getCards(i=>{ + if(!target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))||player.hasSkillTag('directHit_ai',true,{ target:target, @@ -3697,7 +3697,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ expose:0.2, result:{ target:function(player,target){ - if(target.countCards('h')<=target.hp&&!target.mayHaveShan(player,'use',target.getCards(i=>{ + if(target.countCards('h')<=target.hp&&!target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))&&get.effect(target,{name:'sha',isCard:true},player,player)>0) return -1; else if(target.countCards('h')>target.hp&&target.hp>2&&target.hasShan()) return 1; @@ -7273,7 +7273,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var player=_status.event.player; if(player.hp+player.countCards('hs',{name:['tao','jiu']})<=1) return -1; var num=1; - if((!target.mayHaveShan(player,'use',target.getCards(i=>{ + if((!target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))||player.hasSkillTag('directHit_ai',true,{ target:target, @@ -11796,7 +11796,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var d1=true; if(trigger.player.hasSkill('jueqing')||trigger.player.hasSkill('gangzhi')) d1=false; for(var target of trigger.targets){ - if(!target.mayHaveShan(player,'use',target.getCards(i=>{ + if(!target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))||trigger.player.hasSkillTag('directHit_ai',true,{ target:target, diff --git a/character/yijiang.js b/character/yijiang.js index cf811ec54..0bd4041af 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -2228,7 +2228,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ case 2:{ var num=1.3; if(event.card.name=='sha'&&event.targets.filter(function(current){ - if(current.mayHaveShan(player,'use',current.getCards(i=>{ + if(current.mayHaveShan(player,'use',current.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))&&get.attitude(player,current)<=0){ if(current.hasSkillTag('useShan')) num=1.9; diff --git a/mode/guozhan.js b/mode/guozhan.js index 5822819e7..7ca75e0b6 100644 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -3529,7 +3529,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ ]).set('prompt',get.prompt('gzliegong',trigger.target)).setHiddenSkill('gzliegong').set('ai',function(){ var player=_status.event.player,target=_status.event.getTrigger().target; if(get.attitude(player,target)>0) return 2; - return target.mayHaveShan(player,'use',target.getCards(i=>{ + return target.mayHaveShan(player,'use',target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))?1:0; }); @@ -10657,7 +10657,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ goon=false; } else if(trigger.card.name=='sha'){ - if(trigger.target.mayHaveShan(player,'use',trigger.target.getCards(i=>{ + if(trigger.target.mayHaveShan(player,'use',trigger.target.getCards('h',i=>{ return i.hasGaintag('sha_notshan'); }))||trigger.target.hp>=3){ goon=false; diff --git a/noname/library/index.js b/noname/library/index.js index 6422d05c9..8d679504f 100644 --- a/noname/library/index.js +++ b/noname/library/index.js @@ -9681,8 +9681,8 @@ export class Library extends Uninstantable { }, //装备栏相关 /** - * @param { Card } card - * @param { Player } player + * @param { Card } card + * @param { Player } player * @returns { boolean } */ canBeReplaced: function (card, player) { @@ -10323,7 +10323,7 @@ export class Library extends Uninstantable { if (game.hasPlayer(current => { if (!player.canUse(card, current)) return false; const storage = player.storage, zhibi = storage.zhibi; - return (zhibi && !zhibi.includes(current) || get.effect(current, card, player, player) >= 2 - Math.max(0, (storage.stratagem_fury || 0) - 1)) && current.mayHaveShan(player, 'use', current.getCards(i => { + return (zhibi && !zhibi.includes(current) || get.effect(current, card, player, player) >= 2 - Math.max(0, (storage.stratagem_fury || 0) - 1)) && current.mayHaveShan(player, 'use', current.getCards('h', i => { return i.hasGaintag('sha_notshan'); })) && player.hasSkill('jiu'); })) return 1; @@ -10396,7 +10396,7 @@ export class Library extends Uninstantable { if (game.hasPlayer(current => { if (!player.canUse(card, current)) return false; const storage = player.storage, zhibi = storage.zhibi; - return (zhibi && !zhibi.includes(current) || (get.effect(current, card, player, player) >= 2 - Math.max(0, (storage.stratagem_fury || 0) - 1))) && current.mayHaveShan(player, 'use', current.getCards(i => { + return (zhibi && !zhibi.includes(current) || (get.effect(current, card, player, player) >= 2 - Math.max(0, (storage.stratagem_fury || 0) - 1))) && current.mayHaveShan(player, 'use', current.getCards('h', i => { return i.hasGaintag('sha_notshan'); })); })) return get.order(card, player) + 0.5;