Search in sources :

Example 16 with ActiveObj

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

the class DC_ActionManager method generateModesForUnit.

public List<DC_ActiveObj> generateModesForUnit(Unit unit, ACTION_TYPE_GROUPS group) {
    List<DC_ActiveObj> actions = new ArrayList<>();
    for (ActiveObj active : unit.getActives()) {
        DC_ActiveObj action = (DC_ActiveObj) active;
        if (action.getActionGroup() != group) {
            continue;
        }
        if (!StringMaster.isEmpty(action.getActionMode())) {
            continue;
        }
        if (action.isAttackGeneric()) {
            continue;
        }
        List<DC_ActiveObj> subActions = new ArrayList<>();
        for (STD_ACTION_MODES mode : STD_ACTION_MODES.values()) {
            if (checkModeForAction(action, unit, mode)) {
                DC_UnitAction subAction = getModeAction(action, unit, mode);
                subActions.add(subAction);
            }
        }
        action.setSubActions(subActions);
        actions.addAll(subActions);
    }
    return actions;
}
Also used : ActiveObj(main.entity.obj.ActiveObj) STD_ACTION_MODES(main.content.CONTENT_CONSTS2.STD_ACTION_MODES)

Example 17 with ActiveObj

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

the class DungeonObjMaster method createAction.

public DC_UnitAction createAction(T sub, Unit unit, String typeName, DungeonObj obj) {
    // TODO CACHE
    DC_UnitAction action = unit.getGame().getActionManager().getOrCreateAction(typeName, unit);
    action.setTargeting(new SelectiveTargeting(new Conditions(new DistanceCondition("1", true), new FacingCondition(FACING_SINGLE.IN_FRONT))));
    action.setConstructed(true);
    action.getTargeter().setTargetingInitialized(true);
    action.setTargetingCachingOff(true);
    action.setActionTypeGroup(ACTION_TYPE_GROUPS.STANDARD);
    action.setAbilities(null);
    List<ActiveObj> actives = new ArrayList<>();
    actives.add(new ActiveAbilityObj((AbilityType) DataManager.getType("Dummy Ability", DC_TYPE.ABILS), unit.getRef(), unit.getOwner(), unit.getGame()) {

        @Override
        public boolean activatedOn(Ref ref) {
            return actionActivated(sub, unit, obj);
        }
    });
    action.setActives(actives);
    action.setActionTypeGroup(ACTION_TYPE_GROUPS.DUNGEON);
    return action;
}
Also used : SelectiveTargeting(main.elements.targeting.SelectiveTargeting) Ref(main.entity.Ref) ActiveObj(main.entity.obj.ActiveObj) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) AbilityType(main.ability.AbilityType) DistanceCondition(main.elements.conditions.DistanceCondition) ArrayList(java.util.ArrayList) ActiveAbilityObj(main.ability.ActiveAbilityObj) FacingCondition(eidolons.ability.conditions.FacingCondition) DC_UnitAction(eidolons.entity.active.DC_UnitAction) Conditions(main.elements.conditions.Conditions)

Example 18 with ActiveObj

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

the class UnitResetter method resetActives.

public void resetActives() {
    for (ActiveObj active : getEntity().getActives()) {
        active.setRef(getRef());
        active.toBase();
    }
}
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