Search in sources :

Example 16 with ModifyValueEffect

use of eidolons.ability.effects.common.ModifyValueEffect 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 17 with ModifyValueEffect

use of eidolons.ability.effects.common.ModifyValueEffect 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 18 with ModifyValueEffect

use of eidolons.ability.effects.common.ModifyValueEffect in project Eidolons by IDemiurge.

the class EnchantItemEffect method applyThis.

@Override
public boolean applyThis() {
    // TODO select spell to use!
    // perhaps it is better to invoke spell with a special effect!
    // Ref REF = ref.getCopy();
    // this should be an effect - for other things too like traps
    // add spell filter!!!
    // if (selectSpell)
    // game.getManager().infoSelect(ref.getSourceObj());
    spell = (DC_SpellObj) ref.getTargetObj();
    Effects effects = EffectFinder.getEffectsFromSpell(spell);
    effects.add(new AnimationEffect(spell));
    effects.add(new SoundEffect(SOUNDS.IMPACT, ref.getTargetObj()));
    // TODO why was only that 1st spell in SB filtered in???
    if (!new TemplateSelectiveTargeting((weapon) ? SELECTIVE_TARGETING_TEMPLATES.MY_WEAPON : SELECTIVE_TARGETING_TEMPLATES.MY_ARMOR).select(ref)) {
        return false;
    }
    // new ModifyPropertyEffect(G_PROPS.PASSIVES, MOD_PROP_TYPE.ADD,
    // passive)
    // .apply(ref);
    // 
    KEYS key;
    if (!weapon) {
        key = KEYS.ARMOR;
    } else {
        if (ref.getTargetObj() == ref.getObj(KEYS.WEAPON)) {
            key = KEYS.WEAPON;
        } else {
            key = KEYS.OFFHAND;
        }
    }
    int cost = Enchanter.calculateSpellEnergyCost(spell);
    if (case_type == null) {
        case_type = (weapon) ? SPECIAL_EFFECTS_CASE.ON_ATTACK : SPECIAL_EFFECTS_CASE.ON_HIT;
    }
    // another layer of customTargetEffect if ON SELF or so ! Some may even
    // be Zone-targeted!
    BuffType t = new BuffType(new Ref(ref.getGame(), ref.getSource()));
    t.setImage(ref.getActive().getProperty(G_PROPS.IMAGE, false));
    t.setName(buffName + " " + StringMaster.wrapInParenthesis(spell.getName()));
    t.setParam(G_PARAMS.DURATION, ref.getActive().getIntParam(G_PARAMS.DURATION, false));
    new AddBuffEffect(t, new AddSpecialEffects(case_type, new EnergyCostEffect(cost, key, effects))).apply(ref);
    ModifyValueEffect addEnergyEffect = new ModifyValueEffect(PARAMS.C_ENERGY, MOD.MODIFY_BY_CONST, energy);
    addEnergyEffect.setValueOverMax(true);
    addEnergyEffect.apply(ref);
    return true;
}
Also used : SoundEffect(eidolons.ability.effects.special.media.SoundEffect) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) TemplateSelectiveTargeting(eidolons.ability.targeting.TemplateSelectiveTargeting) Ref(main.entity.Ref) AddSpecialEffects(eidolons.ability.AddSpecialEffects) KEYS(main.entity.Ref.KEYS) BuffType(main.entity.type.BuffType) EnergyCostEffect(eidolons.ability.effects.containers.EnergyCostEffect) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) AnimationEffect(eidolons.ability.effects.special.media.AnimationEffect) Effects(main.ability.effects.Effects) AddSpecialEffects(eidolons.ability.AddSpecialEffects)

Example 19 with ModifyValueEffect

use of eidolons.ability.effects.common.ModifyValueEffect in project Eidolons by IDemiurge.

the class DamageInversionEffect method applyThis.

