Browse Source

Values parsed as behaviourtype enumset

combat-2
MagicBot 9 months ago
parent
commit
46f3850e93
  1. 16
      src/engine/objects/ItemTemplate.java

16
src/engine/objects/ItemTemplate.java

@ -121,8 +121,10 @@ public class ItemTemplate { @@ -121,8 +121,10 @@ public class ItemTemplate {
public boolean rune_group_is_guild = false;
public String rune_dsc;
public String rune_fx_txt;
public int rune_group_tactics;
public int rune_group_role_set;
public EnumSet<Enum.MobBehaviourType> rune_group_tactics = EnumSet.noneOf(Enum.MobBehaviourType.class);
;
public EnumSet<Enum.MobBehaviourType> rune_group_role_set = EnumSet.noneOf(Enum.MobBehaviourType.class);
;
public boolean rune_renderable = false;
public int rune_natural_power_attack;
public final HashMap<String, String> rune_sparse_data = new HashMap<>();
@ -492,14 +494,12 @@ public class ItemTemplate { @@ -492,14 +494,12 @@ public class ItemTemplate {
rune_group_is_guild = ((Boolean) rune_group.get("group_is_guild"));
rune_dsc = (String) jsonObject.get("rune_dsc");
rune_fx_txt = (String) jsonObject.get("rune_fx_txt");
rune_group_tactics = ((Long) jsonObject.get("rune_group_tactics")).intValue();
EnumSet<Enum.MobBehaviourType> tactics = EnumSet.noneOf(Enum.MobBehaviourType.class);
int group_tactics_bitvector = ((Long) jsonObject.get("rune_group_tactics")).intValue();
rune_group_tactics.addAll(Enum.fromLong(group_tactics_bitvector, Enum.MobBehaviourType.class));
if (rune_group_tactics != 0)
tactics.addAll(Enum.fromLong(rune_group_tactics, Enum.MobBehaviourType.class));
rune_group_role_set = ((Long) jsonObject.get("rune_group_role_set")).intValue();
int group_role_bitvector = ((Long) jsonObject.get("rune_group_role_set")).intValue();
rune_group_role_set.addAll(Enum.fromLong(group_role_bitvector, Enum.MobBehaviourType.class));
JSONArray enemy_types_json = (JSONArray) jsonObject.get("rune_enemy_monster_types");

Loading…
Cancel
Save