标准版技能去除不必要的await关键字

This commit is contained in:
shijian 2023-12-19 17:32:46 +08:00
parent 327744cc0e
commit 9571e0d266
2 changed files with 154 additions and 207 deletions

View File

@ -101,15 +101,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
direct:true, direct:true,
async content(event,trigger,player){ async content(event,trigger,player){
event.num=trigger.num||1; event.num=trigger.num||1;
while(player.hasSkill('stdshushen')){ do {
const {result:{bool,targets}}=await player.chooseTarget(get.prompt2('stdshushen'),lib.filter.notMe) const {result:{bool,targets}}=await player.chooseTarget(get.prompt2('stdshushen'),lib.filter.notMe)
.set('ai',target=>get.attitude(_status.event.player,target)); .set('ai',target=>get.attitude(_status.event.player,target));
if(!bool) break; if(!bool) return;
const target=targets[0]; const target=targets[0];
player.logSkill('stdshushen',target); player.logSkill('stdshushen',target);
await target.draw(target.countCards('h')?1:2); target.draw(target.countCards('h')?1:2);
if(--event.num<1) break; }while(--event.num>0&&player.hasSkill('stdshushen'));
};
}, },
ai:{threaten:0.8,expose:0.1}, ai:{threaten:0.8,expose:0.1},
}, },
@ -122,8 +121,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player.isPhaseUsing()&&event.card&&event.card.name=='sha'&&event.player!=player&&event.player.isIn(); return player.isPhaseUsing()&&event.card&&event.card.name=='sha'&&event.player!=player&&event.player.isIn();
}, },
async content(event,trigger,player){ async content(event,trigger,player){
if(trigger.player.hp<player.hp) await player.draw(2); if(trigger.player.hp<player.hp) player.draw(2);
else await player.loseHp(); else player.loseHp();
}, },
ai:{ ai:{
halfneg:true, halfneg:true,
@ -138,7 +137,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
logTarget:'player', logTarget:'player',
async content(event,trigger,player){ async content(event,trigger,player){
await player.draw(); player.draw();
let zhu=false; let zhu=false;
const target=trigger.player; const target=trigger.player;
switch(get.mode()){ switch(get.mode()){
@ -160,7 +159,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
} }
if(zhu){ if(zhu){
await player.draw(); player.draw();
target.addTempSkill('rewangzun2'); target.addTempSkill('rewangzun2');
target.addMark('rewangzun2',1,false); target.addMark('rewangzun2',1,false);
} }
@ -207,7 +206,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
})()>0); })()>0);
if(bool){ if(bool){
player.logSkill('retongji',trigger.target); player.logSkill('retongji',trigger.target);
await trigger.target.discard(cards); trigger.target.discard(cards);
const evt=trigger.getParent(); const evt=trigger.getParent();
evt.triggeredTargets2.remove(trigger.target); evt.triggeredTargets2.remove(trigger.target);
evt.targets.remove(trigger.target); evt.targets.remove(trigger.target);
@ -226,9 +225,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(player.storage.hujiaing) return false; if(player.storage.hujiaing) return false;
if(!player.hasZhuSkill('hujia')) return false; if(!player.hasZhuSkill('hujia')) return false;
if(!event.filterCard({name:'shan'},player,event)) return false; if(!event.filterCard({name:'shan'},player,event)) return false;
return game.hasPlayer(function(current){ return game.hasPlayer(current=>current!=player&&current.group=='wei');
return current!=player&&current.group=='wei';
});
}, },
check(event,player){ check(event,player){
if(get.damageEffect(player,event.player,player)>=0) return false; if(get.damageEffect(player,event.player,player)>=0) return false;
@ -276,9 +273,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
skillTagFilter(player){ skillTagFilter(player){
if(player.storage.hujiaing) return false; if(player.storage.hujiaing) return false;
if(!player.hasZhuSkill('hujia')) return false; if(!player.hasZhuSkill('hujia')) return false;
return game.hasPlayer(function(current){ return game.hasPlayer(current=>current!=player&&current.group=='wei');
return current!=player&&current.group=='wei';
});
}, },
}, },
}, },
@ -290,7 +285,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return get.itemtype(event.cards)=='cards'&&get.position(event.cards[0],true)=='o'; return get.itemtype(event.cards)=='cards'&&get.position(event.cards[0],true)=='o';
}, },
async content(event,trigger,player){ async content(event,trigger,player){
await player.gain(trigger.cards,'gain2'); player.gain(trigger.cards,'gain2');
}, },
ai:{ ai:{
maixie:true, maixie:true,
@ -312,7 +307,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return (event.source&&event.source.countGainableCards(player,event.source!=player?'he':'e')&&event.num>0); return (event.source&&event.source.countGainableCards(player,event.source!=player?'he':'e')&&event.num>0);
}, },
async content(event,trigger,player){ async content(event,trigger,player){
await player.gainPlayerCard(true,trigger.source,trigger.source!=player?'he':'e'); player.gainPlayerCard(true,trigger.source,trigger.source!=player?'he':'e');
}, },
ai:{ ai:{
maixie_defend:true, maixie_defend:true,
@ -358,7 +353,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}).set('judging',trigger.player.judging[0]).setHiddenSkill('guicai'); }).set('judging',trigger.player.judging[0]).setHiddenSkill('guicai');
if(!chooseCardResultBool) return; if(!chooseCardResultBool) return;
await player.respond(chooseCardResultCards,'guicai','highlight','noOrdering'); player.respond(chooseCardResultCards,'guicai','highlight','noOrdering');
if(trigger.player.judging[0].clone){ if(trigger.player.judging[0].clone){
trigger.player.judging[0].clone.classList.remove('thrownhighlight'); trigger.player.judging[0].clone.classList.remove('thrownhighlight');
game.broadcast(function(card){ game.broadcast(function(card){
@ -368,11 +363,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
},trigger.player.judging[0]); },trigger.player.judging[0]);
game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone])); game.addVideo('deletenode',player,get.cardsInfo([trigger.player.judging[0].clone]));
} }
await game.cardsDiscard(trigger.player.judging[0]); game.cardsDiscard(trigger.player.judging[0]);
trigger.player.judging[0]=chooseCardResultCards[0]; trigger.player.judging[0]=chooseCardResultCards[0];
trigger.orderingCards.addArray(chooseCardResultCards); trigger.orderingCards.addArray(chooseCardResultCards);
game.log(trigger.player,'的判定牌改为',chooseCardResultCards[0]); game.log(trigger.player,'的判定牌改为',chooseCardResultCards[0]);
await game.asyncDelay(2); game.asyncDelay(2);
}, },
ai:{ ai:{
rejudge:true, rejudge:true,
@ -468,11 +463,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return !event.numFixed; return !event.numFixed;
}, },
async content(event,trigger,player){ async content(event,trigger,player){
let check; let num=game.countPlayer(current=>current!=player&&current.countCards('h')&&get.attitude(player,current)<=0);
let i,num=game.countPlayer(function(current){ let check=num>=2;
return current!=player&&current.countCards('h')&&get.attitude(player,current)<=0;
});
check=(num>=2);
const {result:{bool,targets}}=await player.chooseTarget(get.prompt('tuxi'),'获得其他一至两名角色的各一张手牌',[1,2],(card,player,target)=>{ const {result:{bool,targets}}=await player.chooseTarget(get.prompt('tuxi'),'获得其他一至两名角色的各一张手牌',[1,2],(card,player,target)=>{
return target.countCards('h')>0&&player!=target; return target.countCards('h')>0&&player!=target;
},target=>{ },target=>{
@ -483,9 +475,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}).set('aicheck',check); }).set('aicheck',check);
if(!bool) return; if(!bool) return;
player.logSkill('tuxi',targets); player.logSkill('tuxi',targets);
await player.gainMultiple(targets); player.gainMultiple(targets);
trigger.changeToZero(); trigger.changeToZero();
await game.asyncDelay(); game.asyncDelay();
}, },
ai:{ ai:{
threaten:2, threaten:2,
@ -498,9 +490,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
check(event,player){ check(event,player){
if(player.skipList.includes('phaseUse')||player.countCards('h')<3) return false; if(player.skipList.includes('phaseUse')||player.countCards('h')<3) return false;
if(!player.hasSha()) return false; if(!player.hasSha()) return false;
return game.hasPlayer(function(current){ return game.hasPlayer(current=>get.attitude(player,current)<0&&player.canUse('sha',current));
return get.attitude(player,current)<0&&player.canUse('sha',current);
});
}, },
preHidden:true, preHidden:true,
filter(event,player){ filter(event,player){
@ -530,19 +520,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'judgeEnd'}, trigger:{player:'judgeEnd'},
preHidden:true, preHidden:true,
frequent(event){ frequent(event){
if(event.result.card.name=='du') return false;
//if(get.mode()=='guozhan') return false; //if(get.mode()=='guozhan') return false;
return true; return event.result.card.name!=='du';
}, },
check(event){ check(event){
if(event.result.card.name=='du') return false; return event.result.card.name!=='du';
return true;
}, },
filter(event,player){ filter(event,player){
return get.position(event.result.card,true)=='o'; return get.position(event.result.card,true)=='o';
}, },
async content(event,trigger,player){ async content(event,trigger,player){
await player.gain(trigger.result.card,'gain2'); player.gain(trigger.result.card,'gain2');
} }
}, },
yiji:{ yiji:{
@ -567,7 +555,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
cards.length==1? cards.length==1?
{result:{links:cards.slice(0),bool: true}}: {result:{links:cards.slice(0),bool: true}}:
await player.chooseCardButton('遗计:请选择要分配的牌',true,cards,[1,cards.length]) await player.chooseCardButton('遗计:请选择要分配的牌',true,cards,[1,cards.length])
.set('ai',button=>{ .set('ai',()=>{
if(ui.selected.buttons.length==0) return 1; if(ui.selected.buttons.length==0) return 1;
return 0; return 0;
}); });
@ -604,7 +592,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.line(source,'green'); player.line(source,'green');
list.push([source, event.given_map[i]]); list.push([source, event.given_map[i]]);
} }
await game.loseAsync({ game.loseAsync({
gain_list:list, gain_list:list,
giver:player, giver:player,
animate:'draw', animate:'draw',
@ -625,14 +613,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(get.tag(card,'damage')){ if(get.tag(card,'damage')){
if(player.hasSkillTag('jueqing',false,target)) return [1,-2]; if(player.hasSkillTag('jueqing',false,target)) return [1,-2];
if(!target.hasFriend()) return; if(!target.hasFriend()) return;
var num=1; let num=1;
if(get.attitude(player,target)>0){ if(get.attitude(player,target)>0){
if(player.needsToDiscard()){ if(player.needsToDiscard()) num=0.7;
num=0.7; else num=0.5;
}
else{
num=0.5;
}
} }
if(target.hp>=4) return [1,num*2]; if(target.hp>=4) return [1,num*2];
if(target.hp==3) return [1,num*1.5]; if(target.hp==3) return [1,num*1.5];
@ -674,13 +658,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
} }
if(event.cards.length){ if(event.cards.length){
await player.gain(event.cards,'gain2'); player.gain(event.cards,'gain2');
} }
return; return;
} }
if(!bool){ if(!bool){
if(event.cards.length){ if(event.cards.length){
await player.gain(event.cards,'gain2'); player.gain(event.cards,'gain2');
} }
return; return;
} }
@ -713,13 +697,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
i--; i--;
} }
} }
await player.gain(event.cards,'gain2'); player.gain(event.cards,'gain2');
player.storage.xinluoshen=event.cards.slice(0); player.storage.xinluoshen=event.cards.slice(0);
return; return;
} }
if(!bool){ if(!bool){
if(event.cards.length){ if(event.cards.length){
await player.gain(event.cards,'gain2'); player.gain(event.cards,'gain2');
player.storage.xinluoshen=event.cards.slice(0); player.storage.xinluoshen=event.cards.slice(0);
return; return;
} }
@ -748,16 +732,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
mod:{ mod:{
aiValue(player,card,num){ aiValue(player,card,num){
if(get.name(card)!='shan'&&get.color(card)!='black') return; if(get.name(card)!='shan'&&get.color(card)!='black') return;
var cards=player.getCards('hs',function(card){ const cards=player.getCards('hs',card=>get.name(card)=='shan'||get.color(card)=='black');
return get.name(card)=='shan'||get.color(card)=='black'; cards.sort((a,b)=>{
});
cards.sort(function(a,b){
return (get.name(b)=='shan'?1:2)-(get.name(a)=='shan'?1:2); return (get.name(b)=='shan'?1:2)-(get.name(a)=='shan'?1:2);
}); });
var geti=function(){ const geti=()=>{
if(cards.contains(card)){ if(cards.includes(card)) cards.indexOf(card);
return cards.indexOf(card);
}
return cards.length; return cards.length;
}; };
if(get.name(card)=='shan') return Math.min(num,[6,4,3][Math.min(geti(),2)])*0.6; if(get.name(card)=='shan') return Math.min(num,[6,4,3][Math.min(geti(),2)])*0.6;
@ -809,19 +789,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(ui.selected.cards.length>1) return 0; if(ui.selected.cards.length>1) return 0;
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du') return 0; if(ui.selected.cards.length&&ui.selected.cards[0].name=='du') return 0;
if(!ui.selected.cards.length&&card.name=='du') return 20; if(!ui.selected.cards.length&&card.name=='du') return 20;
var player=get.owner(card); const player=get.owner(card);
var num=0; let num=0;
var evt2=_status.event.getParent(); const evt2=_status.event.getParent();
var num=0; player.getHistory('lose',evt=>{
player.getHistory('lose',function(evt){
if(evt.getParent().skill=='rende'&&evt.getParent(3)==evt2) num+=evt.cards.length; if(evt.getParent().skill=='rende'&&evt.getParent(3)==evt2) num+=evt.cards.length;
}); });
if(player.hp==player.maxHp||num>1||player.countCards('h')<=1){ if(player.hp==player.maxHp||num>1||player.countCards('h')<=1){
if(ui.selected.cards.length){ if(ui.selected.cards.length){
return -1; return -1;
} }
var players=game.filterPlayer(); const players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(let i=0;i<players.length;i++){
if(players[i].hasSkill('haoshi')&& if(players[i].hasSkill('haoshi')&&
!players[i].isTurnedOver()&& !players[i].isTurnedOver()&&
!players[i].hasJudge('lebu')&& !players[i].hasJudge('lebu')&&
@ -842,8 +821,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.getHistory('lose',evt=>{ player.getHistory('lose',evt=>{
if(evt.getParent(2).name=='rende'&&evt.getParent(5)==evt2) num+=evt.cards.length; if(evt.getParent(2).name=='rende'&&evt.getParent(5)==evt2) num+=evt.cards.length;
}); });
await player.give(event.cards,event.target); player.give(event.cards,event.target);
if(num<2&&num+event.cards.length>1) await player.recover(); if(num<2&&num+event.cards.length>1) player.recover();
}, },
ai:{ ai:{
order(skill,player){ order(skill,player){
@ -856,12 +835,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target(player,target){ target(player,target){
if(target.hasSkillTag('nogain')) return 0; if(target.hasSkillTag('nogain')) return 0;
if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){ if(ui.selected.cards.length&&ui.selected.cards[0].name=='du'){
if(target.hasSkillTag('nodu')) return 0; return target.hasSkillTag('nodu')?0:-10;
return -10;
} }
if(target.hasJudge('lebu')) return 0; if(target.hasJudge('lebu')) return 0;
var nh=target.countCards('h'); const nh=target.countCards('h');
var np=player.countCards('h'); const np=player.countCards('h');
if(player.hp==player.maxHp||player.storage.rende<0||player.countCards('h')<=1){ if(player.hp==player.maxHp||player.storage.rende<0||player.countCards('h')<=1){
if(nh>=np-1&&np<=player.hp&&!target.hasSkill('haoshi')) return 0; if(nh>=np-1&&np<=player.hp&&!target.hasSkill('haoshi')) return 0;
} }
@ -872,8 +850,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target(card,player,target){ target(card,player,target){
if(player==target&&get.type(card)=='equip'){ if(player==target&&get.type(card)=='equip'){
if(player.countCards('e',{subtype:get.subtype(card)})){ if(player.countCards('e',{subtype:get.subtype(card)})){
var players=game.filterPlayer(); const players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(let i=0;i<players.length;i++){
if(players[i]!=player&&get.attitude(player,players[i])>0){ if(players[i]!=player&&get.attitude(player,players[i])>0){
return 0; return 0;
} }
@ -899,9 +877,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
group:['jijiang1'], group:['jijiang1'],
zhuSkill:true, zhuSkill:true,
filter(event,player){ filter(event,player){
if(!player.hasZhuSkill('jijiang')||!game.hasPlayer(function(current){ if(!player.hasZhuSkill('jijiang')||!game.hasPlayer(current=>current!=player&&current.group=='shu')) return false;
return current!=player&&current.group=='shu';
})) return false;
return !event.jijiang&&(event.type!='phase'||!player.hasSkill('jijiang3')); return !event.jijiang&&(event.type!='phase'||!player.hasSkill('jijiang3'));
}, },
enable:['chooseToUse','chooseToRespond'], enable:['chooseToUse','chooseToRespond'],
@ -914,9 +890,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
respondSha:true, respondSha:true,
skillTagFilter(player){ skillTagFilter(player){
if(!player.hasZhuSkill('jijiang')||!game.hasPlayer(function(current){ if(!player.hasZhuSkill('jijiang')||!game.hasPlayer(current=>current!=player&&current.group=='shu')) return false;
return current!=player&&current.group=='shu';
})) return false;
}, },
}, },
}, },
@ -1003,7 +977,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
prompt:'将一张红色牌当杀使用或打出', prompt:'将一张红色牌当杀使用或打出',
check(card){ check(card){
var val=get.value(card); const val=get.value(card);
if(_status.event.name=='chooseToRespond') return 1/Math.max(0.1,val); if(_status.event.name=='chooseToRespond') return 1/Math.max(0.1,val);
return 5-val; return 5-val;
}, },
@ -1036,7 +1010,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
async content(event,trigger,player){ async content(event,trigger,player){
player.awakenSkill('zhongyi'); player.awakenSkill('zhongyi');
player.addTempSkill('zhongyi2','roundStart'); player.addTempSkill('zhongyi2','roundStart');
await player.addToExpansion(player,'give',event.cards).gaintag.add('zhongyi2'); player.addToExpansion(player,'give',event.cards).gaintag.add('zhongyi2');
}, },
}, },
zhongyi2:{ zhongyi2:{
@ -1050,7 +1024,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
async content(event,trigger,player){trigger.num++}, async content(event,trigger,player){trigger.num++},
intro:{content:'expansion',markcount:'expansion'}, intro:{content:'expansion',markcount:'expansion'},
onremove(player,skill){ onremove(player,skill){
var cards=player.getExpansions(skill); const cards=player.getExpansions(skill);
if(cards.length) player.loseToDiscardpile(cards); if(cards.length) player.loseToDiscardpile(cards);
}, },
}, },
@ -1095,7 +1069,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
async content(event,trigger,player){ async content(event,trigger,player){
const num=player.hasSkill('yizhi')&&player.hasSkill('guanxing')?5:Math.min(5,game.countPlayer()); const num=player.hasSkill('yizhi')&&player.hasSkill('guanxing')?5:Math.min(5,game.countPlayer());
const cards=get.cards(num); const cards=get.cards(num);
await game.cardsGotoOrdering(cards); game.cardsGotoOrdering(cards);
const next=player.chooseToMove(); const next=player.chooseToMove();
next.set('list',[ next.set('list',[
['牌堆顶',cards], ['牌堆顶',cards],
@ -1134,7 +1108,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
const top=moved[0]; const top=moved[0];
const bottom=moved[1]; const bottom=moved[1];
top.reverse(); top.reverse();
await game.cardsGotoPile( game.cardsGotoPile(
top.concat(bottom), top.concat(bottom),
['top_cards',top], ['top_cards',top],
(event,card)=>{ (event,card)=>{
@ -1144,7 +1118,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
); );
player.popup(get.cnNumber(top.length)+'上'+get.cnNumber(bottom.length)+'下'); player.popup(get.cnNumber(top.length)+'上'+get.cnNumber(bottom.length)+'下');
game.log(player,'将'+get.cnNumber(top.length)+'张牌置于牌堆顶'); game.log(player,'将'+get.cnNumber(top.length)+'张牌置于牌堆顶');
await game.asyncDelayx(); game.asyncDelayx();
}, },
ai:{ ai:{
threaten:1.2 threaten:1.2
@ -1178,7 +1152,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audioname:['re_zhugeliang'], audioname:['re_zhugeliang'],
filter(event,player){ filter(event,player){
if(player.countCards('h')) return false; if(player.countCards('h')) return false;
for(var i=0;i<event.cards.length;i++){ for(let i=0;i<event.cards.length;i++){
if(event.cards[i].original=='h') return true; if(event.cards[i].original=='h') return true;
} }
return false; return false;
@ -1199,7 +1173,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return event.skill=='longdan_sha'||event.skill=='longdan_shan'; return event.skill=='longdan_sha'||event.skill=='longdan_shan';
}, },
async content(event,trigger,player){ async content(event,trigger,player){
await player.draw(); player.draw();
player.storage.fanghun2++; player.storage.fanghun2++;
} }
}, },
@ -1327,7 +1301,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return (get.type(event.card)=='trick'&&event.card.isCard); return (get.type(event.card)=='trick'&&event.card.isCard);
}, },
async content(event,trigger,player){ async content(event,trigger,player){
await player.draw(); player.draw();
}, },
ai:{ ai:{
threaten:1.4, threaten:1.4,
@ -1344,7 +1318,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return (get.type(event.card,'trick')=='trick'&&event.cards[0]&&event.cards[0]==event.card); return (get.type(event.card,'trick')=='trick'&&event.cards[0]&&event.cards[0]==event.card);
}, },
async content(event, trigger, player){ async content(event, trigger, player){
await player.draw(); player.draw();
}, },
ai:{ ai:{
threaten:1.4, threaten:1.4,
@ -1354,8 +1328,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
qicai:{ qicai:{
mod:{ mod:{
targetInRange(card,player,target,now){ targetInRange(card,player,target,now){
var type=get.type(card); if(['trick','delay'].includes(get.type(card))) return true;
if(type=='trick'||type=='delay') return true;
} }
}, },
}, },
@ -1363,8 +1336,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
// alter:true, // alter:true,
mod:{ mod:{
targetInRange(card,player,target,now){ targetInRange(card,player,target,now){
var type=get.type(card); if(['trick','delay'].includes(get.type(card))) return true;
if(type=='trick'||type=='delay') return true;
} }
}, },
}, },
@ -1385,18 +1357,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filterCard:true, filterCard:true,
selectCard:[1,Infinity], selectCard:[1,Infinity],
check(card){ check(card){
var player=_status.event.player; const player=_status.event.player;
if(get.is.altered('xinzhiheng')&&get.position(card)=='h'&&!player.countCards('h',function(card){ if(get.is.altered('xinzhiheng')&&get.position(card)=='h'&&!player.countCards('h',card=>get.value(card)>=8)){
return get.value(card)>=8;
})){
return 8-get.value(card); return 8-get.value(card);
} }
return 6-get.value(card) return 6-get.value(card)
}, },
delay:0, delay:0,
async content(event,trigger,player){ async content(event,trigger,player){
if(!player.hasSkill('xinzhiheng_delay')) await game.asyncDelayx(); if(!player.hasSkill('xinzhiheng_delay')) game.asyncDelayx();
await player.draw(event.cards.length); player.draw(event.cards.length);
}, },
group:'xinzhiheng_draw', group:'xinzhiheng_draw',
subSkill:{ subSkill:{
@ -1407,7 +1377,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(event.getParent(2).skill!='xinzhiheng') return false; if(event.getParent(2).skill!='xinzhiheng') return false;
if(!get.is.altered('xinzhiheng')) return false; if(!get.is.altered('xinzhiheng')) return false;
if(player.countCards('h')) return false; if(player.countCards('h')) return false;
for(var i=0;i<event.cards.length;i++){ for(let i=0;i<event.cards.length;i++){
if(event.cards[i].original=='h') return true; if(event.cards[i].original=='h') return true;
} }
return false; return false;
@ -1455,7 +1425,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return 6-get.value(card) return 6-get.value(card)
}, },
async content(event,trigger,player){ async content(event,trigger,player){
await player.draw(event.cards.length); player.draw(event.cards.length);
}, },
ai:{ ai:{
order:1, order:1,
@ -1497,7 +1467,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return true; return true;
}, },
async content(event,trigger,player){ async content(event,trigger,player){
await player.recover(); player.recover();
}, },
global:'xinjiuyuan2', global:'xinjiuyuan2',
}, },
@ -1508,7 +1478,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter(event,player){ filter(event,player){
if(!get.is.altered('xinjiuyuan')) return false; if(!get.is.altered('xinjiuyuan')) return false;
if(player.group!='wu') return false; if(player.group!='wu') return false;
return game.hasPlayer(function(target){ return game.hasPlayer(target=>{
return player!=target&&target.isDamaged()&&target.hp<player.hp&&target.hasZhuSkill('xinjiuyuan',player); return player!=target&&target.isDamaged()&&target.hp<player.hp&&target.hasZhuSkill('xinjiuyuan',player);
}); });
}, },
@ -1521,8 +1491,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
const {result:{bool}}=await player.chooseBool(get.prompt('xinjiuyuan',current)).set('choice',get.attitude(player,current)>0); const {result:{bool}}=await player.chooseBool(get.prompt('xinjiuyuan',current)).set('choice',get.attitude(player,current)>0);
if(bool){ if(bool){
player.logSkill('xinjiuyuan',event.current); player.logSkill('xinjiuyuan',event.current);
await event.current.recover(); event.current.recover();
await player.draw(); player.draw();
} }
} }
} }
@ -1551,8 +1521,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
filter(event,player){ filter(event,player){
if(player.getHistory('skipped').contains('phaseUse')) return true; if(player.getHistory('skipped').contains('phaseUse')) return true;
var history=player.getHistory('useCard').concat(player.getHistory('respond')); const history=player.getHistory('useCard').concat(player.getHistory('respond'));
for(var i=0;i<history.length;i++){ for(let i=0;i<history.length;i++){
if(history[i].card.name=='sha'&&history[i].isPhaseUsing()) return false; if(history[i].card.name=='sha'&&history[i].isPhaseUsing()) return false;
} }
return true; return true;
@ -1566,8 +1536,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
enable:'phaseUse', enable:'phaseUse',
prompt:'失去1点体力并摸两张牌', prompt:'失去1点体力并摸两张牌',
async content(event,trigger,player){ async content(event,trigger,player){
await player.loseHp(1); player.loseHp(1);
await player.draw(2); player.draw(2);
}, },
ai:{ ai:{
basic:{ basic:{
@ -1621,19 +1591,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
event.choice=control; event.choice=control;
target.chat('我选'+get.translation(event.choice)); target.chat('我选'+get.translation(event.choice));
const {result:{bool,cards}}=await target.gainPlayerCard(player,true,'h'); const {result:{bool,cards}}=await target.gainPlayerCard(player,true,'h');
if(bool&&get.suit(cards[0],player)+'2'!=event.choice) await target.damage('nocard'); if(bool&&get.suit(cards[0],player)+'2'!=event.choice) target.damage('nocard');
}, },
ai:{ ai:{
order:1, order:1,
result:{ result:{
target(player,target){ target(player,target){
var eff=get.damageEffect(target,player); const eff=get.damageEffect(target,player);
if(eff>=0) return 1+eff; if(eff>=0) return 1+eff;
var value=0,i; let value=0,i;
var cards=player.getCards('h'); const cards=player.getCards('h');
for(i=0;i<cards.length;i++){ for(i=0;i<cards.length;i++) value+=get.value(cards[i]);
value+=get.value(cards[i]);
}
value/=player.countCards('h'); value/=player.countCards('h');
if(target.hp==1) return Math.min(0,value-7); if(target.hp==1) return Math.min(0,value-7);
return Math.min(0,value-5); return Math.min(0,value-5);
@ -1667,7 +1635,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter(event,player){ filter(event,player){
if(event.card.name!='sha') return false; if(event.card.name!='sha') return false;
if(player.countCards('he')==0) return false; if(player.countCards('he')==0) return false;
return game.hasPlayer(function(current){ return game.hasPlayer(current=>{
return player.inRange(current)&&current!=event.player&& return player.inRange(current)&&current!=event.player&&
current!=player&&lib.filter.targetEnabled(event.card,event.player,current); current!=player&&lib.filter.targetEnabled(event.card,event.player,current);
}); });
@ -1707,7 +1675,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(bool){ if(bool){
const target=targets[0]; const target=targets[0];
player.logSkill(event.name,target); player.logSkill(event.name,target);
await player.discard(cards); player.discard(cards);
const evt=trigger.getParent(); const evt=trigger.getParent();
evt.triggeredTargets2.remove(player); evt.triggeredTargets2.remove(player);
evt.targets.remove(player); evt.targets.remove(player);
@ -1719,11 +1687,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
target(card,player,target){ target(card,player,target){
if(target.countCards('he')==0) return; if(target.countCards('he')==0) return;
if(card.name!='sha') return; if(card.name!='sha') return;
var min=1; let min=1;
var friend=get.attitude(player,target)>0; const friend=get.attitude(player,target)>0;
var vcard={name:'shacopy',nature:card.nature,suit:card.suit}; const vcard={name:'shacopy',nature:card.nature,suit:card.suit};
var players=game.filterPlayer(); const players=game.filterPlayer();
for(var i=0;i<players.length;i++){ for(let i=0;i<players.length;i++){
if(player!=players[i]&& if(player!=players[i]&&
get.attitude(target,players[i])<0&& get.attitude(target,players[i])<0&&
target.canUse(card,players[i])){ target.canUse(card,players[i])){
@ -1758,11 +1726,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
frequent:true, frequent:true,
filter(event,player){ filter(event,player){
if(player.countCards('h')) return false; if(player.countCards('h')) return false;
var evt=event.getl(player); const evt=event.getl(player);
return evt&&evt.player==player&&evt.hs&&evt.hs.length>0; return evt&&evt.player==player&&evt.hs&&evt.hs.length>0;
}, },
async content(event,trigger,player){ async content(event,trigger,player){
await player.draw(); player.draw();
}, },
ai:{ ai:{
threaten:0.8, threaten:0.8,
@ -1788,23 +1756,22 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
frequent:true, frequent:true,
filter(event,player){ filter(event,player){
var evt=event.getl(player); const evt=event.getl(player);
return evt&&evt.player==player&&evt.es&&evt.es.length>0; return evt&&evt.player==player&&evt.es&&evt.es.length>0;
}, },
async content(event,trigger,player){ async content(event,trigger,player){
event.count=trigger.getl(player).es.length; event.count=trigger.getl(player).es.length;
while(true){ do {
event.count--; player.draw(2);
await player.draw(2); if(!player.hasSkill(event.name)) break;
if(event.count>0&&player.hasSkill(event.name)&&!get.is.blocked(event.name,player)){ if(!get.is.blocked(event.name,player)){
const chooseBoolEvent=player.chooseBool(get.prompt2('xiaoji')).set('frequentSkill','xiaoji'); const chooseBoolEvent=player.chooseBool(get.prompt2('xiaoji')).set('frequentSkill','xiaoji');
chooseBoolEvent.ai=lib.filter.all; chooseBoolEvent.ai=lib.filter.all;
const {result:{bool}}=await chooseBoolEvent; const {result:{bool}}=await chooseBoolEvent;
if(bool){ if(bool) player.logSkill('xiaoji');
player.logSkill('xiaoji'); else break;
}else break;
}
} }
}while(event.count-->0);
}, },
ai:{ ai:{
noe:true, noe:true,
@ -1823,12 +1790,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
usable:1, usable:1,
selectCard:2, selectCard:2,
check(card){ check(card){
var player=get.owner(card); const player=get.owner(card);
if(player.countCards('h')>player.hp) if(player.countCards('h')>player.hp) return 8-get.value(card);
return 8-get.value(card) if(player.hp<player.maxHp) return 6-get.value(card);
if(player.hp<player.maxHp) return 4-get.value(card);
return 6-get.value(card)
return 4-get.value(card)
}, },
filterTarget(card,player,target){ filterTarget(card,player,target){
if(!target.hasSex('male')) return false; if(!target.hasSex('male')) return false;
@ -1837,8 +1802,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return true; return true;
}, },
async content(event,trigger,player){ async content(event,trigger,player){
await player.recover(); player.recover();
await event.target.recover(); event.target.recover();
}, },
ai:{ ai:{
order:5.5, order:5.5,
@ -1868,15 +1833,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player.countCards('he')>0; return player.countCards('he')>0;
}, },
check(card){ check(card){
var player=_status.event.player; const player=_status.event.player;
if(get.position(card)=='e'){ if(get.position(card)=='e'){
var subtype=get.subtype(card); const subtype=get.subtype(card);
if(!game.hasPlayer(function(current){ if(!game.hasPlayer(current=>{
return current!=player&&current.hp!=player.hp&&get.attitude(player,current)>0&&!current.countCards('e',{subtype:subtype}); return current!=player&&current.hp!=player.hp&&get.attitude(player,current)>0&&!current.countCards('e',{subtype});
})){ })){
return 0; return 0;
} }
if(player.countCards('h',{subtype:subtype})) return 20-get.value(card); // 你还想我兼容{subtype:subtype}?不可能!
if(player.countCards('h',{subtype})) return 20-get.value(card);
return 10-get.value(card); return 10-get.value(card);
} }
else{ else{
@ -1887,7 +1853,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
filterTarget(card,player,target){ filterTarget(card,player,target){
if(!target.hasSex('male')) return false; if(!target.hasSex('male')) return false;
var card=ui.selected.cards[0]; card=ui.selected.cards[0];
if(!card) return false; if(!card) return false;
if(get.position(card)=='e'&&target.countCards('e',{subtype:get.subtype(card)})) return false; if(get.position(card)=='e'&&target.countCards('e',{subtype:get.subtype(card)})) return false;
return true; return true;
@ -1899,34 +1865,34 @@ game.import('character',function(lib,game,ui,get,ai,_status){
const {cards,target}=event; const {cards,target}=event;
if(get.position(cards[0])=='e'){ if(get.position(cards[0])=='e'){
player.$give(cards,target); player.$give(cards,target);
await target.equip(cards[0]); target.equip(cards[0]);
} }
else{ else{
await player.discard(cards); player.discard(cards);
} }
if(player.hp>target.hp){ if(player.hp>target.hp){
await player.draw(); player.draw();
if(target.isDamaged()) await target.recover(); if(target.isDamaged()) target.recover();
} }
else if(player.hp<target.hp){ else if(player.hp<target.hp){
await target.draw(); target.draw();
if (player.isDamaged()) await player.recover(); if (player.isDamaged()) player.recover();
} }
}, },
ai:{ ai:{
order(){ order(){
var player=_status.event.player; const player=_status.event.player;
var es=player.getCards('e'); const es=player.getCards('e');
for(var i=0;i<es.length;i++){ for(let i=0;i<es.length;i++){
if(player.countCards('h',{subtype:get.subtype(es[i])})) return 10; if(player.countCards('h',{subtype:get.subtype(es[i])})) return 10;
} }
return 2; return 2;
}, },
result:{ result:{
target(player,target){ target(player,target){
var goon=function(){ const goon=()=>{
var es=player.getCards('e'); const es=player.getCards('e');
for(var i=0;i<es.length;i++){ for(let i=0;i<es.length;i++){
if(player.countCards('h',{subtype:get.subtype(es[i])})) return true; if(player.countCards('h',{subtype:get.subtype(es[i])})) return true;
} }
return false; return false;
@ -1961,12 +1927,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return player.countCards('h')>=2; return player.countCards('h')>=2;
}, },
check(card){ check(card){
var player=get.owner(card); const player=get.owner(card);
if(player.countCards('h')>player.hp) if(player.countCards('h')>player.hp) return 8-get.value(card);
return 8-get.value(card) if(player.hp<player.maxHp) return 6-get.value(card);
if(player.hp<player.maxHp) return 4-get.value(card);
return 6-get.value(card)
return 4-get.value(card)
}, },
filterTarget(card,player,target){ filterTarget(card,player,target){
if(!target.hasSex('male')) return false; if(!target.hasSex('male')) return false;
@ -1975,8 +1939,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return true; return true;
}, },
async content(event,trigger,player){ async content(event,trigger,player){
await player.recover(); player.recover();
await event.target.recover(); event.target.recover();
}, },
ai:{ ai:{
order:5.5, order:5.5,
@ -2001,14 +1965,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filterCard:true, filterCard:true,
usable:1, usable:1,
check(card){ check(card){
return 9-get.value(card) return 9-get.value(card);
}, },
filterTarget(card,player,target){ filterTarget(card,player,target){
if(target.hp>=target.maxHp) return false; if(target.hp>=target.maxHp) return false;
return true; return true;
}, },
async content(event,trigger,player){ async content(event,trigger,player){
await event.target.recover(); event.target.recover();
}, },
ai:{ ai:{
order:9, order:9,
@ -2026,16 +1990,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
mod:{ mod:{
aiValue(player,card,num){ aiValue(player,card,num){
if(get.name(card)!='tao'&&get.color(card)!='red') return; if(get.name(card)!='tao'&&get.color(card)!='red') return;
var cards=player.getCards('hs',function(card){ const cards=player.getCards('hs',card=>get.name(card)=='tao'||get.color(card)=='red');
return get.name(card)=='tao'||get.color(card)=='red'; cards.sort((a,b)=>(get.name(a)=='tao'?1:2)-(get.name(b)=='tao'?1:2));
}); var geti=()=>{
cards.sort(function(a,b){ if(cards.includes(card)) cards.indexOf(card);
return (get.name(a)=='tao'?1:2)-(get.name(b)=='tao'?1:2);
});
var geti=function(){
if(cards.contains(card)){
return cards.indexOf(card);
}
return cards.length; return cards.length;
}; };
return Math.max(num,[6.5,4,3,2][Math.min(geti(),2)]); return Math.max(num,[6.5,4,3,2][Math.min(geti(),2)]);
@ -2077,7 +2035,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger:{player:'useCardToPlayered'}, trigger:{player:'useCardToPlayered'},
forced:true, forced:true,
filter(event,player){ filter(event,player){
return event.card.name=='sha'&&!event.getParent().directHit.contains(event.target); return event.card.name=='sha'&&!event.getParent().directHit.includes(event.target);
}, },
//priority:-1, //priority:-1,
logTarget:'target', logTarget:'target',
@ -2134,15 +2092,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
skillAnimation:true, skillAnimation:true,
animationColor:'gray', animationColor:'gray',
filter(event,player){ filter(event,player){
return player.isDamaged()&&game.dead.filter(function(target){ return player.isDamaged()&&game.dead.filter(target=>target.isFriendOf(player)).length>0
return target.isFriendOf(player);
}).length>0
}, },
async content(event,trigger,player){ async content(event,trigger,player){
player.awakenSkill('zhanshen'); player.awakenSkill('zhanshen');
const cards=player.getEquips(1); const cards=player.getEquips(1);
if(cards.length) await player.discard(cards); if(cards.length) player.discard(cards);
await player.loseMaxHp(); player.loseMaxHp();
player.addSkill('mashu'); player.addSkill('mashu');
player.addSkill('shenji'); player.addSkill('shenji');
}, },
@ -2165,9 +2121,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
enable:'phaseUse', enable:'phaseUse',
usable:1, usable:1,
filter(event,player){ filter(event,player){
return game.countPlayer(function(current){ return game.countPlayer(current=>current!=player&&current.hasSex('male'))>1;
return current!=player&&current.hasSex('male');
})>1;
}, },
check(card){return 10-get.value(card)}, check(card){return 10-get.value(card)},
filterCard:true, filterCard:true,
@ -2186,8 +2140,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
async content(event,trigger,player){ async content(event,trigger,player){
const useCardEvent=event.targets[1].useCard({name:'juedou',isCard:true},'nowuxie',event.targets[0],'noai'); const useCardEvent=event.targets[1].useCard({name:'juedou',isCard:true},'nowuxie',event.targets[0],'noai');
useCardEvent.animate=false; useCardEvent.animate=false;
await useCardEvent; game.asyncDelay(0.5);
await game.asyncDelay(0.5);
}, },
ai:{ ai:{
order:8, order:8,
@ -2220,7 +2173,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
frequent:true, frequent:true,
// alter:true, // alter:true,
async content(event,trigger,player){ async content(event,trigger,player){
await player.draw(1); player.draw();
}, },
}, },
yaowu:{ yaowu:{
@ -2236,7 +2189,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true, forced:true,
check(){return false;}, check(){return false;},
async content(event,trigger,player){ async content(event,trigger,player){
await trigger.source.chooseDrawRecover(true); trigger.source.chooseDrawRecover(true);
}, },
ai:{ ai:{
effect:{ effect:{
@ -2273,12 +2226,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return 'cancel2'; return 'cancel2';
}).set('prompt',get.prompt2('new_jiangchi')); }).set('prompt',get.prompt2('new_jiangchi'));
if(control=='弃牌'){ if(control=='弃牌'){
await player.chooseToDiscard(true,'he'); player.chooseToDiscard(true,'he');
player.addTempSkill('jiangchi2','phaseUseEnd'); player.addTempSkill('jiangchi2','phaseUseEnd');
player.logSkill('new_jiangchi'); player.logSkill('new_jiangchi');
} }
else if(control=='摸牌'){ else if(control=='摸牌'){
await player.draw(); player.draw();
player.addTempSkill('new_jiangchi3','phaseEnd'); player.addTempSkill('new_jiangchi3','phaseEnd');
player.logSkill('new_jiangchi'); player.logSkill('new_jiangchi');
} }
@ -2293,14 +2246,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(card.name=='sha') return false; if(card.name=='sha') return false;
}, },
ignoredHandcard(card,player){ ignoredHandcard(card,player){
if(get.name(card)=='sha'){ if(get.name(card)=='sha') return true;
return true;
}
}, },
cardDiscardable(card,player,name){ cardDiscardable(card,player,name){
if(name=='phaseDiscard'&&get.name(card)=='sha'){ if(name=='phaseDiscard'&&get.name(card)=='sha') return false;
return false;
}
}, },
}, },
}, },
@ -2310,7 +2259,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:2, audio:2,
async content(event,trigger,player){ async content(event,trigger,player){
const card=get.bottomCards()[0]; const card=get.bottomCards()[0];
await game.cardsGotoOrdering(card); game.cardsGotoOrdering(card);
event.card=card; event.card=card;
const {result:{bool,targets}}=await player.chooseTarget(true).set('ai',target=>{ const {result:{bool,targets}}=await player.chooseTarget(true).set('ai',target=>{
let att=get.attitude(_status.event.player,target); let att=get.attitude(_status.event.player,target);
@ -2332,7 +2281,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.line(target,'green'); player.line(target,'green');
const gainEvent=target.gain(card,'draw'); const gainEvent=target.gain(card,'draw');
gainEvent.giver=player; gainEvent.giver=player;
await gainEvent;
} }
}, },
ai:{ ai:{
@ -2353,9 +2301,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(event.name=='gain'){ if(event.name=='gain'){
return event.player!=player&&event.getg(event.player).length>0; return event.player!=player&&event.getg(event.player).length>0;
} }
return game.hasPlayer(function(current){ return game.hasPlayer(current=>current!=player&&event.getg(current).length>0);
return current!=player&&event.getg(current).length>0;
});
}, },
direct:true, direct:true,
async content(event,trigger,player){ async content(event,trigger,player){
@ -2370,7 +2316,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}); });
if(bool){ if(bool){
player.logSkill('xinfu_jiyuan',target); player.logSkill('xinfu_jiyuan',target);
await target.draw(); target.draw();
} }
}while(event.targets.length>0); }while(event.targets.length>0);
}, },

View File

@ -32221,6 +32221,7 @@ new Promise(resolve=>{
return new Promise(resolve=>{ return new Promise(resolve=>{
const runCode=function(event,code){ const runCode=function(event,code){
try { try {
// 为了使玩家调试时使用var player=xxx时不报错故使用var
var {player,_trigger:trigger,_result:result}=event; var {player,_trigger:trigger,_result:result}=event;
return eval(code); return eval(code);
}catch(error){ }catch(error){