@Override
public boolean applyThis() {
    // endurance damage; modify endurance only? above base?
    Targeting targeting = new FixedTargeting(KEYS.SOURCE);
    Effects effects = new Effects();
    if (restoreEndurance) {
        ModifyValueEffect effect = new ModifyValueEffect(PARAMS.C_ENDURANCE, code, formula.toString());
        if (!restoreEnduranceAboveBase) {
            effect.setMaxParam(PARAMS.ENDURANCE);
        }
        effects.add(effect);
    }
    if (restoreToughness) {
        ModifyValueEffect effect = new ModifyValueEffect(PARAMS.C_TOUGHNESS, code, formula.toString());
        if (!restoreToughnessAboveBase) {
            effect.setMaxParam(PARAMS.TOUGHNESS);
        }
        effects.add(effect);
    }
    ActiveAbility ability = new ActiveAbility(targeting, effects);
    new AddTriggerEffect(event_type, conditions, ability).apply(ref);
    return true;
}
Also used : ActiveAbility(main.ability.ActiveAbility) FixedTargeting(main.elements.targeting.FixedTargeting) Targeting(main.elements.targeting.Targeting) FixedTargeting(main.elements.targeting.FixedTargeting) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) Effects(main.ability.effects.Effects) AddTriggerEffect(eidolons.ability.effects.attachment.AddTriggerEffect)

Example 20 with ModifyValueEffect

use of eidolons.ability.effects.common.ModifyValueEffect in project Eidolons by IDemiurge.

the class RestEffect method getRestedBuffEffect.

private Effect getRestedBuffEffect() {
    Effects effects = new Effects();
    effects.add(new ModifyValueEffect(PARAMS.STAMINA, MOD.MODIFY_BY_PERCENT, "25"));
    effects.add(new ModifyValueEffect(PARAMS.ESSENCE, MOD.MODIFY_BY_PERCENT, "25"));
    effects.add(new ModifyValueEffect(PARAMS.WILLPOWER, MOD.MODIFY_BY_PERCENT, "25"));
    effects.add(new ModifyValueEffect(PARAMS.AGILITY, MOD.MODIFY_BY_PERCENT, "25"));
    effects.add(new ModifyValueEffect(PARAMS.DEXTERITY, MOD.MODIFY_BY_PERCENT, "25"));
    effects.add(new ModifyValueEffect(PARAMS.SPELLPOWER, MOD.MODIFY_BY_PERCENT, "25"));
    effects.add(new ModifyValueEffect(PARAMS.STRENGTH, MOD.MODIFY_BY_PERCENT, "25"));
    return new AddBuffEffect("Rested", effects, new Formula("10"));
}
Also used : AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) Formula(main.system.math.Formula) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) Effects(main.ability.effects.Effects)

Aggregations

ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)27 Effects (main.ability.effects.Effects)17 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)11 Ref (main.entity.Ref)8 Formula (main.system.math.Formula)7 PARAMETER (main.content.values.parameters.PARAMETER)5 RemoveBuffEffect (eidolons.ability.effects.oneshot.buff.RemoveBuffEffect)4 ActiveAbility (main.ability.ActiveAbility)4 ModifyPropertyEffect (eidolons.ability.effects.common.ModifyPropertyEffect)3 BehaviorModeEffect (eidolons.ability.effects.continuous.BehaviorModeEffect)3 DealDamageEffect (eidolons.ability.effects.oneshot.DealDamageEffect)3 DrainEffect (eidolons.ability.effects.oneshot.mechanic.DrainEffect)3 ModifyCounterEffect (eidolons.ability.effects.oneshot.mechanic.ModifyCounterEffect)3 RaiseEffect (eidolons.ability.effects.oneshot.unit.RaiseEffect)3 SummonEffect (eidolons.ability.effects.oneshot.unit.SummonEffect)3 Abilities (main.ability.Abilities)3 Effect (main.ability.effects.Effect)3 OwnershipChangeEffect (main.ability.effects.common.OwnershipChangeEffect)3 InstantDeathEffect (main.ability.effects.oneshot.InstantDeathEffect)3 Targeting (main.elements.targeting.Targeting)3