use of main.ability.effects.Effects 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?
}
use of main.ability.effects.Effects in project Eidolons by IDemiurge.
the class AbilityConstructor method constructAbility.
private static Ability constructAbility(Node node) {
Effect effects = null;
Targeting targeting = null;
for (Node NODE : XML_Converter.getNodeList(node)) {
if (NODE.getNodeName().equals(EFFECTS) || NODE.getNodeName().contains(EFFECTS)) {
effects = constructEffects(NODE);
}
if (NODE.getNodeName().equals(TARGETING) || NODE.getNodeName().contains(TARGETING)) {
targeting = constructTargeting(NODE);
}
}
if (effects == null) {
LogMaster.log(1, "null abil effects!");
effects = new Effects();
}
if (targeting == null) {
LogMaster.log(1, "null abil targeting!");
targeting = new FixedTargeting();
}
Ability abil = null;
if (node.getNodeName().equals(ACTIVE_ABILITY)) {
abil = new ActiveAbility(targeting, effects);
} else if (node.getNodeName().equals(ONESHOT_ABILITY)) {
abil = new OneshotAbility(targeting, effects);
} else if (node.getNodeName().equals(PASSIVE_ABILITY)) {
abil = new PassiveAbility(targeting, effects);
}
abil.setXml(XML_Converter.getStringFromXML(node));
return abil;
}
use of main.ability.effects.Effects in project Eidolons by IDemiurge.
the class AuraEffect method applyThis.
/*
*
* so what really happens?
*
* maybe it's OK if it's not Spirit?
*
* There aren't really non-ValueMod effect variants, are there?
* "Damage Aura"? Property Aura, e.g. demonic! :)
*/
public boolean applyThis() {
if (!on) {
return true;
}
if (game.isSimulation()) {
return false;
}
if (continuous) {
AutoTargeting targeting = new AutoTargeting(new DistanceCondition(radius.toString()));
targeting.getConditions().add(ConditionMaster.getAliveCondition(KEYS.MATCH));
if (onlyEnemiesOrAllies != null) {
if (onlyEnemiesOrAllies) {
targeting.getConditions().add(ConditionMaster.getEnemyCondition());
} else {
targeting.getConditions().add(ConditionMaster.getAllyCondition());
}
}
// remove aura-bearer from targets list
targeting.getConditions().add(new NotCondition(new RefCondition(KEYS.MATCH, KEYS.SOURCE)));
AddBuffEffect buffEffect = new AddBuffEffect(getBuffType(), effect, true);
Effects auraEffects = new Effects(new ConditionalEffect(ConditionMaster.getAliveCondition(KEYS.SOURCE), new CustomTargetEffect(targeting, buffEffect)));
auraEffect = new AddBuffEffect(auraEffects);
// auraEffect.setTransient(false);
boolean results = auraEffect.apply(ref);
if (results) {
if (!notSelf) {
Effect copy = effect.getCopy();
copy.apply(Ref.getSelfTargetingRefCopy(ref.getSourceObj()));
}
}
return results;
}
// preCheck?
if (!initialized) {
init();
}
return trigger.apply(ref);
}
use of main.ability.effects.Effects in project Eidolons by IDemiurge.
the class WaitEffect method getAbility.
protected Ability getAbility(Ref ref) {
Effect effect = new Effects(new RemoveBuffEffect(getBuffName()));
Ability ability = new ActiveAbility(new FixedTargeting(KEYS.SOURCE), effect);
ability.setRef(ref);
return ability;
}
use of main.ability.effects.Effects in project Eidolons by IDemiurge.
the class BindingSpellEffect method applyThis.
@Override
public boolean applyThis() {
// TODO Auto-generated method stub
Effects effects = null;
if (!shareOrRedirect) {
effects = new Effects(new CustomTargetEffect(new FixedTargeting(KEYS.TARGET2), new DuplicateEffect(true)), new CustomTargetEffect(new FixedTargeting(KEYS.TARGET), new InterruptEffect()));
}
Effect EFFECT = new DuplicateSpellEffect(KEYS.TARGET.name(), false, true);
EFFECT.setTargetGroup(ref.getGroup());
effects = new Effects(EFFECT);
Event.STANDARD_EVENT_TYPE event_type = Event.STANDARD_EVENT_TYPE.SPELL_RESOLVED;
conditions.add(ConditionMaster.getPropCondition("EVENT_SPELL", G_PROPS.SPELL_TAGS, SpellEnums.SPELL_TAGS.MIND_AFFECTING.name()));
return false;
}
Aggregations