星袁绍【纵势】指定目标结算线上化
This commit is contained in:
parent
7a8572d8f2
commit
c59d8a59c4
|
@ -191,14 +191,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
else if(typeof select=='function') range=select(card,player);
|
||||
game.checkMod(card,player,range,'selectTarget',player);
|
||||
const cards=player.getCards('h',cardx=>card!=cardx&&get.suit(card,player)==get.suit(cardx,player));
|
||||
let targets=game.filterPlayer(target=>player.canUse(card,target)&&get.effect(target,card,player,player)>0);
|
||||
let targets=game.filterPlayer(target=>lib.filter.targetEnabled2(get.event('cardx'),player,target)&&lib.filter.targetInRange(get.event('cardx'),player,target)&&get.effect(target,card,player,player)>0);
|
||||
const max=range[1],max2=Math.min(cards.length,targets.length);
|
||||
if(max>max2) return 0;
|
||||
targets=targets.sort((a,b)=>get.effect(b,card,player,player)-get.effect(a,card,player,player)).slice(0,max2);
|
||||
const sum=targets.reduce((num,target)=>num+get.effect(target,card,player,player),0);
|
||||
if(max==-1){
|
||||
if(game.filterPlayer(target=>{
|
||||
return player.canUse(card,target);
|
||||
return lib.filter.targetEnabled2(get.event('cardx'),player,target)&&lib.filter.targetInRange(get.event('cardx'),player,target);
|
||||
}).reduce((num,target)=>num+get.effect(target,card,player,player),0)>sum) return 0;
|
||||
}
|
||||
return sum;
|
||||
|
@ -212,7 +212,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
|||
await player.showCards([card],get.translation(player)+'发动了【纵势】');
|
||||
const cardx=new lib.element.VCard({name:get.name(card,player),nature:get.nature(card,player),cards:cards});
|
||||
const {result:{bool,targets}}=await player.chooseTarget((card,player,target)=>{
|
||||
return player.canUse(get.event('cardx'),target);
|
||||
//return player.canUse(get.event('cardx'),target);
|
||||
return lib.filter.targetEnabled2(get.event('cardx'),player,target)&&lib.filter.targetInRange(get.event('cardx'),player,target);
|
||||
},true).set('cardx',cardx).set('selectTarget',[1,cards.length])
|
||||
.set('prompt','请选择'+(game.hasNature(cardx)?get.translation(get.nature(cardx)):'')+'【'+get.translation(cardx)+'】('+get.translation(cards)+')的目标')
|
||||
.set('ai',target=>{
|
||||
|
|
Loading…
Reference in New Issue