changed delays for decay tick
This commit is contained in:
parent
0974a24eb8
commit
a359b193ee
6
client/src/events.jsx
Normal file → Executable file
6
client/src/events.jsx
Normal file → Executable file
@ -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;
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user