Search in sources :

Example 21 with DC_UnitAction

use of eidolons.entity.active.DC_UnitAction 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 22 with DC_UnitAction

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

the class HungItemMaster method getActions.

public List<DC_ActiveObj> getActions(DungeonObj obj, Unit unit) {
    if (!(obj instanceof HungItem))
        return new ArrayList<>();
    // check intelligence, mastery
    List<DC_ActiveObj> list = new ArrayList<>();
    DC_UnitAction action = null;
    for (HUNG_ITEM_ACTION sub : HUNG_ITEM_ACTION.values()) {
        if (checkAction(unit, (HungItem) obj, sub)) {
            String name = StringMaster.getWellFormattedString(sub.name()) + " Door";
            action = unit.getAction(name);
            if (action == null)
                action = createAction(sub, unit, name, obj);
            if (action != null) {
                list.add(action);
            }
        }
    }
    return list;
}
Also used : ArrayList(java.util.ArrayList) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) DC_UnitAction(eidolons.entity.active.DC_UnitAction) HUNG_ITEM_ACTION(eidolons.game.module.dungeoncrawl.objects.HungItemMaster.HUNG_ITEM_ACTION)

Aggregations

DC_UnitAction (eidolons.entity.active.DC_UnitAction)22 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)10 ArrayList (java.util.ArrayList)10 Unit (eidolons.entity.obj.unit.Unit)4 Obj (main.entity.obj.Obj)3 PARAMS (eidolons.content.PARAMS)2 DC_SpellObj (eidolons.entity.active.DC_SpellObj)2 DC_Obj (eidolons.entity.obj.DC_Obj)2 Action (eidolons.game.battlecraft.ai.elements.actions.Action)2 ValueContainer (eidolons.libgdx.gui.generic.ValueContainer)2 Ref (main.entity.Ref)2 ObjType (main.entity.type.ObjType)2 Coordinates (main.game.bf.Coordinates)2 Context (main.game.logic.action.context.Context)2 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)1 FacingCondition (eidolons.ability.conditions.FacingCondition)1 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)1 ActivateEffect (eidolons.ability.effects.oneshot.activation.ActivateEffect)1 UNIT_INFO_PARAMS (eidolons.content.UNIT_INFO_PARAMS)1 DC_ActionManager (eidolons.entity.active.DC_ActionManager)1