Browse Source

New branch more progress

combat-2
MagicBot 9 months ago
parent
commit
8656d6bfb9
  1. 4
      src/engine/objects/ItemTemplate.java

4
src/engine/objects/ItemTemplate.java

@ -156,6 +156,8 @@ public class ItemTemplate { @@ -156,6 +156,8 @@ public class ItemTemplate {
item_defense_rating = ((Long) jsonObject.get("item_defense_rating")).intValue();
}
// Fields only present for WEAPON
if (item_type.equals(Enum.ItemType.WEAPON)) {
JSONObject item_weapon = (JSONObject) jsonObject.get("item_weapon");
@ -167,6 +169,8 @@ public class ItemTemplate { @@ -167,6 +169,8 @@ public class ItemTemplate {
JSONArray weapon_damage = (JSONArray) item_weapon.get("weapon_damage");
// Need a pojo for this or a PAIR<>
for (Object o : weapon_damage) {
JSONObject damage_entry = (JSONObject) o;
item_weapon_damage_type = Enum.SourceType.valueOf(((String) damage_entry.get("damage_type")).toUpperCase());

Loading…
Cancel
Save