标准包tuxi技能使用async content
This commit is contained in:
parent
10ab434921
commit
ae6f6cefd9
|
@ -466,31 +466,24 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
filter:function(event,player){
|
filter:function(event,player){
|
||||||
return !event.numFixed;
|
return !event.numFixed;
|
||||||
},
|
},
|
||||||
content:function(){
|
async content(event,trigger,player){
|
||||||
"step 0"
|
let check;
|
||||||
var check;
|
let i,num=game.countPlayer(function(current){
|
||||||
var i,num=game.countPlayer(function(current){
|
|
||||||
return current!=player&¤t.countCards('h')&&get.attitude(player,current)<=0;
|
return current!=player&¤t.countCards('h')&&get.attitude(player,current)<=0;
|
||||||
});
|
});
|
||||||
check=(num>=2);
|
check=(num>=2);
|
||||||
player.chooseTarget(get.prompt('tuxi'),'获得其他一至两名角色的各一张手牌',[1,2],function(card,player,target){
|
const {result:{bool,targets}}=await player.promises.chooseTarget(get.prompt('tuxi'),'获得其他一至两名角色的各一张手牌',[1,2],(card,player,target)=>{
|
||||||
return target.countCards('h')>0&&player!=target;
|
return target.countCards('h')>0&&player!=target;
|
||||||
},function(target){
|
},target=>{
|
||||||
if(!_status.event.aicheck) return 0;
|
if(!_status.event.aicheck) return 0;
|
||||||
var att=get.attitude(_status.event.player,target);
|
const att=get.attitude(_status.event.player,target);
|
||||||
if(target.hasSkill('tuntian')) return att/10;
|
if(target.hasSkill('tuntian')) return att/10;
|
||||||
return 1-att;
|
return 1-att;
|
||||||
}).set('aicheck',check);
|
}).set('aicheck',check);
|
||||||
"step 1"
|
if(!bool) return;
|
||||||
if(result.bool){
|
player.logSkill('tuxi',targets);
|
||||||
player.logSkill('tuxi',result.targets);
|
await player.promises.gainMultiple(targets);
|
||||||
player.gainMultiple(result.targets);
|
trigger.changeToZero();
|
||||||
trigger.changeToZero();
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
event.finish();
|
|
||||||
}
|
|
||||||
"step 2"
|
|
||||||
game.delay();
|
game.delay();
|
||||||
},
|
},
|
||||||
ai:{
|
ai:{
|
||||||
|
|
Loading…
Reference in New Issue