Added soundName to HeldItem (possibly useless)

This commit is contained in:
Wlowscha 2025-06-09 13:39:25 +02:00
parent 8d63f06de2
commit c607a73ebc
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04
2 changed files with 5 additions and 2 deletions

View File

@ -2694,7 +2694,7 @@ export default class BattleScene extends SceneBase {
if (!ignoreUpdate) {
this.updateModifiers(pokemon.isPlayer());
}
const soundName = modifier.type.soundName;
const soundName = allHeldItems[heldItemId].soundName;
if (playSound && !this.sound.get(soundName)) {
this.playSound(soundName);
}
@ -2769,7 +2769,7 @@ export default class BattleScene extends SceneBase {
this.updateModifiers(source.isPlayer());
}
const soundName = modifier.type.soundName;
const soundName = allHeldItems[heldItemId].soundName;
if (playSound && !this.sound.get(soundName)) {
this.playSound(soundName);
}

View File

@ -46,6 +46,9 @@ export class HeldItem {
public isStealable = true;
public isSuppressable = true;
//TODO: If this is actually never changed by any subclass, perhaps it should not be here
public soundName = "se/restore";
constructor(type: HeldItemId, maxStackCount = 1) {
this.type = type;
this.maxStackCount = maxStackCount;