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); + } }