summaryrefslogtreecommitdiff
path: root/script.js
diff options
context:
space:
mode:
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);