use of main.content.enums.entity.ItemEnums.WEAPON_GROUP 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