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 -4
View File
@@ -4,7 +4,6 @@ import Control.Lens
import Dodge.Data.World
import Dodge.Default
import Dodge.SoundLogic
import qualified IntMapHelp as IM
medkit :: Int -> Item
medkit i =
@@ -17,10 +16,10 @@ heal25 = heal 25
heal :: Int -> Int -> World -> Maybe World
heal hp n w
| _crHP (_creatures (_cWorld w) IM.! n) >= 10000 = Nothing
| (w ^?! cWorld . lWorld . creatures . ix n . crHP) >= 10000 = Nothing
| otherwise =
Just $
soundStart (CrSound $ _crID cr) (_crPos cr) healS Nothing w
& cWorld . creatures . ix n . crHP %~ min 10000 . (+ hp)
& cWorld . lWorld . creatures . ix n . crHP %~ min 10000 . (+ hp)
where
cr = _creatures (_cWorld w) IM.! n
cr = w ^?! cWorld . lWorld . creatures . ix n --_creatures (_cWorld w) IM.! n