Keep inventory as intmap, start to allow items of different sizes

This commit is contained in:
2021-11-30 15:33:15 +00:00
parent 184c0c09c1
commit 27b1a6da9e
8 changed files with 87 additions and 57 deletions
+1 -1
View File
@@ -17,6 +17,6 @@ pipe = Craftable
$ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
, _itEquipPict = \_ _ -> mempty
, _itID = Nothing
, _itInvDisplay = _itName
, _itInvDisplay = (:[]) . _itName
, _itInvColor = green
}
+1
View File
@@ -257,6 +257,7 @@ miniGun = defaultAutoGun
, _itEquipPict = pictureWeaponAim miniGunPictItem
, _itTweaks = defaultBulletSelTweak
, _itInvSize = 2
, _itInvDisplay = \it -> basicWeaponDisplay it ++ [" COLD"]
} & itDimension . muzzleLength .~ 15
where
recoilAmount = 5
+2 -2
View File
@@ -11,8 +11,8 @@ 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
basicWeaponDisplay :: Item -> [String]
basicWeaponDisplay it = [midPadL 10 ' ' thename (' ' : thenumber) ++ theparam]
where
thename = _itName it
thenumber = case it ^? itConsumption of