diff --git a/card/guozhan.js b/card/guozhan.js index b70b22e2c..fd82aa63f 100644 --- a/card/guozhan.js +++ b/card/guozhan.js @@ -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'}, diff --git a/game/asset.js b/game/asset.js index e0a3c00c1..8a652d002 100644 --- a/game/asset.js +++ b/game/asset.js @@ -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', diff --git a/game/game.js b/game/game.js index 156558307..4971a183e 100644 --- a/game/game.js +++ b/game/game.js @@ -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+=''+arguments[i].slice(2)+''; + str+=''+get.translation(arguments[i].slice(2))+''; } else{ str+=get.translation(arguments[i]); diff --git a/mode/guozhan.js b/mode/guozhan.js index 031d1e3d6..f5607af52 100644 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -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