Rethink item ammo to item consumables, start item type datatype

This commit is contained in:
2021-11-29 16:22:31 +00:00
parent 3a605b8156
commit f40d486d68
31 changed files with 238 additions and 193 deletions
+3 -3
View File
@@ -79,10 +79,10 @@ itemLaserScopeEffect
--glowPoint = case listToMaybe $ thingsHitLongLine sp xp w of
-- Just (pos,E3x2 wl) -> pos +.+ 2 *.* wallNormal wl
-- _ -> ep -.- 2 *.* unitVectorAtAngle d
it = (cr ^. crInv) IM.! invid
wpammo = _itConsumption $ (cr ^. crInv) IM.! invid
reloadFrac
| _wpLoadedAmmo (_wpAmmo it) == 0 = 1
| otherwise = fromIntegral (_wpReloadState (_wpAmmo it)) / fromIntegral (_wpReloadTime (_wpAmmo it))
| _wpLoadedAmmo wpammo == 0 = 1
| otherwise = fromIntegral (_wpReloadState wpammo) / fromIntegral (_wpReloadTime wpammo)
--col = mixColors reloadFrac (1-reloadFrac) red green
{- | Automatically send out radar pulses that detect walls. -}
autoRadarEffect :: ItEffect