Allow for stacking of items and combining sensibly
This commit is contained in:
@@ -2,19 +2,22 @@
|
||||
Display of weapon strings in the inventory.
|
||||
-}
|
||||
module Dodge.Item.Weapon.InventoryDisplay
|
||||
( basicWeaponDisplay
|
||||
( basicItemDisplay
|
||||
, maybeWarmupStatus
|
||||
, maybeRateStatus
|
||||
) where
|
||||
import Dodge.Data
|
||||
import Padding
|
||||
import Dodge.Inventory.ItemSpace
|
||||
|
||||
import Data.Maybe
|
||||
import Data.Sequence
|
||||
import Control.Lens
|
||||
{- | Displays the item name, ammo if loaded, and any selected '_itCharMode'. -}
|
||||
basicWeaponDisplay :: Item -> [String]
|
||||
basicWeaponDisplay it = [midPadL 10 ' ' thename (' ' : thenumber) ++ theparam]
|
||||
basicItemDisplay :: Item -> [String]
|
||||
basicItemDisplay it = Prelude.take (itSlotsTaken it) $
|
||||
[midPadL 15 ' ' thename (' ' : thenumber) ++ theparam]
|
||||
++ repeat "*"
|
||||
where
|
||||
thename = _itName it
|
||||
thenumber = case it ^? itConsumption of
|
||||
@@ -22,7 +25,7 @@ basicWeaponDisplay it = [midPadL 10 ' ' thename (' ' : thenumber) ++ theparam]
|
||||
Nothing' -> show (_ammoLoaded am)
|
||||
Just' x -> show x ++ "R" ++ show (_ammoLoaded am)
|
||||
Just am@ChargeableAmmo{} -> show $ _wpCharge am
|
||||
Just x@ItemItselfConsumable{} -> show $ _itMaxStack' x
|
||||
Just x@ItemItselfConsumable{} -> "x" ++ show (_itAmount' x)
|
||||
Just NoConsumption -> "NOCONSUMPTION"
|
||||
Nothing -> ""
|
||||
theparam = fromMaybe []
|
||||
|
||||
Reference in New Issue
Block a user