use of eidolons.entity.obj.unit.Unit in project Eidolons by IDemiurge.
the class PartyHelper method addCreepParty.
public static void addCreepParty(Wave wave) {
DC_Game game = wave.getGame();
Unit leader = wave.getLeader();
String name = wave.getName();
List<Unit> units = wave.getUnits();
ObjType newType = new ObjType(game);
wave.setParty(addCreepParty(leader, name, units, newType));
}
use of eidolons.entity.obj.unit.Unit in project Eidolons by IDemiurge.
the class PartyHelper method getPrincipleConditions.
public static Conditions getPrincipleConditions(Party party) {
Conditions principlesConditions = new Conditions();
for (Unit m : party.getMembers()) {
String principles = m.getProperty(G_PROPS.PRINCIPLES);
Condition principlesCondition = new PrinciplesCondition(principles, "{MATCH_" + G_PROPS.PRINCIPLES + "}", true);
principlesConditions.add(principlesCondition);
}
return principlesConditions;
}
use of eidolons.entity.obj.unit.Unit in project Eidolons by IDemiurge.
the class EngagedRule method disengaged.
public void disengaged(DC_ActiveObj action) {
// disengager.getGame().fireEvent(new
// Event(STANDARD_EVENT_TYPE.DISENGAGED, disengager.getRef()));
Unit disengaged = action.getOwnerObj();
for (Unit unit : action.getGame().getUnits()) {
if (unit.getEngagementTarget() == disengaged) {
checkAoO(action, unit);
if (PositionMaster.getDistance(unit, disengaged) >= 1) {
unit.setEngagementTarget(null);
}
}
}
disengaged.setEngagementTarget(null);
}
use of eidolons.entity.obj.unit.Unit in project Eidolons by IDemiurge.
the class EngagedRule method checkDisengagingActionCancelled.
public boolean checkDisengagingActionCancelled(DC_ActiveObj action) {
if (action.getRef().getTargetObj() == action.getOwnerObj().getEngagementTarget()) {
return false;
}
Unit unit = action.getOwnerObj();
boolean prompt = !unit.isAiControlled() && action.getActionGroup() != ActionEnums.ACTION_TYPE_GROUPS.MODE && action.getActionGroup() != ActionEnums.ACTION_TYPE_GROUPS.ATTACK;
if (prompt) {
if (action.getRef().getTargetObj() == null || action.getRef().getTargetObj() == unit) {
// self-targeting or misc instants shouldn't bother
if (action.checkProperty(G_PROPS.SPELL_TAGS, SpellEnums.SPELL_TAGS.INSTANT.toString())) {
prompt = false;
} else if (action.checkProperty(G_PROPS.ACTION_TAGS, ActionEnums.ACTION_TAGS.INSTANT.toString())) {
prompt = false;
}
// auto-disengage if moved away! (blink)
// spells TODO
}
}
if (!prompt) {
return false;
}
return !promptDisengage(action);
}
use of eidolons.entity.obj.unit.Unit in project Eidolons by IDemiurge.
the class PerceptionRule method actionComplete.
public void actionComplete(ActiveObj activeObj) {
Unit unit = (Unit) activeObj.getOwnerObj();
PERCEPTION_STATUS status;
int actionNoise = activeObj.getIntParam(PARAMS.NOISE, false) + activeObj.getOwnerObj().getIntParam(PARAMS.NOISE, false);
for (Unit source : getUnits(activeObj)) {
// status = getPerceptionStatus(source, activeObj, actionNoise);
// map of statuses would be nice...
// statusMap.getOrCreate(source).put(unit, status);
// checkResetPlayerPerceptionStatus(status, source, unit);
// personal independent detection?
}
// GroupAI instead!!! Let it know where to look...
// perceived(source, unit); // creeps' KNOW ... -> stop wandering
// around!
// this status
}
Aggregations