Tweak clouds

This commit is contained in:
2025-06-24 16:40:00 +01:00
parent 03bc733de9
commit 35a3f005c4
4 changed files with 16 additions and 30 deletions
+10 -12
View File
@@ -5,7 +5,6 @@ module Dodge.Block (
) where
import Control.Lens
import Control.Monad
import Data.Foldable
import qualified Data.Graph.Inductive as FGL
import qualified Data.IntSet as IS
@@ -19,13 +18,10 @@ import Dodge.DrWdWd
import Dodge.LightSource
import Dodge.Material.Sound
import Dodge.Wall.Delete
import Dodge.Wall.Dust
import Dodge.Wall.Zone
import Dodge.WorldEvent.Sound
import Dodge.Zoning.Wall
import Geometry
import qualified IntMapHelp as IM
import RandomHelp
splinterBlock :: Block -> World -> World
splinterBlock bl w =
@@ -61,12 +57,13 @@ destroyBlock bl w =
& deleteWallIDs wlids
& maybeClearPaths (_blObstructs bl) -- must happen after the walls are deleted
& cWorld . lWorld . blocks %~ IM.delete (_blID bl)
& flip (foldl' $ flip (wlDustAt awl)) (map (pos +.+) ps)
-- & muchWlDustAt awl (_blPos bl)
-- & flip (foldl' $ flip (muchWlDustAt awl)) (map (pos +.+) ps)
where
wlids = _blWallIDs bl
awl = w ^?! cWorld . lWorld . walls . ix (IS.findMin wlids)
pos = fst . _wlLine $ awl
ps = replicateM 25 (randInCirc 20) & evalState $ _randGen w
-- awl = w ^?! cWorld . lWorld . walls . ix (IS.findMin wlids)
-- pos = fst . _wlLine $ awl
-- ps = replicateM 25 (randInCirc 20) & evalState $ _randGen w
-- this does not handle eg doors blocking the path as well
maybeClearPaths :: Set PathEdgeNodes -> World -> World
@@ -86,15 +83,16 @@ destroyDoor dr w =
& doDrWdWd (_drDeath dr) dr
& deleteWallIDs wlids
& cWorld . lWorld . doors %~ IM.delete (_drID dr)
& flip (foldl' (flip $ wlDustAt awl)) (map (pos +.+) ps)
-- & muchWlDustAt awl (0.5 * uncurry (+) (_drPos dr))
-- & flip (foldl' (flip $ muchWlDustAt awl)) (map (pos +.+) ps)
& stopPushing (_drPushes dr)
& destroyMounts (_drMounts dr)
where
wlids = _drWallIDs dr
--awl = _walls (_cWorld w) IM.! IS.findMin wlids
awl = w ^?! cWorld . lWorld . walls . ix (IS.findMin wlids)
pos = fst . _wlLine $ awl
ps = replicateM 25 (randInCirc 20) & evalState $ _randGen w
-- awl = w ^?! cWorld . lWorld . walls . ix (IS.findMin wlids)
-- pos = fst . _wlLine $ awl
-- ps = replicateM 25 (randInCirc 20) & evalState $ _randGen w
destroyMounts :: [MountedObject] -> World -> World
destroyMounts mos w = foldl' (flip destroyMount) w mos