Search in sources :

Example 71 with DC_ActiveObj

use of eidolons.entity.active.DC_ActiveObj in project Eidolons by IDemiurge.

the class DcHelper method doAction.

@Override
public void doAction(Unit source, String name, Context context, boolean waitForCompletion) {
    DC_ActiveObj action = source.getAction(name);
    assertTrue(action != null);
    doAction(action, context, waitForCompletion);
}
Also used : DC_ActiveObj(eidolons.entity.active.DC_ActiveObj)

Example 72 with DC_ActiveObj

use of eidolons.entity.active.DC_ActiveObj in project Eidolons by IDemiurge.

the class Executor method checkPendingAttacksOfOpportunity.

private void checkPendingAttacksOfOpportunity() {
    for (DC_ActiveObj attack : new ArrayList<>(getPendingAttacksOpportunity())) {
        if (!AttackOfOpportunityRule.checkPendingAttackProceeds(getAction().getOwnerObj(), attack)) {
            continue;
        }
        getPendingAttacksOpportunity().remove(attack);
        Ref REF = Ref.getCopy(attack.getRef());
        REF.setTarget(getAction().getOwnerObj().getId());
        attack.activatedOn(REF);
    }
}
Also used : Ref(main.entity.Ref) ArrayList(java.util.ArrayList) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj)

Example 73 with DC_ActiveObj

use of eidolons.entity.active.DC_ActiveObj in project Eidolons by IDemiurge.

the class FloatingTextMaster method addFloatingTextForEventAnim.

public void addFloatingTextForEventAnim(Event e, CompositeAnim compositeAnim) {
    TEXT_CASES CASE = getCase(e);
    if (CASE == null) {
        return;
    }
    ANIM_PART part = getPart(CASE);
    Anim anim = compositeAnim.getMap().get(part);
    if (anim == null) {
        if (compositeAnim.getMap().values().iterator().hasNext())
            return;
        anim = compositeAnim.getMap().values().iterator().next();
    }
    Object[] args = CASE.getArgs(e);
    DC_ActiveObj active = (DC_ActiveObj) e.getRef().getActive();
    float delay = 0;
    for (Object arg : args) {
        FloatingText floatingText = addFloatingText(active, CASE, arg, anim, delay);
        delay += floatingText.getDuration() / 2;
        LogMaster.log(1, e + "***** adding floating text for " + anim + " : " + floatingText);
    }
}
Also used : ANIM_PART(eidolons.libgdx.anims.AnimationConstructor.ANIM_PART) BattleFieldObject(eidolons.entity.obj.BattleFieldObject) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) Anim(eidolons.libgdx.anims.Anim) CompositeAnim(eidolons.libgdx.anims.CompositeAnim)

Aggregations

DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)73 Unit (eidolons.entity.obj.unit.Unit)22 ArrayList (java.util.ArrayList)17 Obj (main.entity.obj.Obj)15 DC_UnitAction (eidolons.entity.active.DC_UnitAction)12 DC_Obj (eidolons.entity.obj.DC_Obj)12 Ref (main.entity.Ref)9 Action (eidolons.game.battlecraft.ai.elements.actions.Action)8 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)7 ActiveObj (main.entity.obj.ActiveObj)7 Effect (main.ability.effects.Effect)5 SelectiveTargeting (main.elements.targeting.SelectiveTargeting)5 Targeting (main.elements.targeting.Targeting)5 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)4 DC_SpellObj (eidolons.entity.active.DC_SpellObj)4 ActionPath (eidolons.game.battlecraft.ai.tools.path.ActionPath)4 FixedTargeting (main.elements.targeting.FixedTargeting)4 Coordinates (main.game.bf.Coordinates)4 RollEffect (eidolons.ability.effects.oneshot.mechanic.RollEffect)3 ActionSequence (eidolons.game.battlecraft.ai.elements.actions.sequence.ActionSequence)3