Browse Source

More constructor work.

combat-2
MagicBot 9 months ago
parent
commit
04d88d0523
  1. 20
      src/engine/objects/ItemTemplate.java

20
src/engine/objects/ItemTemplate.java

@ -23,19 +23,25 @@ public class ItemTemplate {
public static HashMap<Integer, ItemTemplate> itemTemplates = new HashMap<>(); public static HashMap<Integer, ItemTemplate> itemTemplates = new HashMap<>();
// Template Properties // Template Properties
public String obj_name = ""; public String obj_name;
public Vector3fImmutable obj_scale = new Vector3fImmutable(); public Vector3fImmutable obj_scale;
public int obj_render_object; public int obj_render_object;
public int obj_icon; public int obj_icon;
public float combat_health_current; public float combat_health_current;
public float combat_health_full; public float combat_health_full;
public HashMap<String, Float> combat_attack_resist = new HashMap<>(); public HashMap<String, Float> combat_attack_resist = new HashMap<>();
public Enum.ItemType item_type; public Enum.ItemType item_type;
public int item_eq_slots_value; public int item_eq_slots_value;
public boolean item_eq_slots_type; public boolean item_eq_slots_type;
public EnumSet<Enum.ItemEquipSlotType> item_eq_slots_or = EnumSet.noneOf(Enum.ItemEquipSlotType.class); public EnumSet<Enum.ItemEquipSlotType> item_eq_slots_or = EnumSet.noneOf(Enum.ItemEquipSlotType.class);
public EnumSet<Enum.ItemEquipSlotType> item_eq_slots_and = EnumSet.noneOf(Enum.ItemEquipSlotType.class); public EnumSet<Enum.ItemEquipSlotType> 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) { public ItemTemplate(JSONObject jsonObject) {
@ -89,5 +95,13 @@ public class ItemTemplate {
for (Object o : eq_slots_or) for (Object o : eq_slots_or)
item_eq_slots_and.add(Enum.ItemEquipSlotType.valueOf((String) o)); 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();
} }
} }

Loading…
Cancel
Save