diff --git a/client/src/scenes/combat.skills.js b/client/src/scenes/combat.animations.js similarity index 100% rename from client/src/scenes/combat.skills.js rename to client/src/scenes/combat.animations.js diff --git a/client/src/scenes/combat.render.resolutions.js b/client/src/scenes/combat.render.resolutions.js index ea0bd496..80d1b07b 100644 --- a/client/src/scenes/combat.render.resolutions.js +++ b/client/src/scenes/combat.render.resolutions.js @@ -1,15 +1,15 @@ const { eachSeries } = require('async'); -const CombatSkills = require('./combat.skills'); +const CombatAnimations = require('./combat.animations'); const { CrypImage } = require('./combat.cryps'); const { DELAYS: { ANIMATION_DURATION, MOVE_CREEP, DAMAGE_TICK }, POSITIONS: { COMBAT }, } = require('./constants'); -const randomSkill = () => { - const skills = ['wall', 'spit', 'gravBlast', 'gravBomb', 'chargeBall']; - return skills[Math.floor(Math.random() * 5)]; +const randomAnimation = () => { + const animations = ['wall', 'spit', 'gravBlast', 'gravBomb', 'chargeBall']; + return animations[Math.floor(Math.random() * 5)]; }; function findResolutionCryps(scene, group, resolution, allyTeam, enemyTeam) { @@ -32,7 +32,7 @@ function findResolutionCryps(scene, group, resolution, allyTeam, enemyTeam) { } function animatePhase(scene, group, game, resolution, cb) { - scene.skills = new CombatSkills(scene); + const animations = new CombatAnimations(scene); // Find cryps and targets const tweenParams = (targets, centreSpot, enemy) => { @@ -60,11 +60,11 @@ function animatePhase(scene, group, game, resolution, cb) { scene.tweens.add(moveAllyBattle); scene.tweens.add(moveEnemyBattle); - // animate skill - const skill = randomSkill(); + // animate animation + const animation = randomAnimation(); scene.time.delayedCall(MOVE_CREEP, () => { const isAlly = resolution.target_team_id === account.id; - scene.skills[skill](isAlly); + animations[animation](isAlly); // Target cryp takes damage scene.time.delayedCall(ANIMATION_DURATION, () => { @@ -77,8 +77,8 @@ function animatePhase(scene, group, game, resolution, cb) { // all done scene.time.delayedCall(MOVE_CREEP, () => { - scene.skills.cleanup(); - scene.skills.destroy(); + animations.cleanup(); + animations.destroy(); return cb(); }); });