Browse Source

EffectDescription refactored out.

feature-config-parsing2
MagicBot 3 months ago
parent
commit
f4fc7fc75b
  1. 12
      src/engine/gameManager/PowersManager.java
  2. 7
      src/engine/powers/EffectsBase.java
  3. 38
      src/engine/wpak/EffectsParser.java
  4. 136
      src/engine/wpak/PowerActionParser.java
  5. 10
      src/engine/wpak/PowersParser.java
  6. 11
      src/engine/wpak/data/Effect.java
  7. 18
      src/engine/wpak/data/EffectDescription.java
  8. 6
      src/engine/wpak/data/Power.java
  9. 4
      src/engine/wpak/data/PowerAction.java

12
src/engine/gameManager/PowersManager.java

@ -34,7 +34,7 @@ import engine.server.MBServerStatics; @@ -34,7 +34,7 @@ import engine.server.MBServerStatics;
import engine.wpak.EffectsParser;
import engine.wpak.PowerActionParser;
import engine.wpak.PowersParser;
import engine.wpak.data.EffectEntry;
import engine.wpak.data.Effect;
import org.pmw.tinylog.Logger;
import java.util.ArrayList;
@ -120,7 +120,7 @@ public enum PowersManager { @@ -120,7 +120,7 @@ public enum PowersManager {
// Add EffectsBase
ArrayList<EffectsBase> effectList = new ArrayList<>();
for (EffectEntry entry : EffectsParser.effect_data.values()) {
for (Effect entry : EffectsParser.effect_data.values()) {
EffectsBase effectBase = new EffectsBase(entry);
effectList.add(effectBase);
PowersManager.effectsBaseByToken.put(effectBase.getToken(), effectBase);
@ -981,7 +981,7 @@ public enum PowersManager { @@ -981,7 +981,7 @@ public enum PowersManager {
// if (!stackType.equals("IgnoreStack")) {
if (target.getEffects().containsKey(stackType)) {
// remove any existing power that overrides
Effect ef = target.getEffects().get(stackType);
engine.objects.Effect ef = target.getEffects().get(stackType);
AbstractEffectJob effect = null;
if (ef != null) {
JobContainer jc = ef.getJobContainer();
@ -1153,7 +1153,7 @@ public enum PowersManager { @@ -1153,7 +1153,7 @@ public enum PowersManager {
// if (!stackType.equals("IgnoreStack")) {
if (target.getEffects().containsKey(stackType)) {
// remove any existing power that overrides
Effect ef = target.getEffects().get(stackType);
engine.objects.Effect ef = target.getEffects().get(stackType);
AbstractEffectJob effect = null;
if (ef != null) {
JobContainer jc = ef.getJobContainer();
@ -1467,7 +1467,7 @@ public enum PowersManager { @@ -1467,7 +1467,7 @@ public enum PowersManager {
stackType = (stackType.equals("IgnoreStack")) ? Integer.toString(ab.getUUID()) : stackType;
if (target.getEffects().containsKey(stackType)) {
// remove any existing power that overrides
Effect ef = target.getEffects().get(stackType);
engine.objects.Effect ef = target.getEffects().get(stackType);
AbstractEffectJob effect = null;
if (ef != null) {
JobContainer jc = ef.getJobContainer();
@ -1914,7 +1914,7 @@ public enum PowersManager { @@ -1914,7 +1914,7 @@ public enum PowersManager {
stackType = (stackType.equals("IgnoreStack")) ? Integer
.toString(toRemove.getUUID()) : stackType;
if (fromChant) {
Effect eff = awo.getEffects().get(stackType);
engine.objects.Effect eff = awo.getEffects().get(stackType);
if (eff != null)
eff.cancelJob(true);
} else

7
src/engine/powers/EffectsBase.java

@ -26,12 +26,11 @@ import engine.net.client.ClientConnection; @@ -26,12 +26,11 @@ import engine.net.client.ClientConnection;
import engine.net.client.msg.ApplyEffectMsg;
import engine.objects.AbstractCharacter;
import engine.objects.AbstractWorldObject;
import engine.objects.Effect;
import engine.objects.PlayerCharacter;
import engine.powers.effectmodifiers.AbstractEffectModifier;
import engine.server.MBServerStatics;
import engine.util.Hasher;
import engine.wpak.data.EffectEntry;
import engine.wpak.data.Effect;
import org.pmw.tinylog.Logger;
import java.sql.Connection;
@ -94,7 +93,7 @@ public class EffectsBase { @@ -94,7 +93,7 @@ public class EffectsBase {
}
//EffectEntry constructor
public EffectsBase(EffectEntry entry) {
public EffectsBase(Effect entry) {
this.IDString = entry.effect_id;
this.name = entry.effect_name;
this.token = Hasher.SBStringHash(entry.effect_name);
@ -433,7 +432,7 @@ public class EffectsBase { @@ -433,7 +432,7 @@ public class EffectsBase {
float duration = ab.getDurationInSeconds(trains);
if (pb.getToken() == 1672601862) {
Effect eff = awo.getEffects().get("DeathShroud");
engine.objects.Effect eff = awo.getEffects().get("DeathShroud");
if (eff != null) {

38
src/engine/wpak/EffectsParser.java

@ -11,7 +11,7 @@ package engine.wpak; @@ -11,7 +11,7 @@ package engine.wpak;
import engine.gameManager.ConfigManager;
import engine.mbEnums;
import engine.wpak.data.ConditionEntry;
import engine.wpak.data.EffectEntry;
import engine.wpak.data.Effect;
import engine.wpak.data.EffectModifier;
import org.pmw.tinylog.Logger;
@ -25,7 +25,7 @@ import java.util.regex.Pattern; @@ -25,7 +25,7 @@ import java.util.regex.Pattern;
public class EffectsParser {
public static String effectsPath = ConfigManager.DEFAULT_DATA_DIR + "wpak/Effects.cfg";
public static HashMap<String, EffectEntry> effect_data = new HashMap<>();
public static HashMap<String, Effect> effect_data = new HashMap<>();
private static final Pattern EFFECT_REGEX = Pattern.compile("(?<=EFFECTBEGIN)(.+?)(?=EFFECTEND)", Pattern.DOTALL);
private static final Pattern SOURCE_REGEX = Pattern.compile("(?<=SOURCEBEGIN)(.+?)(?=SOURCEEND)", Pattern.DOTALL);
private static final Pattern MODS_REGEX = Pattern.compile("(?<=MODSBEGIN)(.+?)(?=MODSEND)", Pattern.DOTALL);
@ -51,21 +51,21 @@ public class EffectsParser { @@ -51,21 +51,21 @@ public class EffectsParser {
Matcher matcher = EFFECT_REGEX.matcher(fileContents);
while (matcher.find()) {
EffectEntry effectEntry = parseEffectEntry(matcher.group());
effect_data.put(effectEntry.effect_id, effectEntry);
Effect effect = parseEffectEntry(matcher.group());
effect_data.put(effect.effect_id, effect);
}
}
private static EffectEntry parseEffectEntry(String effectData) {
private static Effect parseEffectEntry(String effectData) {
EffectEntry effectEntry = new EffectEntry();
Effect effect = new Effect();
// Parse fields that lie outside the other tags
effectEntry.isItemEffect = effectData.contains("IsItemEffect");
effectEntry.isSpireEffect = effectData.contains("IsSpireEffect");
effectEntry.ignoreNoMod = effectData.contains("IgnoreNoMod");
effectEntry.dontSave = effectData.contains("DontSave");
effect.isItemEffect = effectData.contains("IsItemEffect");
effect.isSpireEffect = effectData.contains("IsSpireEffect");
effect.ignoreNoMod = effectData.contains("IgnoreNoMod");
effect.dontSave = effectData.contains("DontSave");
// Remove all lines that contain a # and leading/trailing blank lines
@ -90,24 +90,24 @@ public class EffectsParser { @@ -90,24 +90,24 @@ public class EffectsParser {
while (matcher.find())
effectHeader.add(matcher.group().trim());
effectEntry.effect_id = effectHeader.get(0);
effectEntry.effect_name = effectHeader.get(1);
effectEntry.effect_name = effectEntry.effect_name.replaceAll("\"", "");
effect.effect_id = effectHeader.get(0);
effect.effect_name = effectHeader.get(1);
effect.effect_name = effect.effect_name.replaceAll("\"", "");
// Some effect mods have no icon
// (SEEINVIS-SHADE "See Invis")
if (effectHeader.size() == 3)
effectEntry.icon = Integer.parseInt(effectHeader.get(2));
effect.icon = Integer.parseInt(effectHeader.get(2));
else
effectEntry.icon = 0;
effect.icon = 0;
// Parse source entries
matcher = SOURCE_REGEX.matcher(effectData);
while (matcher.find())
effectEntry.sources.add(matcher.group().trim());
effect.sources.add(matcher.group().trim());
// Parse modifier entries
@ -117,7 +117,7 @@ public class EffectsParser { @@ -117,7 +117,7 @@ public class EffectsParser {
while (matcher.find()) {
EffectModifier effectModifier = parseModEntry(matcher.group());
effectEntry.mods.add(effectModifier);
effect.mods.add(effectModifier);
}
// Parse Conditions
@ -141,11 +141,11 @@ public class EffectsParser { @@ -141,11 +141,11 @@ public class EffectsParser {
while (iterator.hasNext())
conditionEntry.damageTypes.add(mbEnums.DamageType.valueOf(iterator.next().toUpperCase()));
effectEntry.conditions.add(conditionEntry);
effect.conditions.add(conditionEntry);
}
}
return effectEntry;
return effect;
}
private static EffectModifier parseModEntry(String modData) {

136
src/engine/wpak/PowerActionParser.java

@ -10,8 +10,8 @@ package engine.wpak; @@ -10,8 +10,8 @@ package engine.wpak;
import engine.gameManager.ConfigManager;
import engine.mbEnums;
import engine.wpak.data.EffectDescription;
import engine.wpak.data.PowerActionEntry;
import engine.wpak.data.Effect;
import engine.wpak.data.PowerAction;
import engine.wpak.data.StatTransfer;
import engine.wpak.data.TrackEntry;
import org.pmw.tinylog.Logger;
@ -51,15 +51,15 @@ public class PowerActionParser { @@ -51,15 +51,15 @@ public class PowerActionParser {
while (matcher.find()) {
PowerActionEntry powerActionEntry = parsePowerActionEntry(matcher.group().trim());
PowerAction powerAction = parsePowerActionEntry(matcher.group().trim());
}
}
private static PowerActionEntry parsePowerActionEntry(String powerActionData) {
private static PowerAction parsePowerActionEntry(String powerActionData) {
PowerActionEntry powerActionEntry = new PowerActionEntry();
EffectDescription effectDescription;
PowerAction powerAction = new PowerAction();
Effect effect;
StatTransfer statTransfer;
TrackEntry trackEntry;
@ -81,34 +81,34 @@ public class PowerActionParser { @@ -81,34 +81,34 @@ public class PowerActionParser {
headerData.add(matcher.group().trim());
Iterator<String> headerIterator = headerData.iterator();
powerActionEntry.action_id = headerIterator.next();
powerActionEntry.action_type = headerIterator.next();
powerAction.action_id = headerIterator.next();
powerAction.action_type = headerIterator.next();
switch (powerActionEntry.action_type) {
switch (powerAction.action_type) {
case "RemoveEffect":
effectDescription = new EffectDescription();
effectDescription.effect_id = headerIterator.next();
powerActionEntry.effects.add(effectDescription);
effect = new Effect();
effect.effect_id = headerIterator.next();
powerAction.effects.add(effect);
break;
case "CreateMob":
powerActionEntry.petLevel = Integer.parseInt(headerIterator.next());
powerActionEntry.petRace = Integer.parseInt(headerIterator.next());
powerAction.petLevel = Integer.parseInt(headerIterator.next());
powerAction.petRace = Integer.parseInt(headerIterator.next());
break;
case "DamageOverTime":
effectDescription = new EffectDescription();
effectDescription.effect_id = headerIterator.next();
effectDescription.cycleDuration = Integer.parseInt(headerIterator.next());
effectDescription.cycleDelay = Integer.parseInt(headerIterator.next());
powerActionEntry.effects.add(effectDescription);
effect = new Effect();
effect.effect_id = headerIterator.next();
effect.cycleDuration = Integer.parseInt(headerIterator.next());
effect.cycleDelay = Integer.parseInt(headerIterator.next());
powerAction.effects.add(effect);
break;
case "ApplyEffects":
int level = Integer.parseInt(headerIterator.next());
while (headerIterator.hasNext()) {
effectDescription = new EffectDescription();
effectDescription.level = level;
effectDescription.effect_id = headerIterator.next();
powerActionEntry.effects.add(effectDescription);
effect = new Effect();
effect.level = level;
effect.effect_id = headerIterator.next();
powerAction.effects.add(effect);
}
break;
case "Transform":
@ -118,15 +118,15 @@ public class PowerActionParser { @@ -118,15 +118,15 @@ public class PowerActionParser {
case "DirectDamage":
case "SpireDisable":
while (headerIterator.hasNext()) {
effectDescription = new EffectDescription();
effectDescription.effect_id = headerIterator.next();
effect = new Effect();
effect.effect_id = headerIterator.next();
// Some applyEffect entries are naked withot a level
if (headerData.size() > 3)
effectDescription.level = Integer.parseInt(headerIterator.next());
effect.level = Integer.parseInt(headerIterator.next());
powerActionEntry.effects.add(effectDescription);
powerAction.effects.add(effect);
}
break;
case "TransferStat":
@ -139,7 +139,7 @@ public class PowerActionParser { @@ -139,7 +139,7 @@ public class PowerActionParser {
statTransfer.toCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
statTransfer.fromStatBool = Boolean.parseBoolean(headerIterator.next());
statTransfer.toStatBool = Boolean.parseBoolean(headerIterator.next());
powerActionEntry.statTransfer = statTransfer;
powerAction.statTransfer = statTransfer;
break;
case "TransferStatOT":
statTransfer = new StatTransfer();
@ -153,26 +153,26 @@ public class PowerActionParser { @@ -153,26 +153,26 @@ public class PowerActionParser {
statTransfer.toStatBool = Boolean.parseBoolean(headerIterator.next());
statTransfer.transfer_action = headerIterator.next();
statTransfer.transfer_ticks = Integer.parseInt(headerIterator.next());
powerActionEntry.statTransfer = statTransfer;
powerAction.statTransfer = statTransfer;
break;
case "Charm":
effectDescription = new EffectDescription();
effectDescription.effect_id = headerIterator.next();
effectDescription.level = Integer.parseInt(headerIterator.next());
effectDescription.type = headerIterator.next();
powerActionEntry.effects.add(effectDescription);
effect = new Effect();
effect.effect_id = headerIterator.next();
effect.level = Integer.parseInt(headerIterator.next());
effect.type = headerIterator.next();
powerAction.effects.add(effect);
break;
case "Block":
effectDescription = new EffectDescription();
effectDescription.effect_id = headerIterator.next();
effectDescription.level = Integer.parseInt(headerIterator.next());
powerActionEntry.effects.add(effectDescription);
effect = new Effect();
effect.effect_id = headerIterator.next();
effect.level = Integer.parseInt(headerIterator.next());
powerAction.effects.add(effect);
break;
case "Resurrect":
powerActionEntry.levelCap = Integer.parseInt(headerIterator.next());
powerAction.levelCap = Integer.parseInt(headerIterator.next());
break;
case "SetItemFlag":
powerActionEntry.itemFlag = mbEnums.ItemFlags.valueOf(headerIterator.next());
powerAction.itemFlag = mbEnums.ItemFlags.valueOf(headerIterator.next());
break;
case "Track":
trackEntry = new TrackEntry();
@ -182,7 +182,7 @@ public class PowerActionParser { @@ -182,7 +182,7 @@ public class PowerActionParser {
trackEntry.type = headerIterator.next();
trackEntry.min = Integer.parseInt(headerIterator.next());
trackEntry.max = Integer.parseInt(headerIterator.next());
powerActionEntry.trackEntry = trackEntry;
powerAction.trackEntry = trackEntry;
break;
case "Recall": // No arguments for these tags or not parsed
case "Summon":
@ -198,7 +198,7 @@ public class PowerActionParser { @@ -198,7 +198,7 @@ public class PowerActionParser {
case "Steal":
break;
default:
Logger.error("Unhandled type " + powerActionEntry.action_type + " for Pow4erAction: " + powerActionEntry.action_id);
Logger.error("Unhandled type " + powerAction.action_type + " for Pow4erAction: " + powerAction.action_id);
break;
}
@ -215,81 +215,81 @@ public class PowerActionParser { @@ -215,81 +215,81 @@ public class PowerActionParser {
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
for (String bodyPart : arguments)
powerActionEntry.bodyparts.add(Integer.parseInt(bodyPart));
powerAction.bodyparts.add(Integer.parseInt(bodyPart));
break;
case "FEMALEBODYPARTS":
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
for (String bodyPart : arguments)
powerActionEntry.femaleBodyParts.add(Integer.parseInt(bodyPart));
powerAction.femaleBodyParts.add(Integer.parseInt(bodyPart));
break;
case "SCALEFACTOR":
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
for (String scaleFactor : arguments)
powerActionEntry.scaleFactor.add(Float.parseFloat(scaleFactor));
powerAction.scaleFactor.add(Float.parseFloat(scaleFactor));
break;
case "ISRESISTABLE":
powerActionEntry.isResistible = Boolean.parseBoolean(lineValues.get(1).trim());
powerAction.isResistible = Boolean.parseBoolean(lineValues.get(1).trim());
break;
case "ISAGGRESSIVE":
powerActionEntry.isAggressive = Boolean.parseBoolean(lineValues.get(1).trim());
powerAction.isAggressive = Boolean.parseBoolean(lineValues.get(1).trim());
break;
case "BLADETRAILS":
powerActionEntry.bladeTrails = Boolean.parseBoolean(lineValues.get(1).trim());
powerAction.bladeTrails = Boolean.parseBoolean(lineValues.get(1).trim());
break;
case "SHOULDSHOWWEAPONS":
powerActionEntry.shouldShowWeapons = Boolean.parseBoolean(lineValues.get(1).trim());
powerAction.shouldShowWeapons = Boolean.parseBoolean(lineValues.get(1).trim());
break;
case "SHOULDSHOWARMOR":
powerActionEntry.shouldShowArmor = Boolean.parseBoolean(lineValues.get(1).trim());
powerAction.shouldShowArmor = Boolean.parseBoolean(lineValues.get(1).trim());
break;
case "APPLYEFFECTBLANK":
powerActionEntry.applyEffectBlank = Boolean.parseBoolean(lineValues.get(1).trim());
powerAction.applyEffectBlank = Boolean.parseBoolean(lineValues.get(1).trim());
break;
case "WEAROFFEFFECTBLANK":
powerActionEntry.wearOffEffectBlank = Boolean.parseBoolean(lineValues.get(1).trim());
powerAction.wearOffEffectBlank = Boolean.parseBoolean(lineValues.get(1).trim());
break;
case "ATTACKANIMS":
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
for (String animation : arguments)
powerActionEntry.attackAnimations.add(Integer.parseInt(animation));
powerAction.attackAnimations.add(Integer.parseInt(animation));
break;
case "REMOVEALL":
powerActionEntry.removeAll = Boolean.parseBoolean(lineValues.get(1).trim());
powerAction.removeAll = Boolean.parseBoolean(lineValues.get(1).trim());
break;
case "EFFECTID":
effectDescription = new EffectDescription();
effectDescription.effect_id = lineValues.get(1).trim();
powerActionEntry.effects.add(effectDescription);
effect = new Effect();
effect.effect_id = lineValues.get(1).trim();
powerAction.effects.add(effect);
break;
case "LEVELCAP":
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
powerActionEntry.levelCap = Integer.parseInt(arguments.get(0));
powerAction.levelCap = Integer.parseInt(arguments.get(0));
if (arguments.size() > 1) // Not all level caps have a curve
powerActionEntry.levelCurve = mbEnums.CompoundCurveType.valueOf(arguments.get(1));
powerAction.levelCurve = mbEnums.CompoundCurveType.valueOf(arguments.get(1));
break;
case "CLEARAGGRO":
powerActionEntry.clearAggro = Boolean.parseBoolean(lineValues.get(1).trim());
powerAction.clearAggro = Boolean.parseBoolean(lineValues.get(1).trim());
break;
case "TARGETBECOMESPET":
powerActionEntry.targetBecomesPet = Boolean.parseBoolean(lineValues.get(1).trim());
powerAction.targetBecomesPet = Boolean.parseBoolean(lineValues.get(1).trim());
break;
case "DESTROYOLDPET":
powerActionEntry.destroyOldPet = Boolean.parseBoolean(lineValues.get(1).trim());
powerAction.destroyOldPet = Boolean.parseBoolean(lineValues.get(1).trim());
break;
case "DAMAGETYPE":
powerActionEntry.damageType = mbEnums.DamageType.valueOf(lineValues.get(1).trim().toUpperCase());
powerAction.damageType = mbEnums.DamageType.valueOf(lineValues.get(1).trim().toUpperCase());
break;
case "ROOTFSMID":
powerActionEntry.rootFsmID = mbEnums.MobBehaviourType.valueOf(lineValues.get(1).trim());
powerAction.rootFsmID = mbEnums.MobBehaviourType.valueOf(lineValues.get(1).trim());
break;
case "SPLASHDAMAGE":
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
powerActionEntry.splashDamageMin = Integer.parseInt(arguments.get(0));
powerActionEntry.splashDamageMax = Integer.parseInt(arguments.get(1));
powerAction.splashDamageMin = Integer.parseInt(arguments.get(0));
powerAction.splashDamageMax = Integer.parseInt(arguments.get(1));
break;
case "APPLYEFFECTOTHER":
case "APPLYEFFECTSELF":
@ -297,9 +297,9 @@ public class PowerActionParser { @@ -297,9 +297,9 @@ public class PowerActionParser {
case "WEAROFFEFFECTSELF":
break;
default:
Logger.error("Unhandled variable type:" + key + " for powerAction: " + powerActionEntry.action_id);
Logger.error("Unhandled variable type:" + key + " for powerAction: " + powerAction.action_id);
}
}
return powerActionEntry;
return powerAction;
}
}

10
src/engine/wpak/PowersParser.java

@ -49,14 +49,14 @@ public class PowersParser { @@ -49,14 +49,14 @@ public class PowersParser {
while (matcher.find()) {
PowerEntry powerEntry = parsePowerEntry(matcher.group().trim());
Power power = parsePowerEntry(matcher.group().trim());
}
}
private static PowerEntry parsePowerEntry(String powerData) {
private static Power parsePowerEntry(String powerData) {
PowerEntry powerEntry = new PowerEntry();
Power powerEntry = new Power();
StringBuilder conditionBuilder = new StringBuilder();
StringBuilder powerBuilder = new StringBuilder();
String conditionString;
@ -222,7 +222,7 @@ public class PowersParser { @@ -222,7 +222,7 @@ public class PowersParser {
powerEntry.bladeTrails = Boolean.parseBoolean(lineValues.get(1).trim());
break;
case "EFFECTPREREQ":
EffectDescription effectPreReq = new EffectDescription();
Effect effectPreReq = new Effect();
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
effectPreReq.effect_id = arguments.get(9);
effectPreReq.level = Integer.parseInt(arguments.get(1));
@ -268,7 +268,7 @@ public class PowersParser { @@ -268,7 +268,7 @@ public class PowersParser {
powerEntry.casterPulseParticle = Integer.parseInt(lineValues.get(1).trim());
break;
case "TARGETEFFECTPREREQS_ORED":
EffectDescription preReq = new EffectDescription();
Effect preReq = new Effect();
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
preReq.effect_id = arguments.get(0);
preReq.level = Integer.parseInt(arguments.get(1));

11
src/engine/wpak/data/EffectEntry.java → src/engine/wpak/data/Effect.java

@ -11,7 +11,7 @@ package engine.wpak.data; @@ -11,7 +11,7 @@ package engine.wpak.data;
import java.util.ArrayList;
import java.util.HashSet;
public class EffectEntry {
public class Effect {
public String effect_id;
public String effect_name;
public int icon;
@ -19,8 +19,17 @@ public class EffectEntry { @@ -19,8 +19,17 @@ public class EffectEntry {
public ArrayList<EffectModifier> mods = new ArrayList<>();
public ArrayList<ConditionEntry> conditions = new ArrayList<>();
// Additional variables outside of tags or parsed
// elsewhere from Effects.cfg
public boolean isItemEffect;
public boolean isSpireEffect;
public boolean ignoreNoMod;
public boolean dontSave;
public String type;
public int level;
public String message;
public int cycleDuration;
public int cycleDelay;
}

18
src/engine/wpak/data/EffectDescription.java

@ -1,18 +0,0 @@ @@ -1,18 +0,0 @@
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2024
// www.magicbane.com
package engine.wpak.data;
public class EffectDescription {
public String effect_id;
public String type;
public int level;
public String message;
public int cycleDuration;
public int cycleDelay;
}

6
src/engine/wpak/data/PowerEntry.java → src/engine/wpak/data/Power.java

@ -14,7 +14,7 @@ import java.util.ArrayList; @@ -14,7 +14,7 @@ import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
public class PowerEntry {
public class Power {
public String power_id;
public String power;
public ArrayList<PowerData> powers = new ArrayList<>();
@ -49,7 +49,7 @@ public class PowerEntry { @@ -49,7 +49,7 @@ public class PowerEntry {
public String category;
public boolean canCastWhileMoving = false;
public boolean bladeTrails = false;
public ArrayList<EffectDescription> effectPreReqs = new ArrayList<>();
public ArrayList<Effect> effectPreReqs = new ArrayList<>();
public ArrayList<EquipmentPreReq> equipmentPreReq = new ArrayList<>();
public EnumSet<mbEnums.MonsterType> monsterRestricts = EnumSet.noneOf(mbEnums.MonsterType.class);
public EnumSet<mbEnums.MonsterType> monsterPrereqs = EnumSet.noneOf(mbEnums.MonsterType.class);
@ -61,7 +61,7 @@ public class PowerEntry { @@ -61,7 +61,7 @@ public class PowerEntry {
public int maxPlayerTargets;
public boolean isAdminPower = false;
public int casterPulseParticle;
public ArrayList<EffectDescription> targetEffectPrereqs = new ArrayList<>();
public ArrayList<Effect> targetEffectPrereqs = new ArrayList<>();
public boolean canCastWhileFlying = false;
public boolean isProjectile = false;
public HashMap<String, Float> conditions = new HashMap<>();

4
src/engine/wpak/data/PowerActionEntry.java → src/engine/wpak/data/PowerAction.java

@ -12,13 +12,13 @@ import engine.mbEnums; @@ -12,13 +12,13 @@ import engine.mbEnums;
import java.util.ArrayList;
public class PowerActionEntry {
public class PowerAction {
// Header values
public String action_id;
public String action_type;
public ArrayList<EffectDescription> effects = new ArrayList<>();
public ArrayList<Effect> effects = new ArrayList<>();
public int petLevel;
public int petRace;
public StatTransfer statTransfer;
Loading…
Cancel
Save