Search in sources :

Example 1 with SpecialTargetingEffect

use of main.ability.effects.container.SpecialTargetingEffect in project Eidolons by IDemiurge.

the class AI_SpellMaster method getZoneLogic.

private static AI_LOGIC getZoneLogic(DC_ActiveObj spell) {
    List<Effect> zoneEffects = EffectFinder.getEffectsOfClass(spell, SpecialTargetingEffect.class);
    if (!zoneEffects.isEmpty()) {
        for (Effect effect : zoneEffects) {
            SpecialTargetingEffect zoneEffect = (SpecialTargetingEffect) effect;
            if (EffectFinder.check(zoneEffect.getEffect(), DealDamageEffect.class)) {
                if (zoneEffect instanceof WaveEffect) {
                    return AiEnums.AI_LOGIC.AUTO_DAMAGE;
                }
                if (zoneEffect instanceof ShapeEffect) {
                    return AiEnums.AI_LOGIC.AUTO_DAMAGE;
                }
                if (spell.getTargetingMode() == AbilityEnums.TARGETING_MODE.NOVA) {
                    return AiEnums.AI_LOGIC.AUTO_DAMAGE;
                }
                if (spell.getTargetingMode() == AbilityEnums.TARGETING_MODE.SPRAY) {
                    return AiEnums.AI_LOGIC.AUTO_DAMAGE;
                }
                if (spell.getTargetingMode() == AbilityEnums.TARGETING_MODE.WAVE) {
                    return AiEnums.AI_LOGIC.AUTO_DAMAGE;
                }
                return AiEnums.AI_LOGIC.DAMAGE_ZONE;
            }
            if (EffectFinder.check(zoneEffect.getEffect(), ModifyValueEffect.class)) {
                if (isModifyValueEffectPositive(spell, zoneEffect)) {
                    return AiEnums.AI_LOGIC.RESTORE_ZONE;
                } else {
                    return AiEnums.AI_LOGIC.DEBILITATE_ZONE;
                }
            }
            if (EffectFinder.check(zoneEffect.getEffect(), ModifyCounterEffect.class)) {
                Effect e = EffectFinder.getEffectsOfClass(zoneEffect.getEffect(), ModifyCounterEffect.class).get(0);
                ModifyCounterEffect counterEffect = (ModifyCounterEffect) e;
                if (isCounterEffectPositive(spell, counterEffect)) {
                    return AiEnums.AI_LOGIC.RESTORE_ZONE;
                } else {
                    return AiEnums.AI_LOGIC.DEBILITATE_ZONE;
                }
            }
        }
    }
    return null;
}
Also used : ModifyCounterEffect(eidolons.ability.effects.oneshot.mechanic.ModifyCounterEffect) SpecialTargetingEffect(main.ability.effects.container.SpecialTargetingEffect) WaveEffect(eidolons.ability.effects.containers.customtarget.WaveEffect) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) WaveEffect(eidolons.ability.effects.containers.customtarget.WaveEffect) DrainEffect(eidolons.ability.effects.oneshot.mechanic.DrainEffect) GatewayEffect(eidolons.ability.effects.oneshot.unit.GatewayEffect) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) ShapeEffect(eidolons.ability.effects.containers.customtarget.ShapeEffect) RaiseEffect(eidolons.ability.effects.oneshot.unit.RaiseEffect) BehaviorModeEffect(eidolons.ability.effects.continuous.BehaviorModeEffect) MoveEffect(eidolons.ability.effects.oneshot.move.MoveEffect) SpecialTargetingEffect(main.ability.effects.container.SpecialTargetingEffect) Effect(main.ability.effects.Effect) DealDamageEffect(eidolons.ability.effects.oneshot.DealDamageEffect) OwnershipChangeEffect(main.ability.effects.common.OwnershipChangeEffect) CreateObjectEffect(eidolons.ability.effects.oneshot.unit.CreateObjectEffect) SummonEffect(eidolons.ability.effects.oneshot.unit.SummonEffect) InstantDeathEffect(main.ability.effects.oneshot.InstantDeathEffect) ModifyCounterEffect(eidolons.ability.effects.oneshot.mechanic.ModifyCounterEffect) ShapeEffect(eidolons.ability.effects.containers.customtarget.ShapeEffect)

Example 2 with SpecialTargetingEffect

use of main.ability.effects.container.SpecialTargetingEffect in project Eidolons by IDemiurge.

the class CoordinatesMaster method getZoneCoordinates.

public static Set<Coordinates> getZoneCoordinates(DC_ActiveObj entity) {
    Effect effect = EffectFinder.getFirstEffectOfClass(entity, SpecialTargetingEffect.class);
    Set<Coordinates> coordinates = null;
    if (effect != null) {
        SpecialTargetingEffect targetEffect = (SpecialTargetingEffect) effect;
        coordinates = targetEffect.getCoordinates();
    }
    return coordinates;
}
Also used : SpecialTargetingEffect(main.ability.effects.container.SpecialTargetingEffect) Coordinates(main.game.bf.Coordinates) SpecialTargetingEffect(main.ability.effects.container.SpecialTargetingEffect) Effect(main.ability.effects.Effect)

Example 3 with SpecialTargetingEffect

use of main.ability.effects.container.SpecialTargetingEffect in project Eidolons by IDemiurge.

the class TargetingMaster method getZoneEffect.

public static Targeting getZoneEffect(DC_ActiveObj active) {
    List<Effect> zoneEffects = EffectFinder.getEffectsOfClass(active, SpecialTargetingEffect.class);
    if (!zoneEffects.isEmpty()) {
        SpecialTargetingEffect zoneEffect = (SpecialTargetingEffect) zoneEffects.get(0);
        zoneEffect.setRef(active.getRef());
        zoneEffect.initTargeting();
        return zoneEffect.getTargeting();
    }
    return active.getTargeting();
}
Also used : SpecialTargetingEffect(main.ability.effects.container.SpecialTargetingEffect) SpecialTargetingEffect(main.ability.effects.container.SpecialTargetingEffect) Effect(main.ability.effects.Effect)

Aggregations

Effect (main.ability.effects.Effect)3 SpecialTargetingEffect (main.ability.effects.container.SpecialTargetingEffect)3 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)1 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)1 ShapeEffect (eidolons.ability.effects.containers.customtarget.ShapeEffect)1 WaveEffect (eidolons.ability.effects.containers.customtarget.WaveEffect)1 BehaviorModeEffect (eidolons.ability.effects.continuous.BehaviorModeEffect)1 DealDamageEffect (eidolons.ability.effects.oneshot.DealDamageEffect)1 DrainEffect (eidolons.ability.effects.oneshot.mechanic.DrainEffect)1 ModifyCounterEffect (eidolons.ability.effects.oneshot.mechanic.ModifyCounterEffect)1 MoveEffect (eidolons.ability.effects.oneshot.move.MoveEffect)1 CreateObjectEffect (eidolons.ability.effects.oneshot.unit.CreateObjectEffect)1 GatewayEffect (eidolons.ability.effects.oneshot.unit.GatewayEffect)1 RaiseEffect (eidolons.ability.effects.oneshot.unit.RaiseEffect)1 SummonEffect (eidolons.ability.effects.oneshot.unit.SummonEffect)1 OwnershipChangeEffect (main.ability.effects.common.OwnershipChangeEffect)1 InstantDeathEffect (main.ability.effects.oneshot.InstantDeathEffect)1 Coordinates (main.game.bf.Coordinates)1