diff --git a/src/org/infinity/resource/effects/BaseOpcode.java b/src/org/infinity/resource/effects/BaseOpcode.java index 6d89e7e50..b08640f59 100644 --- a/src/org/infinity/resource/effects/BaseOpcode.java +++ b/src/org/infinity/resource/effects/BaseOpcode.java @@ -139,6 +139,7 @@ public static enum EffectEntry { public static final TreeMap DURATIONS_V1_MAP = new TreeMap<>(); public static final TreeMap DURATIONS_V2_MAP = new TreeMap<>(); + public static final TreeMap AC_TYPES_MAP = new TreeMap<>(); public static final TreeMap COLOR_LOCATIONS_MAP = new TreeMap<>(); public static final TreeMap PROJECTILES_IWD_MAP = new TreeMap<>(); public static final TreeMap INC_TYPES_MAP = new TreeMap<>(); @@ -304,11 +305,6 @@ public static enum EffectEntry { "", "Black", "Blue", "Chromatic", "Gold", "Green", "Purple", "Red", "White", "Ice", "Stone", "Magenta", "Orange" }; - public static final String[] AC_TYPES = { - "All weapons", "Crushing weapons", "Missile weapons", "Piercing weapons", "Slashing weapons", - "Set base AC to value" - }; - public static final String[] DAMAGE_TYPES = { "All", "Fire damage", "Cold damage", "Electricity damage", "Acid damage", "Magic damage", "Poison damage", "Slashing damage", "Piercing damage", "Crushing damage", "Missile damage" @@ -406,6 +402,13 @@ public static enum EffectEntry { DURATIONS_V2_MAP.put(10L, "Instant/Limited (ticks)"); DURATIONS_V2_MAP.put(4096L, "Absolute duration"); + AC_TYPES_MAP.put(0x0L, "All weapons"); + AC_TYPES_MAP.put(0x1L, "Crushing weapons"); + AC_TYPES_MAP.put(0x2L, "Missile weapons"); + AC_TYPES_MAP.put(0x4L, "Piercing weapons"); + AC_TYPES_MAP.put(0x8L, "Slashing weapons"); + AC_TYPES_MAP.put(0x10L, "Set base AC to value"); + COLOR_LOCATIONS_MAP.put(0x00L, "Armor (grey): Belt/Amulet"); COLOR_LOCATIONS_MAP.put(0x01L, "Armor (teal): Minor color"); COLOR_LOCATIONS_MAP.put(0x02L, "Armor (pink): Major color"); diff --git a/src/org/infinity/resource/effects/Opcode000.java b/src/org/infinity/resource/effects/Opcode000.java index f1c227f28..5e2793630 100644 --- a/src/org/infinity/resource/effects/Opcode000.java +++ b/src/org/infinity/resource/effects/Opcode000.java @@ -10,7 +10,7 @@ import org.infinity.datatype.Bitmap; import org.infinity.datatype.Datatype; import org.infinity.datatype.DecNumber; -import org.infinity.datatype.Flag; +import org.infinity.datatype.HashBitmap; import org.infinity.resource.StructEntry; /** @@ -36,7 +36,7 @@ public Opcode000() { protected String makeEffectParamsGeneric(Datatype parent, ByteBuffer buffer, int offset, List list, boolean isVersion1) { list.add(new DecNumber(buffer, offset, 4, EFFECT_AC_VALUE)); - list.add(new Flag(buffer, offset + 4, 4, EFFECT_BONUS_TO, AC_TYPES)); + list.add(new HashBitmap(buffer, offset + 4, 4, EFFECT_BONUS_TO, AC_TYPES_MAP, false)); return null; }