Add in "linear" lWorld to separate time reversable worlds
This commit is contained in:
@@ -38,7 +38,7 @@ autoEffect :: (Item -> Creature -> World -> World) -> Int -> SoundID -> Item ->
|
||||
autoEffect eff t sid itm cr w
|
||||
| _eparamInt (_eeParams (_equipEffect $ _itUse itm)) < 1 =
|
||||
eff itm cr w
|
||||
& cWorld . creatures . ix (_crID cr) . crInv . ix (_ipInvID $ _itLocation itm)
|
||||
& cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix (_ipInvID $ _itLocation itm)
|
||||
. itUse
|
||||
. equipEffect
|
||||
. eeParams
|
||||
@@ -47,7 +47,7 @@ autoEffect eff t sid itm cr w
|
||||
& soundStart OnceSound (_crPos cr) sid Nothing
|
||||
| otherwise =
|
||||
w
|
||||
& cWorld . creatures . ix (_crID cr) . crInv . ix (_ipInvID $ _itLocation itm)
|
||||
& cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix (_ipInvID $ _itLocation itm)
|
||||
. itUse
|
||||
. equipEffect
|
||||
. eeParams
|
||||
@@ -86,10 +86,10 @@ targetRBCreatureUp it cr w t
|
||||
mwp = mouseWorldPos w
|
||||
updatePos t' = t' & tgPos .~ posFromMaybeID (_tgID t')
|
||||
posFromMaybeID Nothing = Nothing
|
||||
posFromMaybeID (Just i) = w ^? cWorld . creatures . ix i . crPos
|
||||
posFromMaybeID (Just i) = w ^? cWorld . lWorld . creatures . ix i . crPos
|
||||
canSeeTarget = fromMaybe False $ do
|
||||
cid <- t ^? tgID . _Just
|
||||
cpos <- w ^? cWorld . creatures . ix cid . crPos
|
||||
cpos <- w ^? cWorld . lWorld . creatures . ix cid . crPos
|
||||
Just $ hasLOS cpos (_crPos cr) w
|
||||
|
||||
targetUpdateWith ::
|
||||
@@ -141,7 +141,7 @@ targetLaserUpdate _ cr w t
|
||||
sp = _crPos cr +.+ 15 *.* unitVectorAtAngle (_crDir cr)
|
||||
ep = sp +.+ 5000 *.* normalizeV (mouseWorldPos w -.- sp)
|
||||
addLaserPic =
|
||||
cWorld . lasers
|
||||
cWorld . lWorld . lasers
|
||||
.:~ LaserStart
|
||||
{ _lpPhaseV = 1
|
||||
, _lpDir = _crDir cr
|
||||
|
||||
Reference in New Issue
Block a user