Search in sources :

Example 6 with ObjAtCoordinate

use of main.entity.type.ObjAtCoordinate in project Eidolons by IDemiurge.

the class WaveAssembler method applyLevel.

public void applyLevel() {
    // TODO foreach unit add level and break if exceeding power
    unitLevel++;
    wave.setUnitLevel(unitLevel);
    for (ObjAtCoordinate type : typeMap) {
        ObjType newType = new UnitLevelManager().getLeveledType(type.getType(), 1, true);
        type.setType(newType);
        if (!checkPowerAdjustmentNeeded()) {
            return;
        }
    }
}
Also used : UnitLevelManager(eidolons.client.cc.logic.UnitLevelManager) ObjAtCoordinate(main.entity.type.ObjAtCoordinate) ObjType(main.entity.type.ObjType)

Example 7 with ObjAtCoordinate

use of main.entity.type.ObjAtCoordinate in project Eidolons by IDemiurge.

the class LE_PlanPanel method newGroup.

private void newGroup() {
    Coordinates coordinate = LE_MapMaster.pickCoordinate();
    if (coordinate == null) {
        return;
    }
    Coordinates coordinate2 = LE_MapMaster.pickCoordinate();
    if (coordinate2 == null) {
        return;
    }
    List<ObjAtCoordinate> group = LE_ObjMaster.newUnitGroup(coordinate, Math.abs(coordinate.x - coordinate2.x), Math.abs(coordinate.y - coordinate2.y), false);
    String name = DialogMaster.inputText("group's name?", lastUnitGroupName + " " + n);
    if (name == null) {
        return;
    }
    // TODO next file version?
    if (!StringMaster.contains(name, lastUnitGroupName)) {
        n = 0;
    }
    // n will be +1
    lastUnitGroupName = name.replace(" " + n, "");
    if (name.contains(lastUnitGroupName + " " + (n))) {
        n++;
    }
    LE_DataMaster.saveUnitGroup(name, group, "");
}
Also used : ObjAtCoordinate(main.entity.type.ObjAtCoordinate) Coordinates(main.game.bf.Coordinates)

Example 8 with ObjAtCoordinate

use of main.entity.type.ObjAtCoordinate 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 9 with ObjAtCoordinate

use of main.entity.type.ObjAtCoordinate in project Eidolons by IDemiurge.

the class LE_DataMaster method saveUnitGroup.

public static void saveUnitGroup(String name, List<ObjAtCoordinate> units, String pathPrefix) {
    String content = "";
    for (ObjAtCoordinate obj : units) {
        content += DC_ObjInitializer.getObjString(obj) + DC_ObjInitializer.OBJ_SEPARATOR;
    }
    XML_Writer.write(content, PathFinder.getUnitGroupPath() + pathPrefix, name + ".xml");
}
Also used : ObjAtCoordinate(main.entity.type.ObjAtCoordinate)

Aggregations

ObjAtCoordinate (main.entity.type.ObjAtCoordinate)9 ObjType (main.entity.type.ObjType)5 Coordinates (main.game.bf.Coordinates)5 FACING_DIRECTION (main.game.bf.Coordinates.FACING_DIRECTION)3 UnitLevelManager (eidolons.client.cc.logic.UnitLevelManager)2 Unit (eidolons.entity.obj.unit.Unit)1 ArrayList (java.util.ArrayList)1 Obj (main.entity.obj.Obj)1 AiGroupData (main.game.logic.dungeon.editor.logic.AiGroupData)1 Event (main.game.logic.event.Event)1 EnumMaster (main.system.auxiliary.EnumMaster)1