Add in "linear" lWorld to separate time reversable worlds
This commit is contained in:
+5
-5
@@ -40,7 +40,7 @@ mvBullet x w bu
|
||||
|
||||
applyMagnetsToBul :: Bullet -> World -> Bullet
|
||||
applyMagnetsToBul bu =
|
||||
foldl' (flip doMagnetBuBu) bu . _magnets . _cWorld
|
||||
foldl' (flip doMagnetBuBu) bu . _magnets . _lWorld . _cWorld
|
||||
|
||||
updateBulVel :: Bullet -> Bullet
|
||||
updateBulVel bt = case _buTrajectory bt of
|
||||
@@ -55,7 +55,7 @@ updateBulVel bt = case _buTrajectory bt of
|
||||
|
||||
useAmmoParams :: Item -> Creature -> World -> World
|
||||
useAmmoParams it cr w =
|
||||
w & cWorld . instantBullets
|
||||
w & cWorld . lWorld . instantBullets
|
||||
.:~ ( _amBullet bultype
|
||||
& buPos .~ sp
|
||||
& buTrajectory %~ settrajectory
|
||||
@@ -89,7 +89,7 @@ bulletSpawn :: Bullet -> Maybe (Point2 -> World -> World)
|
||||
bulletSpawn bu = case _buSpawn bu of
|
||||
BulSpark -> Nothing
|
||||
BulBall IncBall -> Just incBallAt
|
||||
BulBall ConcBall -> Just $ \p -> cWorld . shockwaves .:~ concBall p
|
||||
BulBall ConcBall -> Just $ \p -> cWorld . lWorld . shockwaves .:~ concBall p
|
||||
BulBall TeslaBall -> Just makeStaticBall
|
||||
|
||||
hitEffFromBul ::
|
||||
@@ -125,8 +125,8 @@ setFromToDams bu p = map f (_buDamages bu)
|
||||
|
||||
damageThingHit :: Bullet -> (Point2, Either Creature Wall) -> World -> World
|
||||
damageThingHit bu (p, crwl) = case crwl of
|
||||
Left cr -> cWorld . creatures . ix (_crID cr) . crState . csDamage .++~ dams
|
||||
Right wl -> cWorld . wallDamages %~ IM.insertWith (++) (_wlID wl) dams
|
||||
Left cr -> cWorld . lWorld . creatures . ix (_crID cr) . crState . csDamage .++~ dams
|
||||
Right wl -> cWorld . lWorld . wallDamages %~ IM.insertWith (++) (_wlID wl) dams
|
||||
where
|
||||
dams = setFromToDams bu p
|
||||
|
||||
|
||||
Reference in New Issue
Block a user