标准包xinfu_jijie技能使用async content

This commit is contained in:
shijian 2023-12-09 15:47:51 +08:00
parent 78b159049f
commit 093507cc9d
1 changed files with 10 additions and 11 deletions

View File

@ -2316,13 +2316,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
enable:"phaseUse", enable:"phaseUse",
usable:1, usable:1,
audio:2, audio:2,
content:function(){ async content(event,trigger,player){
'step 0' const card=get.bottomCards()[0];
var card=get.bottomCards()[0]; await game.cardsGotoOrdering(card).toPromise();
game.cardsGotoOrdering(card);
event.card=card; event.card=card;
player.chooseTarget(true).set('ai',function(target){ const {result:{bool,targets}}=await player.promises.chooseTarget(true).set('ai',target=>{
var att=get.attitude(_status.event.player,target); let att=get.attitude(_status.event.player,target);
if(_status.event.du){ if(_status.event.du){
if(target.hasSkillTag('nodu')) return 0.5; if(target.hasSkillTag('nodu')) return 0.5;
return -att; return -att;
@ -2336,12 +2335,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
'机捷:选择一名角色获得此牌', '机捷:选择一名角色获得此牌',
[card] [card]
]); ]);
'step 1' if(bool){
if(result.bool){ const target=targets[0];
var target=result.targets[0];
player.line(target,'green'); player.line(target,'green');
var next=target.gain(card,'draw'); const gainEvent=target.promises.gain(card,'draw');
next.giver=player; gainEvent.giver=player;
await gainEvent;
} }
}, },
ai:{ ai:{