Files
prestonbane/src/engine/powers/effectmodifiers/DamageShieldEffectModifier.java
T

73 lines
2.3 KiB
Java
Raw Normal View History

2022-04-30 09:41:17 -04:00
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
package engine.powers.effectmodifiers;
2024-03-24 09:42:27 -04:00
2022-04-30 09:41:17 -04:00
import engine.jobs.AbstractEffectJob;
import engine.mbEnums;
2022-04-30 09:41:17 -04:00
import engine.objects.*;
import engine.powers.DamageShield;
import java.sql.ResultSet;
import java.sql.SQLException;
public class DamageShieldEffectModifier extends AbstractEffectModifier {
2023-07-15 09:23:48 -04:00
public DamageShieldEffectModifier(ResultSet rs) throws SQLException {
super(rs);
}
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
@Override
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
}
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
@Override
public void applyBonus(AbstractCharacter ac, int trains) {
float amount;
boolean usePercent;
if (this.percentMod != 0) {
amount = this.percentMod;
usePercent = true;
} else {
amount = this.minMod;
usePercent = false;
}
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
if (this.ramp > 0f) {
float mod = this.ramp * trains;
if (this.useRampAdd)
amount += mod;
else
amount *= (1 + mod);
}
2022-04-30 09:41:17 -04:00
mbEnums.DamageType dt = mbEnums.DamageType.getDamageType(this.type);
2024-02-26 03:44:51 -05:00
2023-07-15 09:23:48 -04:00
if (dt != null) {
2024-02-26 15:18:03 -05:00
2023-07-15 09:23:48 -04:00
DamageShield ds = new DamageShield(dt, amount, usePercent);
2024-02-26 15:18:03 -05:00
2023-07-15 09:23:48 -04:00
PlayerBonuses bonus = ac.getBonuses();
2024-02-26 15:18:03 -05:00
2023-07-15 09:23:48 -04:00
if (bonus != null)
bonus.addDamageShield(this, ds);
}
}
2022-04-30 09:41:17 -04:00
2023-07-15 09:23:48 -04:00
@Override
public void applyBonus(Item item, int trains) {
}
@Override
public void applyBonus(Building building, int trains) {
}
2022-04-30 09:41:17 -04:00
}