Add ItEffect data as parameter to the effect itself

This commit is contained in:
jgk
2021-05-24 21:37:42 +02:00
parent 38682049c4
commit a7d4d8911d
12 changed files with 109 additions and 59 deletions
+12 -4
View File
@@ -285,11 +285,12 @@ data Item
| NoItem
data ItEffect = NoItEffect
| ItInvEffect
{_itInvEffect :: Creature -> Int -> World -> World
{_itInvEffect :: ItEffect -> Creature -> Int -> World -> World
-- the Int is the items inventory position
,_itEffectCounter :: Int
}
| ItEffect
{_itInvEffect :: Creature -> Int -> World -> World
{_itInvEffect :: ItEffect -> Creature -> Int -> World -> World
,_itFloorEffect :: Int -> World -> World
,_itEffectCounter :: Int
}
@@ -386,7 +387,7 @@ data Projectile
, _pjVel :: Point2
, _pjDraw :: Projectile -> Picture
, _pjID :: Int
, _pjUpdate :: World -> World
, _pjUpdate :: Projectile -> World -> World
}
| Shell
{ _pjPos :: Point2
@@ -394,9 +395,16 @@ data Projectile
, _pjVel :: Point2
, _pjDraw :: Projectile -> Picture
, _pjID :: Int
, _pjUpdate :: World -> World
, _pjUpdate :: Projectile -> World -> World
, _pjPayload :: Point2-> World -> World
}
| LinearShockwave
{ _pjDraw :: Projectile -> Picture
, _pjID :: Int
, _pjUpdate :: Projectile -> World -> World
, _pjPoints :: [(Point2,Point2)]
, _pjTimer :: Int
}
data Either3 a b c = E3x1 a | E3x2 b | E3x3 c
data Wall
= Wall