From d2761c31fd81fca800ef585b3e16d0a14c74885a Mon Sep 17 00:00:00 2001 From: 157 <3619242020@qq.com> Date: Wed, 10 Jan 2024 16:40:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=5Fstatus.event.filterCard?= =?UTF-8?q?=E4=BC=A0=E5=8F=82=E6=97=A0hasGaintag=E6=96=B9=E6=B3=95bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- card/extra.js | 4 ++-- card/gujian.js | 2 +- card/hearth.js | 4 ++-- noname/library/element/vcard.js | 3 +++ 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/card/extra.js b/card/extra.js index ed6242f66..c611d8e97 100644 --- a/card/extra.js +++ b/card/extra.js @@ -241,7 +241,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ var nh=player.countCards('h'); if(nh<=player.hp&&nh<=4&&_status.event.name=='chooseToUse'){ if(typeof _status.event.filterCard=='function'&& - _status.event.filterCard({name:'huogong'},player,_status.event)){ + _status.event.filterCard(new lib.element.VCard({name:'huogong'}),player,_status.event)){ return -10; } if(_status.event.skill){ @@ -268,7 +268,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ } if(target==player){ if(typeof _status.event.filterCard=='function'&& - _status.event.filterCard({name:'huogong'},player,_status.event)){ + _status.event.filterCard(new lib.element.VCard({name:'huogong'}),player,_status.event)){ return -1.15; } if(_status.event.skill){ diff --git a/card/gujian.js b/card/gujian.js index 97c4d7840..224ecb0be 100644 --- a/card/gujian.js +++ b/card/gujian.js @@ -730,7 +730,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ player:function(player,target){ if(player.countCards('h')<=Math.min(5,Math.max(2,player.hp))&&_status.event.name=='chooseToUse'){ if(typeof _status.event.filterCard=='function'&& - _status.event.filterCard({name:'bingpotong'})){ + _status.event.filterCard(new lib.element.VCard({name:'bingpotong'}))){ return -10; } if(_status.event.skill){ diff --git a/card/hearth.js b/card/hearth.js index 82600260f..1482e6e43 100644 --- a/card/hearth.js +++ b/card/hearth.js @@ -255,7 +255,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ var nh=player.countCards('h'); if(nh<=player.hp&&nh<=4&&_status.event.name=='chooseToUse'){ if(typeof _status.event.filterCard=='function'&& - _status.event.filterCard({name:'shandianjian'})){ + _status.event.filterCard(new lib.element.VCard({name:'shandianjian'}))){ return -10; } if(_status.event.skill){ @@ -271,7 +271,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ if(player.countCards('h')<=1) return 0; if(target==player){ if(typeof _status.event.filterCard=='function'&& - _status.event.filterCard({name:'shandianjian'})){ + _status.event.filterCard(new lib.element.VCard({name:'shandianjian'}))){ return -1.5; } if(_status.event.skill){ diff --git a/noname/library/element/vcard.js b/noname/library/element/vcard.js index f38e47cc5..a0bc68e30 100644 --- a/noname/library/element/vcard.js +++ b/noname/library/element/vcard.js @@ -126,4 +126,7 @@ export class VCard { if (nature == 'linked') return natures.some(n => lib.linked.includes(n)); return get.is.sameNature(natures, nature); } + hasGaintag(tag) { + return this.gaintag && this.gaintag.includes(tag); + } }