From 552f76a58db1e40c6e95aaf310f569cbecd2b8d8 Mon Sep 17 00:00:00 2001 From: libccy Date: Fri, 31 Mar 2017 23:27:04 +0800 Subject: [PATCH] phase --- card/guozhan.js | 2 +- character/hearth.js | 13 ++++++++++--- game/game.js | 21 ++++++++++++++++++++- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/card/guozhan.js b/card/guozhan.js index 737edcea2..0e5dfe2ed 100644 --- a/card/guozhan.js +++ b/card/guozhan.js @@ -846,7 +846,7 @@ card.guozhan={ } "step 1" if(result.bool){ - player.phase(); + player.insertPhase(); } }, }, diff --git a/character/hearth.js b/character/hearth.js index 0fbddcfd0..8bea0c23b 100644 --- a/character/hearth.js +++ b/character/hearth.js @@ -174,16 +174,23 @@ character.hearth={ priority:-50, direct:true, filter:function(event,player){ + if(get.mode()=='identity'&&_status.mode=='zhong'&& + game.zhu&&!game.zhu.isZhu&&player==game.zhong){ + return false; + } return !player.isTurnedOver(); }, content:function(){ 'step 0' player.chooseTarget(get.prompt('mengye'),function(card,player,target){ + if(target==player){ + return false; + } if(get.mode()=='identity'&&_status.mode=='zhong'&&game.zhu&&!game.zhu.isZhu){ return target==game.zhong; } if(target.identity=='zhu'||get.is.jun(target)) return false; - return target!=player; + return true; }).ai=function(target){ var att=-ai.get.attitude(player,target); if(att<=0) return 0; @@ -220,7 +227,7 @@ character.hearth={ target.unmarkSkill('mad'); } player.out('mengye'); - target.phase(); + target.insertPhase(); }, ai:{ threaten:2 @@ -3197,7 +3204,7 @@ character.hearth={ }, content:function(){ player.draw(); - player.phase(); + player.insertPhase(); }, ai:{ threaten:1.8 diff --git a/game/game.js b/game/game.js index f1fabf53f..93e01e3be 100644 --- a/game/game.js +++ b/game/game.js @@ -13063,31 +13063,50 @@ } this.node.identity.dataset.color=identity; }, + insertPhase:function(){ + var evt=_status.event.getParent('phase'); + var next; + if(evt&&evt.parent&&evt.parent.next){ + next=game.createEvent('phase',null,evt.parent); + console.log(evt.parent); + } + else{ + next=game.createEvent('phase'); + } + next.player=this; + next.setContent('phase'); + return next; + }, phase:function(){ var next=game.createEvent('phase'); next.player=this; next.setContent('phase'); + return next; }, phaseJudge:function(){ var next=game.createEvent('phaseJudge'); next.player=this; next.setContent('phaseJudge'); + return next; }, phaseDraw:function(){ var next=game.createEvent('phaseDraw'); next.player=this; next.num=2; next.setContent('phaseDraw'); + return next; }, phaseUse:function(){ var next=game.createEvent('phaseUse'); next.player=this; next.setContent('phaseUse'); + return next; }, phaseDiscard:function(){ var next=game.createEvent('phaseDiscard'); next.player=this; next.setContent('phaseDiscard'); + return next; }, chooseToUse:function(use){ var next=game.createEvent('chooseToUse'); @@ -38459,7 +38478,7 @@ return num?Math.round(9*(num-1)/8+1):'sp'; } } - return num?Math.round(6*(num-1)/8+1):'x'; + return num?Math.round(9*(num-1)/8+1):'x'; }, targetsInfo:function(targets){ var info=[];