Search in sources :

Example 36 with Effects

use of main.ability.effects.Effects in project Eidolons by IDemiurge.

the class FreezeRule method getEffect.

@Override
protected Effect getEffect() {
    Effects effects = new Effects(new ModifyValueEffect(PARAMS.ENDURANCE_REGEN, MOD.MODIFY_BY_PERCENT, getCounterRef() + "*" + ENDURANCE_REGEN_PER_COUNTER), new ModifyValueEffect(PARAMS.INITIATIVE_MODIFIER, MOD.MODIFY_BY_CONST, getCounterRef() + "*" + INITIATIVE_PER_COUNTER));
    // if (checkIsFrozen(unit)) {
    effects.add(new ConditionalEffect(new StatusCheckCondition(UnitEnums.STATUS.FROZEN), new Effects(new ModifyValueEffect(RESISTANCES_REDUCED, MOD.MODIFY_BY_CONST, getCounterRef() + "*" + RESISTANCE_REDUCED_PER_COUNTER), new ModifyValueEffect(RESISTANCES_BOOSTED, MOD.MODIFY_BY_CONST, getCounterRef() + "*" + BONUS_RESISTANCE_PER_COUNTER))));
    return effects;
}
Also used : ConditionalEffect(main.ability.effects.container.ConditionalEffect) StatusCheckCondition(eidolons.ability.conditions.StatusCheckCondition) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) Effects(main.ability.effects.Effects)

Example 37 with Effects

use of main.ability.effects.Effects in project Eidolons by IDemiurge.

the class DialogueSyntax method getParamModEffects.

private static Effects getParamModEffects(String text) {
    Effects e = new Effects();
    for (String substring : StringMaster.open(text, item_separator)) {
        // TODO permanent for non-dynamic? base?
        MOD mod = MOD.MODIFY_BY_CONST;
        String param = text.split(pair_separator)[0];
        String formula = text.split(pair_separator)[1];
        ModifyValueEffect ef = new ModifyValueEffect(param, mod, formula);
        // ef.setBase()
        e.add(ef);
    }
    return e;
}
Also used : MOD(main.ability.effects.Effect.MOD) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) Effects(main.ability.effects.Effects)

Example 38 with Effects

use of main.ability.effects.Effects in project Eidolons by IDemiurge.

the class StateCloner method cloneAbility.

private Ability cloneAbility(Ability abilities) {
    Effects effects = new Effects();
    for (Effect e : abilities.getEffects()) {
        effects.add(cloneEffect(e));
    }
    Ability ability = (abilities instanceof ActiveAbility) ? new ActiveAbility(abilities.getTargeting(), effects) : new PassiveAbility(abilities.getTargeting(), effects);
    return ability;
}
Also used : ActiveAbility(main.ability.ActiveAbility) Ability(main.ability.Ability) PassiveAbility(main.ability.PassiveAbility) ActiveAbility(main.ability.ActiveAbility) ContinuousEffect(main.ability.effects.continuous.ContinuousEffect) Effect(main.ability.effects.Effect) PassiveAbility(main.ability.PassiveAbility) Effects(main.ability.effects.Effects)

Example 39 with Effects

use of main.ability.effects.Effects in project Eidolons by IDemiurge.

the class ActivesConstructor method getEffectsFromAbilityType.

public static Effect getEffectsFromAbilityType(String abilName) {
    AbilityType abilType = (AbilityType) DataManager.getType(abilName, DC_TYPE.ABILS);
    if (abilType == null) {
        abilType = VariableManager.getVarType(abilName);
        if (abilType == null) {
            LogMaster.log(1, "getEffectsFromAbilityType: no such ability - " + abilName);
            return null;
        }
    }
    Abilities abils = AbilityConstructor.constructAbilities(abilType.getDoc());
    Effects effects = new Effects();
    for (Ability ability : abils) {
        effects.add(ability.getEffects());
    }
    return effects;
}
Also used : Effects(main.ability.effects.Effects)

Example 40 with Effects

use of main.ability.effects.Effects in project Eidolons by IDemiurge.

the class ActivesConstructor method constructActive.

