Added block animations, misc ui fixes
This commit is contained in:
@@ -15,7 +15,7 @@ const animationParams = (isAlly) => {
|
||||
return { spawnLocation, speed, img, angleMin, angleMax };
|
||||
};
|
||||
|
||||
const randomAnimation = () => {
|
||||
const randomAttack = () => {
|
||||
const animations = ['wall', 'spit', 'gravBlast', 'gravBomb', 'chargeBall'];
|
||||
return animations[Math.floor(Math.random() * 5)];
|
||||
};
|
||||
@@ -27,25 +27,18 @@ class CombatSkills extends Phaser.GameObjects.Group {
|
||||
}
|
||||
|
||||
getSkill(type, isAlly, castLocation) {
|
||||
if (type === 'attack') {
|
||||
this[randomAnimation()](isAlly);
|
||||
const genericHeal = ['Heal', 'Triage', 'TriageTick'];
|
||||
const genericBlock = ['Block', 'Parry', 'Evasion', 'Shield'];
|
||||
|
||||
if (genericHeal.includes(type)) {
|
||||
this.genericHeal(isAlly, castLocation);
|
||||
} else if (genericBlock.includes(type)) {
|
||||
this.genericBlock(isAlly);
|
||||
} else {
|
||||
this[type](isAlly, castLocation);
|
||||
this[randomAttack()](isAlly);
|
||||
}
|
||||
}
|
||||
|
||||
Heal(isAlly, castLocation) {
|
||||
this.genericHeal(isAlly, castLocation);
|
||||
}
|
||||
|
||||
Triage(isAlly, castLocation) {
|
||||
this.genericHeal(isAlly, castLocation);
|
||||
}
|
||||
|
||||
TriageTick(isAlly, castLocation) {
|
||||
this.genericHeal(isAlly, castLocation);
|
||||
}
|
||||
|
||||
genericHeal(isAlly, castLocation) {
|
||||
// const { sourceX, sourceY } = getCrypPosition(sourcePos, 0);
|
||||
const lifespan = DELAYS.ANIMATION_DURATION;
|
||||
@@ -88,7 +81,7 @@ class CombatSkills extends Phaser.GameObjects.Group {
|
||||
this.scene.time.delayedCall(lifespan, () => { emitter.stop(); }, [], this);
|
||||
}
|
||||
|
||||
Block(isAlly) {
|
||||
genericBlock(isAlly) {
|
||||
const lifespan = DELAYS.ANIMATION_DURATION;
|
||||
const colour = randomColour();
|
||||
const x = isAlly ? COMBAT.width() * 0.3 : COMBAT.width() * 0.7;
|
||||
|
||||
Reference in New Issue
Block a user