标准包ganglie技能使用async content

This commit is contained in:
shijian 2023-12-09 12:19:10 +08:00
parent e31b7dc734
commit c61d214cb7
1 changed files with 9 additions and 13 deletions

View File

@ -390,25 +390,21 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return (get.attitude(player,event.source)<=0); return (get.attitude(player,event.source)<=0);
}, },
logTarget:'source', logTarget:'source',
content:function(){ async content(event,trigger,player){
"step 0" const judgeEvent=player.promises.judge(card=>{
player.judge(function(card){
if(get.suit(card)=='heart') return -2; if(get.suit(card)=='heart') return -2;
return 2; return 2;
}).judge2=function(result){ });
return result.bool; judgeEvent.judge2=result=>result.bool;
}; const {result:{judge}}=await judgeEvent;
"step 1" if(judge<2) return;
if(result.judge<2){ const {result:{bool}}=await trigger.source.promises.chooseToDiscard(2)
event.finish();return; .set('ai',card=>{
}
trigger.source.chooseToDiscard(2).set('ai',function(card){
if(card.name=='tao') return -10; if(card.name=='tao') return -10;
if(card.name=='jiu'&&_status.event.player.hp==1) return -10; if(card.name=='jiu'&&_status.event.player.hp==1) return -10;
return get.unuseful(card)+2.5*(5-get.owner(card).hp); return get.unuseful(card)+2.5*(5-get.owner(card).hp);
}); });
"step 2" if(bool==false){
if(result.bool==false){
trigger.source.damage(); trigger.source.damage();
} }
}, },