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;
}
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;
}
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;
}
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;
}
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"));
}
Aggregations