Allow for partial reloading

This commit is contained in:
2021-12-01 17:40:09 +00:00
parent d75ea2b252
commit 016a1faf80
21 changed files with 181 additions and 143 deletions
+4 -2
View File
@@ -81,8 +81,10 @@ itemLaserScopeEffect
-- _ -> ep -.- 2 *.* unitVectorAtAngle d
wpammo = _itConsumption $ (cr ^. crInv) IM.! invid
reloadFrac
| _wpLoadedAmmo wpammo == 0 = 1
| otherwise = fromIntegral (_wpReloadState wpammo) / fromIntegral (_wpReloadTime wpammo)
| _ammoLoaded wpammo == 0 = 1
| otherwise = case _reloadState wpammo of
Just' rs -> fromIntegral rs / fromIntegral (_reloadTime wpammo)
Nothing' -> 1
--col = mixColors reloadFrac (1-reloadFrac) red green
{- | Automatically send out radar pulses that detect walls. -}
autoRadarEffect :: ItEffect