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