Search in sources :

Example 1 with ActiveObj

use of main.entity.obj.ActiveObj in project Eidolons by IDemiurge.

the class DC_AttackMaster method attack.

private Boolean attack(Attack attack, Ref ref, boolean free, boolean canCounter, Effect onHit, Effect onKill, boolean offhand, boolean counter) {
    ENTRY_TYPE type = ENTRY_TYPE.ATTACK;
    boolean extraAttack = true;
    if (attack.getAction().isCounterMode()) {
        type = ENTRY_TYPE.COUNTER_ATTACK;
    } else if (attack.getAction().isInstantMode()) {
        type = ENTRY_TYPE.INSTANT_ATTACK;
    } else if (attack.getAction().isAttackOfOpportunityMode()) {
        type = ENTRY_TYPE.ATTACK_OF_OPPORTUNITY;
    } else {
        extraAttack = false;
    }
    // LogEntryNode entry = game.getLogManager().newLogEntryNode(type,
    // attack.getAttacker().getName(), attack.getAttackedUnit().getName(), attack.getAction());
    Boolean result = null;
    if (!extraAttack) {
        Unit guard = (Unit) GuardRule.checkTargetChanged(attack.getAction());
        if (guard != null) {
            game.getLogManager().log(guard.getNameIfKnown() + " intercepts " + attack.toLogString());
            ref.setTarget(guard.getId());
            attack.setRef(ref);
            attack.setAttacked(guard);
        }
    }
    attack.setSneak(SneakRule.checkSneak(ref));
    try {
        main.system.auxiliary.log.LogMaster.log(1, attack.getAttacker() + " attacks " + attack.getAttacked() + " with " + attack.getAction());
        result = attackNow(attack, ref, free, canCounter, onHit, onKill, offhand, counter);
        boolean countered = false;
        if (result == null) {
            // first strike
            main.system.auxiliary.log.LogMaster.log(1, "Counter attack with first strike against " + attack.getAction());
            ActiveObj action = counterRule.tryCounter(attack, false);
            if (action != null) {
                AttackEffect effect = EffectMaster.getAttackEffect(action);
                waitForAttackAnimation(effect.getAttack());
            }
            attackNow(attack, ref, free, false, onHit, onKill, offhand, counter);
            countered = true;
            result = true;
        }
        if ((!countered) || attack.getAttacker().hasDoubleCounter()) {
            if (canCounter) {
                if (!counter) {
                    counterRule.tryCounter(attack);
                }
            }
        }
    } catch (Exception e) {
        result = false;
        main.system.ExceptionMaster.printStackTrace(e);
    } finally {
        if (!extraAttack) {
            game.getLogManager().doneLogEntryNode(ENTRY_TYPE.ACTION);
        }
        game.getLogManager().doneLogEntryNode(type);
    }
    return result;
}
Also used : ActiveObj(main.entity.obj.ActiveObj) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) AttackEffect(eidolons.ability.effects.oneshot.attack.AttackEffect) Unit(eidolons.entity.obj.unit.Unit) ENTRY_TYPE(main.system.text.EntryNodeMaster.ENTRY_TYPE)

Example 2 with ActiveObj

use of main.entity.obj.ActiveObj in project Eidolons by IDemiurge.

the class EmitterController method setForActive.

public void setForActive() {
    String presetPath = new FileChooser(PathFinder.getSfxPath()).launch("", "");
    // ImageChooser ic = new ImageChooser();
    // ic.setDefaultFileLocation(PathFinder.getSfxPath()+"images//");
    // String imagePath = ic.
    ActiveObj active = DC_Game.game.getManager().getActiveObj().getRef().getActive();
    CompositeAnim anim = AnimMaster.getInstance().getConstructor().getOrCreate(active);
    // ANIM_PART part = ANIM_PART.IMPACT;
    anim.getMap().keySet().forEach(part -> {
        // anim.getMap().get(part).getData().setValue();
        List<EmitterActor> list = EmitterPools.getEmitters(presetPath);
        anim.getMap().get(part).setEmitterList(list);
    });
// impact?
}
Also used : ActiveObj(main.entity.obj.ActiveObj) FileChooser(main.swing.generic.components.editors.FileChooser) EmitterActor(eidolons.libgdx.anims.particles.EmitterActor) CompositeAnim(eidolons.libgdx.anims.CompositeAnim)

