Search in sources :

Example 21 with Effects

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

the class PriorityManagerImpl method initRollMap.

private void initRollMap(DC_ActiveObj spell, List<Effect> effects) {
    rollMap = new ConcurrentMap<>();
    List<RollEffect> rollEffects = EffectFinder.getRollEffects(spell);
    for (RollEffect roll : rollEffects) {
        for (Effect e : effects) {
            Effect effect = roll.getEffect();
            if (effect instanceof Effects) {
                Effects rolledEffects = (Effects) effect;
                for (Effect e1 : rolledEffects.getEffects()) {
                    rollMap.put(e1, roll);
                }
                break;
            }
            if (effect == e) {
                rollMap.put(e, roll);
                break;
            }
        }
    }
}
Also used : RollEffect(eidolons.ability.effects.oneshot.mechanic.RollEffect) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) RollEffect(eidolons.ability.effects.oneshot.mechanic.RollEffect) Effect(main.ability.effects.Effect) DealDamageEffect(eidolons.ability.effects.oneshot.DealDamageEffect) OwnershipChangeEffect(main.ability.effects.common.OwnershipChangeEffect) InstantDeathEffect(main.ability.effects.oneshot.InstantDeathEffect) ModifyCounterEffect(eidolons.ability.effects.oneshot.mechanic.ModifyCounterEffect) DrainEffect(eidolons.ability.effects.oneshot.mechanic.DrainEffect) AttackEffect(eidolons.ability.effects.oneshot.attack.AttackEffect) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) RaiseEffect(eidolons.ability.effects.oneshot.unit.RaiseEffect) BehaviorModeEffect(eidolons.ability.effects.continuous.BehaviorModeEffect) SummonEffect(eidolons.ability.effects.oneshot.unit.SummonEffect) Effects(main.ability.effects.Effects)

Example 22 with Effects

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

the class EffectFinder method initPropModEffects.

public static Effects initPropModEffects(String modString, Ref ref) {
    Effects modEffects = new Effects();
    Map<PROPERTY, String> map = new RandomWizard<PROPERTY>().constructStringWeightMap(modString, PROPERTY.class);
    initPropModEffects(modEffects, map, ref);
    return modEffects;
}
Also used : PROPERTY(main.content.values.properties.PROPERTY) Effects(main.ability.effects.Effects)

Example 23 with Effects

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

the class EffectFinder method getEffectsFromAbilityString.

public static Effects getEffectsFromAbilityString(String abilName, Ref ref) {
    Effects effects = (new Effects());
    String separator = StringMaster.AND_PROPERTY_SEPARATOR;
    if (!abilName.contains(separator)) {
        separator = StringMaster.AND_SEPARATOR;
    }
    for (String s : StringMaster.open(abilName, separator)) {
        effects.addAll(EffectFinder.getEffectsFromAbilityType(s, ref));
    }
    return effects;
}
Also used : Effects(main.ability.effects.Effects)

Example 24 with Effects

use of main.ability.effects.Effects 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;
}
Also used : ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) Effects(main.ability.effects.Effects)

Example 25 with Effects

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

the class BindingDamageEffect method applyThis.

@Override
public boolean applyThis() {
    // Can be initialized() just once
    GroupImpl group = ref.getGroup();
    Effects effects = new Effects();
    STANDARD_EVENT_TYPE event_type;
    if (shareOrRedirect) {
        // TODO splitMode!
        event_type = STANDARD_EVENT_TYPE.UNIT_IS_DEALT_TOUGHNESS_DAMAGE;
        if (spellDmgOnly != null) {
            if (spellDmgOnly) {
                event_type = STANDARD_EVENT_TYPE.UNIT_HAS_BEEN_DEALT_SPELL_DAMAGE;
            }
        }
        if (physicalDmgOnly != null) {
            if (physicalDmgOnly) {
                event_type = STANDARD_EVENT_TYPE.UNIT_HAS_BEEN_DEALT_PHYSICAL_DAMAGE;
            }
        }
    } else {
        effects.add(new AlteringEffect(false, formula.getNegative().toString()));
        event_type = Event.STANDARD_EVENT_TYPE.UNIT_IS_BEING_DEALT_DAMAGE;
        if (spellDmgOnly != null) {
            if (spellDmgOnly) {
                event_type = STANDARD_EVENT_TYPE.UNIT_IS_BEING_DEALT_SPELL_DAMAGE;
            }
        }
        if (physicalDmgOnly != null) {
            if (physicalDmgOnly) {
                event_type = STANDARD_EVENT_TYPE.UNIT_IS_BEING_DEALT_PHYSICAL_DAMAGE;
            }
        }
    }
    Targeting targeting_other_units = new AutoTargeting(new Conditions(new GroupCondition(Ref.KEYS.MATCH.name(), group), // negative
    new RefCondition(KEYS.EVENT_TARGET, KEYS.MATCH, true)));
    effects.add(new CustomTargetEffect(targeting_other_units, new DealDamageEffect(getDamageFormula(), GenericEnums.DAMAGE_TYPE.PURE)));
    /*
         * ensure there is no deadlock
		 */
    conditions = new Conditions();
    conditions.add(new NonTriggeredEventCondition());
    KEYS OBJ_REF = Ref.KEYS.EVENT_TARGET;
    conditions.add(new GroupCondition(OBJ_REF, group));
    // has the group...
    Ref REF = Ref.getCopy(ref);
    // REF.setTarget(null); // ???
    new AddTriggerEffect(event_type, conditions, OBJ_REF, effects).apply(REF);
    return true;
}
Also used : AutoTargeting(main.elements.targeting.AutoTargeting) Targeting(main.elements.targeting.Targeting) AutoTargeting(main.elements.targeting.AutoTargeting) NonTriggeredEventCondition(main.elements.conditions.standard.NonTriggeredEventCondition) STANDARD_EVENT_TYPE(main.game.logic.event.Event.STANDARD_EVENT_TYPE) RefCondition(main.elements.conditions.RefCondition) CustomTargetEffect(main.ability.effects.continuous.CustomTargetEffect) DealDamageEffect(eidolons.ability.effects.oneshot.DealDamageEffect) Effects(main.ability.effects.Effects) Conditions(main.elements.conditions.Conditions) AddTriggerEffect(eidolons.ability.effects.attachment.AddTriggerEffect) Ref(main.entity.Ref) GroupImpl(main.entity.group.GroupImpl) KEYS(main.entity.Ref.KEYS) AlteringEffect(eidolons.ability.effects.oneshot.misc.AlteringEffect) GroupCondition(main.elements.conditions.standard.GroupCondition)

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