Search in sources :

Example 1 with DC_Effect

use of eidolons.ability.effects.DC_Effect in project Eidolons by IDemiurge.

the class ActivesConstructor method constructActive.

public static void constructActive(TARGETING_MODE mode, DC_ActiveObj entity) {
    if (mode == AbilityEnums.TARGETING_MODE.MULTI) {
        addMultiTargetingMods(entity);
        return;
    }
    if (entity.checkBool(GenericEnums.STD_BOOLS.MULTI_TARGETING)) {
        // constructMultiAbilities(entity);
        return;
    }
    if (entity.getActives() == null) {
        return;
    }
    List<ActiveObj> list = new ArrayList<>(entity.getActives());
    Effects effects = new Effects();
    for (Active active : list) {
        for (Ability abil : ((AbilityObj) active).getAbilities().getAbils()) {
            for (Effect effect : abil.getEffects().getEffects()) {
                // anything?
                if (effect instanceof DC_Effect) {
                    DC_Effect effect2 = (DC_Effect) effect;
                    effect2.setAnimationActive(entity);
                }
                effects.add(effect);
            }
        }
    }
    // TODO what if the effects should have different targetings like in
    // damage+light?
    String saveRoll = entity.getProperty(PROPS.ROLL_TYPES_TO_SAVE);
    if (!StringMaster.isEmpty(saveRoll)) {
        wrapInSaveRollEffect(effects, saveRoll);
    }
    String wrap = entity.getProperty(PROPS.EFFECTS_WRAP);
    Effect wrappedEffect;
    if (StringMaster.isEmpty(wrap)) {
        wrappedEffect = wrapEffects(mode, effects, entity);
    } else {
        EFFECTS_WRAP WRAP = new EnumMaster<EFFECTS_WRAP>().retrieveEnumConst(EFFECTS_WRAP.class, wrap);
        wrappedEffect = wrapEffects(WRAP, effects, entity);
    }
    Targeting targeting = getTargeting(mode, entity);
    if (targeting == null) {
        try {
            targeting = entity.getActives().get(0).getActives().get(0).getTargeting();
        } catch (Exception e) {
        // targeting = getDefaultSingleTargeting(entity);TODO necessary?
        }
    }
    if (targeting != null)
        entity.setTargeting(targeting);
    Abilities abilities = new Abilities();
    abilities.add(new ActiveAbility(null, wrappedEffect));
    entity.setAbilities(abilities);
// TODO wrapping in RollEffect - each single effect or the resulting
// wrapped Effects?
}
Also used : FixedTargeting(main.elements.targeting.FixedTargeting) TemplateAutoTargeting(eidolons.ability.targeting.TemplateAutoTargeting) TemplateSelectiveTargeting(eidolons.ability.targeting.TemplateSelectiveTargeting) Targeting(main.elements.targeting.Targeting) MultiTargeting(main.elements.targeting.MultiTargeting) SelectiveTargeting(main.elements.targeting.SelectiveTargeting) DC_Effect(eidolons.ability.effects.DC_Effect) ArrayList(java.util.ArrayList) Effects(main.ability.effects.Effects) Active(main.entity.obj.Active) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) ActiveObj(main.entity.obj.ActiveObj) EFFECTS_WRAP(main.content.enums.entity.AbilityEnums.EFFECTS_WRAP) DC_Effect(eidolons.ability.effects.DC_Effect) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) RollEffect(eidolons.ability.effects.oneshot.mechanic.RollEffect) Effect(main.ability.effects.Effect) RayEffect(eidolons.ability.effects.containers.customtarget.RayEffect) WaveEffect(eidolons.ability.effects.containers.customtarget.WaveEffect) ZoneEffect(eidolons.ability.effects.containers.customtarget.ZoneEffect)

Aggregations

DC_Effect (eidolons.ability.effects.DC_Effect)1 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)1 RayEffect (eidolons.ability.effects.containers.customtarget.RayEffect)1 WaveEffect (eidolons.ability.effects.containers.customtarget.WaveEffect)1 ZoneEffect (eidolons.ability.effects.containers.customtarget.ZoneEffect)1 RollEffect (eidolons.ability.effects.oneshot.mechanic.RollEffect)1 TemplateAutoTargeting (eidolons.ability.targeting.TemplateAutoTargeting)1 TemplateSelectiveTargeting (eidolons.ability.targeting.TemplateSelectiveTargeting)1 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)1 ArrayList (java.util.ArrayList)1 Effect (main.ability.effects.Effect)1 Effects (main.ability.effects.Effects)1 EFFECTS_WRAP (main.content.enums.entity.AbilityEnums.EFFECTS_WRAP)1 FixedTargeting (main.elements.targeting.FixedTargeting)1 MultiTargeting (main.elements.targeting.MultiTargeting)1 SelectiveTargeting (main.elements.targeting.SelectiveTargeting)1 Targeting (main.elements.targeting.Targeting)1 Active (main.entity.obj.Active)1 ActiveObj (main.entity.obj.ActiveObj)1