From fda7771ab007a543cf19ab4e02551b4206b9b2b0 Mon Sep 17 00:00:00 2001 From: libccy Date: Sat, 15 Apr 2017 01:12:00 +0800 Subject: [PATCH] f --- game/game.js | 40 ++++++++++++++++++++++++------------ mode/boss.js | 56 ++++++++++++++++++++++++++++++++++----------------- mode/stone.js | 1 + 3 files changed, 65 insertions(+), 32 deletions(-) diff --git a/game/game.js b/game/game.js index 361806e5f..7c0a385da 100644 --- a/game/game.js +++ b/game/game.js @@ -13424,6 +13424,7 @@ this.node.identity.firstChild.innerHTML=get.translation(identity); } this.node.identity.dataset.color=identity; + return this; }, insertPhase:function(skill){ var evt=_status.event.getParent('phase'); @@ -21448,19 +21449,32 @@ } }, bossSwap:function(player,name){ - player.delete(); - var boss=ui.create.player().init(name); - boss.dataset.position=player.dataset.position; - game.playerMap[player.dataset.position]=boss; - if(game.me==player){ - game.me=boss; + if(player&&name){ + player.delete(); + var noboss=false; + if(name[0]=='_'){ + name=name.slice(1); + noboss=true; + } + var boss=ui.create.player().init(name); + boss.dataset.position=player.dataset.position; + game.playerMap[player.dataset.position]=boss; + if(game.me==player){ + game.me=boss; + } + game.players.push(boss); + game.arrangePlayers(); + if(!noboss){ + game.boss=boss; + boss.setIdentity('zhu'); + boss.identity='zhu'; + } + else{ + boss.setIdentity('zhong'); + boss.identity='zhong'; + } + ui.arena.appendChild(boss.animate('zoominanim')); } - game.players.push(boss); - game.arrangePlayers(); - game.boss=boss; - ui.arena.appendChild(boss.animate('zoominanim')); - boss.setIdentity('zhu'); - boss.identity='zhu'; }, stoneSwap:function(info){ var player=ui.create.player(); @@ -40594,7 +40608,7 @@ td.innerHTML='手牌'; tr.appendChild(td); td=document.createElement('td'); - td.innerHTML='轮数'; + td.innerHTML='行动'; tr.appendChild(td); tr=document.createElement('tr'); diff --git a/mode/boss.js b/mode/boss.js index 896497c18..111474c6b 100644 --- a/mode/boss.js +++ b/mode/boss.js @@ -463,34 +463,51 @@ mode.boss={ }, game:{ reserveDead:true, - changeBoss:function(name){ - if(game.additionaldead){ - game.additionaldead.push(game.boss); + addBossFellow:function(position,name){ + var fellow=game.addFellow(position,name,'zoominanim'); + fellow.directgain(get.cards(4)); + fellow.side=true; + fellow.identity='zhong'; + fellow.setIdentity('zhong'); + game.addVideo('setIdentity',fellow,'zhong'); + }, + changeBoss:function(name,player){ + if(!player){ + if(game.additionaldead){ + game.additionaldead.push(game.boss); + } + else{ + game.additionaldead=[game.boss]; + } + player=game.boss; + delete game.boss; } - else{ - game.additionaldead=[game.boss]; - } - game.boss.delete(); - game.dead.remove(game.boss); + + player.delete(); + game.players.remove(player); + game.dead.remove(player); var boss=ui.create.player(); boss.getId(); boss.init(name); boss.side=true; - game.addVideo('bossSwap',game.boss,boss.name); - if(game.me==game.boss){ - boss.dataset.position=0; + game.addVideo('bossSwap',player,(game.boss?'_':'')+boss.name); + boss.dataset.position=player.dataset.position; + if(game.me==player){ game.swapControl(boss); } - else{ - boss.dataset.position=7; - } game.players.push(boss.animate('zoominanim')); game.arrangePlayers(); - game.boss=boss; + if(!game.boss){ + game.boss=boss; + boss.setIdentity('zhu'); + boss.identity='zhu'; + } + else{ + boss.setIdentity('zhong'); + boss.identity='zhong'; + } ui.arena.appendChild(boss); boss.directgain(get.cards(4)); - boss.setIdentity('zhu'); - boss.identity='zhu'; }, checkResult:function(){ if(game.boss==game.me){ @@ -960,8 +977,8 @@ mode.boss={ game.players[i].hp=game.players[i].maxHp; game.players[i].update(); } - game.addFellow(game.me==game.boss?1:5,'boss_yanling','zoominanim').directgain(get.cards(4)).side=true; - game.addFellow(7,'boss_yanling','zoominanim').directgain(get.cards(4)).side=true; + game.addBossFellow(game.me==game.boss?1:5,'boss_yanling'); + game.addBossFellow(7,'boss_yanling'); game.animate.window(2); 'step 3' while(_status.event.name!='phaseLoop'){ @@ -3743,6 +3760,7 @@ mode.boss={ translate:{ zhu:'神', cai:'盟', + zhong:'从', boss_chi:'魑', boss_mo:'魅', diff --git a/mode/stone.js b/mode/stone.js index 134b7765d..31f3ca519 100644 --- a/mode/stone.js +++ b/mode/stone.js @@ -1285,6 +1285,7 @@ mode.stone={ next.player=player; next.setContent(function(){ "step 0" + _status.roundStart=game.me; player.phase(); event.num=0; "step 1"