rename skills -> animations
This commit is contained in:
parent
bd7e56e8cc
commit
fa4793f5eb
@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user