Search in sources :

Example 1 with DAMAGE_CASE

use of main.content.enums.GenericEnums.DAMAGE_CASE in project Eidolons by IDemiurge.

the class DamageCalculator method getBonusDamageList.

public static List<Damage> getBonusDamageList(Ref ref, DAMAGE_CASE CASE) {
    List<Damage> list = new ArrayList<>();
    // TODO make BonusDamage all add to source?
    DC_Obj obj = (DC_Obj) ref.getSourceObj();
    for (DAMAGE_CASE e : obj.getBonusDamage().keySet()) {
        if (e == CASE) {
            list.addAll(obj.getBonusDamage().get(e));
        }
    }
    obj = (DC_Obj) ref.getObj(KEYS.ACTIVE);
    for (DAMAGE_CASE e : obj.getBonusDamage().keySet()) {
        if (e == CASE) {
            list.addAll(obj.getBonusDamage().get(e));
        }
    }
    if (obj instanceof DC_ActiveObj) {
        obj = ((DC_ActiveObj) obj).getActiveWeapon();
        if (obj != null) {
            for (DAMAGE_CASE e : obj.getBonusDamage().keySet()) {
                if (e == CASE) {
                    list.addAll(obj.getBonusDamage().get(e));
                }
            }
        }
    }
    return list;
}
Also used : DC_Obj(eidolons.entity.obj.DC_Obj) ArrayList(java.util.ArrayList) DAMAGE_CASE(main.content.enums.GenericEnums.DAMAGE_CASE) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj)

Aggregations

DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)1 DC_Obj (eidolons.entity.obj.DC_Obj)1 ArrayList (java.util.ArrayList)1 DAMAGE_CASE (main.content.enums.GenericEnums.DAMAGE_CASE)1