Search in sources :

Example 1 with PositionCondition

use of main.elements.conditions.standard.PositionCondition in project Eidolons by IDemiurge.

the class DC_StateManager method checkCellBuffs.

private void checkCellBuffs() {
    for (BattleFieldObject unit : getGame().getBfObjects()) {
        if (unit.isDead()) {
            continue;
        }
        Obj cell = game.getCellByCoordinate(unit.getCoordinates());
        if (cell == null) {
            continue;
        }
        if (cell.getBuffs() == null) {
            continue;
        }
        for (BuffObj buff : game.getCellByCoordinate(unit.getCoordinates()).getBuffs()) {
            if (unit.hasBuff(buff.getName())) {
                continue;
            }
            if (buff.isAppliedThrough()) {
                Condition retainCondition = new PositionCondition(KEYS.SOURCE.toString(), cell);
                getGame().getManager().copyBuff(buff, unit, retainCondition);
            }
        }
    }
}
Also used : PositionCondition(main.elements.conditions.standard.PositionCondition) Condition(main.elements.conditions.Condition) BattleFieldObject(eidolons.entity.obj.BattleFieldObject) BuffObj(main.entity.obj.BuffObj) DC_SpellObj(eidolons.entity.active.DC_SpellObj) DC_Obj(eidolons.entity.obj.DC_Obj) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) Obj(main.entity.obj.Obj) BuffObj(main.entity.obj.BuffObj) PositionCondition(main.elements.conditions.standard.PositionCondition)

Aggregations

DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)1 DC_SpellObj (eidolons.entity.active.DC_SpellObj)1 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)1 DC_Obj (eidolons.entity.obj.DC_Obj)1 Condition (main.elements.conditions.Condition)1 PositionCondition (main.elements.conditions.standard.PositionCondition)1 BuffObj (main.entity.obj.BuffObj)1 Obj (main.entity.obj.Obj)1