diff --git a/src/Dodge/Block/Debris.hs b/src/Dodge/Block/Debris.hs index 09975628d..4b20fc941 100644 --- a/src/Dodge/Block/Debris.hs +++ b/src/Dodge/Block/Debris.hs @@ -31,8 +31,7 @@ makeDoorDebris dr w = w & makeDebris mt p mt = fromMaybe Stone $ do wlids <- w ^? cWorld . lWorld . doors . ix (_drID dr) . drFootPrint ((wlid,_),_) <- IM.minViewWithKey wlids - wl <- w ^? cWorld . lWorld . walls . ix wlid - return $ wl ^. wlMaterial + w ^? cWorld . lWorld . walls . ix wlid . wlMaterial makeBlockDebris :: Block -> World -> World makeBlockDebris bl w = foldl' (flip $ makeDebris mt) w ps diff --git a/src/Dodge/Projectile/Update.hs b/src/Dodge/Projectile/Update.hs index a3309506f..e073ef93f 100644 --- a/src/Dodge/Projectile/Update.hs +++ b/src/Dodge/Projectile/Update.hs @@ -128,7 +128,6 @@ tryThrust pj = fromMaybe id $ do doThrust :: Projectile -> Maybe RocketSmoke -> World -> World doThrust pj smoke w = ---doThrust pj _ w = w & randGen .~ g & cWorld . lWorld . projectiles . ix i . pjVel . _xy %~ (\v -> accel + frict *^ v) diff --git a/src/Dodge/Room/LongDoor.hs b/src/Dodge/Room/LongDoor.hs index 69fe99699..ae0d25e0a 100644 --- a/src/Dodge/Room/LongDoor.hs +++ b/src/Dodge/Room/LongDoor.hs @@ -94,13 +94,12 @@ addSouthPillars x h r = do return $ r & rmPmnts .++~ pillars addButtonSlowDoor :: RandomGen g => Float -> Float -> Room -> State g Room -addButtonSlowDoor x h rm = do - shuffleLinks $ - setOutLinksPD (f (> h + 40)) $ - setInLinksPD (f (< h - 40)) $ - rm - & rmPmnts <>~ [butDoor, theterminal] - & rmBound .:~ openDoorBound +addButtonSlowDoor x h = + shuffleLinks + . setOutLinksPD (f (> h + 40)) + . setInLinksPD (f (< h - 40)) + . (rmPmnts <>~ [butDoor, theterminal]) + . (rmBound .:~ openDoorBound) where f g y = g $ y ^. _1 . _y theterminal = diff --git a/src/Dodge/WorldBool.hs b/src/Dodge/WorldBool.hs index 7723044c0..bc29993fa 100644 --- a/src/Dodge/WorldBool.hs +++ b/src/Dodge/WorldBool.hs @@ -14,6 +14,7 @@ doWdBl wb w = case wb of WdBlDoorMoving i -> fromMaybe False $ do dr <- w ^? cWorld . lWorld . doors . ix i return (0 /= _drLerp dr && 1 /= _drLerp dr) - WdBlCrFilterNearPoint r p t -> any (crNearPoint r p) (IM.filter (doCrBl t) (w ^. cWorld . lWorld . creatures)) + WdBlCrFilterNearPoint r p t + -> any (crNearPoint r p) (IM.filter (doCrBl t) (w ^. cWorld . lWorld . creatures)) WdBlBtOn btid -> w ^?! cWorld . lWorld . buttons . ix btid . btEvent . btOn -- unsafe WdBlNegate x -> not $ doWdBl x w diff --git a/src/Dodge/WorldEvent/Explosion.hs b/src/Dodge/WorldEvent/Explosion.hs index 5b02bcfe8..00f1d3705 100644 --- a/src/Dodge/WorldEvent/Explosion.hs +++ b/src/Dodge/WorldEvent/Explosion.hs @@ -8,6 +8,7 @@ module Dodge.WorldEvent.Explosion ( makeTeslaExplosionAt, ) where +import Linear import Control.Monad import Data.List import Dodge.Data.World @@ -19,8 +20,6 @@ import Geometry import LensHelp import Picture import RandomHelp -import Linear.V3 -import Linear.Metric makePoisonExplosionAt :: -- | Position @@ -72,19 +71,17 @@ makeFlameExplosionAt p w = makeExplosionAt :: Point3 -> Point3 -> World -> World makeExplosionAt p vel w = ---makeExplosionAt p _ w = w & soundStart (Explosion (w ^. cWorld . lWorld . lClock)) (p ^. _xy) bangS Nothing & addFlames & cWorld . lWorld . worldEvents .:~ MakeTempLight (LSParam p 150 (V3 1 0.5 0)) 20 & makeShockwaveAt [] p 50 100 1 white --- & makeShockwaveAt [] p 50 5000 1 white where fVs = fmap (`v2z` 0) $ replicateM 100 (randInCirc 1) & evalState $ _randGen w fPs' = fmap (`v2z` 0) $ replicateM 100 (randInCirc 5) & evalState $ _randGen w fdamps = replicateM 100 (state $ randomR (0,1)) & evalState $ _randGen w - inversePushOut v = (15 - norm v) * 0.01 *.*.* v + inversePushOut v = (15 - norm v) * 0.01 *^ v fVs' = zipWith (+.+.+) fVs $ map inversePushOut fPs' sizes = randomRs (2, 9) $ _randGen w times = randomRs (15, 20) $ _randGen w