Merge branch 'ko-anims' into develop

This commit is contained in:
Mashy
2019-10-23 16:04:21 +10:00
4 changed files with 25 additions and 21 deletions
+11 -6
View File
@@ -1,4 +1,5 @@
const { TIMES } = require('./constants');
const { removeTier } = require('./utils');
function none() {
return {
@@ -75,8 +76,6 @@ function getObjects(resolution, stages, game, account) {
function getSequence(resolution) {
if (!resolution.event) return [];
if (resolution.event[0] === 'Inversion') return [];
if (['TargetKo', 'Ko'].includes(resolution.event[0])) return [];
if (['Skill', 'AoeSkill'].includes(resolution.event[0])) return ['START_SKILL', 'END_SKILL'];
switch (resolution.stages) {
case 'AllStages': return ['START_SKILL', 'END_SKILL', 'POST_SKILL'];
@@ -202,14 +201,20 @@ function getText(resolution, sequence) {
};
}
function isCbAnim(skill) {
return ['Attack', 'Blast', 'Siphon', 'SiphonTick', 'Strike', 'Chaos', 'Slay', 'Heal',
'Buff', 'Amplify', 'Haste', 'Triage', 'TriageTick', 'Link', 'Hybrid', 'Intercept',
'Debuff', 'Curse', 'Decay', 'DecayTick', 'Purge', 'Silence', 'Restrict',
'Stun', 'Bash', 'Absorb', 'Sleep', 'Break', 'Ruin',
'Block', 'Sustain', 'Electrify', 'Electrocute', 'ElectrocuteTick',
'Counter', 'CounterAttack', 'Purify', 'Recharge', 'Reflect'].includes(removeTier(skill));
}
module.exports = {
getFocusTargets,
getObjects,
getTime,
getSequence,
getText,
isCbAnim,
};
// if (!(resolution.target.id === construct.id)
// && !(resolution.event[0] === 'AoeSkill' && targetTeam.includes(construct.id))) return false;
+4 -6
View File
@@ -7,7 +7,7 @@ const sample = require('lodash/sample');
const actions = require('./actions');
const { TIMES } = require('./constants');
const animations = require('./animations.utils');
const { infoToast, errorToast, removeTier } = require('./utils');
const { infoToast, errorToast } = require('./utils');
function registerEvents(store) {
function notify(msg) {
@@ -67,8 +67,6 @@ function registerEvents(store) {
// stop fetching the game state til animations are done
const newRes = game.resolved.slice(currentGame.resolved.length);
return eachSeries(newRes, (r, cb) => {
if (['Disable', 'TargetKo'].includes(r.event[0])) return cb();
// convert server enum into anims keywords
// todo make serersideonly
const sequence = animations.getSequence(r);
@@ -81,7 +79,7 @@ function registerEvents(store) {
if (sequence.includes('START_SKILL') && anims.animSource) store.dispatch(actions.setAnimSource(anims.animSource));
if (sequence.includes('END_SKILL') && anims.animTarget) {
store.dispatch(actions.setAnimTarget(anims.animTarget));
if (!['Banish', 'Invert'].includes(removeTier(anims.animTarget.skill))) store.dispatch(actions.setAnimCb(cb));
if (animations.isCbAnim(anims.animSkill)) store.dispatch(actions.setAnimCb(cb));
}
if (sequence.includes('POST_SKILL') && text) {
// timeout to prevent text classes from being added too soon
@@ -100,8 +98,8 @@ function registerEvents(store) {
store.dispatch(actions.setAnimTarget(null));
store.dispatch(actions.setAnimText(null));
store.dispatch(actions.setAnimFocus([]));
if (!sequence.includes('END_SKILL') || (anims.animSkill && ['Banish', 'Invert'].includes(anims.animSkill))) return cb();
return true;
if (sequence.includes('END_SKILL') && animations.isCbAnim(anims.animSkill)) return true;
return cb();
}, timeout);
}, err => {
if (err) return console.error(err);
+1
View File
@@ -142,6 +142,7 @@ function randomPoints(numPoints, radius, dimensions) {
}
const removeTier = skill => {
if (!skill) return skill;
if (skill.includes('SiphonTick')) return 'SiphonTick';
if (skill.includes('TriageTick')) return 'TriageTick';
if (skill.includes('DecayTick')) return 'DecayTick';