Browse Source

More parsing work.

combat-2
MagicBot 9 months ago
parent
commit
2d3b74e688
  1. 8
      src/engine/Enum.java
  2. 6
      src/engine/objects/ItemTemplate.java

8
src/engine/Enum.java

@ -2991,4 +2991,12 @@ public class Enum { @@ -2991,4 +2991,12 @@ public class Enum {
EMPTY_NEWITEM;
}
public enum AttributeType {
None,
Strength,
Dexterity,
Constitution,
Intelligence,
Spirit,
}
}

6
src/engine/objects/ItemTemplate.java

@ -57,8 +57,9 @@ public class ItemTemplate { @@ -57,8 +57,9 @@ 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 Enum.AttributeType item_primary_attr = Enum.AttributeType.None;
public Enum.AttributeType item_secondary_attr = Enum.AttributeType.None;
public EnumSet<Enum.ItemFlags> item_flags = EnumSet.noneOf(Enum.ItemFlags.class);
public EnumSet<Enum.ItemUseFlags> item_use_flags = EnumSet.noneOf(Enum.ItemUseFlags.class);
public int item_initial_charges;
@ -204,6 +205,9 @@ public class ItemTemplate { @@ -204,6 +205,9 @@ public class ItemTemplate {
int[] minMax = {min, max};
item_weapon_damage.put(sourceType, minMax);
}
item_primary_attr = Enum.AttributeType.valueOf((String) jsonObject.get("item_primary_attr"));
item_secondary_attr = Enum.AttributeType.valueOf((String) jsonObject.get("item_secondary_attr"));
}
JSONArray itemflags = (JSONArray) jsonObject.get("item_flags");

Loading…
Cancel
Save