From 093507cc9d6fb7d3b0d0dbe9c52eb08b62d6d38a Mon Sep 17 00:00:00 2001 From: shijian <2954700422@qq.com> Date: Sat, 9 Dec 2023 15:47:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E5=87=86=E5=8C=85xinfu=5Fjijie?= =?UTF-8?q?=E6=8A=80=E8=83=BD=E4=BD=BF=E7=94=A8async=20content?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/standard.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/character/standard.js b/character/standard.js index d3226aa18..658c05174 100755 --- a/character/standard.js +++ b/character/standard.js @@ -2316,13 +2316,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ enable:"phaseUse", usable:1, audio:2, - content:function(){ - 'step 0' - var card=get.bottomCards()[0]; - game.cardsGotoOrdering(card); + async content(event,trigger,player){ + const card=get.bottomCards()[0]; + await game.cardsGotoOrdering(card).toPromise(); event.card=card; - player.chooseTarget(true).set('ai',function(target){ - var att=get.attitude(_status.event.player,target); + const {result:{bool,targets}}=await player.promises.chooseTarget(true).set('ai',target=>{ + let att=get.attitude(_status.event.player,target); if(_status.event.du){ if(target.hasSkillTag('nodu')) return 0.5; return -att; @@ -2336,12 +2335,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ '机捷:选择一名角色获得此牌', [card] ]); - 'step 1' - if(result.bool){ - var target=result.targets[0]; + if(bool){ + const target=targets[0]; player.line(target,'green'); - var next=target.gain(card,'draw'); - next.giver=player; + const gainEvent=target.promises.gain(card,'draw'); + gainEvent.giver=player; + await gainEvent; } }, ai:{