Linting, haddocking

This commit is contained in:
2021-04-29 15:31:07 +02:00
parent 750a67ea6e
commit 6a38950501
34 changed files with 506 additions and 441 deletions
+17 -6
View File
@@ -1,15 +1,26 @@
{- |
Display of weapon strings in the inventory.
-}
module Dodge.Item.Weapon.InventoryDisplay
where
import Dodge.Data
import Dodge.Base
import Dodge.Item.Attachment.Data
import Control.Lens
import Control.Monad
-- MODES SHOULD BE MADE UNIFORM
basicWeaponDisplay :: Item -> String
basicWeaponDisplay it = midPadL 10 ' ' (_itName it) (' ' : aIfLoaded)
where
availableAmmo = show $ _wpMaxAmmo it
aIfLoaded = case (_wpReloadState it) of
0 -> show $ _wpLoadedAmmo it
x -> "R" ++ show x
basicWeaponDisplay it = case it ^? itAttachment . _Just . itCharMode of
Just c -> midPadL 10 ' ' (_itName it) (' ' : aIfLoaded) ++ [' ',c]
otherwise -> midPadL 10 ' ' (_itName it) (' ' : aIfLoaded)
where
availableAmmo = show $ _wpMaxAmmo it
aIfLoaded = case (_wpReloadState it) of
0 -> show $ _wpLoadedAmmo it
x -> "R" ++ show x
displayAutoGun :: Item -> String
displayAutoGun it@(Weapon {_itAttachment = mayMode})