cleanup
This commit is contained in:
parent
09d95a7cf7
commit
70711fd37b
@ -1,4 +1,3 @@
|
|||||||
const { TIMES } = require('./constants');
|
|
||||||
const { removeTier } = require('./utils');
|
const { removeTier } = require('./utils');
|
||||||
|
|
||||||
function none() {
|
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) {
|
function getFocusTargets(resolution) {
|
||||||
const [type, event] = resolution.variant;
|
const [type, event] = resolution.variant;
|
||||||
if (type === 'HitCast') {
|
if (type === 'HitCast') {
|
||||||
@ -178,7 +164,6 @@ function isCbAnim(skill) {
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
getFocusTargets,
|
getFocusTargets,
|
||||||
getObjects,
|
getObjects,
|
||||||
getTime,
|
|
||||||
getText,
|
getText,
|
||||||
isCbAnim,
|
isCbAnim,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -5,7 +5,6 @@ const eachSeries = require('async/eachSeries');
|
|||||||
const sample = require('lodash/sample');
|
const sample = require('lodash/sample');
|
||||||
|
|
||||||
const actions = require('./actions');
|
const actions = require('./actions');
|
||||||
const { TIMES } = require('./constants');
|
|
||||||
const animations = require('./animations.utils');
|
const animations = require('./animations.utils');
|
||||||
const { infoToast, errorToast } = require('./utils');
|
const { infoToast, errorToast } = require('./utils');
|
||||||
const { tutorialVbox } = require('./tutorial.utils');
|
const { tutorialVbox } = require('./tutorial.utils');
|
||||||
@ -89,11 +88,9 @@ function registerEvents(store) {
|
|||||||
// stop fetching the game state til animations are done
|
// stop fetching the game state til animations are done
|
||||||
const newRes = game.events[currentGame.events.length - 1];
|
const newRes = game.events[currentGame.events.length - 1];
|
||||||
return eachSeries(newRes, (r, cb) => {
|
return eachSeries(newRes, (r, cb) => {
|
||||||
// if (!r.event) return cb();
|
|
||||||
const timeout = r.delay;
|
const timeout = r.delay;
|
||||||
const anims = animations.getObjects(r, game, account);
|
const anims = animations.getObjects(r, game, account);
|
||||||
|
|
||||||
|
|
||||||
if (r.variant[0].includes('Hit')) {
|
if (r.variant[0].includes('Hit')) {
|
||||||
if (r.variant[0] === 'HitCast') {
|
if (r.variant[0] === 'HitCast') {
|
||||||
store.dispatch(actions.setAnimSource(anims.animSource));
|
store.dispatch(actions.setAnimSource(anims.animSource));
|
||||||
@ -111,6 +108,7 @@ function registerEvents(store) {
|
|||||||
return cb();
|
return cb();
|
||||||
}, timeout);
|
}, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
const text = animations.getText(r);
|
const text = animations.getText(r);
|
||||||
store.dispatch(actions.setAnimText(text));
|
store.dispatch(actions.setAnimText(text));
|
||||||
return setTimeout(cb, timeout);
|
return setTimeout(cb, timeout);
|
||||||
|
|||||||
@ -105,7 +105,10 @@ impl Cast {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn actions(&self) -> Vec<Action> {
|
pub fn actions(&self) -> Vec<Action> {
|
||||||
let mut actions = vec![Action::HitCast { construct: self.target, skill: self.skill, source: self.source }];
|
let mut actions = match self.skill.is_tick() {
|
||||||
|
false => vec![Action::HitCast { construct: self.target, skill: self.skill, source: self.source }],
|
||||||
|
true => vec![Action::Hit { construct: self.target, skill: self.skill }]
|
||||||
|
};
|
||||||
|
|
||||||
let mut rest = match self.skill {
|
let mut rest = match self.skill {
|
||||||
Skill::Amplify => vec![
|
Skill::Amplify => vec![
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user