Browse Source

Skills and mastery work.

combat-2
MagicBot 9 months ago
parent
commit
5e6d298ca0
  1. 26
      src/engine/objects/ItemTemplate.java

26
src/engine/objects/ItemTemplate.java

@ -105,22 +105,14 @@ public class ItemTemplate { @@ -105,22 +105,14 @@ public class ItemTemplate {
item_render_object_female = ((Long) jsonObject.get("item_render_object_female")).intValue();
item_health_full = ((Double) jsonObject.get("item_health_full")).floatValue();
Object skills_used = jsonObject.get("item_skill_used");
if (((JSONObject) jsonObject.get("item_skill_used")).containsValue(0) == false)
for (Object o : (JSONArray) jsonObject.get("item_skill_used")) {
String skilString = ((String) o).replaceAll("\\s", "");
Enum.CharacterSkills characterSkill = Enum.CharacterSkills.valueOf(skilString);
item_skill_used.add(characterSkill);
}
Object mastery_used = jsonObject.get("item_skill_mastery_used");
if ((int) mastery_used != 0)
for (Object o : (JSONArray) mastery_used) {
String masteryString = ((String) o).replaceAll("\\s", "");
Enum.CharacterSkills masterySkill = Enum.CharacterSkills.valueOf(masteryString);
item_skill_mastery_used.add(masterySkill);
}
String skills_used = (String) jsonObject.get("item_skill_used");
if (skills_used.length() > 1)
item_skill_used.add(Enum.CharacterSkills.valueOf(skills_used));
String mastery_used = (String) jsonObject.get("item_skill_mastery_used");
if (mastery_used.length() > 1)
item_skill_mastery_used.add(Enum.CharacterSkills.valueOf(mastery_used));
}
}

Loading…
Cancel
Save