Move background item effects out of records

This commit is contained in:
2025-06-05 22:08:39 +01:00
parent 10ca82c4d5
commit 9a699e70ed
11 changed files with 272 additions and 143 deletions
+5 -3
View File
@@ -13,6 +13,7 @@ module Dodge.Creature.Action (
youDropItem,
) where
import Dodge.Item.BackgroundEffect
import Control.Applicative
import Control.Monad
import Data.Bifunctor
@@ -178,9 +179,10 @@ dropItem cr invid =
. copyItemToFloor (_crPos cr) itm -- . mayberemoveequip
. soundStart (CrSound (_crID cr)) (_crPos cr) whiteNoiseFadeOutS Nothing
where
doanyitemdropeffect = fromMaybe id $ do
rmf <- itm ^? itEffect . ieOnDrop
return $ doInvEffect rmf itm cr
--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
maybeshiftseldown w = fromMaybe w $ do
3 <- w ^? hud . hudElement . diSelection . _Just . _1