Commit 8cec27ced3c408373a2425d04ee44aa9b89ad276
1 parent
04c7448f
战斗开始
Showing
3 changed files
with
6 additions
and
0 deletions
Show diff stats
src/GlobalVar.lua
@@ -103,6 +103,7 @@ AdvBackEventType = { | @@ -103,6 +103,7 @@ AdvBackEventType = { | ||
103 | Passive = 13, -- 獲得被動 | 103 | Passive = 13, -- 獲得被動 |
104 | TurnEnd = 14, -- 回合结束 | 104 | TurnEnd = 14, -- 回合结束 |
105 | Miss = 15, -- miss | 105 | Miss = 15, -- miss |
106 | + BattleBegin = 16, -- 战斗开始 | ||
106 | } | 107 | } |
107 | 108 | ||
108 | AdvScoreType = { | 109 | AdvScoreType = { |
src/adv/Adv.lua
@@ -1096,6 +1096,10 @@ function Adv:backTurnEnd() | @@ -1096,6 +1096,10 @@ function Adv:backTurnEnd() | ||
1096 | self:pushBackEvent(AdvBackEventType.TurnEnd, {}) | 1096 | self:pushBackEvent(AdvBackEventType.TurnEnd, {}) |
1097 | end | 1097 | end |
1098 | 1098 | ||
1099 | +function Adv:backBattleBegin() | ||
1100 | + self:pushBackEvent(AdvBackEventType.BattleBegin, {}) | ||
1101 | +end | ||
1102 | + | ||
1099 | 1103 | ||
1100 | function Adv:scoreChange(scoreType, pms) | 1104 | function Adv:scoreChange(scoreType, pms) |
1101 | local cutTypes = {} | 1105 | local cutTypes = {} |
src/adv/AdvBattle.lua
@@ -120,6 +120,7 @@ function Battle:battleBegin(roomId, blockId, isQuick) | @@ -120,6 +120,7 @@ function Battle:battleBegin(roomId, blockId, isQuick) | ||
120 | end | 120 | end |
121 | local enemy = self:getEnemy(roomId, blockId) | 121 | local enemy = self:getEnemy(roomId, blockId) |
122 | if enemy then | 122 | if enemy then |
123 | + self.adv:backBattleBegin() | ||
123 | self.enemy = enemy | 124 | self.enemy = enemy |
124 | self.player:battleBegin() | 125 | self.player:battleBegin() |
125 | self.enemy:battleBegin() | 126 | self.enemy:battleBegin() |