public static void constructActive(TARGETING_MODE mode, DC_ActiveObj entity) {
    if (mode == AbilityEnums.TARGETING_MODE.MULTI) {
        addMultiTargetingMods(entity);
        return;
    }
    if (entity.checkBool(GenericEnums.STD_BOOLS.MULTI_TARGETING)) {
        // constructMultiAbilities(entity);
        return;
    }
    if (entity.getActives() == null) {
        return;
    }
    List<ActiveObj> list = new ArrayList<>(entity.getActives());
    Effects effects = new Effects();
    for (Active active : list) {
        for (Ability abil : ((AbilityObj) active).getAbilities().getAbils()) {
            for (Effect effect : abil.getEffects().getEffects()) {
                // anything?
                if (effect instanceof DC_Effect) {
                    DC_Effect effect2 = (DC_Effect) effect;
                    effect2.setAnimationActive(entity);
                }
                effects.add(effect);
            }
        }
    }
    // TODO what if the effects should have different targetings like in
    // damage+light?
    String saveRoll = entity.getProperty(PROPS.ROLL_TYPES_TO_SAVE);
    if (!StringMaster.isEmpty(saveRoll)) {
        wrapInSaveRollEffect(effects, saveRoll);
    }
    String wrap = entity.getProperty(PROPS.EFFECTS_WRAP);
    Effect wrappedEffect;
    if (StringMaster.isEmpty(wrap)) {
        wrappedEffect = wrapEffects(mode, effects, entity);
    } else {
        EFFECTS_WRAP WRAP = new EnumMaster<EFFECTS_WRAP>().retrieveEnumConst(EFFECTS_WRAP.class, wrap);
        wrappedEffect = wrapEffects(WRAP, effects, entity);
    }
    Targeting targeting = getTargeting(mode, entity);
    if (targeting == null) {
        try {
            targeting = entity.getActives().get(0).getActives().get(0).getTargeting();
        } catch (Exception e) {
        // targeting = getDefaultSingleTargeting(entity);TODO necessary?
        }
    }
    if (targeting != null)
        entity.setTargeting(targeting);
    Abilities abilities = new Abilities();
    abilities.add(new ActiveAbility(null, wrappedEffect));
    entity.setAbilities(abilities);
// TODO wrapping in RollEffect - each single effect or the resulting
// wrapped Effects?
}
Also used : FixedTargeting(main.elements.targeting.FixedTargeting) TemplateAutoTargeting(eidolons.ability.targeting.TemplateAutoTargeting) TemplateSelectiveTargeting(eidolons.ability.targeting.TemplateSelectiveTargeting) Targeting(main.elements.targeting.Targeting) MultiTargeting(main.elements.targeting.MultiTargeting) SelectiveTargeting(main.elements.targeting.SelectiveTargeting) DC_Effect(eidolons.ability.effects.DC_Effect) ArrayList(java.util.ArrayList) Effects(main.ability.effects.Effects) Active(main.entity.obj.Active) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) ActiveObj(main.entity.obj.ActiveObj) EFFECTS_WRAP(main.content.enums.entity.AbilityEnums.EFFECTS_WRAP) DC_Effect(eidolons.ability.effects.DC_Effect) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) RollEffect(eidolons.ability.effects.oneshot.mechanic.RollEffect) Effect(main.ability.effects.Effect) RayEffect(eidolons.ability.effects.containers.customtarget.RayEffect) WaveEffect(eidolons.ability.effects.containers.customtarget.WaveEffect) ZoneEffect(eidolons.ability.effects.containers.customtarget.ZoneEffect)

Aggregations

Effects (main.ability.effects.Effects)50 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)23 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)18 Effect (main.ability.effects.Effect)17 RollEffect (eidolons.ability.effects.oneshot.mechanic.RollEffect)8 FixedTargeting (main.elements.targeting.FixedTargeting)8 Ref (main.entity.Ref)8 ActiveAbility (main.ability.ActiveAbility)7 Formula (main.system.math.Formula)7 AddTriggerEffect (eidolons.ability.effects.attachment.AddTriggerEffect)6 Targeting (main.elements.targeting.Targeting)6 DealDamageEffect (eidolons.ability.effects.oneshot.DealDamageEffect)5 AttackEffect (eidolons.ability.effects.oneshot.attack.AttackEffect)5 ModifyCounterEffect (eidolons.ability.effects.oneshot.mechanic.ModifyCounterEffect)5 DC_Effect (eidolons.ability.effects.DC_Effect)4 ZoneEffect (eidolons.ability.effects.containers.customtarget.ZoneEffect)4 BehaviorModeEffect (eidolons.ability.effects.continuous.BehaviorModeEffect)4 DrainEffect (eidolons.ability.effects.oneshot.mechanic.DrainEffect)4 RaiseEffect (eidolons.ability.effects.oneshot.unit.RaiseEffect)4 SummonEffect (eidolons.ability.effects.oneshot.unit.SummonEffect)4