|
|
@ -10,6 +10,7 @@ package engine.objects; |
|
|
|
|
|
|
|
|
|
|
|
import engine.Enum; |
|
|
|
import engine.Enum; |
|
|
|
import engine.math.Vector3fImmutable; |
|
|
|
import engine.math.Vector3fImmutable; |
|
|
|
|
|
|
|
import javafx.util.Pair; |
|
|
|
import org.json.simple.JSONArray; |
|
|
|
import org.json.simple.JSONArray; |
|
|
|
import org.json.simple.JSONObject; |
|
|
|
import org.json.simple.JSONObject; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
import org.pmw.tinylog.Logger; |
|
|
@ -54,9 +55,8 @@ public class ItemTemplate { |
|
|
|
public int item_weapon_projectile_id; |
|
|
|
public int item_weapon_projectile_id; |
|
|
|
public float item_weapon_projectile_speed; |
|
|
|
public float item_weapon_projectile_speed; |
|
|
|
public int item_weapon_combat_idle_anim; |
|
|
|
public int item_weapon_combat_idle_anim; |
|
|
|
public Enum.SourceType item_weapon_damage_type; |
|
|
|
|
|
|
|
public int item_weapon_damage_min; |
|
|
|
public HashMap<Enum.SourceType, Pair<Integer, Integer>> item_weapon_damage = new HashMap<>(); |
|
|
|
public int item_weapon_damage_max; |
|
|
|
|
|
|
|
public EnumSet<Enum.ItemFlags> item_flags = EnumSet.noneOf(Enum.ItemFlags.class); |
|
|
|
public EnumSet<Enum.ItemFlags> item_flags = EnumSet.noneOf(Enum.ItemFlags.class); |
|
|
|
public EnumSet<Enum.ItemUseFlags> item_use_flags = EnumSet.noneOf(Enum.ItemUseFlags.class); |
|
|
|
public EnumSet<Enum.ItemUseFlags> item_use_flags = EnumSet.noneOf(Enum.ItemUseFlags.class); |
|
|
|
public int item_initial_charges; |
|
|
|
public int item_initial_charges; |
|
|
@ -169,13 +169,13 @@ public class ItemTemplate { |
|
|
|
|
|
|
|
|
|
|
|
JSONArray weapon_damage = (JSONArray) item_weapon.get("weapon_damage"); |
|
|
|
JSONArray weapon_damage = (JSONArray) item_weapon.get("weapon_damage"); |
|
|
|
|
|
|
|
|
|
|
|
// Need a pojo for this or a PAIR<>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Object o : weapon_damage) { |
|
|
|
for (Object o : weapon_damage) { |
|
|
|
JSONObject damage_entry = (JSONObject) o; |
|
|
|
JSONObject damage_entry = (JSONObject) o; |
|
|
|
item_weapon_damage_type = Enum.SourceType.valueOf(((String) damage_entry.get("damage_type")).toUpperCase()); |
|
|
|
Enum.SourceType sourceType = Enum.SourceType.valueOf(((String) damage_entry.get("damage_type")).toUpperCase()); |
|
|
|
item_weapon_damage_min = ((Long) damage_entry.get("damage_min")).intValue(); |
|
|
|
int min = ((Long) damage_entry.get("damage_min")).intValue(); |
|
|
|
item_weapon_damage_max = ((Long) damage_entry.get("damage_max")).intValue(); |
|
|
|
int max = ((Long) damage_entry.get("damage_max")).intValue(); |
|
|
|
|
|
|
|
Pair<Integer, Integer> minMax = new Pair<>(min, max); // getKey = min. getValue = max.
|
|
|
|
|
|
|
|
item_weapon_damage.put(sourceType, minMax); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|