Require weapon also primed on ammo check

This commit is contained in:
2022-06-22 21:03:06 +01:00
parent fff5c87092
commit ee47ee8e95
3 changed files with 13 additions and 11 deletions
+5 -4
View File
@@ -124,10 +124,11 @@ withThickSmokeI eff item cr w = eff item cr
-- TODO create a trigger that does different things on first and continued
-- fire.
ammoCheckI :: ChainEffect
ammoCheckI eff item cr w
| _laLoaded (_itConsumption item) <= 0 = w -- fromMaybe w (startReloadingWeapon cr w)
-- | _reloadState (_itConsumption item) /= Nothing' = w
| otherwise = eff item cr $ w & creatures . ix (_crID cr) %~ crCancelReloading
ammoCheckI eff itm cr w
| _laLoaded ic <= 0 || not (_laPrimed ic) = w
| otherwise = eff itm cr $ w & creatures . ix (_crID cr) %~ crCancelReloading
where
ic = _itConsumption itm
-- combined ammo and hammer check: want to be able to auto-reload even if the
-- hammer is down?