remove tiers from skill anim
This commit is contained in:
parent
0310b1b3df
commit
d232402c49
@ -6,6 +6,8 @@ const Strike = require('./anims/strike');
|
||||
|
||||
const AttackCharge = require('./anims/attack.charge');
|
||||
|
||||
const { removeTier } = require('../utils');
|
||||
|
||||
const colours = {
|
||||
red: '#a52a2a',
|
||||
green: '#1FF01F',
|
||||
@ -13,30 +15,39 @@ const colours = {
|
||||
purple: '#A25AC1',
|
||||
yellow: '#d1c86a',
|
||||
cyan: '#6AD1BF',
|
||||
white: '#FFFFFF',
|
||||
};
|
||||
|
||||
|
||||
function animations(props) {
|
||||
const { combatTextClass, combatText, stage, player, construct } = props;
|
||||
|
||||
const anim = text => {
|
||||
if (stage === 'START_SKILL') {
|
||||
switch (text) {
|
||||
case 'StrikeI': return <AttackCharge id={construct.id} team={player} colour={colours.red}/>;
|
||||
case 'HealI': return <AttackCharge id={construct.id} team={player} colour={colours.green}/>;
|
||||
case 'BlastI': return <AttackCharge id={construct.id} team={player} colour={colours.blue}/>;
|
||||
case 'ChaosI': return <AttackCharge id={construct.id} team={player} colour={colours.purple}/>;
|
||||
case 'SlayI': return <AttackCharge id={construct.id} team={player} colour={colours.yellow}/>;
|
||||
case 'SiphonI': return <AttackCharge id={construct.id} team={player} colour={colours.cyan}/>;
|
||||
|
||||
default: return <AttackCharge id={construct.id} team={player} colour="#a52a2a"/>;
|
||||
const skill = removeTier(text);
|
||||
switch (skill) {
|
||||
// Attack Base
|
||||
case 'Attack': return <AttackCharge id={construct.id} team={player} colour={colours.white}/>;
|
||||
case 'Strike': return <AttackCharge id={construct.id} team={player} colour={colours.red}/>;
|
||||
case 'Heal': return <AttackCharge id={construct.id} team={player} colour={colours.green}/>;
|
||||
case 'Blast': return <AttackCharge id={construct.id} team={player} colour={colours.blue}/>;
|
||||
case 'Chaos': return <AttackCharge id={construct.id} team={player} colour={colours.purple}/>;
|
||||
case 'Slay': return <AttackCharge id={construct.id} team={player} colour={colours.yellow}/>;
|
||||
case 'Siphon': return <AttackCharge id={construct.id} team={player} colour={colours.cyan}/>;
|
||||
// Stun Base
|
||||
// Block Base
|
||||
// Buff Base
|
||||
// Debuff Base
|
||||
default: return text;
|
||||
}
|
||||
}
|
||||
switch (text) {
|
||||
} else if (stage === 'END_SKILL') {
|
||||
const skill = removeTier(text);
|
||||
switch (skill) {
|
||||
case 'Attack': return <Attack id={construct.id} stage={stage} team={player}/>;
|
||||
case 'StrikeI': return <Strike id={construct.id} stage={stage} team={player}/>;
|
||||
default: return text;
|
||||
}
|
||||
}
|
||||
return text;
|
||||
};
|
||||
|
||||
if (combatText) {
|
||||
|
||||
@ -376,6 +376,46 @@ function randomPoints(numPoints, radius, width, height) {
|
||||
return points;
|
||||
}
|
||||
|
||||
const removeTier = skill => {
|
||||
if (skill.includes('Strike')) return 'Strike';
|
||||
if (skill.includes('Heal')) return 'Heal';
|
||||
if (skill.includes('Blast')) return 'Blast';
|
||||
if (skill.includes('Chaos')) return 'Chaos';
|
||||
if (skill.includes('Slay')) return 'Slay';
|
||||
if (skill.includes('Siphon')) return 'Siphon';
|
||||
|
||||
if (skill.includes('Snare')) return 'Snare';
|
||||
if (skill.includes('Purge')) return 'Purge';
|
||||
if (skill.includes('Silence')) return 'Silence';
|
||||
if (skill.includes('Curse')) return 'Curse';
|
||||
if (skill.includes('Decay')) return 'Decay';
|
||||
if (skill.includes('Invert')) return 'Invert';
|
||||
|
||||
if (skill.includes('Taunt')) return 'Taunt';
|
||||
if (skill.includes('Triage')) return 'Triage';
|
||||
if (skill.includes('Scatter')) return 'Scatter';
|
||||
if (skill.includes('Haste')) return 'Haste';
|
||||
if (skill.includes('Impurity')) return 'Impurity';
|
||||
if (skill.includes('Amplify')) return 'Amplify';
|
||||
|
||||
if (skill.includes('Parry')) return 'Parry';
|
||||
if (skill.includes('Purify')) return 'Purify';
|
||||
if (skill.includes('Corrupt')) return 'Corrupt';
|
||||
if (skill.includes('Clutch')) return 'Clutch';
|
||||
if (skill.includes('Reflect')) return 'Reflect';
|
||||
if (skill.includes('Recharge')) return 'Recharge';
|
||||
|
||||
if (skill.includes('Bash')) return 'Bash';
|
||||
if (skill.includes('Sleep')) return 'Sleep';
|
||||
if (skill.includes('Ruin')) return 'Ruin';
|
||||
if (skill.includes('Throw')) return 'Throw';
|
||||
if (skill.includes('Hex')) return 'Hex';
|
||||
if (skill.includes('Banish')) return 'Banish';
|
||||
|
||||
return skill;
|
||||
};
|
||||
|
||||
|
||||
module.exports = {
|
||||
stringSort,
|
||||
convertItem,
|
||||
@ -388,4 +428,5 @@ module.exports = {
|
||||
COLOURS,
|
||||
TARGET_COLOURS,
|
||||
randomPoints,
|
||||
removeTier,
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user