Search in sources :

Example 31 with PARAMETER

use of main.content.values.parameters.PARAMETER 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)

Example 32 with PARAMETER

use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.

the class UpkeepRule method subtractUpkeep.

public void subtractUpkeep(Unit unit, Obj payObj) {
    for (PARAMETER p : ValuePages.UPKEEP_PARAMETERS) {
        PARAMETER payParam = DC_ContentManager.getPayParamFromUpkeep(p);
        int amount = new Formula(payObj.getParam(p)).getAppendedByModifier(StringMaster.getValueRef(KEYS.SOURCE, PARAMS.UPKEEP_MOD)).getInt(unit.getRef());
        if (amount <= 0) {
            return;
        }
        unit.modifyParameter(payParam, -amount);
        unit.getGame().getLogManager().log(payObj.getName() + "'s " + ContentManager.getBaseParameterFromCurrent(p).getName() + " upkeep paid: " + amount);
    }
}
Also used : Formula(main.system.math.Formula) PARAMETER(main.content.values.parameters.PARAMETER)

Example 33 with PARAMETER

use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.

the class IntegrityRule method getIntegrityMod.

public static int getIntegrityMod(Entity hero, PRINCIPLES principle) {
    PARAMETER alignment_param = DC_ContentManager.getAlignmentForPrinciple(principle);
    PARAMETER identity_param = DC_ContentManager.getIdentityParamForPrinciple(principle);
    Integer degree = hero.getIntParam(identity_param);
    Integer amount = hero.getIntParam(alignment_param);
    int product = getIntegrityProduct(degree, amount);
    return product;
}
Also used : PARAMETER(main.content.values.parameters.PARAMETER)

Example 34 with PARAMETER

use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.

the class IntegrityRule method applyMods.

public static void applyMods(Entity hero, Entity from, boolean alignment_identity) {
    if (from == null) {
        return;
    }
    PARAMETER[] array = alignment_identity ? ValuePages.PRINCIPLE_ALIGNMENTS : ValuePages.PRINCIPLE_IDENTITIES;
    for (PARAMETER param : array) {
        Integer amount = from.getIntParam(param);
        // min/max?
        hero.modifyParameter(param, amount);
    }
}
Also used : PARAMETER(main.content.values.parameters.PARAMETER)

Example 35 with PARAMETER

use of main.content.values.parameters.PARAMETER in project Eidolons by IDemiurge.

the class IntegrityRule method getValues.

public static Integer[] getValues(PRINCIPLES principle, Entity item, Entity hero) {
    PARAMETER alignment_param = DC_ContentManager.getAlignmentForPrinciple(principle);
    PARAMETER identity_param = DC_ContentManager.getIdentityParamForPrinciple(principle);
    Integer alignment = hero.getIntParam(alignment_param);
    Integer identity = hero.getIntParam(identity_param);
    if (item != null) {
        alignment = item.getIntParam(alignment_param);
        identity = item.getIntParam(identity_param);
    }
    return new Integer[] { identity, alignment, getIntegrityProduct(hero.getIntParam(identity_param), alignment) };
}
Also used : PARAMETER(main.content.values.parameters.PARAMETER)

Aggregations

PARAMETER (main.content.values.parameters.PARAMETER)136 PROPERTY (main.content.values.properties.PROPERTY)22 ObjType (main.entity.type.ObjType)13 ArrayList (java.util.ArrayList)12 Formula (main.system.math.Formula)12 Ref (main.entity.Ref)9 VALUE (main.content.VALUE)7 Obj (main.entity.obj.Obj)7 PARAMS (eidolons.content.PARAMS)6 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)5 Cost (main.elements.costs.Cost)5 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)4 G_Panel (main.swing.generic.components.G_Panel)4 Node (org.w3c.dom.Node)4 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)3 HashMap (java.util.HashMap)3 DAMAGE_TYPE (main.content.enums.GenericEnums.DAMAGE_TYPE)3 Costs (main.elements.costs.Costs)3 Entity (main.entity.Entity)3 GraphicComponent (main.swing.generic.components.misc.GraphicComponent)3