Add in "linear" lWorld to separate time reversable worlds

This commit is contained in:
2022-10-28 12:24:51 +01:00
parent 5f6bd43599
commit 7e790b7153
130 changed files with 827 additions and 980 deletions
+5 -5
View File
@@ -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