From cac9ab08f00ad8c951f9e7aa8a39557c41aeec4b Mon Sep 17 00:00:00 2001 From: shijian <2954700422@qq.com> Date: Sat, 9 Dec 2023 15:50:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E5=87=86=E5=8C=85xinfu=5Fjiyuan?= =?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 | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/character/standard.js b/character/standard.js index 658c05174..d005526fe 100755 --- a/character/standard.js +++ b/character/standard.js @@ -2366,25 +2366,21 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }); }, direct:true, - content:function(){ - 'step 0' + async content(event,trigger,player){ if(trigger.name!='loseAsync') event.targets=[trigger.player]; - else event.targets=game.filterPlayer(function(current){ - return current!=player&&trigger.getg(current).length>0; - }); - 'step 1' - var target=event.targets.shift(); - event.target=target; - player.chooseBool(get.prompt2('xinfu_jiyuan',target)).set('ai',function(){ - var evt=_status.event; - return get.attitude(player,evt.getParent().target)>0; - }); - 'step 2' - if(result.bool){ - player.logSkill('xinfu_jiyuan',target); - target.draw(); - } - if(targets.length>0) event.goto(1); + else event.targets=game.filterPlayer(current=>current!=player&&trigger.getg(current).length>0); + do{ + const target=event.targets.shift(); + event.target=target; + const {result:{bool}}=await player.promises.chooseBool(get.prompt2('xinfu_jiyuan',target)).set('ai',()=>{ + const evt=_status.event; + return get.attitude(player,evt.getParent().target)>0; + }); + if(bool){ + player.logSkill('xinfu_jiyuan',target); + await target.promises.draw(); + } + }while(event.targets.length>0); }, }, },