From c26d707a65e5c1928924e2d7ae87102bfe761d77 Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Sat, 2 Mar 2024 15:21:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B9=E7=88=BD=E3=80=90=E6=B8=90?= =?UTF-8?q?=E4=B8=93=E3=80=91ai=20bugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/huicui.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/character/huicui.js b/character/huicui.js index 2ec155454..790f804a2 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -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); From 6e69a8d80ba86c997661998b2237e3eaf731a35d Mon Sep 17 00:00:00 2001 From: mengxinzxz <2223529500@qq.com> Date: Sat, 2 Mar 2024 15:33:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B9=E7=88=BD=E3=80=90=E8=A6=86?= =?UTF-8?q?=E6=96=97=E3=80=91bugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/huicui.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/character/huicui.js b/character/huicui.js index 790f804a2..79f9847f1 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -295,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); @@ -303,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;