Browse Source

Fleshing out constructor

combat-2
MagicBot 9 months ago
parent
commit
b0542a5bc3
  1. 7
      src/engine/objects/ItemTemplate.java

7
src/engine/objects/ItemTemplate.java

@ -24,6 +24,8 @@ public class ItemTemplate { @@ -24,6 +24,8 @@ public class ItemTemplate {
public String obj_name = "";
public Vector3fImmutable obj_scale = new Vector3fImmutable();
public int obj_render_object;
public float combat_health_current;
public float combat_health_full;
public HashMap<String, Float> combat_attack_resist = new HashMap<>();
public ItemTemplate(JSONObject jsonObject) {
@ -42,6 +44,11 @@ public class ItemTemplate { @@ -42,6 +44,11 @@ public class ItemTemplate {
obj_render_object = ((Long) jsonObject.get("obj_render_object")).intValue();
// Reading float values
combat_health_current = ((Double) jsonObject.get("combat_health_current")).floatValue();
combat_health_full = ((Double) jsonObject.get("combat_health_full")).floatValue();
// Reading a hashmap of floats
JSONObject resist_json = (JSONObject) jsonObject.get("combat_attack_resist");

Loading…
Cancel
Save