Work on cleaning up item effects/attachments etc

This commit is contained in:
2022-07-27 16:39:58 +01:00
parent 8d17ce66e9
commit b52adddd5d
39 changed files with 696 additions and 844 deletions
+9 -25
View File
@@ -7,39 +7,23 @@ import Control.Lens
import Data.Aeson
import Data.Aeson.TH
data ItEffect
= NoItEffect
| ItInvEffect
{ _ieInv :: ItInvEffect --Item -> Creature -> World -> World
, _ieCounter :: Int
}
| ItRewindEffect
{ _ieInv :: ItInvEffect --Item -> Creature -> World -> World
}
| ItEffect
{ _ieInv :: ItInvEffect --Item -> Creature -> World -> World
, _ieFloor :: ItFloorEffect --Int -> World -> World
, _ieCounter :: Int
}
| ItInvEffectID
{ _ieInv :: ItInvEffect --Item -> Creature -> World -> World
, _ieMID :: Maybe Int
} -- the duplication of ieMID may cause errors...
| ItInvEffectDrop
{ _ieInv :: ItInvEffect --Item -> Creature -> World -> World
, _ieDrop :: ItDropEffect --Item -> Creature -> World -> World
, _ieMID :: Maybe Int
}
data ItEffect = ItEffect
{ _ieInv :: ItInvEffect --Item -> Creature -> World -> World
, _ieOnInsert :: ItInvEffect
, _ieOnDrop :: ItInvEffect --Item -> Creature -> World -> World
, _ieOnHeld :: ItInvEffect
, _ieOnStash :: ItInvEffect
}
deriving (Eq, Ord, Show, Read)
data ItInvEffect
= NoInvEffect
| RewindEffect
| ResetAttachmentEffect
| OnOffHeldEffect ItInvEffect ItInvEffect
| EffectIfHeld ItInvEffect ItInvEffect
| CreateHeldLight
| CreateShieldWall
| RemoveShieldWall
| EffectWhileHeld ItInvEffect
deriving (Eq, Ord, Show, Read)
data ItFloorEffect = NoFloorEffect