fix animCb logic from stalling
This commit is contained in:
parent
b120fdc08e
commit
14cb075161
@ -1,4 +1,5 @@
|
||||
const { TIMES } = require('./constants');
|
||||
const { removeTier } = require('./utils');
|
||||
|
||||
function none() {
|
||||
return {
|
||||
@ -200,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;
|
||||
|
||||
@ -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) {
|
||||
@ -79,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
|
||||
@ -98,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);
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -69,12 +69,12 @@ pub fn pre_resolve(cast: &Cast, game: &mut Game, mut resolutions: Resolutions) -
|
||||
|
||||
pub fn resolve(skill: Skill, source: &mut Construct, target: &mut Construct, mut resolutions: Vec<Resolution>) -> Resolutions {
|
||||
if let Some(disable) = source.disabled(skill) {
|
||||
resolutions.push(Resolution::new(source, target).event(Event::Disable { disable, skill }));
|
||||
resolutions.push(Resolution::new(source, target).event(Event::Disable { disable, skill }).stages(EventStages::PostOnly));
|
||||
return resolutions;
|
||||
}
|
||||
|
||||
if target.is_ko() {
|
||||
resolutions.push(Resolution::new(source, target).event(Event::TargetKo { skill }));
|
||||
resolutions.push(Resolution::new(source, target).event(Event::TargetKo { skill }).stages(EventStages::PostOnly));
|
||||
return resolutions;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user