From a359b193eef4a50f8e2c6b4feb0c642fe7fe4107 Mon Sep 17 00:00:00 2001 From: Mashy Date: Tue, 16 Apr 2019 11:06:30 +1000 Subject: [PATCH] changed delays for decay tick --- client/src/events.jsx | 6 ++---- client/src/utils.jsx | 9 +++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) mode change 100644 => 100755 client/src/events.jsx diff --git a/client/src/events.jsx b/client/src/events.jsx old mode 100644 new mode 100755 index 96ad39be..1cf4ffca --- a/client/src/events.jsx +++ b/client/src/events.jsx @@ -3,6 +3,7 @@ const eachSeries = require('async/eachSeries'); const actions = require('./actions'); const { TIMES } = require('./constants'); +const { getCombatSequence } = require('./utils'); function registerEvents(store) { function setCryps(cryps) { @@ -25,10 +26,7 @@ function registerEvents(store) { return eachSeries(newRes, (r, cb) => { if (['Disable', 'TargetKo'].includes(r.event[0])) return cb(); // Create sub events for combat animations - // Some types only need to animate final effect - const sequence = ['Ko'].includes(r.event[0]) - ? ['POST_SKILL'] - : ['START_SKILL', 'END_SKILL', 'POST_SKILL']; + const sequence = getCombatSequence(r.event); return eachSeries(sequence, (stage, sCb) => { const stagedR = Object.create(r); stagedR.stage = stage; diff --git a/client/src/utils.jsx b/client/src/utils.jsx index f25c95b1..fa34190d 100644 --- a/client/src/utils.jsx +++ b/client/src/utils.jsx @@ -175,6 +175,14 @@ function eventClasses(resolution, cryp) { return ''; } +function getCombatSequence(event) { + if (!event) return false; + // Skip combat animations depending on event type, expandable in future + if (['Ko'].includes(event[0])) return ['POST_SKILL']; + if (['DecayTick'].includes(event[1].skill)) return ['END_SKILL', 'POST_SKILL']; + return ['START_SKILL', 'END_SKILL', 'POST_SKILL']; +} + function getCombatText(cryp, resolution) { if (!resolution) return ''; @@ -262,6 +270,7 @@ module.exports = { genAvatar, requestAvatar, eventClasses, + getCombatSequence, getCombatText, NULL_UUID, STATS,