Initial refactor of damagetype

This commit is contained in:
2024-04-01 09:19:37 -04:00
parent adfbf87056
commit a29269e335
32 changed files with 447 additions and 380 deletions
+3 -3
View File
@@ -62,7 +62,7 @@ public class ItemTemplate {
public int item_weapon_projectile_id;
public float item_weapon_projectile_speed;
public int item_weapon_combat_idle_anim;
public HashMap<Enum.SourceType, int[]> item_weapon_damage = new HashMap<>();
public HashMap<Enum.DamageType, int[]> item_weapon_damage = new HashMap<>();
public ArrayList<int[]> weapon_attack_anim_right = new ArrayList();
public ArrayList<int[]> weapon_attack_anim_left = new ArrayList();
public Enum.AttributeType item_primary_attr = Enum.AttributeType.None;
@@ -227,11 +227,11 @@ public class ItemTemplate {
if (weapon_damage.isEmpty() == false)
for (Object o : weapon_damage) {
JSONObject damage_entry = (JSONObject) o;
Enum.SourceType sourceType = Enum.SourceType.valueOf(((String) damage_entry.get("damage_type")).toUpperCase());
Enum.DamageType damageType = Enum.DamageType.valueOf(((String) damage_entry.get("damage_type")));
int min = ((Long) damage_entry.get("damage_min")).intValue();
int max = ((Long) damage_entry.get("damage_max")).intValue();
int[] minMax = {min, max};
item_weapon_damage.put(sourceType, minMax);
item_weapon_damage.put(damageType, minMax);
}
JSONArray attack_anim_right = (JSONArray) item_weapon.get("weapon_attack_anim_right");