Major item refactor, still broken
This commit is contained in:
@@ -170,18 +170,21 @@ dropExcept cr invid w =
|
||||
|
||||
-- why not a cid (Int)?
|
||||
dropItem :: Creature -> Int -> World -> World
|
||||
dropItem cr invid =
|
||||
dropItem cr invid w' =
|
||||
doanyitemdropeffect
|
||||
. maybeshiftseldown
|
||||
. rmInvItem (_crID cr) invid
|
||||
. copyItemToFloor (_crPos cr) itm -- . mayberemoveequip
|
||||
. soundStart (CrSound (_crID cr)) (_crPos cr) whiteNoiseFadeOutS Nothing
|
||||
$ w'
|
||||
where
|
||||
--doanyitemdropeffect = fromMaybe id $ do
|
||||
-- rmf <- itm ^? itEffect . ieOnDrop
|
||||
-- return $ doInvEffect rmf itm cr
|
||||
doanyitemdropeffect = itEffectOnDrop itm cr
|
||||
itm = fromMaybe (error "dropItem cannot find item") $ cr ^? crInv . ix invid
|
||||
itm = fromMaybe (error "dropItem cannot find item") $ do
|
||||
itid <- cr ^? crInv . ix invid
|
||||
w' ^? cWorld . lWorld . items . ix itid
|
||||
maybeshiftseldown w = fromMaybe w $ do
|
||||
3 <- w ^? hud . hudElement . diSelection . _Just . _1
|
||||
return $ w & hud . hudElement . diSelection . _Just . _2 +~ 1
|
||||
|
||||
Reference in New Issue
Block a user