Implement item use (energy potions)

- Selectors don't work yet
This commit is contained in:
Melledy
2025-11-01 08:08:31 -07:00
parent a00dffe2e4
commit b4e008fb9a
7 changed files with 202 additions and 38 deletions
@@ -2,6 +2,7 @@ package emu.nebula.data.resources;
import emu.nebula.data.BaseDef;
import emu.nebula.data.ResourceType;
import emu.nebula.game.inventory.ItemParamMap;
import emu.nebula.game.inventory.ItemSubType;
import emu.nebula.game.inventory.ItemType;
import lombok.Getter;
@@ -16,6 +17,11 @@ public class ItemDef extends BaseDef {
private int Rarity;
private boolean Stack;
private int UseMode;
private int UseAction;
private String UseArgs;
private transient ItemParamMap useParams;
private transient ItemType itemType;
private transient ItemSubType itemSubType;
@@ -28,5 +34,9 @@ public class ItemDef extends BaseDef {
public void onLoad() {
this.itemType = ItemType.getByValue(this.Type);
this.itemSubType = ItemSubType.getByValue(this.Stype);
if (this.UseArgs != null) {
this.useParams = ItemParamMap.fromJsonString(this.UseArgs);
}
}
}