Search in sources :

Example 1 with UPKEEP_FAIL_ACTION

use of main.ability.effects.Effect.UPKEEP_FAIL_ACTION in project Eidolons by IDemiurge.

the class UpkeepRule method addUpkeep.

public static void addUpkeep(Obj payObj) {
    Obj spell = payObj.getRef().getObj(KEYS.ACTIVE);
    if (spell == null) {
        return;
    }
    Obj abil = payObj.getRef().getObj(KEYS.ABILITY);
    if (abil != null) {
        if (abil instanceof PassiveAbilityObj) {
            return;
        }
    }
    String property = spell.getProperty(PROPS.UPKEEP_FAIL_ACTION);
    if (new EnumMaster<UPKEEP_FAIL_ACTION>().retrieveEnumConst(UPKEEP_FAIL_ACTION.class, property) == null) {
        property = UPKEEP_FAIL_ACTION.DEATH + "";
    }
    payObj.setProperty(PROPS.UPKEEP_FAIL_ACTION, property);
    for (PARAMETER p : ValuePages.UPKEEP_PARAMETERS) {
        Integer param = spell.getIntParam(p);
        if (param > 0) {
            payObj.getType().setParam(p, param);
        }
    }
}
Also used : UPKEEP_FAIL_ACTION(main.ability.effects.Effect.UPKEEP_FAIL_ACTION) EnumMaster(main.system.auxiliary.EnumMaster) BuffObj(main.entity.obj.BuffObj) Obj(main.entity.obj.Obj) PassiveAbilityObj(main.ability.PassiveAbilityObj) PassiveAbilityObj(main.ability.PassiveAbilityObj) PARAMETER(main.content.values.parameters.PARAMETER)

Aggregations

PassiveAbilityObj (main.ability.PassiveAbilityObj)1 UPKEEP_FAIL_ACTION (main.ability.effects.Effect.UPKEEP_FAIL_ACTION)1 PARAMETER (main.content.values.parameters.PARAMETER)1 BuffObj (main.entity.obj.BuffObj)1 Obj (main.entity.obj.Obj)1 EnumMaster (main.system.auxiliary.EnumMaster)1