Merge pull request #1006 from mengxinzxz/PR-Branch

bugfix
This commit is contained in:
Spmario233 2024-03-02 18:23:55 +08:00 committed by GitHub
commit 4bbe25e46e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 5 deletions

View File

@ -148,10 +148,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
const {result:{control}}=await player.chooseControl(choices).set('choiceList',choiceList).set('ai',()=>{
const player=get.event('player'),num=get.event('num'),info=get.info('dcjianzhuan').choices;
let choices=get.event('controls').slice(),map=get.event('map'),mapx={};
for(const i in map) mapx[map[i]]=i;
return mapx[choices.sort((a,b)=>info[b].ai_effect(player,num)-info[a].ai_effect(player,num))[0]];
}).set('num',num).set('map',map);
let choices=get.event('controls').slice(),map=get.event('map')
return choices.sort((a,b)=>info[map[b]].ai_effect(player,num)-info[map[a]].ai_effect(player,num))[0];
}).set('num',num).set('map',map).set('prompt','渐专:请选择一项执行');
if(control){
if(!player.storage.dcjianzhuan_used){
player.when('phaseUseAfter').then(()=>delete player.storage.dcjianzhuan_used);
@ -296,7 +295,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
const color=get.color(event.card);
if(!['black','red'].includes(color)) return false;
const damage=event.target.getAllHistory('sourceDamage',evt=>evt.player==player).length;
return damage==(color=='black');
return Math.min(1,damage)==(color=='black');
},
check(event,player){
const color=get.color(event.card);
@ -304,6 +303,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player.getHp()+player.countCards('hs',card=>player.canSaveCard(card,player))<=1) return false;
return get.effect(player,{name:'losehp'},player,player)>=get.effect(event.target,{name:'losehp'},player,player);
},
prompt2(event,player){
return '与'+get.translation(event.target)+'各'+(get.color(event.card)=='black'?'失去1点体力':'摸一张牌');
},
logTarget:'target',
async content(event,trigger,player){
const color=get.color(trigger.card),target=trigger.target;