Search in sources :

Example 71 with Obj

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);
}
Also used : ObjAtCoordinate(main.entity.type.ObjAtCoordinate) Obj(main.entity.obj.Obj) AiGroupData(main.game.logic.dungeon.editor.logic.AiGroupData) Coordinates(main.game.bf.Coordinates)

Example 72 with Obj

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();
    }
}
Also used : Obj(main.entity.obj.Obj)

Example 73 with Obj

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();
}
Also used : Obj(main.entity.obj.Obj)

Example 74 with Obj

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;
}
Also used : ActiveObj(main.entity.obj.ActiveObj) Obj(main.entity.obj.Obj)

Example 75 with Obj

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;
}
Also used : FACING_DIRECTION(main.game.bf.Coordinates.FACING_DIRECTION) BfObj(main.entity.obj.BfObj) Obj(main.entity.obj.Obj) BfObj(main.entity.obj.BfObj) Event(main.game.logic.event.Event) Unit(eidolons.entity.obj.unit.Unit)

Aggregations

Obj (main.entity.obj.Obj)127 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)34 DC_Obj (eidolons.entity.obj.DC_Obj)30 Coordinates (main.game.bf.Coordinates)27 Unit (eidolons.entity.obj.unit.Unit)24 ArrayList (java.util.ArrayList)19 Ref (main.entity.Ref)15 DC_SpellObj (eidolons.entity.active.DC_SpellObj)14 BuffObj (main.entity.obj.BuffObj)13 DC_WeaponObj (eidolons.entity.item.DC_WeaponObj)12 DC_QuickItemObj (eidolons.entity.item.DC_QuickItemObj)11 ActiveObj (main.entity.obj.ActiveObj)10 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)9 PassiveAbilityObj (main.ability.PassiveAbilityObj)9 ObjType (main.entity.type.ObjType)8 DC_HeroItemObj (eidolons.entity.item.DC_HeroItemObj)7 DC_BuffObj (eidolons.entity.obj.attach.DC_BuffObj)7 PARAMETER (main.content.values.parameters.PARAMETER)7 Conditions (main.elements.conditions.Conditions)6 MicroObj (main.entity.obj.MicroObj)6