cleanup
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
const { TIMES } = require('./constants');
|
||||
const { removeTier } = require('./utils');
|
||||
|
||||
function none() {
|
||||
@@ -61,19 +60,6 @@ function getObjects(resolution, game, account) {
|
||||
};
|
||||
}
|
||||
|
||||
function getTime(stages) {
|
||||
let time = 0;
|
||||
if (stages.includes('START_SKILL') && stages.includes('END_SKILL')) {
|
||||
time += TIMES.SOURCE_AND_TARGET_TOTAL_DURATION;
|
||||
} else {
|
||||
if (stages.includes('START_SKILL')) time += TIMES.SOURCE_DURATION_MS;
|
||||
if (stages.includes('END_SKILL')) time += TIMES.TARGET_DURATION_MS;
|
||||
}
|
||||
if (stages.includes('POST_SKILL')) time += TIMES.POST_SKILL_DURATION_MS;
|
||||
|
||||
return time;
|
||||
}
|
||||
|
||||
function getFocusTargets(resolution) {
|
||||
const [type, event] = resolution.variant;
|
||||
if (type === 'HitCast') {
|
||||
@@ -178,7 +164,6 @@ function isCbAnim(skill) {
|
||||
module.exports = {
|
||||
getFocusTargets,
|
||||
getObjects,
|
||||
getTime,
|
||||
getText,
|
||||
isCbAnim,
|
||||
};
|
||||
|
||||
@@ -5,7 +5,6 @@ const eachSeries = require('async/eachSeries');
|
||||
const sample = require('lodash/sample');
|
||||
|
||||
const actions = require('./actions');
|
||||
const { TIMES } = require('./constants');
|
||||
const animations = require('./animations.utils');
|
||||
const { infoToast, errorToast } = require('./utils');
|
||||
const { tutorialVbox } = require('./tutorial.utils');
|
||||
@@ -89,11 +88,9 @@ function registerEvents(store) {
|
||||
// stop fetching the game state til animations are done
|
||||
const newRes = game.events[currentGame.events.length - 1];
|
||||
return eachSeries(newRes, (r, cb) => {
|
||||
// if (!r.event) return cb();
|
||||
const timeout = r.delay;
|
||||
const anims = animations.getObjects(r, game, account);
|
||||
|
||||
|
||||
if (r.variant[0].includes('Hit')) {
|
||||
if (r.variant[0] === 'HitCast') {
|
||||
store.dispatch(actions.setAnimSource(anims.animSource));
|
||||
@@ -111,6 +108,7 @@ function registerEvents(store) {
|
||||
return cb();
|
||||
}, timeout);
|
||||
}
|
||||
|
||||
const text = animations.getText(r);
|
||||
store.dispatch(actions.setAnimText(text));
|
||||
return setTimeout(cb, timeout);
|
||||
|
||||
Reference in New Issue
Block a user