This commit is contained in:
libccy 2017-02-26 13:52:55 +08:00
parent 8ba7dbd2fe
commit 423d9e48fc
4 changed files with 153 additions and 10 deletions

View File

@ -603,7 +603,112 @@ card.guozhan={
},
},
feilongduofeng2:{
trigger:{source:'dieAfter'},
filter:function(event,player){
return event.player.isDead()&&lib.group.contains(player.identity)&&player.isMinor();
},
logTarget:'player',
content:function(){
'step 0'
var list=[];
for(var i=0;i<_status.characterlist.length;i++){
var info=lib.character[_status.characterlist[i]];
if(info[4]&&info[4].contains('jun')) continue;
if(info[1]==player.identity){
list.push(_status.characterlist[i]);
}
}
event.identity=event.player.identity;
if(trigger.player==game.me&&!_status.auto){
event.dialog=ui.create.dialog('是否选择一名角色重新加入游戏?',[list,'character']);
event.filterButton=function(){return true};
event.player=game.me;
event.custom.replace.confirm=function(){
event.directresult=ui.selected.buttons[0].link;
event.dialog.close();
if(ui.confirm) ui.confirm.close();
delete event.player;
game.resume();
}
event.switchToAuto=function(){
event.directresult=list.randomGet();
event.dialog.close();
if(ui.confirm) ui.confirm.close();
delete event.player;
};
game.check();
game.pause();
}
else if(trigger.player.isOnline()){
trigger.player.send(function(player,list){
if(_status.auto){
_status.event._result=list.randomGet();
}
else{
var next=game.createEvent('replacePlayer');
next.source=player;
next.list=list;
next.setContent(function(){
event.dialog=ui.create.dialog('是否选择一名角色重新加入游戏?',[event.list,'character']);
event.filterButton=function(){return true};
event.player=event.source;
event.custom.replace.confirm=function(){
event.result=ui.selected.buttons[0].link;
event.dialog.close();
if(ui.confirm) ui.confirm.close();
delete event.player;
game.resume();
game.uncheck();
}
event.switchToAuto=function(){
event.result=list.randomGet();
event.dialog.close();
if(ui.confirm) ui.confirm.close();
delete event.player;
game.uncheck();
};
game.check();
game.pause();
});
}
game.resume();
},trigger.player,list);
trigger.player.wait();
game.pause();
}
else{
event.directresult=list.randomGet();
}
event.list=list;
'step 1'
game.uncheck();
if(!event.directresult){
if(event.resultOL){
event.directresult=event.resultOL[trigger.player.playerid];
}
if(!event.directresult||event.directresult=='ai'){
event.directresult=event.list.randomGet();
}
}
game.log(trigger.player,'重新加入游戏');
var name=event.directresult;
game.log(trigger.player,'将主将替换为','#b'+name);
_status.characterlist.remove(name);
game.broadcastAll(function(source,name,identity){
source.revive(2,false);
source.identity=identity;
source._group=identity;
source.setIdentity();
if(source==game.me){
ui.arena.classList.remove('selecting');
}
},trigger.player,name,event.identity);
trigger.player.draw();
trigger.player.reinit(trigger.player.name1,name,false);
trigger.player.removeCharacter(1);
trigger.getParent('damage').untrigger(false,trigger.player);
game.addVideo('setIdentity',trigger.player,event.identity);
}
},
taipingyaoshu:{
trigger:{player:'damageBefore'},

View File

@ -427,6 +427,8 @@ window.noname_asset_list=[
'image/character/jsp_guanyu.jpg',
'image/character/jsp_huangyueying.jpg',
'image/character/jsp_zhaoyun.jpg',
'image/character/jun_liubei.jpg',
'image/character/jun_zhangjiao.jpg',
'image/character/kanze.jpg',
'image/character/kongrong.jpg',
'image/character/liaohua.jpg',

View File

@ -5915,7 +5915,12 @@
else{
target=game.me.next;
}
target.init(name);
if(!lib.character[name]){
target.node.avatar.setBackground(name,'character');
}
else{
target.init(name);
}
if(i===true){
if(lib.config.layout=='long2'){
lib.init.layout('mobile');
@ -10317,7 +10322,10 @@
num=0;
}
else{
num=(maxHp||info2[2])-info1[2];
if(typeof maxHp!='number'){
maxHp=info2[2];
}
num=maxHp-info1[2];
}
if(typeof this.singleHp=='boolean'){
if(num%2==1){
@ -10997,6 +11005,11 @@
}
}
},
syncSkills:function(){
game.broadcast(function(player,skills){
player.applySkills(skills);
},this,get.skillState(this));
},
playerfocus:function(time){
time=time||1000;
this.classList.add('playerfocus');
@ -12175,6 +12188,10 @@
ui.revive.close();
delete ui.revive;
}
if(ui.exit){
ui.exit.close();
delete ui.exit;
}
if(ui.swap){
ui.swap.close();
delete ui.swap;
@ -18650,6 +18667,14 @@
console.log(player);
}
},
identityColor:function(player,str){
if(player&&str){
player.node.identity.dataset.color=str;
}
else{
console.log(player);
}
},
chessSwap:function(content){
var me=game.playerMap[content[0]];
var player=game.playerMap[content[1]];
@ -22774,7 +22799,7 @@
case 'y':color='yellow';break;
case 'g':color='green';break;
}
str+='<span class="'+color+'text">'+arguments[i].slice(2)+'</span>';
str+='<span class="'+color+'text">'+get.translation(arguments[i].slice(2))+'</span>';
}
else{
str+=get.translation(arguments[i]);

View File

@ -887,13 +887,17 @@ mode.guozhan={
var skills;
if(result.control=='主将'){
trigger.source.showCharacter(0);
trigger.source.node.avatar.classList.add('disabled');
game.broadcastAll(function(player){
player.node.avatar.classList.add('disabled');
},trigger.source);
skills=lib.character[trigger.source.name][3];
game.log(trigger.source,'失去了主将技能');
}
else{
trigger.source.showCharacter(1);
trigger.source.node.avatar2.classList.add('disabled');
game.broadcastAll(function(player){
player.node.avatar2.classList.add('disabled');
},trigger.source);
skills=lib.character[trigger.source.name2][3];
game.log(trigger.source,'失去了副将技能');
}
@ -909,6 +913,7 @@ mode.guozhan={
}
}
trigger.source.disableSkill('gzduanchang',list);
trigger.source.syncSkills();
},
logTarget:'source',
ai:{
@ -1882,6 +1887,7 @@ mode.guozhan={
if(lib.character[i][2]==3||lib.character[i][2]==4||lib.character[i][2]==5)
event.list.push(i);
}
_status.characterlist=event.list.slice(0);
if(_status.brawl&&_status.brawl.chooseCharacterFilter){
event.list=_status.brawl.chooseCharacterFilter(event.list);
}
@ -2024,6 +2030,8 @@ mode.guozhan={
for(var i=0;i<game.players.length;i++){
game.players[i].classList.add('unseen');
game.players[i].classList.add('unseen2');
_status.characterlist.remove(game.players[i].name);
_status.characterlist.remove(game.players[i].name2);
if(game.players[i]!=game.me){
game.players[i].node.identity.firstChild.innerHTML='猜';
game.players[i].node.identity.dataset.color='unknown';
@ -2074,6 +2082,7 @@ mode.guozhan={
else{
list=get.charactersOL();
}
_status.characterlist=list.slice(0);
event.list=list.slice(0);
var list2=[];
var num;
@ -2160,6 +2169,8 @@ mode.guozhan={
}
for(var i=0;i<game.players.length;i++){
_status.characterlist.remove(game.players[i].name);
_status.characterlist.remove(game.players[i].name2);
game.players[i].hiddenSkills=lib.character[game.players[i].name][3].slice(0);
var hiddenSkills2=lib.character[game.players[i].name2][3];
for(var j=0;j<hiddenSkills2.length;j++){
@ -2670,7 +2681,7 @@ mode.guozhan={
var info=lib.character[name];
if(!info) return;
var to='gz_shibing'+(info[0]=='male'?1:2)+info[1];
game.log(this,'移除了'+(num?'副将':'主将'),'#b'+get.translation(name));
game.log(this,'移除了'+(num?'副将':'主将'),'#b'+name);
this.reinit(name,to,false);
this.showCharacter(num,false);
},
@ -2713,21 +2724,21 @@ mode.guozhan={
var skills;
switch(num){
case 0:
if(log!==false) game.log(this,'展示了主将','#b'+get.translation(this.name1));
if(log!==false) game.log(this,'展示了主将','#b'+this.name1);
this.name=this.name1;
skills=lib.character[this.name][3];
this.sex=lib.character[this.name][0];
this.classList.remove('unseen');
break;
case 1:
if(log!==false) game.log(this,'展示了副将','#b'+get.translation(this.name2));
if(log!==false) game.log(this,'展示了副将','#b'+this.name2);
skills=lib.character[this.name2][3];
if(this.sex=='unknown') this.sex=lib.character[this.name2][0];
if(this.name.indexOf('unknown')==0) this.name=this.name2;
this.classList.remove('unseen2');
break;
case 2:
if(log!==false) game.log(this,'展示了主将','#b'+get.translation(this.name1),'、副将','#b'+get.translation(this.name2));
if(log!==false) game.log(this,'展示了主将','#b'+this.name1,'、副将','#b'+this.name2);
this.name=this.name1;
skills=lib.character[this.name][3].concat(lib.character[this.name2][3]);
this.sex=lib.character[this.name][0];