From 38801acdcc56540487df9e71399c7a1369c40efa Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Fri, 29 Dec 2023 09:57:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E8=B0=83=E7=94=A8mayHaveShan=E7=9A=84?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E5=A2=9E=E5=8A=A0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 也包括mayHaveSha --- card/standard.js | 6 +++--- character/diy.js | 2 +- character/extra.js | 2 +- character/huicui.js | 2 +- character/jsrg.js | 4 ++-- character/mobile.js | 2 +- character/offline.js | 8 ++++---- character/refresh.js | 2 +- character/sp.js | 10 +++++----- character/sp2.js | 4 ++-- character/tw.js | 10 +++++----- character/yijiang.js | 2 +- mode/guozhan.js | 4 ++-- noname/library/index.js | 4 ++-- 14 files changed, 31 insertions(+), 31 deletions(-) diff --git a/card/standard.js b/card/standard.js index 67710990c..2df8ea5ac 100644 --- a/card/standard.js +++ b/card/standard.js @@ -231,7 +231,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)&&get.attitude(viewer,target)<0&&get.damageEffect(target,player,viewer,get.natureList(card))>0; + return target.mayHaveShan(viewer,'use')&&get.attitude(viewer,target)<0&&get.damageEffect(target,player,viewer,get.natureList(card))>0; })) base+=5; } if(get.cardtag(card,'yingbian_add')){ @@ -241,7 +241,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)||player.hasSkillTag('directHit_ai',true,{ + return get.attitude(player,target)<0&&(hit||!target.mayHaveShan(viewer,'use')||player.hasSkillTag('directHit_ai',true,{ target:target, card:card, },true))&&!target.hasSkillTag('filterDamage',null,{ @@ -294,7 +294,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ } return -1.5; }(); - if(!isLink&&target.mayHaveShan()&&!player.hasSkillTag('directHit_ai',true,{ + if(!isLink&&target.mayHaveShan(player,'use')&&!player.hasSkillTag('directHit_ai',true,{ target:target, card:card, },true)) return eff/1.2; diff --git a/character/diy.js b/character/diy.js index 2704a047f..f64456b46 100755 --- a/character/diy.js +++ b/character/diy.js @@ -3513,7 +3513,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.contains('不计入次数')&&player.hasSha()) return '不计入次数'; - if(list.contains('不可被响应')&&trigger.target.mayHaveShan()) return '不可被响应'; + if(list.contains('不可被响应')&&trigger.target.mayHaveShan(_status.event.player,'use')) return '不可被响应'; if(list.contains('伤害+1')) return '伤害+1'; return list.randomGet(); }()).set('ai',()=>_status.event.choice); diff --git a/character/extra.js b/character/extra.js index a146d9c58..a2cf46bbd 100755 --- a/character/extra.js +++ b/character/extra.js @@ -1012,7 +1012,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()&&get.attitude(player,target)<0&&get.effect(target,{name:'sha'},player,player)>0; + return target!=player&&player.canUse('sha',target,null,true)&&!target.mayHaveShan(player,'use')&&get.attitude(player,target)<0&&get.effect(target,{name:'sha'},player,player)>0; }) for(var card of hs){ var name=get.name(card); diff --git a/character/huicui.js b/character/huicui.js index 952b79b20..1e6ad60c2 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -4582,7 +4582,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()||trigger.player.hasSkillTag('directHit_ai',true,{ + if(!target.mayHaveShan(player,'use')||trigger.player.hasSkillTag('directHit_ai',true,{ target:target, card:trigger.card, },true)){ diff --git a/character/jsrg.js b/character/jsrg.js index 38761f34d..0674bc8dc 100644 --- a/character/jsrg.js +++ b/character/jsrg.js @@ -2368,7 +2368,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()) eff*=2; + if(!target.mayHaveShan(player,'use')) eff*=2; var del=target.countCards('h')-player.countCards('h')+1.5; eff*=Math.sqrt(del); return eff; @@ -5224,7 +5224,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()&&Math.random()<0.75).set('forceAuto',true); + }).set('all',!target.mayHaveShan(player,'use')&&Math.random()<0.75).set('forceAuto',true); 'step 1' if(result.bool){ var cards=result.cards; diff --git a/character/mobile.js b/character/mobile.js index 296333da9..eb6a97d6f 100644 --- a/character/mobile.js +++ b/character/mobile.js @@ -8443,7 +8443,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()?0:1; + var num=target.mayHaveShan(player,'use')?0:1; if(get.attitude(player,target)>0) num=1-num; return num; }); diff --git a/character/offline.js b/character/offline.js index b8a8280c8..7e4c073c7 100644 --- a/character/offline.js +++ b/character/offline.js @@ -170,7 +170,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()||trigger.player.hasSkillTag('directHit_ai',true,{ + if(!target.mayHaveShan(player,'use')||trigger.player.hasSkillTag('directHit_ai',true,{ target:target, card:trigger.card, },true)){ @@ -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()||trigger.player.hasSkillTag('directHit_ai',true,{ + if(!target.mayHaveShan(player,'use')||trigger.player.hasSkillTag('directHit_ai',true,{ target:target, card:trigger.card, },true)){ @@ -4906,7 +4906,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } //护驾 else if(!player.hasShan()&&game.hasPlayer(function(current){ - return current!=player&¤t.group=='wei'&¤t.mayHaveShan()&&get.attitude(player,current)>0&&get.attitude(current,player)>0; + return current!=player&¤t.group=='wei'&¤t.mayHaveShan(player,'respond')&&get.attitude(player,current)>0&&get.attitude(current,player)>0; })) return 1; return -1; }); @@ -4940,7 +4940,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } //护驾 else if(!player.hasShan()&&game.hasPlayer(function(current){ - return current!=player&¤t.group=='wei'&¤t.mayHaveShan()&&get.attitude(player,current)>0&&get.attitude(current,player)>0; + return current!=player&¤t.group=='wei'&¤t.mayHaveShan(player,'respond')&&get.attitude(player,current)>0&&get.attitude(current,player)>0; })) return 'hujia'; }); } diff --git a/character/refresh.js b/character/refresh.js index e9dd2a57d..91379365a 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -11122,7 +11122,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ useShan:true, effect:{ target:function(card,player,target,current){ - let name='sha'; + let name; if(typeof card=='object'){ if(card.viewAs) name=card.viewAs; else name=get.name(card); diff --git a/character/sp.js b/character/sp.js index 594f6a8bf..835672f4d 100755 --- a/character/sp.js +++ b/character/sp.js @@ -5162,10 +5162,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } return -1.5; }(); - if(!isLink && target.mayHaveShan() && !player.hasSkillTag('directHit_ai', true, { + if(!isLink && target.mayHaveShan(player,'use') && !player.hasSkillTag('directHit_ai', true, { target: target, card: card - }, true)) return eff / 1.2; + }, true)) return eff * 0.6; return eff; } }, @@ -6954,7 +6954,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } else{ var target=trigger.target; - if(trigger.targets.length>1||target.mayHaveShan()) return 0; + if(trigger.targets.length>1||target.mayHaveShan(player,'use')) return 0; } var num=trigger.getParent().baseDamage; var map=trigger.getParent().customArgs,id=target.playerid; @@ -14460,12 +14460,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(num>=delta) return 'zeroplayertarget'; } else if(get.tag(card,'respondShan')>0){ - if(current<0&&used==target.getAttackRange()-1&&target.mayHaveShan()){ + if(current<0&&used==target.getAttackRange()-1&&target.mayHaveShan(player)){ return 0.6; } } else if(get.tag(card,'respondSha')>0){ - if(current<0&&used==target.getAttackRange()-1&&target.mayHaveSha()){ + if(current<0&&used==target.getAttackRange()-1&&target.mayHaveSha(player)){ return 0.6; } } diff --git a/character/sp2.js b/character/sp2.js index 901a261a4..dd52c95c5 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -5015,7 +5015,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ })) return 3; return Math.sqrt(target.countCards('he')); } - if(target.mayHaveShan()&&player.countCards('hs',function(card){ + if(target.mayHaveShan(player,'use')&&player.countCards('hs',function(card){ return !ui.selected.cards.contains(card)&&get.name(card)=='sha'&&player.canUse(card,target)&&get.effect(target,card,player,player)!=0; })) return -Math.sqrt(Math.abs(get.attitude(player,target)))/2; return 0.1; @@ -5347,7 +5347,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.hasSkillTag('directHit_ai',true,{ + if(get.attitude(player,target)>=0||!player.canUse(cards[0],target,false)||(!player.hasJudge('lebu')&&target.mayHaveShan(player,'use')&&!player.hasSkillTag('directHit_ai',true,{ target:target, card:cards[0], },true))) return 0; diff --git a/character/tw.js b/character/tw.js index be5aef49c..51be0f39a 100644 --- a/character/tw.js +++ b/character/tw.js @@ -384,7 +384,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.hasSkillTag('directHit_ai',true,{ + if(!target.mayHaveShan(player,'use')||player.hasSkillTag('directHit_ai',true,{ target:target, card:trigger.card, },true)){ @@ -2985,7 +2985,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()&&get.effect(target,{name:'sha',isCard:true},player,player)>0) return -1; + if(target.countCards('h')<=target.hp&&!target.mayHaveShan(player,'use')&&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; return 0; }, @@ -6572,7 +6572,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.hasSkillTag('directHit_ai',true,{ + if((!target.mayHaveShan(player,'use')||player.hasSkillTag('directHit_ai',true,{ target:target, card:{name:'sha'}, },true))&&!target.hasSkillTag('filterDamage',null,{ @@ -11090,7 +11090,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()||trigger.player.hasSkillTag('directHit_ai',true,{ + if(!target.mayHaveShan(player,'use')||trigger.player.hasSkillTag('directHit_ai',true,{ target:target, card:trigger.card, },true)){ @@ -13290,7 +13290,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()||trigger.player.hasSkillTag('directHit_ai',true,{ + if(!target.mayHaveShan(player,'use')||trigger.player.hasSkillTag('directHit_ai',true,{ target:target, card:trigger.card, },true)){ diff --git a/character/yijiang.js b/character/yijiang.js index 657eaad49..d17ad07d3 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -2235,7 +2235,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()&&get.attitude(player,current)<=0){ + if(current.mayHaveShan(player,'use')&&get.attitude(player,current)<=0){ if(current.hasSkillTag('useShan')) num=1.9; return true; } diff --git a/mode/guozhan.js b/mode/guozhan.js index c1a180daf..9a65a01a6 100644 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -3528,7 +3528,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()?1:0; + return target.mayHaveShan(player,'use')?1:0; }); 'step 1' if(result.control!='cancel2'){ @@ -10654,7 +10654,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ goon=false; } else if(trigger.card.name=='sha'){ - if(trigger.target.mayHaveShan()||trigger.target.hp>=3){ + if(trigger.target.mayHaveShan(player,'use')||trigger.target.hp>=3){ goon=false; } } diff --git a/noname/library/index.js b/noname/library/index.js index 8e42ec2fc..21c9d3893 100644 --- a/noname/library/index.js +++ b/noname/library/index.js @@ -10090,7 +10090,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.hasSkill('jiu'); + return (zhibi && !zhibi.includes(current) || get.effect(current, card, player, player) >= 2 - Math.max(0, (storage.stratagem_fury || 0) - 1)) && current.mayHaveShan(player, 'use') && player.hasSkill('jiu'); })) return 1; return 0; } @@ -10161,7 +10161,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.contains(current) || (get.effect(current, card, player, player) >= 2 - Math.max(0, (storage.stratagem_fury || 0) - 1))) && current.mayHaveShan(); + return (zhibi && !zhibi.contains(current) || get.effect(current, card, player, player) >= 2 - Math.max(0, (storage.stratagem_fury || 0) - 1)) && current.mayHaveShan(player, 'use'); })) return get.order(card, player) + 0.5; } else if (cardName == 'tao' && player.hp <= 2 && player.getDamagedHp() >= 2) return get.order(card, player) + 0.5;