This commit is contained in:
libccy 2016-08-14 01:24:05 +08:00
parent 2111a3f506
commit f0c5a5ae9a
2 changed files with 78 additions and 69 deletions

View File

@ -3529,7 +3529,7 @@
}
if(_status.waitingForDB){
ui.create.arena();
game.createEvent('game',false).content=lib.init.start;
game.createEvent('game',false).setContent(lib.init.start);
delete lib.init.start;
delete _status.waitingForDB;
game.loop();
@ -4153,7 +4153,7 @@
}
else{
ui.create.arena();
game.createEvent('game',false).content=lib.init.start;
game.createEvent('game',false).setContent(lib.init.start);
delete lib.init.start;
delete _status.dbLoaded;
game.loop();
@ -5027,7 +5027,7 @@
next.player=player;
next._trigger=trigger;
next.triggername=event.triggername;
next.content=info.content;
next.setContent(info.content);
next.skillHidden=event.skillHidden;
if(info.popup!=false&&!info.direct){
if(info.popup){
@ -5330,14 +5330,14 @@
if(event.cancelled&&!event.direct){
if(lib.card[name].cancel){
var next=game.createEvent(name+'Cancelled');
next.content=lib.card[name].cancel;
next.setContent(lib.card[name].cancel);
next.card=event.card;
next.player=player;
}
}
else{
var next=game.createEvent(name);
next.content=lib.card[name].effect;
next.setContent(lib.card[name].effect);
next._result=result;
next.card=event.card;
next.player=player;
@ -5804,7 +5804,7 @@
next.target=event.current;
next.card1=event.card1;
next.card2=event.card2;
next.content=event.callback;
next.setContent(event.callback);
}
"step 5"
game.broadcastAll(ui.clear);
@ -6877,7 +6877,7 @@
"step 1"
if(get.info(card).contentBefore){
var next=game.createEvent(card.name+'ContentBefore');
next.content=get.info(card).contentBefore;
next.setContent(get.info(card).contentBefore);
next.targets=targets;
next.card=card;
next.cards=cards;
@ -6890,7 +6890,7 @@
var info=get.info(card);
if(targets.length==0&&!info.notarget) return;
var next=game.createEvent(card.name);
next.content=info.content;
next.setContent(info.content);
next.targets=targets;
next.card=card;
next.cards=cards;
@ -6952,7 +6952,7 @@
"step 4"
if(get.info(card).contentAfter){
var next=game.createEvent(card.name+'contentAfter');
next.content=get.info(card).contentAfter;
next.setContent(get.info(card).contentAfter);
next.targets=targets;
next.card=card;
next.cards=cards;
@ -7099,7 +7099,7 @@
return;
}
var next=game.createEvent(event.skill);
next.content=info.content;
next.setContent(info.content);
next.targets=targets;
next.cards=cards;
next.player=player;
@ -7506,7 +7506,7 @@
player.popup(cards[num].name);
var next=game.createEvent('lose_'+cards[num].name);
var info=get.info(cards[num]);
next.content=info.onLose;
next.setContent(info.onLose);
next.player=player;
next.card=cards[num];
game.delayx();
@ -7865,7 +7865,7 @@
var info=get.info(card);
if(info.onEquip&&(!info.filterEquip||info.filterEquip(card,player))){
var next=game.createEvent('equip_'+card.name);
next.content=info.onEquip;
next.setContent(info.onEquip);
next.player=player;
next.card=card;
game.delayx();
@ -8902,28 +8902,28 @@
phase:function(){
var next=game.createEvent('phase');
next.player=this;
next.content=lib.element.content.phase;
next.setContent('phase');
},
phaseJudge:function(){
var next=game.createEvent('phaseJudge');
next.player=this;
next.content=lib.element.content.phaseJudge;
next.setContent('phaseJudge');
},
phaseDraw:function(){
var next=game.createEvent('phaseDraw');
next.player=this;
next.num=2;
next.content=lib.element.content.phaseDraw;
next.setContent('phaseDraw');
},
phaseUse:function(){
var next=game.createEvent('phaseUse');
next.player=this;
next.content=lib.element.content.phaseUse;
next.setContent('phaseUse');
},
phaseDiscard:function(){
var next=game.createEvent('phaseDiscard');
next.player=this;
next.content=lib.element.content.phaseDiscard;
next.setContent('phaseDiscard');
},
chooseToUse:function(use){
var next=game.createEvent('chooseToUse');
@ -8972,7 +8972,7 @@
}
if(next.ai1==undefined) next.ai1=ai.get.order;
if(next.ai2==undefined) next.ai2=ai.get.effect;
next.content=lib.element.content.chooseToUse;
next.setContent('chooseToUse');
next._args=Array.from(arguments);
return next;
},
@ -9032,7 +9032,7 @@
next.dialog=str;
}
}
next.content=lib.element.content.chooseToRespond;
next.setContent('chooseToRespond');
next._args=Array.from(arguments);
return next;
},
@ -9081,7 +9081,7 @@
if(typeof this.selectCard=='function') return false;
return get.select(this.selectCard)[0]>=this.player.num(this.position||'h');
}
next.content=lib.element.content.chooseToDiscard;
next.setContent('chooseToDiscard');
next._args=Array.from(arguments);
return next;
},
@ -9101,7 +9101,7 @@
}
return get.number(card)-ai.get.value(card)/2+addi;
}
next.content=lib.element.content.chooseToCompareMultiple;
next.setContent('chooseToCompareMultiple');
}
else{
next.target=target;
@ -9125,7 +9125,7 @@
return get.number(card)-ai.get.value(card)/2+addi;
}
}
next.content=lib.element.content.chooseToCompare;
next.setContent('chooseToCompare');
}
next._args=Array.from(arguments);
return next;
@ -9171,14 +9171,14 @@
if(next.filterButton==undefined) next.filterButton=lib.filter.filterButton;
if(next.selectButton==undefined) next.selectButton=[1,1];
if(next.ai==undefined) next.ai=function(){return 1};
next.content=lib.element.content.chooseButton;
next.setContent('chooseButton');
next._args=Array.from(arguments);
return next;
},
chooseButtonOL:function(list,callback,ai){
var next=game.createEvent('chooseButtonOL');
next.list=list;
next.content=lib.element.content.chooseButtonOL;
next.setContent('chooseButtonOL');
next.ai=ai;
next.callback=callback;
next._args=Array.from(arguments);
@ -9195,7 +9195,7 @@
next._args.push(arguments[i]);
}
}
next.content=lib.element.content.chooseCardOL;
next.setContent('chooseCardOL');
next._args.add('glow_result');
return next;
},
@ -9232,7 +9232,7 @@
if(next.filterCard==undefined) next.filterCard=lib.filter.all;
if(next.selectCard==undefined) next.selectCard=[1,1];
if(next.ai==undefined) next.ai=ai.get.unuseful3;
next.content=lib.element.content.chooseCard;
next.setContent('chooseCard');
next._args=Array.from(arguments);
return next;
},
@ -9264,7 +9264,7 @@
if(next.filterTarget==undefined) next.filterTarget=lib.filter.all;
if(next.selectTarget==undefined) next.selectTarget=[1,1];
if(next.ai==undefined) next.ai=ai.get.attitude2;
next.content=lib.element.content.chooseTarget;
next.setContent('chooseTarget');
next._args=Array.from(arguments);
return next;
},
@ -9296,7 +9296,7 @@
}
if(next.ai1==undefined) next.ai1=ai.get.unuseful2;
if(next.ai2==undefined) next.ai2=ai.get.attitude2;
next.content=lib.element.content.chooseCardTarget;
next.setContent('chooseCardTarget');
next._args=Array.from(arguments);
return next;
},
@ -9322,7 +9322,7 @@
}
next.player=this;
if(next.choice==undefined) next.choice=0;
next.content=lib.element.content.chooseControl;
next.setContent('chooseControl');
next._args=Array.from(arguments);
return next;
},
@ -9344,7 +9344,7 @@
if(next.choice==undefined) next.choice=true;
}
next.player=this;
next.content=lib.element.content.chooseBool;
next.setContent('chooseBool');
next._args=Array.from(arguments);
return next;
},
@ -9389,7 +9389,7 @@
if(ai.get.attitude(_status.event.player,get.owner(button.link))>0) return -val;
return val;
};
next.content=lib.element.content.choosePlayerCard;
next.setContent('choosePlayerCard');
next._args=Array.from(arguments);
return next;
},
@ -9434,7 +9434,7 @@
if(ai.get.attitude(_status.event.player,get.owner(button.link))>0) return -val;
return val;
};
next.content=lib.element.content.discardPlayerCard;
next.setContent('discardPlayerCard');
next._args=Array.from(arguments);
return next;
},
@ -9479,14 +9479,14 @@
if(ai.get.attitude(_status.event.player,get.owner(button.link))>0) return -val;
return val;
};
next.content=lib.element.content.gainPlayerCard;
next.setContent('gainPlayerCard');
next._args=Array.from(arguments);
return next;
},
showHandcards:function(){
var next=game.createEvent('showHandcards');
next.player=this;
next.content=lib.element.content.showHandcards;
next.setContent('showHandcards');
next._args=Array.from(arguments);
return next;
},
@ -9502,7 +9502,7 @@
if(get.itemtype(cards)=='card') next.cards=[cards];
else if(get.itemtype(cards)=='cards') next.cards=cards;
else _status.event.next.remove(next);
next.content=lib.element.content.showCards;
next.setContent('showCards');
next._args=Array.from(arguments);
},
viewCards:function(str,cards){
@ -9510,7 +9510,7 @@
next.player=this;
next.str=str;
next.cards=cards;
next.content=lib.element.content.viewCards;
next.setContent('viewCards');
next._args=Array.from(arguments);
return next;
},
@ -9605,7 +9605,7 @@
this.logAi(next.targets,next.card);
}
}
next.content=lib.element.content.useCard;
next.setContent('useCard');
return next;
},
useSkill:function(){
@ -9649,7 +9649,8 @@
else{
next.targets=[];
}
next.content=lib.element.content.useSkill;
next.setContent('useSkill');
return next;
},
draw:function(){
var next=game.createEvent('draw');
@ -9670,7 +9671,7 @@
}
if(next.num==undefined) next.num=1;
if(next.num<=0) _status.event.next.remove(next);
next.content=lib.element.content.draw;
next.setContent('draw');
if(lib.config.mode=='stone'&&_status.mode=='deck'&&
next.drawDeck==undefined&&!next.player.isMin()&&next.num>1){
next.drawDeck=1;
@ -9696,7 +9697,7 @@
}
}
if(next.cards==undefined) _status.event.next.remove(next);
next.content=lib.element.content.discard;
next.setContent('discard');
return next;
},
respond:function(){
@ -9732,7 +9733,7 @@
next.card=next.cards[0];
}
}
next.content=lib.element.content.respond;
next.setContent('respond');
},
directgain:function(cards){
var hs=this.get('h');
@ -9781,7 +9782,7 @@
next.animate=arguments[i];
}
}
next.content=lib.element.content.gain;
next.setContent('gain');
return next;
},
lose:function(){
@ -9803,7 +9804,7 @@
}
if(next.cards==undefined) _status.event.next.remove(next);
if(next.position==undefined) next.position=ui.discardPile;
next.content=lib.element.content.lose;
next.setContent('lose');
return next;
},
damage:function(){
@ -9842,7 +9843,7 @@
if(next.source==undefined&&!nosource) next.source=event.player;
if(next.num==undefined) next.num=1;
if(next.nature=='poison') delete next._triggered;
next.content=lib.element.content.damage;
next.setContent('damage');
return next;
},
recover:function(){
@ -9878,13 +9879,13 @@
if(next.source==undefined&&!nosource) next.source=event.player;
if(next.num==undefined) next.num=1;
if(next.num<=0) _status.event.next.remove(next);
next.content=lib.element.content.recover;
next.setContent('recover');
return next;
},
doubleDraw:function(){
var next=game.createEvent('doubleDraw');
next.player=this;
next.content=lib.element.content.doubleDraw;
next.setContent('doubleDraw');
return next;
},
loseHp:function(num){
@ -9892,7 +9893,8 @@
next.num=num;
next.player=this;
if(next.num==undefined) next.num=1;
next.content=lib.element.content.loseHp;
next.setContent('loseHp');
return next;
},
loseMaxHp:function(){
var next=game.createEvent('loseMaxHp');
@ -9906,7 +9908,8 @@
next.forced=arguments[i];
}
}
next.content=lib.element.content.loseMaxHp;
next.setContent('loseMaxHp');
return next;
},
gainMaxHp:function(){
var next=game.createEvent('gainMaxHp');
@ -9920,28 +9923,31 @@
next.forced=arguments[i];
}
}
next.content=lib.element.content.gainMaxHp;
next.setContent('gainMaxHp');
return next;
},
changeHp:function(num,popup){
var next=game.createEvent('changeHp',false);
next.num=num;
if(popup!=undefined) next.popup=popup;
next.player=this;
next.content=lib.element.content.changeHp;
next.setContent('changeHp');
return next;
},
dying:function(reason){
var next=game.createEvent('dying');
next.player=this;
next.reason=reason;
next.source=reason.source;
next.content=lib.element.content.dying;
next.setContent('dying');
return next;
},
die:function(reason){
var next=game.createEvent('die');
next.player=this;
next.reason=reason;
if(reason) next.source=reason.source;
next.content=lib.element.content.die;
next.setContent('die');
return next;
},
revive:function(hp){
@ -10019,7 +10025,7 @@
var next=game.createEvent('equip');
next.card=card;
next.player=this;
next.content=lib.element.content.equip;
next.setContent(lib.element.content.equip);
},
addJudge:function(card,cards){
var next=game.createEvent('addJudge');
@ -10028,7 +10034,8 @@
if(next.cards==undefined) next.cards=[card];
if(get.itemtype(next.cards)=='card') next.cards=[next.cards];
next.player=this;
next.content=lib.element.content.addJudge;
next.setContent('addJudge');
return next;
},
judge:function(){
var next=game.createEvent('judge');
@ -10061,13 +10068,14 @@
else if(next.skill) str=get.translation(next.skill);
else str=get.translation(_status.event.name);
next.judgestr=str;
next.content=lib.element.content.judge;
next.setContent('judge');
return next;
},
turnOver:function(){
var next=game.createEvent('turnOver');
next.player=this;
next.content=lib.element.content.turnOver;
next.setContent('turnOver');
return next;
},
out:function(bool){
if(this.lockOut) return;
@ -10083,7 +10091,8 @@
link:function(){
var next=game.createEvent('link');
next.player=this;
next.content=lib.element.content.link;
next.setContent('link');
return next;
},
skip:function(name){
this.skipList.add(name);
@ -14196,7 +14205,7 @@
next:[],
};
_status.paused=false;
game.createEvent('game',false).content=lib.init.startOnline;
game.createEvent('game',false).setContent(lib.init.startOnline);
game.loop();
game.send('inited');
});
@ -14387,7 +14396,7 @@
game.updateState(state2);
}
var next=game.createEvent('game',false);
next.content=lib.init.startOnline;
next.setContent(lib.init.startOnline);
if(observe){
next.custom.replace.target=function(player){
if(!lib.configOL.observe_handcard&&lib.configOL.mode=='guozhan'){
@ -14605,10 +14614,10 @@
}
}
if(_status.connectMode){
next.content=lib.element.content.replaceHandcardsOL;
next.setContent('replaceHandcardsOL');
}
else{
next.content=lib.element.content.replaceHandcards;
next.setContent('replaceHandcards');
}
},
removeCard:function(name){
@ -14766,7 +14775,7 @@
waitForPlayer:function(func){
var next=game.createEvent('waitForPlayer',false);
next.func=func;
next.content=lib.element.content.waitForPlayer;
next.setContent('waitForPlayer');
},
countDown:function(time,onEnd){
time=parseInt(time);
@ -15591,7 +15600,7 @@
lib.character[j]=lib.character[j]||lib.characterPack[i][j];
}
}
next.content=lib.element.content.playVideoContent;
next.setContent('playVideoContent');
game.loop();
},
videoContent:{
@ -17092,7 +17101,7 @@
next.player=player;
next.triggername=name;
next._trigger=event;
next.content=lib.element.content.createTrigger;
next.setContent('createTrigger');
},
createEvent:function(name,trigger,triggerevent){
var next={
@ -18761,14 +18770,14 @@
}
}
game.createEvent('game',false).content=mode[lib.config.mode].start;
game.createEvent('game',false).setContent(mode[lib.config.mode].start);
game.loop();
});
},
loadMode:function(mode){
var next=game.createEvent('loadMode');
next.mode=mode;
next.content=lib.element.content.loadMode;
next.setContent('loadMode');
},
loadPackage:function(){
var next=game.createEvent('loadPackage');

View File

@ -629,7 +629,7 @@ mode.chess={
var next=game.createEvent('chooseToMove');
next.num=num||1;
next.player=this;
next.content=lib.element.content.chooseToMove;
next.setContent('chooseToMove');
next.prompt=prompt;
return next;
},
@ -1557,7 +1557,7 @@ mode.chess={
var next=game.createEvent('replaceChessPlayer');
next.playername=name;
next.enemy=enemy;
next.content=lib.element.content.replaceChessPlayer;
next.setContent('replaceChessPlayer');
},
removeTreasure:function(player){
game.addVideo('removeTreasure',null,player.dataset.position);
@ -2084,7 +2084,7 @@ mode.chess={
if(!info.filter||info.filter(mech)){
var next=game.createEvent('chessMech');
next.player=mech;
next.content=info.content;
next.setContent(info.content);
mech.chessFocus();
if(lib.config.animation&&!lib.config.low_performance){
mech.$epic2();