use of main.elements.conditions.Conditions in project Eidolons by IDemiurge.
the class FunctionManager method getSumAllyConditions.
public static Condition getSumAllyConditions() {
Conditions c = new Conditions(ConditionMaster.getOwnershipFilterCondition(Ref.KEYS.MATCH.name(), true));
c.add(ConditionMaster.getUnit_CharTypeCondition());
c.add(ConditionMaster.getNotDeadCondition());
return c;
}
use of main.elements.conditions.Conditions in project Eidolons by IDemiurge.
the class FunctionManager method getAllConditions.
public static Condition getAllConditions() {
Conditions c = new Conditions(ConditionMaster.getUnit_CharTypeCondition());
c.add(ConditionMaster.getNotDeadCondition());
return c;
}
use of main.elements.conditions.Conditions in project Eidolons by IDemiurge.
the class FunctionManager method getSumEnemyConditions.
public static Condition getSumEnemyConditions() {
Conditions c = new Conditions(ConditionMaster.getOwnershipFilterCondition(Ref.KEYS.MATCH.name(), false));
c.add(ConditionMaster.getUnit_CharTypeCondition());
c.add(ConditionMaster.getNotDeadCondition());
return c;
}
use of main.elements.conditions.Conditions 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 main.elements.conditions.Conditions in project Eidolons by IDemiurge.
the class DebugMaster method summon.
private void summon(Boolean me, DC_TYPE units, Ref ref) {
Player player = Player.NEUTRAL;
if (me != null) {
player = game.getPlayer(me);
if (!me) {
if (ALT_AI_PLAYER) {
if (altAiPlayer == null) {
altAiPlayer = new DC_Player("", null, false);
}
player = altAiPlayer;
}
}
}
/*
* alt mode: >> random >> preset >> last
*/
ref.setPlayer(player);
String typeName;
if (arg instanceof Unit) {
Obj obj = arg;
typeName = (obj.getType().getName());
}
if (altMode) {
typeName = lastType;
// RandomWizard.getRandomType(units).getName();
} else {
typeName = ListChooser.chooseType(units);
}
if (!DataManager.isTypeName(typeName)) {
typeName = DialogMaster.inputText("Then enter it yourself...");
}
if (typeName == null) {
return;
}
if (!DataManager.isTypeName(typeName)) {
ObjType foundType = DataManager.findType(typeName, units);
if (foundType == null) {
return;
}
typeName = foundType.getName();
}
if (arg instanceof Obj) {
Obj obj = arg;
ref.setTarget(game.getCellByCoordinate(obj.getCoordinates()).getId());
} else if (!new SelectiveTargeting(new Conditions(ConditionMaster.getTYPECondition(DC_TYPE.TERRAIN))).select(ref)) {
return;
}
lastType = typeName;
SummonEffect effect = (me == null) ? new CreateObjectEffect(typeName, true) : new SummonEffect(typeName);
if (units == DC_TYPE.UNITS) {
if (checkAddXp()) {
Formula xp = new Formula("" + (DC_Formulas.getTotalXpForLevel(DataManager.getType(typeName, DC_TYPE.UNITS).getIntParam(PARAMS.LEVEL) + DialogMaster.inputInt()) - DC_Formulas.getTotalXpForLevel(DataManager.getType(typeName, DC_TYPE.UNITS).getIntParam(PARAMS.LEVEL))));
effect = new SummonEffect(typeName, xp);
}
}
effect.setOwner(player);
effect.apply(ref);
if (player.isAi()) {
game.getAiManager().getCustomUnitGroup((Unit) effect.getUnit()).add(effect.getUnit());
}
game.getManager().refreshAll();
}
Aggregations