Team animations come from source, skill buttons
This commit is contained in:
@@ -26,18 +26,35 @@ class CombatSkills extends Phaser.GameObjects.Group {
|
||||
this.scene = scene;
|
||||
}
|
||||
|
||||
getSkill(type, isAlly) {
|
||||
getSkill(type, isAlly, castLocation) {
|
||||
if (type === 'attack') {
|
||||
this[randomAnimation()](isAlly);
|
||||
} else {
|
||||
this[type](isAlly);
|
||||
this[type](isAlly, castLocation);
|
||||
}
|
||||
}
|
||||
|
||||
Heal(isAlly) {
|
||||
Heal(isAlly, castLocation) {
|
||||
// const { sourceX, sourceY } = getCrypPosition(sourcePos, 0);
|
||||
const lifespan = DELAYS.ANIMATION_DURATION;
|
||||
const particles = this.scene.add.particles(randomColour());
|
||||
const colour = randomColour();
|
||||
const particles = this.scene.add.particles(colour);
|
||||
const x = isAlly ? COMBAT.width() * 0.7 : COMBAT.width() * 0.3;
|
||||
|
||||
const emitter2 = particles.createEmitter({
|
||||
x: castLocation.x,
|
||||
y: castLocation.y,
|
||||
moveToX: x,
|
||||
moveToY: COMBAT.height() * 0.2,
|
||||
speed: 500,
|
||||
lifespan: lifespan / 3,
|
||||
scale: { start: 0.5, end: 1 },
|
||||
quantity: 3,
|
||||
_frequency: 20,
|
||||
blendMode: 'ADD',
|
||||
emitZone: { source: new Phaser.Geom.Rectangle(-200, -100, 400, 200) },
|
||||
});
|
||||
|
||||
const emitter = particles.createEmitter({
|
||||
x,
|
||||
y: COMBAT.height() * 0.2,
|
||||
@@ -48,8 +65,14 @@ class CombatSkills extends Phaser.GameObjects.Group {
|
||||
scale: { start: 0.1, end: 1 },
|
||||
blendMode: 'ADD',
|
||||
lifespan,
|
||||
active: false,
|
||||
});
|
||||
|
||||
|
||||
this.add(particles);
|
||||
this.scene.time.delayedCall(lifespan / 3, () => { emitter2.stop(); }, [], this);
|
||||
this.scene.time.delayedCall(lifespan / 3, () => { emitter.active = true; }, [], this);
|
||||
|
||||
this.scene.time.delayedCall(lifespan, () => { emitter.stop(); }, [], this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user