use of eidolons.ability.effects.common.ModifyValueEffect in project Eidolons by IDemiurge.
the class WaterRule method initSubmergedEffects.
private Effects initSubmergedEffects(float factor) {
Effects effects = new Effects();
Formula formula = new Formula("x*50");
effects.add(new ModifyValueEffect(PARAMS.STEALTH, MOD.MODIFY_BY_PERCENT, formula.substituteVarValue("x", factor + "").toString()));
effects.add(new ModifyValueEffect(PARAMS.NOISE, MOD.MODIFY_BY_PERCENT, formula.substituteVarValue("x", factor + "").toString()));
formula = new Formula("-x*50");
effects.add(new ModifyValueEffect(PARAMS.DEFENSE, MOD.MODIFY_BY_PERCENT, formula.substituteVarValue("x", factor + "").toString()));
effects.add(new ModifyValueEffect(PARAMS.FIRE_RESISTANCE, MOD.MODIFY_BY_CONST, formula.substituteVarValue("x", factor + "").toString()));
return effects;
}
use of eidolons.ability.effects.common.ModifyValueEffect in project Eidolons by IDemiurge.
the class DivinationMaster method applyKnownSpellDivinationEffect.
private static void applyKnownSpellDivinationEffect(DC_SpellObj spell) {
if (hero.checkPassive(UnitEnums.STANDARD_PASSIVES.DRUIDIC_VISIONS)) {
Ref ref = Ref.getSelfTargetingRefCopy(hero);
ref.setID(KEYS.SPELL, spell.getId());
new ModifyValueEffect(PARAMS.C_ESSENCE, MOD.MODIFY_BY_CONST, DC_Formulas.DRUIDIC_VISIONS_ESSENCE).apply(ref);
return;
}
if (hero.checkPassive(UnitEnums.STANDARD_PASSIVES.HOLY_PRAYER)) {
Ref ref = Ref.getSelfTargetingRefCopy(hero);
ref.setID(KEYS.SPELL, spell.getId());
new ModifyValueEffect(PARAMS.C_MORALE, MOD.MODIFY_BY_CONST, DC_Formulas.HOLY_PRAYER_MORALE).apply(ref);
// ++ REMOVE COOLDOWN FROM SPELL?
}
Ref ref = Ref.getSelfTargetingRefCopy(spell);
AddBuffEffect buffEffect = new AddBuffEffect(BUFF_FAVORED, new Effects(new ModifyValueEffect(PARAMS.ESS_COST, MOD.MODIFY_BY_PERCENT, "-25"), new ModifyValueEffect(PARAMS.FOC_REQ, MOD.MODIFY_BY_PERCENT, "-25"), new ModifyValueEffect(PARAMS.FOC_COST, MOD.MODIFY_BY_PERCENT, "-25"), new ModifyValueEffect(PARAMS.STA_COST, MOD.MODIFY_BY_PERCENT, "-25"), new ModifyValueEffect(PARAMS.SPELLPOWER_MOD, MOD.MODIFY_BY_PERCENT, "25")));
buffEffect.apply(ref);
buffEffect.getBuff().setDuration((// TODO
hero.getIntParam(PARAMS.CHARISMA) + // GRACE!
hero.getIntParam(PARAMS.DIVINATION_MASTERY)) / 5);
buffEffect.getBuff().setProperty(G_PROPS.STD_BOOLS, "" + GenericEnums.STD_BOOLS.STACKING, true);
}
use of eidolons.ability.effects.common.ModifyValueEffect in project Eidolons by IDemiurge.
the class EffectFinder method initParamModEffects.
public static void initParamModEffects(Effects modEffects, Map<PARAMETER, String> map, Ref ref) {
for (PARAMETER param : map.keySet()) {
String amount = map.get(param);
MOD code = MOD.MODIFY_BY_CONST;
if (!amount.contains(StringMaster.BASE_CHAR)) {
if (amount.contains(StringMaster.MOD)) {
code = MOD.MODIFY_BY_PERCENT;
amount = amount.replace(StringMaster.MOD, "");
}
if (amount.contains(StringMaster.SET)) {
code = MOD.SET;
amount = amount.replace(StringMaster.SET, "");
}
}
if (ref.getId(KEYS.INFO) == null) {
ref.setID(KEYS.INFO, ref.getId(KEYS.SKILL));
}
amount = TextParser.parse(amount, ref, TextParser.INFO_PARSING_CODE);
modEffects.add(new ModifyValueEffect(param, code, amount));
}
}
use of eidolons.ability.effects.common.ModifyValueEffect in project Eidolons by IDemiurge.
the class WatchBuffEffect method generateEffects.
private static Effect generateEffects(Unit watcher, List<DC_Obj> list) {
// some triggers? for the list...
// preCheck specials per watcher!
Effects e = new Effects();
if (!watcher.getMode().equals(STD_MODES.ALERT)) {
e.add(new ModifyValueEffect(PARAMS.DEFENSE_MOD, MOD.MODIFY_BY_CONST, WatchRule.getDefenseModVsOthers(watcher, list)));
e.add(new ModifyValueEffect(PARAMS.ATTACK_MOD, MOD.MODIFY_BY_CONST, WatchRule.getAttackModVsOthers(watcher, list)));
e.add(new ModifyValueEffect(PARAMS.AP_PENALTY, MOD.MODIFY_BY_CONST, WatchRule.getApPenaltyMod(watcher, list)));
} else {
}
//
return e;
}
use of eidolons.ability.effects.common.ModifyValueEffect in project Eidolons by IDemiurge.
the class CreateObjectEffect method applyParamBuff.
private void applyParamBuff() {
Effects param_effects = new Effects();
for (String s : StringMaster.open(param_mods)) {
String varPart = VariableManager.getVarPart(s);
String valueName = s.replace(varPart, "");
String formula = StringMaster.cropParenthesises(varPart) + // MAX?
" *({Summoner_Spellpower}+{Summoner_Mastery}) ";
param_effects.add(new ModifyValueEffect(valueName, MOD.MODIFY_BY_CONST, formula));
}
BuffMaster.applyBuff(getBuffName(), param_effects, unit, // retain only
ContentManager.INFINITE_VALUE);
// while
// summoner
// alive?
}
Aggregations