From e719d13c8c90cf329754b28ea53ef42719c2c5c2 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 19 Aug 2024 07:53:19 -0400 Subject: [PATCH] More PowerEntry parsing work. --- src/engine/wpak/PowersParser.java | 5 +++++ src/engine/wpak/data/PowerEntry.java | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/engine/wpak/PowersParser.java b/src/engine/wpak/PowersParser.java index 0e8a342f..aa623575 100644 --- a/src/engine/wpak/PowersParser.java +++ b/src/engine/wpak/PowersParser.java @@ -234,6 +234,11 @@ public class PowersParser { case "WEAROFFEFFECTOTHER": case "WEAROFFEFFECTSELF": break; + case "MONSTERRESTRICTS": + arguments = lineValues[1].trim().split("\\s+"); + for (String restriction : arguments) + powerEntry.monsterRestricts.add(mbEnums.MonsterType.valueOf(restriction.trim())); + break; default: Logger.error("Unhandled variable type:" + key + " for power: " + powerEntry.power_id); } diff --git a/src/engine/wpak/data/PowerEntry.java b/src/engine/wpak/data/PowerEntry.java index a6479a12..b51e26e9 100644 --- a/src/engine/wpak/data/PowerEntry.java +++ b/src/engine/wpak/data/PowerEntry.java @@ -11,6 +11,7 @@ package engine.wpak.data; import engine.mbEnums; import java.util.ArrayList; +import java.util.EnumSet; public class PowerEntry { public String power_id; @@ -49,4 +50,5 @@ public class PowerEntry { public boolean canCastWhileMoving = false; public boolean bladeTrails = false; public EquipmentPreReq equipmentPreReq; + public EnumSet monsterRestricts; }