Add in "linear" lWorld to separate time reversable worlds
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user