Merge branch 'reso_stages'
This commit is contained in:
@@ -43,7 +43,7 @@ function registerEvents(store) {
|
||||
return eachSeries(newRes, (r, cb) => {
|
||||
if (['Disable', 'TargetKo'].includes(r.event[0])) return cb();
|
||||
// Create sub events for combat animations
|
||||
const sequence = getCombatSequence(r.event);
|
||||
const sequence = getCombatSequence(r);
|
||||
return eachSeries(sequence, (stage, sCb) => {
|
||||
const { skip } = store.getState();
|
||||
if (skip) return sCb();
|
||||
|
||||
+15
-31
@@ -276,38 +276,22 @@ function eventClasses(resolution, construct) {
|
||||
return '';
|
||||
}
|
||||
|
||||
function getCombatSequence(event) {
|
||||
if (!event) return false;
|
||||
// Skip combat animations depending on event type, expandable in future
|
||||
if (['Inversion'].includes(event[0])) return false;
|
||||
if (['Skill', 'AoeSkill'].includes(event[0])) return ['START_SKILL', 'END_SKILL'];
|
||||
if (['Immunity'].includes(event[0])) return ['START_SKILL', 'POST_SKILL'];
|
||||
if (['Removal'].includes(event[0])) return ['POST_SKILL'];
|
||||
function getCombatSequence(resolution) {
|
||||
if (!resolution.event) return false;
|
||||
if (resolution.event[0] === 'Inversion') return false;
|
||||
if (resolution.event[0] === 'Skill') return ['START_SKILL', 'END_SKILL'];
|
||||
if (resolution.event[0] === 'Ko') return ['POST_SKILL'];
|
||||
|
||||
if (['Healing'].includes(event[0])
|
||||
&& (event[1].skill.includes('Slay')
|
||||
|| event[1].skill.includes('SiphonTick')
|
||||
|| event[1].skill.includes('Purify')
|
||||
|| event[1].skill.includes('Sleep'))) return ['POST_SKILL'];
|
||||
|
||||
if (['Recharge'].includes(event[0])
|
||||
&& (event[1].skill.includes('Reflect'))) return ['POST_SKILL'];
|
||||
|
||||
|
||||
if (event[0] === 'Effect'
|
||||
&& (['Ruin', 'Taunt', 'Strangling', 'Parry'].includes(event[1].skill)
|
||||
|| (event[1].skill.includes('Decay') && event[1].effect === 'Wither'))) return ['POST_SKILL'];
|
||||
|
||||
if (['Power'].includes(event[0])
|
||||
&& ((event[1].skill.includes('Chaos') && event[1].colour === 'Red')
|
||||
|| event[1].skill.includes('Silence')
|
||||
|| event[1].skill.includes('Snare'))) return ['POST_SKILL'];
|
||||
|
||||
if (['Ko'].includes(event[0])
|
||||
|| (event[1].skill.includes('Throw') && event[1].effect === 'Vulnerable')) return ['POST_SKILL'];
|
||||
|
||||
if (['Tick'].includes(event[1].skill)) return ['END_SKILL', 'POST_SKILL'];
|
||||
return ['START_SKILL', 'END_SKILL', 'POST_SKILL'];
|
||||
switch (resolution.stages) {
|
||||
case 1: return ['START_SKILL', 'END_SKILL'];
|
||||
case 2: return ['START_SKILL', 'POST_SKILL'];
|
||||
case 3: return ['START_SKILL'];
|
||||
case 4: return ['END_SKILL', 'POST_SKILL'];
|
||||
case 5: return ['END_SKILL'];
|
||||
case 6: return ['POST_SKILL'];
|
||||
case 7: return false;
|
||||
default: return ['START_SKILL', 'END_SKILL', 'POST_SKILL'];
|
||||
}
|
||||
}
|
||||
|
||||
function getCombatText(construct, resolution) {
|
||||
|
||||
Reference in New Issue
Block a user