use of main.entity.obj.Obj in project Eidolons by IDemiurge.
the class LE_AiMaster method newGroup.
private static void newGroup(Obj obj) {
AiGroupData aiGroup = new AiGroupData(obj);
while (true) {
Coordinates c = LevelEditor.getMouseMaster().pickCoordinate();
if (c == null) {
break;
}
// per level!
for (Obj u : LevelEditor.getSimulation().getUnitsForCoordinates(c)) {
ObjAtCoordinate objAtCoordinate = new ObjAtCoordinate(u.getType(), c);
aiGroup.add(objAtCoordinate);
}
}
LevelEditor.getCurrentLevel().getAiGroups().add(aiGroup);
}
use of main.entity.obj.Obj in project Eidolons by IDemiurge.
the class OwnershipCondition method check.
@Override
public boolean check(Ref ref) {
Obj obj = ref.getObj(string);
Obj obj2 = ref.getObj(string2);
// return false;
if (player != null) {
return obj.getOwner() == player;
}
if (neutral) {
return obj.getOwner() == Player.NEUTRAL;
}
if (enemy) {
return obj.getOwner() != Player.NEUTRAL && obj.getOwner() != obj2.getOwner();
} else {
return obj.getOwner() == obj2.getOwner();
}
}
use of main.entity.obj.Obj in project Eidolons by IDemiurge.
the class ObjComparison method check.
// example: dispel buffs on target: /*
/*
* ability 1: select target (emply ability) ability 2: targeting: auto
* (filter(conditions: 1) obj_class ==buff 2) idCondition:
* ABILITY_1(target)==MATCH_TARGET(buff's basis)) effect: saving throw
* effect: caster roll: ("SOURCE", "SP" + "SOURCE", "INT" + "SOURCE", target
* roll: ("TARGET_SOURCE", "SP" + "ABILITY_1", "WIL" + "TARGET_SPELL", "SD")
*
* (note: these abilities get ref from saving throw effect) success: null
* fail: ability(targeting: fixed(TARGET); effect: destroyObjEffect
*/
@Override
public boolean check(Ref ref) {
Obj obj;
if (id != null) {
obj = ref.getGame().getObjectById(id);
} else {
obj = ref.getGame().getObjectById(ref.getId(arg2));
}
setTrue(ref.getGame().getObjectById(ref.getId(arg1)) == obj);
return isTrue();
}
use of main.entity.obj.Obj in project Eidolons by IDemiurge.
the class Ref method toString.
public String toString() {
if (game == null || values == null) {
return "invalid ref!";
}
String result = "REF values: \n";
for (KEYS key : values.keySet()) {
String value;
Integer id = null;
try {
value = values.get(key);
if (value != null)
id = Integer.valueOf(value);
} catch (Exception e) {
continue;
}
if (id != null) {
Obj obj = game.getObjectById(id);
if (obj != null) {
result += key + " = " + obj;
} else {
result += key + " = " + value;
}
result = result + ";" + "\n";
}
}
return result;
}
use of main.entity.obj.Obj in project Eidolons by IDemiurge.
the class ChangeFacingEffect method applyThis.
@Override
public boolean applyThis() {
if (!(ref.getTargetObj() instanceof Unit)) {
return false;
}
Unit obj = (Unit) ref.getTargetObj();
FACING_DIRECTION oldDirection = obj.getFacing();
FACING_DIRECTION newDirection = null;
if (isClockwise() == null) {
for (FACING_DIRECTION f : FACING_DIRECTION.values()) {
Obj active = ref.getObj(KEYS.ACTIVE);
if (active == null) {
return false;
}
if (FacingMaster.getSingleFacing(f, obj, (BfObj) active.getRef().getTargetObj()) == UnitEnums.FACING_SINGLE.IN_FRONT) {
newDirection = f;
break;
}
}
} else {
newDirection = FacingMaster.rotate(oldDirection, isClockwise());
}
obj.setFacing(newDirection);
game.fireEvent(new Event(getEventTypeDone(), ref));
return true;
}
Aggregations