手杀霍骏【竭御】bugfix

This commit is contained in:
mengxinzxz 2024-01-21 15:54:13 +08:00
parent 36ca8b3cef
commit 07446eb830
1 changed files with 17 additions and 15 deletions

View File

@ -482,32 +482,34 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:'twjieyu', audio:'twjieyu',
trigger:{player:'phaseJieshuBegin'}, trigger:{player:'phaseJieshuBegin'},
filter:function(event,player){ filter:function(event,player){
for(var i=0;i<ui.discardPile.childElementCount;i++){ for(let i=0;i<ui.discardPile.childElementCount;i++){
if(get.type(ui.discardPile.childNodes[i])=='basic') return true; if(get.type(ui.discardPile.childNodes[i],false)=='basic') return true;
} }
return false; return false;
}, },
prompt2:function(event,player){ prompt2:function(event,player){
const num=lib.skill.jieyu.getNum(player,true); const num=lib.skill.jieyu.getNum(player);
return '获得弃牌堆中'+get.cnNumber(num)+'张'+(num>1?'牌名各不相同的':'')+'基本牌'; return '获得弃牌堆中'+get.cnNumber(num)+'张'+(num>1?'牌名各不相同的':'')+'基本牌';
}, },
async content(event,trigger,player){ async content(event,trigger,player){
const num=lib.skill.jieyu.getNum(player,false); const num=lib.skill.jieyu.getNum(player,event);
let gains=[],names=lib.inpile.filter(name=>get.type(name)=='basic').randomGets(num); let gains=[],names=[];
names.forEach(name=>{ for(let i=0;i<ui.discardPile.childElementCount;i++){
let card=get.discardPile(card=>card.name==name); let card=ui.discardPile.childNodes[i];
if(name) gains.push(card); if(get.type(card,false)=='basic'&&!names.includes(card.name)){
}); gains.push(card);
if(gains.length) player.gain(gains,'gain2'); names.push(card.name);
}
}
if(gains.length) player.gain(gains.randomGets(Math.min(gains.length,num)),'gain2');
}, },
getNum:function(player,goon){ getNum:function(player,event){
let num=3,bool=goon; let num=3;
const history=game.getAllGlobalHistory('everything'); const history=game.getAllGlobalHistory('everything');
for(let i=history.length-1;i>=0;i--){ for(let i=history.length-1;i>=0;i--){
const evt=history[i]; const evt=history[i];
if(evt.name=='useSkill'&&evt.player==player&&evt.skill=='jieyu'){ if(evt.name=='jieyu'&&evt.player==player){
if(!bool) bool=true; if(!event||evt!=event) break;
else break;
} }
if(evt.name=='useCard'&&evt.player!=player&&evt.targets&&evt.targets.includes(player)&&get.tag(evt.card,'damage')){ if(evt.name=='useCard'&&evt.player!=player&&evt.targets&&evt.targets.includes(player)&&get.tag(evt.card,'damage')){
num--; num--;