diff --git a/character/sp.js b/character/sp.js index 607edc119..f2b994397 100644 --- a/character/sp.js +++ b/character/sp.js @@ -1443,6 +1443,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, logTarget:'player', check:function(event,player){ + if(event.player.hasSkill('subplayer')) return false; if(get.attitude(player,event.player)<0){ if(event.player.hp==1) return false; return true; diff --git a/game/game.js b/game/game.js index 292ad87c7..c9b0b53a3 100644 --- a/game/game.js +++ b/game/game.js @@ -8988,35 +8988,37 @@ }, element:{ content:{ + toggleSubPlayer:function(){ + + }, exitSubPlayer:function(){ 'step 0' if(player.storage.subplayer){ var current=player.storage.subplayer.name2; + if(event.remove){ + player.lose(player.getCards('he'),ui.discardPile)._triggered=null; + } + else{ + player.storage[current].hp=player.hp; + player.storage[current].maxHp=player.maxHp; + player.storage[current].hs=player.getCards('h'); + player.storage[current].es=player.getCards('e'); + player.lose(player.getCards('he'),ui.special)._triggered=null; + } player.reinit(current,player.storage.subplayer.name,[ player.storage.subplayer.hp, player.storage.subplayer.maxHp ]); player.update(); if(event.remove){ - delete player.storage.subplayer.storage[current]; + delete player.storage[current]; player.storage.subplayer.skills.remove(current); game.log(player,'牺牲了随从','#g'+current); } else{ game.log(player,'收回了随从','#g'+current); } - for(var i in player.storage.subplayer.storage){ - player.storage[i]=player.storage.subplayer.storage[i]; - } player.addSkill(player.storage.subplayer.skills); - if(event.remove){ - player.lose(player.getCards('he'),ui.discardPile)._triggered=null; - } - else{ - player.storage[current].hs=player.getCards('h'); - player.storage[current].es=player.getCards('e'); - player.lose(player.getCards('he'),ui.special)._triggered=null; - } } 'step 1' if(player.storage.subplayer){ @@ -9058,11 +9060,6 @@ } } if(event.directresult){ - var storage={}; - for(var i=0;i