Allow for partial reloading
This commit is contained in:
@@ -4,6 +4,7 @@ Display of weapon strings in the inventory.
|
||||
module Dodge.Item.Weapon.InventoryDisplay
|
||||
( basicWeaponDisplay
|
||||
, maybeWarmupStatus
|
||||
, maybeRateStatus
|
||||
) where
|
||||
import Dodge.Data
|
||||
import Padding
|
||||
@@ -17,9 +18,9 @@ basicWeaponDisplay it = [midPadL 10 ' ' thename (' ' : thenumber) ++ theparam]
|
||||
where
|
||||
thename = _itName it
|
||||
thenumber = case it ^? itConsumption of
|
||||
Just am@LoadableAmmo{} -> case _wpReloadState am of
|
||||
0 -> show $ _wpLoadedAmmo am
|
||||
x -> "R" ++ show x
|
||||
Just am@LoadableAmmo{} -> case _reloadState am of
|
||||
Nothing' -> show (_ammoLoaded am)
|
||||
Just' x -> show x ++ "R" ++ show (_ammoLoaded am)
|
||||
Just am@ChargeableAmmo{} -> show $ _wpCharge am
|
||||
Just x@ItemItselfConsumable{} -> show $ _itMaxStack' x
|
||||
Nothing -> ""
|
||||
@@ -28,7 +29,7 @@ basicWeaponDisplay it = [midPadL 10 ' ' thename (' ' : thenumber) ++ theparam]
|
||||
$ mapMaybe ($ it)
|
||||
[ maybeModeStatus
|
||||
-- , maybeWarmupStatus
|
||||
, maybeRateStatus
|
||||
-- , maybeRateStatus
|
||||
]
|
||||
|
||||
maybeModeStatus :: Item -> Maybe String
|
||||
@@ -40,7 +41,7 @@ maybeModeStatus it = case it ^? itAttachment of
|
||||
maybeRateStatus :: Item -> Maybe String
|
||||
maybeRateStatus it = case it ^? itUse . useDelay . rateMaxMax of
|
||||
Nothing -> Nothing
|
||||
_ -> Just $ ' ' : "T" ++ leftPad 3 ' ' (show (_rateMax . _useDelay $ _itUse it))
|
||||
_ -> Just $ ' ' : " " ++ leftPad 4 ' ' (show (_rateMax . _useDelay $ _itUse it))
|
||||
|
||||
maybeWarmupStatus :: Item -> Maybe String
|
||||
maybeWarmupStatus it = case it ^? itUse . useDelay . warmMax of
|
||||
|
||||
Reference in New Issue
Block a user