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
@@ -16,7 +16,6 @@ import Dodge.FloatFunction
import Dodge.RandImpulse
import Dodge.SoundLogic
import Geometry
import qualified IntMapHelp as IM
import LensHelp
import System.Random
@@ -25,7 +24,7 @@ impulsiveAIBefore ::
Creature ->
World ->
World
impulsiveAIBefore f cr w = g w & cWorld . creatures . ix (_crID cr) .~ cr'
impulsiveAIBefore f cr w = g w & cWorld . lWorld . creatures . ix (_crID cr) .~ cr'
where
(g, cr') = followImpulses w $ f w cr
@@ -80,10 +79,10 @@ followImpulse cr w imp = case imp of
cpos = _crPos cr
cdir = _crDir cr
cid = _crID cr
posFromID cid' = _crPos $ _creatures (_cWorld w) IM.! cid'
posFromID cid' = w ^?! cWorld . lWorld . creatures . ix cid' . crPos
rr a = randomR (- a, a) $ _randGen w
hitCr i =
( cWorld . creatures . ix i . crState . csDamage
( cWorld . lWorld . creatures . ix i . crState . csDamage
.:~ Damage BLUNT 100 cpos (posFromID i) (posFromID i) NoDamageEffect
)
. soundStart (CrSound cid) cpos hitS Nothing