Merge Damage and Source types.

This commit is contained in:
2024-02-26 03:44:51 -05:00
parent a7b3fba018
commit e8e84e00af
16 changed files with 177 additions and 311 deletions
@@ -10,7 +10,6 @@
package engine.powers.effectmodifiers;
import engine.Enum;
import engine.Enum.DamageType;
import engine.Enum.ModType;
import engine.Enum.SourceType;
import engine.gameManager.ChatManager;
@@ -32,13 +31,13 @@ import java.util.concurrent.ThreadLocalRandom;
public class StaminaEffectModifier extends AbstractEffectModifier {
private DamageType damageType;
private SourceType damageType;
public StaminaEffectModifier(ResultSet rs) throws SQLException {
super(rs);
String damageTypeDB = rs.getString("type");
try {
this.damageType = DamageType.valueOf(damageTypeDB);
this.damageType = SourceType.valueOf(damageTypeDB);
} catch (IllegalArgumentException e) {
Logger.error("DamageType could not be loaded from database. " + "UUID = " + this.UUID
+ " value received = '" + damageTypeDB + '\'', e);
@@ -154,7 +153,7 @@ public class StaminaEffectModifier extends AbstractEffectModifier {
}
}
PlayerBonuses bonus = ac.getBonuses();
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) {
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Healing) >= trains) {
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
mhm.setUnknown03(5); //set target is immune
DispatchMessage.sendToAllInRange(ac, mhm);