Search in sources :

Example 1 with DAMAGE_TYPE

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;
}
Also used : DAMAGE_TYPE(main.content.enums.GenericEnums.DAMAGE_TYPE)

Example 2 with DAMAGE_TYPE

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;
}
Also used : DAMAGE_TYPE(main.content.enums.GenericEnums.DAMAGE_TYPE)

Example 3 with DAMAGE_TYPE

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());
}
Also used : DAMAGE_TYPE(main.content.enums.GenericEnums.DAMAGE_TYPE) Unit(eidolons.entity.obj.unit.Unit)

Example 4 with DAMAGE_TYPE

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;
}
Also used : DAMAGE_TYPE(main.content.enums.GenericEnums.DAMAGE_TYPE) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj)

Example 5 with DAMAGE_TYPE

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));
}
Also used : Ref(main.entity.Ref) DAMAGE_TYPE(main.content.enums.GenericEnums.DAMAGE_TYPE)

Aggregations

DAMAGE_TYPE (main.content.enums.GenericEnums.DAMAGE_TYPE)18 RESIST_GRADE (main.content.enums.GenericEnums.RESIST_GRADE)4 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)3 Unit (eidolons.entity.obj.unit.Unit)3 PARAMETER (main.content.values.parameters.PARAMETER)3 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)2 Damage (eidolons.game.battlecraft.rules.combat.damage.Damage)2 ValueContainer (eidolons.libgdx.gui.generic.ValueContainer)2 HashMap (java.util.HashMap)2 Ref (main.entity.Ref)2 PARAMS (eidolons.content.PARAMS)1 DC_HeroSlotItem (eidolons.entity.item.DC_HeroSlotItem)1 AttackCalculator (eidolons.game.battlecraft.rules.combat.attack.AttackCalculator)1 MultiValueContainer (eidolons.libgdx.gui.panels.dc.unitinfo.MultiValueContainer)1 ValueTooltip (eidolons.libgdx.gui.tooltips.ValueTooltip)1 PROPERTY (main.content.values.properties.PROPERTY)1 Obj (main.entity.obj.Obj)1 Event (main.game.logic.event.Event)1 EnumMaster (main.system.auxiliary.EnumMaster)1 AnimPhase (main.system.graphics.AnimPhase)1