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
+3 -3
View File
@@ -18,8 +18,8 @@ updateBarreloid cr = case cr ^?! crType . barrelType of
-- should generate the sparks externally using new random generators
updateExpBarrel :: Creature -> World -> World
updateExpBarrel cr w
| _crHP cr > 0 = foldl' (flip ($)) (hiss w & cWorld . creatures . at (_crID cr) .~ newCr) pierceSparks
| otherwise = makeExplosionAt (_crPos cr) $ stopSounds w & cWorld . creatures . at (_crID cr) .~ Nothing
| _crHP cr > 0 = foldl' (flip ($)) (hiss w & cWorld . lWorld . creatures . at (_crID cr) .~ newCr) pierceSparks
| otherwise = makeExplosionAt (_crPos cr) $ stopSounds w & cWorld . lWorld . creatures . at (_crID cr) .~ Nothing
where
g = _randGen w
damages = _csDamage $ _crState cr
@@ -45,7 +45,7 @@ updateExpBarrel cr w
updateBarrel :: Creature -> World -> World
updateBarrel cr
| _crHP cr > 0 = doDamage cr
| otherwise = cWorld . creatures . at (_crID cr) .~ Nothing
| otherwise = cWorld . lWorld . creatures . at (_crID cr) .~ Nothing
damsToExpBarrel :: [Damage] -> Creature -> Creature
damsToExpBarrel ds cr = foldl' damToExpBarrel (foldl' damToExpBarrel cr pierceDam) otherDam