DamageType defined as in JSON

This commit is contained in:
2024-04-01 12:01:59 -04:00
parent a29269e335
commit 14ee83e147
4 changed files with 120 additions and 121 deletions
+35 -36
View File
@@ -725,51 +725,50 @@ public class Enum {
}
public enum DamageType {
None,
Crush,
Slash,
Siege,
Pierce,
Magic,
Bleed,
Poison,
Mental,
Holy,
Unholy,
Lightning,
Fire,
Cold,
Healing,
Acid,
Disease,
Unknown,
NONE,
CRUSHING,
SLASHING,
SIEGE,
PIERCE,
MAGIC,
BLEEDING,
POISON,
MENTAL,
HOLY,
UNHOLY,
LIGHTNING,
FIRE,
COLD,
HEALING,
ACID,
DISEASE,
UNKNOWN,
// these added for immunities
Attack,
Powers,
Combat,
Spires,
Snare,
Stun,
Blind,
Root,
Fear,
Charm,
PowerBlock,
DeBuff,
Powerblock,
Steel,
Drain;
ATTACK,
POWERS,
COMBAT,
SPIRES,
SNARE,
STUN,
BLIND,
ROOT,
FEAR,
CHARM,
POWERBLOCK,
DEBUFF,
STEAL,
DRAIN;
public static DamageType GetDamageType(String modName) {
DamageType damageType;
if (modName.isEmpty())
return DamageType.None;
return DamageType.NONE;
try {
damageType = DamageType.valueOf(modName.replace(",", ""));
damageType = DamageType.valueOf(modName.replace(",", "").toUpperCase());
} catch (Exception e) {
Logger.error(e);
return DamageType.None;
return DamageType.NONE;
}
return damageType;
}