{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE StrictData #-} module Dodge.Data.ItEffect where import GHC.Generics import Data.Aeson import Control.Lens -- I believe this is called every frame, not sure when though data ItEffect = NoItEffect | ItInvEffect {_ieInv :: ItInvEffect --Item -> Creature -> World -> World ,_ieCounter :: Int } | ItRewindEffect {_ieInv :: ItInvEffect --Item -> Creature -> World -> World -- ,_ieStoredWorlds :: [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 } deriving (Eq,Ord,Show,Read,Generic) instance ToJSON ItEffect where toEncoding = genericToEncoding defaultOptions instance FromJSON ItEffect data ItInvEffect = NoInvEffect | RewindEffect | ResetAttachmentEffect | OnOffHeldEffect ItInvEffect ItInvEffect | CreateHeldLight | CreateShieldWall | RemoveShieldWall deriving (Eq,Ord,Show,Read,Generic) instance ToJSON ItInvEffect where toEncoding = genericToEncoding defaultOptions instance FromJSON ItInvEffect data ItFloorEffect = NoFloorEffect deriving (Eq,Ord,Show,Read,Generic) instance ToJSON ItFloorEffect where toEncoding = genericToEncoding defaultOptions instance FromJSON ItFloorEffect data ItDropEffect = NoDropEffect deriving (Eq,Ord,Show,Read,Generic) instance ToJSON ItDropEffect where toEncoding = genericToEncoding defaultOptions instance FromJSON ItDropEffect makeLenses ''ItEffect