Added heals and removed enemy hitbox in target phase
This commit is contained in:
@@ -15,12 +15,44 @@ const animationParams = (isAlly) => {
|
||||
return { spawnLocation, speed, img, angleMin, angleMax };
|
||||
};
|
||||
|
||||
const randomAnimation = () => {
|
||||
const animations = ['wall', 'spit', 'gravBlast', 'gravBomb', 'chargeBall'];
|
||||
return animations[Math.floor(Math.random() * 5)];
|
||||
};
|
||||
|
||||
class CombatSkills extends Phaser.GameObjects.Group {
|
||||
constructor(scene) {
|
||||
super(scene);
|
||||
this.scene = scene;
|
||||
}
|
||||
|
||||
getSkill(type, isAlly) {
|
||||
if (type === 'attack') {
|
||||
this[randomAnimation()](isAlly);
|
||||
} else {
|
||||
this.heal();
|
||||
}
|
||||
}
|
||||
|
||||
heal() {
|
||||
const lifespan = DELAYS.ANIMATION_DURATION;
|
||||
const particles = this.scene.add.particles(randomColour());
|
||||
const emitter = particles.createEmitter({
|
||||
x: COMBAT.width() * 0.3,
|
||||
y: COMBAT.height() * 0.2,
|
||||
angle: { min: 250, max: 290 },
|
||||
speed: 250,
|
||||
gravityY: 1000,
|
||||
quantity: 4,
|
||||
scale: { start: 0.1, end: 1 },
|
||||
blendMode: 'ADD',
|
||||
lifespan,
|
||||
});
|
||||
this.add(particles);
|
||||
this.scene.time.delayedCall(lifespan, () => { emitter.stop(); }, [], this);
|
||||
|
||||
}
|
||||
|
||||
wall(isAlly) {
|
||||
const lifespan = DELAYS.ANIMATION_DURATION;
|
||||
const { spawnLocation, speed, img } = animationParams(isAlly);
|
||||
|
||||
Reference in New Issue
Block a user