From 9c8b6907390bd1271d4cc40df0f1916b079c35d6 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 24 Feb 2024 15:28:21 -0500 Subject: [PATCH] Weapon field parsing --- src/engine/objects/ItemTemplate.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index 62f393ef..b5b18916 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -165,6 +165,11 @@ public class ItemTemplate { item_weapon_projectile_speed = ((Double) item_weapon.get("weapon_max_range")).floatValue(); item_weapon_combat_idle_anim = ((Long) item_weapon.get("weapon_combat_idle_anime")).intValue(); + JSONObject weapon_damage = (JSONObject) jsonObject.get("weapon_damage"); + item_weapon_damage_type = Enum.DamageType.valueOf((String) weapon_damage.get("damage_type")); + item_weapon_damage_min = ((Long) weapon_damage.get("damage_mi")).intValue(); + item_weapon_damage_max = ((Long) weapon_damage.get("damage_max")).intValue(); + } JSONArray itemflags = (JSONArray) jsonObject.get("item_flags");