Initial refactor of damagetype

This commit is contained in:
2024-04-01 09:19:37 -04:00
parent adfbf87056
commit a29269e335
32 changed files with 447 additions and 380 deletions
@@ -188,7 +188,7 @@ public class ApplyEffectPowerAction extends AbstractPowerAction {
if (bonuses == null)
return;
boolean noSilence = bonuses.getBool(ModType.Silenced, SourceType.NONE);
boolean noSilence = bonuses.getBool(ModType.Silenced, SourceType.None);
if (noSilence)
return;
@@ -44,7 +44,7 @@ public class TransferStatPowerAction extends AbstractPowerAction {
protected float transferEfficiencyRamp;
protected boolean transferEfficiencyRampAdd;
protected boolean targetToCaster;
protected SourceType damageType;
protected Enum.DamageType damageType;
protected EffectsBase effect;
public TransferStatPowerAction(ResultSet rs, HashMap<String, EffectsBase> effects) throws SQLException {
@@ -78,7 +78,7 @@ public class TransferStatPowerAction extends AbstractPowerAction {
// Damage type can sometimes be null in the DB.
if (damageString.isEmpty() == false)
this.damageType = SourceType.valueOf(damageString.toUpperCase());
this.damageType = Enum.DamageType.valueOf(damageString);
} catch (Exception e) {
this.damageType = null;
}
@@ -210,7 +210,7 @@ public class TransferStatPowerAction extends AbstractPowerAction {
// Apply any power effect modifiers (such as stances)
PlayerBonuses bonus = source.getBonuses();
if (bonus != null)
damage *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.NONE));
damage *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None));
//get amount to transfer
fromAmount = damage;
@@ -236,7 +236,7 @@ public class TransferStatPowerAction extends AbstractPowerAction {
AbstractNetMsg mhmFrom = null;
//stop if target is immune to drains
if (from.getBonuses().getBool(ModType.ImmuneTo, SourceType.DRAIN)) {
if (from.getBonuses().getBool(ModType.ImmuneTo, SourceType.Drain)) {
ModifyHealthMsg mhm = new ModifyHealthMsg(source, to, 0f, 0f, 0f, powerID, powerName, trains, effectID);
mhm.setUnknown03(5); //set target is immune
DispatchMessage.sendToAllInRange(from, mhm);