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;
}
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;
}
Aggregations