never ending bug fix

This commit is contained in:
Spmario233 2023-09-02 19:40:31 +08:00
parent 3f83f02193
commit 6a20717488
6 changed files with 39 additions and 32 deletions

View File

@ -580,12 +580,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{
order:7,
result:{
target:function(player,target){
player:function(player,target){
var name=(target.countCards('h')>player.countCards('h')?'tuixinzhifu':'chenghuodajie');
var list=[];
if(ui.selected.cards.length) list.addArray(ui.selected.cards);
var card=get.autoViewAs({name:name},list);
return get.effect(card,target,player);
return get.effect(target,card,player,player);
},
},
},
@ -1482,8 +1482,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player.group=='qun';
},
filterCard:lib.filter.cardRecastable,
check:function(card,player){
var val=5+['shan','tao'].contains(get.name(card))*1.5;
check:function(card){
var player=_status.event.player,val=5+['shan','tao'].contains(get.name(card))*1.5;
if(player.needsToDiscard()>2&&get.name(card)=='sha'&&player.countCards('hs','sha')>1) val+=0.5;
return val-get.value(card);
},

View File

@ -7034,9 +7034,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var source=event.source;
if(!source) return false;
var cards=source.getEquips(1);
return cards.length&&cards.some(card=>lib.filter.canBeGained(card,player,source));
return cards.some(card=>lib.filter.canBeGained(card,player,source));
},
prompt2:function(event){
prompt2:function(event,player){
var source=event.source;
var cards=source.getEquips(1).filter(card=>lib.filter.canBeGained(card,player,source));
return '获得其装备区中的'+get.translation(cards);

View File

@ -1014,19 +1014,21 @@ game.import('character',function(lib,game,ui,get,ai,_status){
})>1) return 'equip5';
});
'step 1'
if(result.control=='equip1'){
player.addTempSkill('drlt_jueyan1',{player:'phaseAfter'});
};
if(result.control=='equip2'){
player.draw(3);
player.addTempSkill('drlt_jueyan3',{player:'phaseAfter'});
};
if(result.control=='equip6'){
player.addTempSkill('drlt_jueyan2',{player:'phaseAfter'});
};
if(result.control=='equip5'){
player.addTempSkill('rejizhi',{player:'phaseAfter'});
};
switch(result.control){
case 'equip1':
player.addTempSkill('drlt_jueyan1',{player:'phaseAfter'});
break;
case 'equip2':
player.draw(3);
player.addTempSkill('drlt_jueyan3',{player:'phaseAfter'});
break;
case 'equip3_4':
player.addTempSkill('drlt_jueyan2',{player:'phaseAfter'});
break;
case 'equip5':
player.addTempSkill('rejizhi',{player:'phaseAfter'});
break;
}
},
ai:{
order:13,

View File

@ -10736,8 +10736,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
selectTarget:[1,Infinity],
content:function(){
'step 0'
if(!target.countCards('he')) event.finish();
else target.chooseCard('he','交给'+get.translation(player)+'一张牌',true);
if(!target.countCards('h')) event.finish();
else target.chooseCard('h','交给'+get.translation(player)+'一张牌',true);
'step 1'
target.give(result.cards,player);
'step 2'

View File

@ -514,7 +514,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var mod=game.checkMod(card,player,source,'unchanged','cardEnabled',source);
if(mod!='unchanged') return mod;
if(typeof filter=='boolean') return filter;
if(typeof filter=='function') return filter(card,player,event);
if(typeof filter=='function') return filter(card,source,event);
}
},
cardUsable:function(card,player,num){
@ -10715,15 +10715,20 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.finish();
return;
}
var color=get.color(result.cards[0],result.cards[0].original=='j'?false:target);
event.color=color;
var next=player.chooseTarget(true,'挫锐:选择另一名其他角色','弃置该角色装备区里至多两张'+get.translation(event.color)+'牌;或展示该角色的至多两张手牌,然后获得其中的'+get.translation(event.color)+'牌');
next.set('filterTarget',(card,player,target)=>{
return target.countCards('he')>0&&target!=player&&target!=_status.event.getParent().target;
});
next.set('ai',target=>{
return -get.attitude(_status.event.player,target)*target.countCards('he')+0.1;
});
if(game.hasPlayer(current=>{
return current.countCards('he')>0&&current!=player&&current!=target;
})){
var color=get.color(result.cards[0],result.cards[0].original=='j'?false:target);
event.color=color;
var next=player.chooseTarget(true,'挫锐:选择另一名其他角色','弃置该角色装备区里至多两张'+get.translation(event.color)+'牌;或展示该角色的至多两张手牌,然后获得其中的'+get.translation(event.color)+'牌');
next.set('filterTarget',(card,player,target)=>{
return target.countCards('he')>0&&target!=player&&target!=_status.event.getParent().target;
});
next.set('ai',target=>{
return -get.attitude(_status.event.player,target)*target.countCards('he')+0.1;
});
}
else event.finish();
'step 8'
if(result.bool){
var targetx=result.targets[0];

View File

@ -16486,7 +16486,7 @@
}
}
if(card.name=='wuxie'){
game.logv(player,[card,cards],[evt.card]);
game.logv(player,[card,cards],[event.getTrigger().card]);
}
else{
game.logv(player,[card,cards],targets);