Files
Server/src/engine/parsers/objects/wpak/EffectTemplate.java
T
MagicBotandClaude Opus 5.5 623f7c4ae6 Load Effects.cfg, ModTypes.cfg and CompoundCurves.cfg at world boot
CompoundCurveParser keeps every curve segment (the CompoundCurveType enum
holds one value per curve). ModTypeParser keeps each mod type's Behavior,
which decides the argument layout of a MODS line. EffectParser loads
Effects.cfg into EffectTemplate._effects: header, the four flag keys
(case-insensitive, as in the client), SOURCE lines, every MODS line in
order, and CONDITION lines. Mod layouts follow the client's ArcMod*_Parse
functions; curve names in effects and power actions must exist in
CompoundCurves.cfg. Boot order: curves, mod types, power actions, effects.
No consumers change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 11:13:26 -04:00

77 lines
2.9 KiB
Java

// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2026
// https://www.magicbane.com
package engine.parsers.objects.wpak;
import engine.mbEnums;
import java.util.ArrayList;
import java.util.HashMap;
// One EFFECTBEGIN block of Effects.cfg (client ArcEffect_ParseBlock 0x555540).
// Header: <effect_id> <effect_name> <icon>. Keys are flags; SOURCE, MODS and
// CONDITION are nested blocks, kept in file order.
//
// Read only once loaded.
public class EffectTemplate {
public static HashMap<String, EffectTemplate> _effects = new HashMap<>();
public String effect_id;
public String effect_name;
public int icon;
public boolean isitemeffect;
public boolean dontsave;
public boolean ignorenomod;
public boolean isspireeffect;
public final ArrayList<String> sources = new ArrayList<>();
public final ArrayList<ModEntry> mods = new ArrayList<>();
public final ArrayList<ConditionEntry> conditions = new ArrayList<>();
// One MODS line. Which fields are set depends on the mod type's behavior in ModTypes.cfg;
// the layouts are from the client's ArcMod*_Parse functions. args keeps the line as written.
public static class ModEntry {
public mbEnums.ModType mod_type;
public String behavior;
public final ArrayList<String> args = new ArrayList<>();
public float min_mod;
public float max_mod;
// Standard and FPSubType*: the client reads this with String::ToInt, so 16.8 acts as 16 (0x55A6C0)
public float percent_mod;
public String curve;
// The behavior's subtype: attribute, skill, damage type, source type, power type, mod type or monster type
public String type;
// SubTypeSourceType/SubTypePowerType display text, or the two ItemName strings
public String string1;
public String string2;
public String proc_power_id;
public int map_key;
public final ArrayList<Integer> map_values = new ArrayList<>();
}
// One CONDITION line: <condition> <amount> [curve] [damage type ...] (0x588320)
public static class ConditionEntry {
public mbEnums.PowerFailCondition condition;
public float amount;
public String curve;
public final ArrayList<mbEnums.DamageType> damage_types = new ArrayList<>();
}
}