summaryrefslogtreecommitdiff
path: root/script.js
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2023-08-15 15:21:49 +0200
committerDaniel Weipert <code@drogueronin.de>2023-08-15 15:21:49 +0200
commit946d5592d24050337193ba7202dd5b2e5b40c1d3 (patch)
treed39d3c2dcd35bf027f688ae3f039e39dcbfaf0b1 /script.js
parent0007e50506ebaa61554bfd11e98581dada7e0cdd (diff)
damage colors and animation fix
Diffstat (limited to 'script.js')
-rw-r--r--script.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/script.js b/script.js
index ee8414d..575db99 100644
--- a/script.js
+++ b/script.js
@@ -17,11 +17,11 @@ const ElementType = {
};
const ElementTypeColor = {
[ElementType.aether]: 'rgba(255, 255, 255, 1)',
- [ElementType.wood]: 'rgb(0, 255, 0, 1)',
- [ElementType.fire]: 'red',
- [ElementType.earth]: 'brown',
- [ElementType.metal]: 'silver',
- [ElementType.water]: 'blue',
+ [ElementType.wood]: '#3ca6a6',
+ [ElementType.fire]: '#ca3c3c',
+ [ElementType.earth]: '#eac93c',
+ [ElementType.metal]: '#e4e4e4',
+ [ElementType.water]: '#3c3c3c',
};
const TasteWarm = {
tasteless: 'tasteless',
@@ -172,7 +172,7 @@ class Monster {
}
evolve () {
- const evolution = this.getPossibleEvolutions[0];
+ const evolution = this.getPossibleEvolutions()[0];
const statusPreEvolve = this.status;
const hpPreEvolve = this.hp;
@@ -478,9 +478,9 @@ function slugToName (slug) {
var enemyAnimation = battleEnemy.querySelector('.battle__monster-sprite__animation');
// enemyAnimation.style.top = enemyImg.getBoundingClientRect().top;
// enemyAnimation.style.left = enemyImg.getBoundingClientRect().left;
- if (!this.damageAnimationInterval) {
+ if (!this.damageAnimationInterval && state.activeTechnique.animation) {
this.damageAnimationInterval = setInterval(() => {
- enemyAnimation.src = `/modules/tuxemon/mods/tuxemon/animations/technique/${state.activeTechnique.animation}_0${this.damageAnimationNumber}.png`;
+ enemyAnimation.src = `/modules/tuxemon/mods/tuxemon/animations/technique/${state.activeTechnique.animation}_${("00" + this.damageAnimationNumber).slice(-2)}.png`;
enemyAnimation.style.top = event.clientY - (enemyAnimation.clientHeight / 2);
enemyAnimation.style.left = event.clientX - (enemyAnimation.clientWidth / 2);
console.log(enemyAnimation.src);
@@ -623,7 +623,7 @@ function slugToName (slug) {
state.money += faintedMonster.level * faintedMonster.moneyModifier;
- state.activeMonster.exp += calculateAwardedExperience(state.activeMonster, faintedMonster) * 50;
+ state.activeMonster.exp += calculateAwardedExperience(state.activeMonster, faintedMonster);
state.activeMonster.levelUp();
if (state.activeMonster.canEvolve()) {
await fetchMonster(state.activeMonster.evolutions[0].monster_slug);