Start targeting refactor

This commit is contained in:
2022-07-20 22:54:05 +01:00
parent 866196ab3e
commit a89b0c784f
4 changed files with 39 additions and 27 deletions
+2 -26
View File
@@ -10,6 +10,7 @@ circular imports are probably not a good idea.
{-# LANGUAGE DerivingStrategies #-}
module Dodge.Data
( module Dodge.Data
, module Dodge.Data.Targeting
, module Dodge.Data.ItEffect
, module Dodge.Data.Hammer
, module Dodge.Data.Item.Use
@@ -65,6 +66,7 @@ module Dodge.Data
, module Dodge.Data.RadarBlip
, module Dodge.Data.PathGraph
) where
import Dodge.Data.Targeting
import Dodge.Data.ItEffect
import Dodge.Data.Hammer
import Dodge.Data.Item.Use
@@ -442,31 +444,6 @@ data Targeting
, _tgActive :: Bool
}
-- 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
}
data IntID a = IntID Int a
data WorldBeams = WorldBeams
@@ -1227,7 +1204,6 @@ makeLenses ''CreatureState
makeLenses ''World
makeLenses ''Creature
makeLenses ''Item
makeLenses ''ItEffect
makeLenses ''FloorItem
makeLenses ''TweakParam
makeLenses ''Prop
+29
View File
@@ -1,4 +1,32 @@
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StrictData #-}
module Dodge.Data.ItEffect where
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
}
data ItInvEffect = NoInvEffect
| RewindEffect
@@ -9,3 +37,4 @@ data ItInvEffect = NoInvEffect
| RemoveShieldWall
data ItFloorEffect = NoFloorEffect
data ItDropEffect = NoDropEffect
makeLenses ''ItEffect
+7
View File
@@ -0,0 +1,7 @@
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StrictData #-}
module Dodge.Data.Targeting where
data TargetUpdate = NoTargeting
data TargetDraw = SquareTarget
+1 -1
View File
@@ -20,7 +20,7 @@ rewindGun = defaultLeftItem
{ _wpMaxCharge = 250
, _wpCharge = 0
}
, _itEffect = ItRewindEffect RewindEffect []
, _itEffect = ItRewindEffect RewindEffect-- []
, _itUse = defaultlUse
& lUse .~ LRewind --useRewindGun
& eqEq . eqSite .~ GoesOnChest