Add ItEffect data as parameter to the effect itself

This commit is contained in:
2021-05-24 21:37:42 +02:00
parent 38682049c4
commit a7d4d8911d
12 changed files with 109 additions and 59 deletions
+2 -2
View File
@@ -128,7 +128,7 @@ tractorBeamAt colID i pos dir = Projectile
, _pjVel = d
, _pjDraw = \_ -> blank
, _pjID = i
, _pjUpdate = updateTractor colID 10 i
, _pjUpdate = \_ -> updateTractor colID 10 i
}
where
d = unitVectorAtAngle dir
@@ -138,7 +138,7 @@ tractorBeamAt colID i pos dir = Projectile
The interaction of this with objects, walls etc needs more thought. -}
updateTractor :: Int -> Int -> Int -> World -> World
updateTractor colID time i w
| time > 0 = set (projectiles . ix i . pjUpdate) (updateTractor colID (time-1) i)
| time > 0 = set (projectiles . ix i . pjUpdate) (\_ -> updateTractor colID (time-1) i)
$ set (projectiles . ix i . pjDraw) (\_ -> pic)
$ over creatures (IM.map tractCr)
$ over floorItems (IM.map tractFlIt)