Allow creation of items via typed command

This commit is contained in:
2022-06-19 11:04:16 +01:00
parent 075d4b1164
commit 6cc29813d8
7 changed files with 61 additions and 39 deletions
+6
View File
@@ -1,6 +1,9 @@
module Dodge.Inventory.Add where
import Dodge.Data
import Dodge.Inventory.CheckSlots
import Dodge.FloorItem
import Dodge.Combine.Module
import Dodge.Base.You
import Data.Maybe
import Control.Lens
@@ -42,3 +45,6 @@ tryPutItemInInv cid flit w = case maybeInvSlot of
-- updateItLocation invid w' = case _itID it of
-- Nothing -> w'
-- Just j -> w' & itemPositions . ix j .~ InInv cid invid
createPutItem :: Item -> World -> World
createPutItem it w = uncurry (putItemInInvID (_yourID w))
$ copyItemToFloorID (_crPos $ you w) (applyModules it) w