Search in sources :

Example 1 with AiQuickItemAction

use of eidolons.game.battlecraft.ai.elements.actions.AiQuickItemAction in project Eidolons by IDemiurge.

the class PriorityManagerImpl method getSelfSpellPriority.

@Override
public int getSelfSpellPriority(Action action) {
    Effects effects = null;
    if (action instanceof AiQuickItemAction)
        effects = EffectFinder.getEffectsFromSpell(((DC_QuickItemAction) action.getActive()).getItem().getActives().get(0));
    else
        effects = EffectFinder.getEffectsFromSpell(action.getActive());
    if (effects.getEffects().isEmpty())
        return 0;
    setBasePriority(getUnitPriority(getUnit(), false));
    for (Effect e : effects) {
        addEffectPriority(action, e);
    }
    return priority;
}
Also used : AiQuickItemAction(eidolons.game.battlecraft.ai.elements.actions.AiQuickItemAction) AddBuffEffect(eidolons.ability.effects.attachment.AddBuffEffect) RollEffect(eidolons.ability.effects.oneshot.mechanic.RollEffect) Effect(main.ability.effects.Effect) DealDamageEffect(eidolons.ability.effects.oneshot.DealDamageEffect) OwnershipChangeEffect(main.ability.effects.common.OwnershipChangeEffect) InstantDeathEffect(main.ability.effects.oneshot.InstantDeathEffect) ModifyCounterEffect(eidolons.ability.effects.oneshot.mechanic.ModifyCounterEffect) DrainEffect(eidolons.ability.effects.oneshot.mechanic.DrainEffect) AttackEffect(eidolons.ability.effects.oneshot.attack.AttackEffect) ModifyValueEffect(eidolons.ability.effects.common.ModifyValueEffect) RaiseEffect(eidolons.ability.effects.oneshot.unit.RaiseEffect) BehaviorModeEffect(eidolons.ability.effects.continuous.BehaviorModeEffect) SummonEffect(eidolons.ability.effects.oneshot.unit.SummonEffect) Effects(main.ability.effects.Effects)

Example 2 with AiQuickItemAction

use of eidolons.game.battlecraft.ai.elements.actions.AiQuickItemAction in project Eidolons by IDemiurge.

the class ActionSequenceConstructor method getRangedReloadAction.

// now replaced with Atomic logic?
private List<AiQuickItemAction> getRangedReloadAction(Action action) {
    Obj weapon = action.getActive().getRef().getObj(KEYS.RANGED);
    WEAPON_GROUP weapon_group = null;
    List<AiQuickItemAction> list = new ArrayList<>();
    if (weapon instanceof DC_WeaponObj) {
        DC_WeaponObj dc_WeaponObj = (DC_WeaponObj) weapon;
        if (dc_WeaponObj.getWeaponGroup() == ItemEnums.WEAPON_GROUP.BOWS) {
            weapon_group = ItemEnums.WEAPON_GROUP.ARROWS;
        }
        if (dc_WeaponObj.getWeaponGroup() == ItemEnums.WEAPON_GROUP.CROSSBOWS) {
            weapon_group = ItemEnums.WEAPON_GROUP.BOLTS;
        }
        for (DC_QuickItemObj ammo : action.getSource().getQuickItems()) {
            if (!ammo.isAmmo()) {
                continue;
            }
            ammo.construct();
            if (ammo.getWrappedWeapon().getWeaponGroup() == weapon_group) {
                AiQuickItemAction qia = new AiQuickItemAction(ammo);
                if (qia.canBeActivated()) {
                    list.add(qia);
                }
            }
        }
    }
    return list;
}
Also used : AiQuickItemAction(eidolons.game.battlecraft.ai.elements.actions.AiQuickItemAction) DC_WeaponObj(eidolons.entity.item.DC_WeaponObj) DC_WeaponObj(eidolons.entity.item.DC_WeaponObj) DC_QuickItemObj(eidolons.entity.item.DC_QuickItemObj) DC_ActiveObj(eidolons.entity.active.DC_ActiveObj) Obj(main.entity.obj.Obj) WEAPON_GROUP(main.content.enums.entity.ItemEnums.WEAPON_GROUP) ArrayList(java.util.ArrayList) DC_QuickItemObj(eidolons.entity.item.DC_QuickItemObj)

Aggregations

AiQuickItemAction (eidolons.game.battlecraft.ai.elements.actions.AiQuickItemAction)2 AddBuffEffect (eidolons.ability.effects.attachment.AddBuffEffect)1 ModifyValueEffect (eidolons.ability.effects.common.ModifyValueEffect)1 BehaviorModeEffect (eidolons.ability.effects.continuous.BehaviorModeEffect)1 DealDamageEffect (eidolons.ability.effects.oneshot.DealDamageEffect)1 AttackEffect (eidolons.ability.effects.oneshot.attack.AttackEffect)1 DrainEffect (eidolons.ability.effects.oneshot.mechanic.DrainEffect)1 ModifyCounterEffect (eidolons.ability.effects.oneshot.mechanic.ModifyCounterEffect)1 RollEffect (eidolons.ability.effects.oneshot.mechanic.RollEffect)1 RaiseEffect (eidolons.ability.effects.oneshot.unit.RaiseEffect)1 SummonEffect (eidolons.ability.effects.oneshot.unit.SummonEffect)1 DC_ActiveObj (eidolons.entity.active.DC_ActiveObj)1 DC_QuickItemObj (eidolons.entity.item.DC_QuickItemObj)1 DC_WeaponObj (eidolons.entity.item.DC_WeaponObj)1 ArrayList (java.util.ArrayList)1 Effect (main.ability.effects.Effect)1 Effects (main.ability.effects.Effects)1 OwnershipChangeEffect (main.ability.effects.common.OwnershipChangeEffect)1 InstantDeathEffect (main.ability.effects.oneshot.InstantDeathEffect)1 WEAPON_GROUP (main.content.enums.entity.ItemEnums.WEAPON_GROUP)1