Browse Source

toUppercase()

combat-2
MagicBot 9 months ago
parent
commit
1763266972
  1. 2
      src/engine/Enum.java
  2. 2
      src/engine/objects/ItemBase.java
  3. 2
      src/engine/objects/ItemTemplate.java
  4. 2
      src/engine/objects/Resists.java
  5. 2
      src/engine/powers/EffectsBase.java
  6. 2
      src/engine/powers/effectmodifiers/BlackMantleEffectModifier.java
  7. 5
      src/engine/powers/effectmodifiers/DamageShieldEffectModifier.java
  8. 4
      src/engine/powers/effectmodifiers/HealthEffectModifier.java
  9. 4
      src/engine/powers/effectmodifiers/ManaEffectModifier.java
  10. 4
      src/engine/powers/effectmodifiers/StaminaEffectModifier.java
  11. 2
      src/engine/powers/poweractions/TransferStatPowerAction.java

2
src/engine/Enum.java

@ -920,7 +920,7 @@ public class Enum {
return SourceType.NONE; return SourceType.NONE;
try { try {
returnMod = SourceType.valueOf(modName.replace(",", "")); returnMod = SourceType.valueOf(modName.replace(",", "").toUpperCase());
} catch (Exception e) { } catch (Exception e) {
Logger.error(modName); Logger.error(modName);
Logger.error(e); Logger.error(e);

2
src/engine/objects/ItemBase.java

@ -132,7 +132,7 @@ public class ItemBase {
this.requiredDiscs = DbManager.parseEnumSet(rs.getString("disc_required"), Enum.DisciplineType.class); this.requiredDiscs = DbManager.parseEnumSet(rs.getString("disc_required"), Enum.DisciplineType.class);
this.mastery = rs.getString("mastery"); this.mastery = rs.getString("mastery");
damageType = Enum.SourceType.valueOf(rs.getString("damageType")); damageType = Enum.SourceType.valueOf(rs.getString("damageType").toUpperCase());
this.twoHanded = (rs.getInt("twoHanded") == 1); this.twoHanded = (rs.getInt("twoHanded") == 1);

2
src/engine/objects/ItemTemplate.java

@ -169,7 +169,7 @@ public class ItemTemplate {
for (Object o : weapon_damage) { for (Object o : weapon_damage) {
JSONObject damage_entry = (JSONObject) o; JSONObject damage_entry = (JSONObject) o;
item_weapon_damage_type = Enum.SourceType.valueOf((String) damage_entry.get("damage_type")); item_weapon_damage_type = Enum.SourceType.valueOf(((String) damage_entry.get("damage_type")).toUpperCase());
item_weapon_damage_min = ((Long) damage_entry.get("damage_min")).intValue(); item_weapon_damage_min = ((Long) damage_entry.get("damage_min")).intValue();
item_weapon_damage_max = ((Long) damage_entry.get("damage_max")).intValue(); item_weapon_damage_max = ((Long) damage_entry.get("damage_max")).intValue();
} }

2
src/engine/objects/Resists.java

@ -136,7 +136,7 @@ public class Resists {
//Test if Damagetype is valid for foritude //Test if Damagetype is valid for foritude
private static boolean isValidDamageCapType(HashSet<SourceType> forts, SourceType damageType, boolean exclusive) { private static boolean isValidDamageCapType(HashSet<SourceType> forts, SourceType damageType, boolean exclusive) {
for (SourceType fort : forts) { for (SourceType fort : forts) {
SourceType dt = SourceType.valueOf(fort.name()); SourceType dt = SourceType.valueOf(fort.name().toUpperCase());
if (dt == SourceType.NONE) if (dt == SourceType.NONE)
continue; continue;

2
src/engine/powers/EffectsBase.java

@ -285,7 +285,7 @@ public class EffectsBase {
if (name.isEmpty()) if (name.isEmpty())
return null; return null;
else else
return Enum.SourceType.valueOf(name); return Enum.SourceType.valueOf(name.toUpperCase());
} }

2
src/engine/powers/effectmodifiers/BlackMantleEffectModifier.java

@ -33,7 +33,7 @@ public class BlackMantleEffectModifier extends AbstractEffectModifier {
@Override @Override
public void applyBonus(AbstractCharacter ac, int trains) { public void applyBonus(AbstractCharacter ac, int trains) {
PlayerBonuses bonus = ac.getBonuses(); PlayerBonuses bonus = ac.getBonuses();
SourceType sourceType = SourceType.valueOf(this.type); SourceType sourceType = SourceType.valueOf(this.type.toUpperCase());
if (sourceType == null) { if (sourceType == null) {
Logger.error("Bad Source Type for " + this.type); Logger.error("Bad Source Type for " + this.type);

5
src/engine/powers/effectmodifiers/DamageShieldEffectModifier.java

@ -48,11 +48,14 @@ public class DamageShieldEffectModifier extends AbstractEffectModifier {
amount *= (1 + mod); amount *= (1 + mod);
} }
Enum.SourceType dt = Enum.SourceType.valueOf(this.type); Enum.SourceType dt = Enum.SourceType.valueOf(this.type.toUpperCase());
if (dt != null) { if (dt != null) {
DamageShield ds = new DamageShield(dt, amount, usePercent); DamageShield ds = new DamageShield(dt, amount, usePercent);
PlayerBonuses bonus = ac.getBonuses(); PlayerBonuses bonus = ac.getBonuses();
if (bonus != null) if (bonus != null)
bonus.addDamageShield(this, ds); bonus.addDamageShield(this, ds);
} }

4
src/engine/powers/effectmodifiers/HealthEffectModifier.java

@ -33,10 +33,10 @@ public class HealthEffectModifier extends AbstractEffectModifier {
super(rs); super(rs);
String damageTypeDB = rs.getString("type"); String damageTypeDB = rs.getString("type");
try { try {
this.damageType = SourceType.valueOf(damageTypeDB); this.damageType = SourceType.valueOf(damageTypeDB.toUpperCase());
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
Logger.error("DamageType could not be loaded from database. " + "UUID = " + this.UUID Logger.error("DamageType could not be loaded from database. " + "UUID = " + this.UUID
+ " value received = '" + damageTypeDB + '\'', e); + " value received = '" + damageTypeDB.toUpperCase() + '\'', e);
} }
} }

4
src/engine/powers/effectmodifiers/ManaEffectModifier.java

@ -37,10 +37,10 @@ public class ManaEffectModifier extends AbstractEffectModifier {
super(rs); super(rs);
String damageTypeDB = rs.getString("type"); String damageTypeDB = rs.getString("type");
try { try {
this.damageType = SourceType.valueOf(damageTypeDB); this.damageType = SourceType.valueOf(damageTypeDB.toUpperCase());
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
Logger.error("DamageType could not be loaded from database. " + "UUID = " + this.UUID Logger.error("DamageType could not be loaded from database. " + "UUID = " + this.UUID
+ " value received = '" + damageTypeDB + '\'', e); + " value received = '" + damageTypeDB.toUpperCase() + '\'', e);
} }
} }

4
src/engine/powers/effectmodifiers/StaminaEffectModifier.java

@ -37,10 +37,10 @@ public class StaminaEffectModifier extends AbstractEffectModifier {
super(rs); super(rs);
String damageTypeDB = rs.getString("type"); String damageTypeDB = rs.getString("type");
try { try {
this.damageType = SourceType.valueOf(damageTypeDB); this.damageType = SourceType.valueOf(damageTypeDB.toUpperCase());
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
Logger.error("DamageType could not be loaded from database. " + "UUID = " + this.UUID Logger.error("DamageType could not be loaded from database. " + "UUID = " + this.UUID
+ " value received = '" + damageTypeDB + '\'', e); + " value received = '" + damageTypeDB.toUpperCase() + '\'', e);
} }
} }

2
src/engine/powers/poweractions/TransferStatPowerAction.java

@ -79,7 +79,7 @@ public class TransferStatPowerAction extends AbstractPowerAction {
// Damage type can sometimes be null in the DB. // Damage type can sometimes be null in the DB.
if (damageString.isEmpty() == false) if (damageString.isEmpty() == false)
this.damageType = SourceType.valueOf(damageString); this.damageType = SourceType.valueOf(damageString.toUpperCase());
} catch (Exception e) { } catch (Exception e) {
this.damageType = null; this.damageType = null;
} }

Loading…
Cancel
Save