Remove creature records

This commit is contained in:
2025-06-06 14:52:52 +01:00
parent 05f250f928
commit 467f241d7a
15 changed files with 37 additions and 28 deletions
+6 -1
View File
@@ -1,6 +1,7 @@
module Dodge.Inventory.CheckSlots (
checkInvSlotsYou,
crNumFreeSlots,
maxInvSlots,
) where
import Control.Monad
@@ -20,7 +21,11 @@ checkInvSlotsYou it w = do
Just . IM.newKey $ _crInv ycr
crNumFreeSlots :: Creature -> Int
crNumFreeSlots cr = _crInvCapacity cr - invSize (_crInv cr)
--crNumFreeSlots cr = _crInvCapacity cr - invSize (_crInv cr)
crNumFreeSlots cr = maxInvSlots - invSize (_crInv cr)
maxInvSlots :: Int
maxInvSlots = 25
invSize :: IM.IntMap Item -> Int
invSize = alaf Sum foldMap itInvHeight
+6 -4
View File
@@ -6,8 +6,10 @@ module Dodge.Inventory.Lock (
import Control.Lens
import Dodge.Data.World
lockInv :: Int -> World -> World
lockInv cid = cWorld . lWorld . creatures . ix cid . crInvLock ||~ True
lockInv :: World -> World
--lockInv cid = cWorld . lWorld . creatures . ix cid . crInvLock ||~ True
lockInv = cWorld . lWorld . lInvLock .~ True
unlockInv :: Int -> World -> World
unlockInv cid = cWorld . lWorld . creatures . ix cid . crInvLock &&~ False
--unlockInv :: Int -> World -> World
unlockInv :: World -> World
unlockInv = cWorld . lWorld . lInvLock .~ False