This commit is contained in:
Mashy 2019-12-05 23:10:26 +10:00
parent 09d95a7cf7
commit 70711fd37b
3 changed files with 5 additions and 19 deletions

View File

@ -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,
};

View File

@ -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);

View File

@ -105,7 +105,10 @@ impl Cast {
}
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 {
Skill::Amplify => vec![