Search in sources :

Example 11 with BuffObj

use of main.entity.obj.BuffObj 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)

Example 12 with BuffObj

use of main.entity.obj.BuffObj in project Eidolons by IDemiurge.

the class DispelEffect method applyThis.

@Override
public boolean applyThis() {
    for (Attachment attachment : game.getState().getAttachmentsMap().get(ref.getTargetObj())) {
        if (!(attachment instanceof BuffObj)) {
            continue;
        }
        BuffObj buff = (BuffObj) attachment;
        if (!buff.isDispelable()) {
            continue;
        }
        if (!friendlyFire) {
            if (buff.getOwner().isMe()) {
                continue;
            }
        }
        if (positiveOnly) {
        // if (buff.getBuffType() ==)
        }
        boolean result = true;
        // Ref REF = Ref.getCopy(ref);
        // REF.setTarget(buff.getId());
        // REF.setID(KEYS.SUMMONER, buff.getOwnerObj()); // is it owner or
        // // basis? ;)
        // 
        // Roll roll = new Roll(ROLL_TYPES.DISPEL, chance.getInt(ref));
        // result = RollMaster.roll(roll);
        // TODO ROLL!
        Integer amount = durationMod.getInt(ref);
        buff.modifyDuration(amount);
    }
    return true;
}
Also used : Attachment(main.entity.obj.Attachment) BuffObj(main.entity.obj.BuffObj)

Example 13 with BuffObj

use of main.entity.obj.BuffObj in project Eidolons by IDemiurge.

the class RemoveBuffEffect method applyThis.

@Override
public boolean applyThis() {
    if (buffName.equals(AddBuffEffect.EMPTY_BUFF_NAME)) {
        buffName = ref.getActive().getName();
    }
    BuffObj buff = ref.getTargetObj().getBuff(buffName, strict);
    if (buff != null)
        return buff.kill();
    LogMaster.log(1, ref.getTargetObj().getNameAndCoordinate() + " has no buff named " + buffName + ref);
    return false;
}
Also used : BuffObj(main.entity.obj.BuffObj)

Example 14 with BuffObj

use of main.entity.obj.BuffObj in project Eidolons by IDemiurge.

the class AnimMaster method updateContinuousAnims.

private void updateContinuousAnims() {
    if (!continuousAnimsOn) {
        return;
    }
    final List<BuffObj> toRemove = new ArrayList<>();
    continuousAnims.keySet().forEach(buff -> {
        if (buff.isDead()) {
            continuousAnims.get(buff).finished();
            toRemove.add(buff);
        }
    });
    toRemove.forEach(buff -> {
        continuousAnims.remove(buff);
    });
    DC_Game.game.getUnits().forEach(unit -> {
        unit.getBuffs().forEach(buff -> {
            if (// TODO or full reset always?
            !continuousAnims.containsKey(buff)) {
                if (buff.isVisible()) {
                    BuffAnim anim = constructor.getBuffAnim(buff);
                    // TODO cache!
                    if (anim != null) {
                        continuousAnims.put(buff, anim);
                        try {
                            anim.start();
                        } catch (Exception e) {
                            main.system.ExceptionMaster.printStackTrace(e);
                        }
                    }
                }
            }
        });
    });
}
Also used : BuffAnim(eidolons.libgdx.anims.std.BuffAnim) ArrayList(java.util.ArrayList) BuffObj(main.entity.obj.BuffObj)

Example 15 with BuffObj

use of main.entity.obj.BuffObj in project Eidolons by IDemiurge.

the class ExploreCleaner method cleanUpAfterBattle.

public void cleanUpAfterBattle() {
    Eidolons.getGame().getUnits().forEach(unit -> {
        unit.resetDynamicParam(PARAMS.C_N_OF_ACTIONS);
        removeMode(unit);
        BuffObj buff = unit.getBuff(StealthRule.SPOTTED);
        if (buff != null)
            buff.remove();
        cleanUpActions(unit);
    });
}
Also used : BuffObj(main.entity.obj.BuffObj)

Aggregations

BuffObj (main.entity.obj.BuffObj)16 Obj (main.entity.obj.Obj)5 DC_BuffObj (eidolons.entity.obj.attach.DC_BuffObj)4 Effect (main.ability.effects.Effect)4 Attachment (main.entity.obj.Attachment)4 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)3 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)3 ArrayList (java.util.ArrayList)3 Ref (main.entity.Ref)3 RemoveBuffEffect (eidolons.ability.effects.oneshot.buff.RemoveBuffEffect)2 DC_Obj (eidolons.entity.obj.DC_Obj)2 SpectrumEffect (eidolons.ability.effects.common.SpectrumEffect)1 BehaviorModeEffect (eidolons.ability.effects.continuous.BehaviorModeEffect)1 WatchActionEffect (eidolons.ability.effects.oneshot.rule.WatchActionEffect)1 ImmobilizeEffect (eidolons.ability.effects.oneshot.status.ImmobilizeEffect)1 DC_SpellObj (eidolons.entity.active.DC_SpellObj)1 DC_HeroSlotItem (eidolons.entity.item.DC_HeroSlotItem)1 BattleFieldObject (eidolons.entity.obj.BattleFieldObject)1 DC_HeroAttachedObj (eidolons.entity.obj.attach.DC_HeroAttachedObj)1 Unit (eidolons.entity.obj.unit.Unit)1