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;
}
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;
}
Aggregations