use of main.content.enums.GenericEnums.DAMAGE_TYPE in project Eidolons by IDemiurge.
the class ActionAnimation method drawDamageDealt.
protected boolean drawDamageDealt(AnimPhase phase) {
List<Object> list = new ArrayList<>(Arrays.asList(phase.getArgs()));
int i = 0;
while (list.size() >= 3) {
int t_damage = (int) list.get(0);
int e_damage = (int) list.get(1);
DAMAGE_TYPE damage_type = (DAMAGE_TYPE) list.get(2);
drawDamageDealt(t_damage, e_damage, damage_type, i);
list.remove(0);
list.remove(0);
list.remove(0);
i++;
}
return true;
}
use of main.content.enums.GenericEnums.DAMAGE_TYPE in project Eidolons by IDemiurge.
the class ArmorMaster method getShieldBlockValue.
public Integer getShieldBlockValue(int amount, DC_WeaponObj shield, Unit attacked, Unit attacker, DC_WeaponObj weapon, DC_ActiveObj action, boolean zone) {
DAMAGE_TYPE dmg_type = action.getDamageType();
if (dmg_type == null) {
if (weapon == null) {
dmg_type = action.getEnergyType();
} else {
dmg_type = weapon.getDamageType();
}
}
int blockValue = getArmorValue(shield, dmg_type);
if (zone) {
// TODO always apply maximum? or half..
// blockValue =amount*shield.getIntParam(params.cover)/100;
}
// attacked.getIntParam(PARAMS.SHIELD_MASTERY)) / 100;
return blockValue;
}
use of main.content.enums.GenericEnums.DAMAGE_TYPE in project Eidolons by IDemiurge.
the class DamageCalculator method precalculateDamage.
/**
* Calculates damage for AI's FutureBuilder (DealDamageEffect)
*
* @param ref
* @return
*/
public static int precalculateDamage(Ref ref) {
Unit sourceObj = (Unit) ref.getSourceObj();
Damage damage = DamageFactory.getDamageForPrecalculate(ref);
int amount = damage.getAmount();
DAMAGE_TYPE damageType = damage.getDmgType();
if (damage.getTarget() instanceof Unit) {
int blocked = sourceObj.getGame().getArmorSimulator().getArmorBlockDamage(damage);
amount -= blocked;
}
amount -= amount * ResistMaster.getResistanceForDamageType((Unit) ref.getTargetObj(), sourceObj, damageType) / 100;
// applySpellArmorReduction(amount, (DC_HeroObj)
return amount;
// ref.getTargetObj(), ref.getSourceObj());
}
use of main.content.enums.GenericEnums.DAMAGE_TYPE in project Eidolons by IDemiurge.
the class DamageFactory method getDamageForPrecalculate.
public static Damage getDamageForPrecalculate(Ref ref) {
Damage dmg = new Damage();
int amount = ref.getAmount();
// if (ref.getActive().isSpell())
DAMAGE_TYPE damageType = ref.getDamageType();
if (ref.getActive() instanceof DC_ActiveObj) {
DC_ActiveObj activeObj = (DC_ActiveObj) ref.getActive();
dmg.setAction(activeObj);
if (damageType == null) {
damageType = activeObj.getDamageType();
}
}
dmg.setRef(ref);
dmg.setAmount(amount);
dmg.setDmgType(damageType);
return dmg;
}
use of main.content.enums.GenericEnums.DAMAGE_TYPE in project Eidolons by IDemiurge.
the class ForceRule method getDamageObject.
public static Damage getDamageObject(DC_ActiveObj action, BattleFieldObject attacker, BattleFieldObject attacked) {
int amount = getDamage(action, attacker, attacked);
if (amount <= 0) {
return null;
}
DAMAGE_TYPE type = getForceDamageType(action);
return DamageFactory.getGenericDamage(type, amount, new Ref(attacker, attacked));
}
Aggregations