From 04d88d052375c6d9ce60c13d60051cd1cd4b7379 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 18 Feb 2024 14:25:28 -0500 Subject: [PATCH] More constructor work. --- src/engine/objects/ItemTemplate.java | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index 4b854fee..479e9cd7 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -23,19 +23,25 @@ public class ItemTemplate { public static HashMap itemTemplates = new HashMap<>(); // Template Properties - public String obj_name = ""; - public Vector3fImmutable obj_scale = new Vector3fImmutable(); + public String obj_name; + public Vector3fImmutable obj_scale; public int obj_render_object; public int obj_icon; public float combat_health_current; public float combat_health_full; public HashMap combat_attack_resist = new HashMap<>(); - public Enum.ItemType item_type; public int item_eq_slots_value; public boolean item_eq_slots_type; public EnumSet item_eq_slots_or = EnumSet.noneOf(Enum.ItemEquipSlotType.class); public EnumSet item_eq_slots_and = EnumSet.noneOf(Enum.ItemEquipSlotType.class); + public int item_value; + public int item_wt; + public float item_passive_defense_mod; + public String item_base_name; + public String item_dsc; + public int item_render_object_female; + public float item_health_full; public ItemTemplate(JSONObject jsonObject) { @@ -89,5 +95,13 @@ public class ItemTemplate { for (Object o : eq_slots_or) item_eq_slots_and.add(Enum.ItemEquipSlotType.valueOf((String) o)); + item_value = ((Long) jsonObject.get("item_value")).intValue(); + item_wt = ((Long) jsonObject.get("item_wt")).intValue(); + item_passive_defense_mod = ((Double) jsonObject.get("item_passive_defense_mod")).floatValue(); + item_base_name = (String) jsonObject.get("item_base_name"); + item_dsc = (String) jsonObject.get("item_dsc"); + item_render_object_female = ((Long) jsonObject.get("item_render_object_female")).intValue(); + item_health_full = ((Double) jsonObject.get("item_health_full")).floatValue(); + } }