Example 3 with ActiveObj

use of main.entity.obj.ActiveObj in project Eidolons by IDemiurge.

the class ActivesConstructor method getSingleTargeting.

public static Targeting getSingleTargeting(DC_ActiveObj obj) {
    List<ActiveObj> actives = obj.getActives();
    if (actives == null) {
        return null;
    }
    if (actives.size() < 1) {
        return null;
    }
    if (actives.get(0) == null) {
        return null;
    }
    Targeting targeting;
    try {
        targeting = ((AbilityObj) actives.get(0)).getType().getAbilities().getTargeting();
    } catch (Exception e) {
        targeting = getDefaultSingleTargeting(obj);
    }
    return targeting;
}
Also used : DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) ActiveObj(main.entity.obj.ActiveObj) 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)

Example 4 with ActiveObj

use of main.entity.obj.ActiveObj in project Eidolons by IDemiurge.

the class ActivesConstructor method setAnimForEffects.

public static void setAnimForEffects(DC_ActiveObj entity) {
    List<ActiveObj> list = new ArrayList<>(entity.getActives());
    for (Active active : list) {
        for (Ability abil : ((AbilityObj) active).getAbilities().getAbils()) {
            for (Effect effect : abil.getEffects().getEffects()) {
                if (effect instanceof EffectImpl) {
                    EffectImpl effect2 = (EffectImpl) effect;
                    effect2.setAnimationActive(entity);
                }
            }
        }
    }
}
Also used : Active(main.entity.obj.Active) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) ActiveObj(main.entity.obj.ActiveObj) EffectImpl(main.ability.effects.EffectImpl) ArrayList(java.util.ArrayList) 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)

Example 5 with ActiveObj

use of main.entity.obj.ActiveObj in project Eidolons by IDemiurge.

the class LogManager method logFastAction.

public void logFastAction(Obj payee, Ref ref) {
    String text = " finishes ";
    ActiveObj active = ref.getActive();
    if (active.getOBJ_TYPE_ENUM() == DC_TYPE.SPELLS) {
        text = " casts ";
        if (StringMaster.compare(active.getProp("spell tags"), "channeling", false)) {
            text = " channels ";
        }
    }
    String string = payee.getNameIfKnown() + text + active.getName() + " rapidly, saving 1 Action point";
    // logAlert(string);
    log(LOG.GAME_INFO, StringMaster.MESSAGE_PREFIX_ALERT + string, ENTRY_TYPE.ACTION);
}
Also used : ActiveObj(main.entity.obj.ActiveObj)

Aggregations

ActiveObj (main.entity.obj.ActiveObj)18 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)7 ArrayList (java.util.ArrayList)4 SelectiveTargeting (main.elements.targeting.SelectiveTargeting)4 Unit (eidolons.entity.obj.unit.Unit)3 Targeting (main.elements.targeting.Targeting)3 Ref (main.entity.Ref)3 Active (main.entity.obj.Active)3 DC_Effect (eidolons.ability.effects.DC_Effect)2 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)2 RayEffect (eidolons.ability.effects.containers.customtarget.RayEffect)2 WaveEffect (eidolons.ability.effects.containers.customtarget.WaveEffect)2 ZoneEffect (eidolons.ability.effects.containers.customtarget.ZoneEffect)2 RollEffect (eidolons.ability.effects.oneshot.mechanic.RollEffect)2 TemplateAutoTargeting (eidolons.ability.targeting.TemplateAutoTargeting)2 TemplateSelectiveTargeting (eidolons.ability.targeting.TemplateSelectiveTargeting)2 STD_ACTION_MODES (main.content.CONTENT_CONSTS2.STD_ACTION_MODES)2 FixedTargeting (main.elements.targeting.FixedTargeting)2 ActionType (main.entity.type.ActionType)2 ActionGenerator (eidolons.ability.ActionGenerator)1