From 75939a5dc8b1e95b8c2118687e1f4754fc23acd6 Mon Sep 17 00:00:00 2001 From: WEBXOSS Date: Sun, 26 Feb 2017 14:26:34 +0800 Subject: [PATCH] implement onRised timing --- Card.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Card.js b/Card.js index b68c5d2..169bdf9 100644 --- a/Card.js +++ b/Card.js @@ -124,6 +124,7 @@ function Card (game,player,zone,pid,side) { this.onHeaven = new Timming(game); this.onFreeze = new Timming(game); this.onChangeSigniZone = new Timming(game); + this.onRised = new Timming(game); // 附加的属性 this.canNotAttack = false; @@ -781,6 +782,7 @@ Card.prototype.moveTo = function (zone,arg) { isSigni: inArr(card,card.player.signis), isCharm: arg.isCharm || false, isCrossed: !!card.crossed, + riseTarget: null, isUp: arg.up, oldZone: card.zone, newZone: zone, @@ -842,6 +844,7 @@ Card.prototype.moveTo = function (zone,arg) { // 出场 arg.bottom = false; enterFieldEvent = moveEvent; + enterFieldEvent.riseTarget = signi; card.player.signis.push(card); } else { // 放置到 SIGNI 下面的卡 @@ -945,6 +948,10 @@ Card.prototype.moveTo = function (zone,arg) { if (!(arg.dontTriggerStartUp || card.player.signiStartUpBanned)) { card.onStartUp.trigger(enterFieldEvent); } + // rise + if (enterFieldEvent.riseTarget) { + enterFieldEvent.riseTarget.onRised.trigger(enterFieldEvent); + } } else if (leaveFieldEvent) { // card.player.onSignisChange.trigger(); card.onLeaveField.trigger(leaveFieldEvent);