Search in sources :

Example 51 with Effect

use of main.ability.effects.Effect 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)

Example 52 with Effect

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

the class DC_Obj method addSpecialEffect.

public void addSpecialEffect(SPECIAL_EFFECTS_CASE case_type, Effect effects) {
    if (effects instanceof Effects) {
        Effects effects_ = (Effects) effects;
        for (Effect e : effects_.getEffects()) {
            addSpecialEffect(case_type, e);
        }
        return;
    }
    if (effects instanceof AddSpecialEffects) {
        AddSpecialEffects addSpecialEffects = (AddSpecialEffects) effects;
        effects = addSpecialEffects.getEffects();
    }
    if (getSpecialEffects().get(case_type) != null) {
        getSpecialEffects().put(case_type, new Effects(getSpecialEffects().get(case_type), effects));
    } else {
        getSpecialEffects().put(case_type, effects);
    }
}
Also used : AddSpecialEffects(eidolons.ability.AddSpecialEffects) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) Effect(main.ability.effects.Effect) Effects(main.ability.effects.Effects) AddSpecialEffects(eidolons.ability.AddSpecialEffects)

Example 53 with Effect

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

the class DC_Obj method applySpecialEffects.

public void applySpecialEffects(SPECIAL_EFFECTS_CASE case_type, BattleFieldObject target, Ref REF) {
    if (specialEffects == null) {
        return;
    }
    if (specialEffects.get(case_type) == null) {
        return;
    }
    Ref ref = Ref.getCopy(REF);
    ref.setTarget(target.getId());
    if (this instanceof Unit) {
        ref.setSource(getId());
    } else {
        ref.setID(KEYS.THIS, getId());
    }
    Effect effect = specialEffects.get(case_type);
    effect.apply(ref);
}
Also used : Ref(main.entity.Ref) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) Effect(main.ability.effects.Effect) Unit(eidolons.entity.obj.unit.Unit)

Example 54 with Effect

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

the class DC_FeatObj method applyRank.

private void applyRank() {
    Integer rank = getRank();
    if (rank == 0) {
        return;
    }
    Integer mod = rank * getRankFormulaMod();
    for (AbilityObj p : getPassives()) {
        // will affect AddParam effects?
        for (Ability a : p.getAbilities()) {
            for (Effect ef : a.getEffects()) {
                try {
                    ef.resetOriginalFormula();
                    ef.appendFormulaByMod(100 + mod);
                } catch (Exception e) {
                    main.system.ExceptionMaster.printStackTrace(e);
                }
            // some exceptions?
            /*
                     * how widely will this be used?
					 * mostly on simple low-level skills...
					 * but also on auras I guess...
					 * the point is to make things flexible, deeply customizable, and viable for 
					 * no-magic heroes...
					 * 
					 * it's true that with the amount of Masteries/Skills I may not need this on lower
					 * levels, but at some point I will! 
					 * 
					 * how will the rank be saved into hero data? 
					 * >> (var)
					 * >> special prop 
					 * >> prop per rank #
					 */
            }
        }
    }
    for (PARAMETER attr : ContentManager.getAttributes()) {
        PARAMS param = (PARAMS) attr;
        Integer value = getIntParam(param, true);
        if (value <= 0) {
            continue;
        }
        value += Math.round(value * mod / 100);
        setParam(param, value);
    }
    // modifyHeroParameters();
    for (PARAMETER param : DC_ContentManager.getFeatModifyingParams()) {
        Integer value = getIntParam(param, true);
        if (value == 0) {
            continue;
        }
        value += Math.round(value * mod / 100);
        setParam(param, value);
    }
    Integer sdMod = rank * getIntParam(PARAMS.RANK_SD_MOD);
    setParam(PARAMS.SKILL_DIFFICULTY, getIntParam(PARAMS.SKILL_DIFFICULTY, true));
    modifyParamByPercent(PARAMS.SKILL_DIFFICULTY, sdMod);
    rankApplied = true;
}
Also used : Ability(main.ability.Ability) AbilityObj(main.ability.AbilityObj) Effect(main.ability.effects.Effect) PARAMS(eidolons.content.PARAMS) PARAMETER(main.content.values.parameters.PARAMETER)

Example 55 with Effect

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

the class HeroManager method update.

public void update(Unit hero, boolean refresh) {
    // hero.setItemsInitialized(false);
    if (hero == null) {
        return;
    }
    for (DC_HeroSlotItem item : hero.getSlotItems()) {
        if (item != null) {
            if (item.getAttachments() != null) {
                item.getAttachments().clear();
                for (BuffObj buff : item.getBuffs()) {
                    buff.kill();
                }
            }
        }
    }
    hero.toBase();
    if (game.isSimulation()) {
        List<Attachment> attachments = hero.getAttachments();
        List<Effect> secondLayerEffects = new ArrayList<>();
        if (attachments != null) {
            for (Attachment a : attachments) {
                try {
                    for (Effect e : a.getEffects()) {
                        if (e.getLayer() != Effect.SECOND_LAYER) {
                            e.apply(Ref.getSelfTargetingRefCopy(hero));
                        } else {
                            secondLayerEffects.add(e);
                        }
                    }
                } catch (Exception e) {
                    main.system.ExceptionMaster.printStackTrace(e);
                }
            }
        }
        for (Effect e : secondLayerEffects) {
            e.apply(Ref.getSelfTargetingRefCopy(hero));
        }
        EffectFinder.applyAttachmentEffects(hero.getMainWeapon(), null);
        EffectFinder.applyAttachmentEffects(hero.getOffhandWeapon(), null);
        EffectFinder.applyAttachmentEffects(hero.getArmor(), null);
    }
    hero.afterEffects();
    hero.setDirty(true);
    if (!hero.getGame().isSimulation()) {
        try {
            hero.resetObjects();
            hero.resetQuickSlotsNumber();
            refreshInvWindow();
        } catch (Exception e) {
            main.system.ExceptionMaster.printStackTrace(e);
        }
        return;
    }
    if (refresh) {
        refresh(hero);
    }
}
Also used : Attachment(main.entity.obj.Attachment) Effect(main.ability.effects.Effect) BuffObj(main.entity.obj.BuffObj) DC_HeroSlotItem(eidolons.entity.item.DC_HeroSlotItem)

Aggregations

Effect (main.ability.effects.Effect)55 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)31 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)18 Effects (main.ability.effects.Effects)17 DealDamageEffect (eidolons.ability.effects.oneshot.DealDamageEffect)16 RollEffect (eidolons.ability.effects.oneshot.mechanic.RollEffect)16 ModifyCounterEffect (eidolons.ability.effects.oneshot.mechanic.ModifyCounterEffect)15 OwnershipChangeEffect (main.ability.effects.common.OwnershipChangeEffect)14 BehaviorModeEffect (eidolons.ability.effects.continuous.BehaviorModeEffect)13 AttackEffect (eidolons.ability.effects.oneshot.attack.AttackEffect)13 InstantDeathEffect (main.ability.effects.oneshot.InstantDeathEffect)13 DrainEffect (eidolons.ability.effects.oneshot.mechanic.DrainEffect)12 RaiseEffect (eidolons.ability.effects.oneshot.unit.RaiseEffect)12 SummonEffect (eidolons.ability.effects.oneshot.unit.SummonEffect)12 ArrayList (java.util.ArrayList)10 WaveEffect (eidolons.ability.effects.containers.customtarget.WaveEffect)8 DC_Effect (eidolons.ability.effects.DC_Effect)7 Ref (main.entity.Ref)7 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)6 SpecialTargetingEffect (main.ability.effects.container.SpecialTargetingEffect)6