|
|
|
@ -12,7 +12,7 @@ import engine.gameManager.ConfigManager;
@@ -12,7 +12,7 @@ import engine.gameManager.ConfigManager;
|
|
|
|
|
import engine.mbEnums; |
|
|
|
|
import engine.wpak.data.ConditionEntry; |
|
|
|
|
import engine.wpak.data.Effect; |
|
|
|
|
import engine.wpak.data.EffectModifier; |
|
|
|
|
import engine.wpak.data.ModifierEntry; |
|
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
@ -116,8 +116,8 @@ public class EffectsParser {
@@ -116,8 +116,8 @@ public class EffectsParser {
|
|
|
|
|
// Iterate effect entries from .wpak config data
|
|
|
|
|
|
|
|
|
|
while (matcher.find()) { |
|
|
|
|
EffectModifier effectModifier = parseModEntry(matcher.group()); |
|
|
|
|
effect.mods.add(effectModifier); |
|
|
|
|
ModifierEntry modifierEntry = parseModEntry(matcher.group()); |
|
|
|
|
effect.mods.add(modifierEntry); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Parse Conditions
|
|
|
|
@ -148,9 +148,9 @@ public class EffectsParser {
@@ -148,9 +148,9 @@ public class EffectsParser {
|
|
|
|
|
return effect; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static EffectModifier parseModEntry(String modData) { |
|
|
|
|
private static ModifierEntry parseModEntry(String modData) { |
|
|
|
|
|
|
|
|
|
EffectModifier effectModifier = new EffectModifier(); |
|
|
|
|
ModifierEntry modifierEntry = new ModifierEntry(); |
|
|
|
|
|
|
|
|
|
String[] modEntries = modData.trim().split("\n"); |
|
|
|
|
|
|
|
|
@ -162,22 +162,22 @@ public class EffectsParser {
@@ -162,22 +162,22 @@ public class EffectsParser {
|
|
|
|
|
while (matcher.find()) |
|
|
|
|
modValues.add(matcher.group().trim()); |
|
|
|
|
|
|
|
|
|
effectModifier.type = mbEnums.ModType.valueOf(modValues.get(0).trim()); |
|
|
|
|
modifierEntry.type = mbEnums.ModType.valueOf(modValues.get(0).trim()); |
|
|
|
|
|
|
|
|
|
switch (effectModifier.type) { |
|
|
|
|
switch (modifierEntry.type) { |
|
|
|
|
case AnimOverride: |
|
|
|
|
effectModifier.min = Float.parseFloat(modValues.get(1).trim()); |
|
|
|
|
effectModifier.max = Float.parseFloat(modValues.get(2).trim()); |
|
|
|
|
modifierEntry.min = Float.parseFloat(modValues.get(1).trim()); |
|
|
|
|
modifierEntry.max = Float.parseFloat(modValues.get(2).trim()); |
|
|
|
|
break; |
|
|
|
|
case Health: |
|
|
|
|
case Mana: |
|
|
|
|
case Stamina: |
|
|
|
|
effectModifier.min = Float.parseFloat(modValues.get(1).trim()); |
|
|
|
|
effectModifier.max = Float.parseFloat(modValues.get(2).trim()); |
|
|
|
|
effectModifier.value = Float.parseFloat(modValues.get(3).trim()); |
|
|
|
|
modifierEntry.min = Float.parseFloat(modValues.get(1).trim()); |
|
|
|
|
modifierEntry.max = Float.parseFloat(modValues.get(2).trim()); |
|
|
|
|
modifierEntry.value = Float.parseFloat(modValues.get(3).trim()); |
|
|
|
|
// Parameter 4 is always 0.
|
|
|
|
|
effectModifier.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(5).trim()); |
|
|
|
|
effectModifier.arg1 = modValues.get(6).trim(); |
|
|
|
|
modifierEntry.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(5).trim()); |
|
|
|
|
modifierEntry.arg1 = modValues.get(6).trim(); |
|
|
|
|
break; |
|
|
|
|
case Attr: |
|
|
|
|
case Resistance: |
|
|
|
@ -192,12 +192,12 @@ public class EffectsParser {
@@ -192,12 +192,12 @@ public class EffectsParser {
|
|
|
|
|
case Slay: |
|
|
|
|
case Fade: |
|
|
|
|
case Durability: |
|
|
|
|
effectModifier.min = Float.parseFloat(modValues.get(1).trim()); |
|
|
|
|
effectModifier.max = Float.parseFloat(modValues.get(2).trim()); |
|
|
|
|
effectModifier.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(3).trim()); |
|
|
|
|
modifierEntry.min = Float.parseFloat(modValues.get(1).trim()); |
|
|
|
|
modifierEntry.max = Float.parseFloat(modValues.get(2).trim()); |
|
|
|
|
modifierEntry.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(3).trim()); |
|
|
|
|
|
|
|
|
|
if (modValues.size() > 4) |
|
|
|
|
effectModifier.arg1 = modValues.get(4).trim(); // Some HeathFull entries do not have an argument
|
|
|
|
|
modifierEntry.arg1 = modValues.get(4).trim(); // Some HeathFull entries do not have an argument
|
|
|
|
|
break; |
|
|
|
|
case MeleeDamageModifier: |
|
|
|
|
case OCV: |
|
|
|
@ -222,32 +222,32 @@ public class EffectsParser {
@@ -222,32 +222,32 @@ public class EffectsParser {
|
|
|
|
|
case ScanRange: |
|
|
|
|
case ScaleHeight: |
|
|
|
|
case ScaleWidth: |
|
|
|
|
effectModifier.min = Float.parseFloat(modValues.get(1).trim()); |
|
|
|
|
effectModifier.max = Float.parseFloat(modValues.get(2).trim()); |
|
|
|
|
effectModifier.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(3).trim()); |
|
|
|
|
modifierEntry.min = Float.parseFloat(modValues.get(1).trim()); |
|
|
|
|
modifierEntry.max = Float.parseFloat(modValues.get(2).trim()); |
|
|
|
|
modifierEntry.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(3).trim()); |
|
|
|
|
break; |
|
|
|
|
case ItemName: |
|
|
|
|
case BlockedPowerType: |
|
|
|
|
case ImmuneTo: |
|
|
|
|
case BlackMantle: |
|
|
|
|
effectModifier.arg1 = modValues.get(1).trim(); |
|
|
|
|
modifierEntry.arg1 = modValues.get(1).trim(); |
|
|
|
|
|
|
|
|
|
// Some BlockedPowerType entries have only one argument
|
|
|
|
|
|
|
|
|
|
if (modValues.size() > 2) |
|
|
|
|
effectModifier.arg2 = modValues.get(2).trim(); |
|
|
|
|
modifierEntry.arg2 = modValues.get(2).trim(); |
|
|
|
|
break; |
|
|
|
|
case NoMod: |
|
|
|
|
case ConstrainedAmbidexterity: |
|
|
|
|
case ProtectionFrom: |
|
|
|
|
case ExclusiveDamageCap: |
|
|
|
|
case IgnoreDamageCap: |
|
|
|
|
effectModifier.arg1 = modValues.get(1).trim(); |
|
|
|
|
modifierEntry.arg1 = modValues.get(1).trim(); |
|
|
|
|
break; |
|
|
|
|
case WeaponProc: |
|
|
|
|
effectModifier.min = Float.parseFloat(modValues.get(1).trim()); |
|
|
|
|
effectModifier.arg1 = modValues.get(2).trim(); |
|
|
|
|
effectModifier.max = Float.parseFloat(modValues.get(3).trim()); |
|
|
|
|
modifierEntry.min = Float.parseFloat(modValues.get(1).trim()); |
|
|
|
|
modifierEntry.arg1 = modValues.get(2).trim(); |
|
|
|
|
modifierEntry.max = Float.parseFloat(modValues.get(3).trim()); |
|
|
|
|
break; |
|
|
|
|
case BladeTrails: // These tags have no parms or are not parsed
|
|
|
|
|
case ImmuneToAttack: |
|
|
|
@ -268,12 +268,12 @@ public class EffectsParser {
@@ -268,12 +268,12 @@ public class EffectsParser {
|
|
|
|
|
case SeeInvisible: |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
Logger.error("Unhandled type: " + effectModifier.type); |
|
|
|
|
Logger.error("Unhandled type: " + modifierEntry.type); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return effectModifier; |
|
|
|
|
return modifierEntry; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|