Add bounds to door rooms, tweak mounted lights

This commit is contained in:
2022-03-20 08:23:18 +00:00
parent 02adb0a915
commit e811e67ff9
8 changed files with 44 additions and 65 deletions
+10
View File
@@ -29,6 +29,16 @@ padWithAno ano (Node x xs) = Node ano [Node x (map (padWithAno ano) xs)]
padSucWithCorridors :: Tree [Annotation g] -> Tree [Annotation g]
padSucWithCorridors (Node x xs) = Node x (map padWithCorridors xs)
padSucWithDoors :: RandomGen g => Tree [Annotation g] -> Tree [Annotation g]
padSucWithDoors (Node x xs) = Node x (map (padWithAno [SpecificRoom thetree]) xs)
where
thetree = do
thecor <- shuffleLinks corridor
takeOne
[ return (UseAll door)
, treeFromPost [PassDown door, PassDown thecor] (UseAll door)
]
{- Add one to three corridors between each parent-child link of a tree of annotations. -}
randomPadCorridors :: RandomGen g => Tree [Annotation g] -> State g (Tree [Annotation g])
randomPadCorridors (Node x xs) = do
+1 -1
View File
@@ -53,7 +53,7 @@ spreadGunCrit = defaultCreature
, _crStrategy = StrategyActions WatchAndWait [StartSentinelPost]
, _crGoal = []
}
, _crInv = IM.fromList [(0,spreadGun),(1,medkit 100)]
, _crInv = IM.fromList [(0,bangStick 6),(1,medkit 100)]
, _crInvSel = 0
, _crRad = 10
, _crHP = 500
+15 -14
View File
@@ -1,5 +1,6 @@
module Dodge.Debug.Terminal
where
( applyTerminalString
) where
import Dodge.Data
import Dodge.Creature
import Dodge.Creature.YourControl
@@ -8,17 +9,17 @@ import Dodge.Creature.State
import Control.Lens
applyTerminalString :: String -> Universe -> Universe
applyTerminalString "NOCLIP" = config . debug_noclip %~ not
applyTerminalString "LOADME" = (uvWorld . creatures . ix 0 . crInv .~ stackedInventory)
. (uvWorld . creatures . ix 0 . crInvCapacity .~ 50)
applyTerminalString "GODON" =
uvWorld . creatures . ix 0 . crUpdate .~ stateUpdateDamage clearDamage yourControl
applyTerminalString "GODOFF" = uvWorld . creatures . ix 0 . crUpdate .~ stateUpdate yourControl
applyTerminalString "LOADTEST" = (uvWorld . creatures . ix 0 . crInv .~ testInventory)
. (uvWorld . creatures . ix 0 . crInvCapacity .~ 50)
applyTerminalString "LM" = applyTerminalString "LOADME"
applyTerminalString "LT" = applyTerminalString "LOADTEST"
applyTerminalString _ = id
applyTerminalString str = case str of
"NOCLIP" -> config . debug_noclip %~ not
"LOADME" -> (uvWorld . creatures . ix 0 . crInv .~ stackedInventory)
. (uvWorld . creatures . ix 0 . crInvCapacity .~ 50)
"GODON" -> uvWorld . creatures . ix 0 . crUpdate .~ stateUpdateDamage clearDamage yourControl
"GODOFF" -> uvWorld . creatures . ix 0 . crUpdate .~ stateUpdate yourControl
"LOADTEST" -> (uvWorld . creatures . ix 0 . crInv .~ testInventory)
. (uvWorld . creatures . ix 0 . crInvCapacity .~ 50)
"LM" -> applyTerminalString "LOADME"
"LT" -> applyTerminalString "LOADTEST"
_ -> loadme
loadme :: a
loadme = undefined
loadme :: a -> a
loadme = id
+1 -1
View File
@@ -34,7 +34,7 @@ import System.Random
--import qualified Data.IntMap.Strict as IM
initialAnoTree :: RandomGen g => Tree [Annotation g]
initialAnoTree = padSucWithCorridors $ treeFromTrunk
initialAnoTree = padSucWithDoors $ treeFromTrunk
[[AnoApplyInt 0 startRoom]
, [SpecificRoom $ fmap (return . UseAll) $ tanksRoom [] []]
, [PassthroughLockKeyLists 2 lockRoomKeyItems itemRooms]
-34
View File
@@ -5,7 +5,6 @@ module Dodge.Item.Weapon.BulletGuns
, biggerBlunderbuss
, biggestBlunderbuss
, grenadeLauncher
, spreadGun
, ltAutoGun
, hvAutoGun
, autogunSpread
@@ -276,39 +275,6 @@ ltAutoGun = defaultAutoGun
}
, _itTweaks = defaultBulletSelTweak
}
spreadGun :: Item
spreadGun = defaultGun
{ _itName = "SPREAD"
, _itType = SPREADGUN
, _itConsumption = defaultAmmo
{ _aoType = basicBullet
, _ammoBaseMax = 5
, _ammoLoaded = 5
, _reloadTime = 80
}
, _itUse = ruseAmmoParamsRate 20 upHammer
[ ammoCheckI
, hammerCheckI
, useTimeCheck
, withSoundStart shotgunS
, useAmmoAmount 1
, withRecoil
, withMuzFlareI
, spreadNumI
]
, _itParams = defBulletShooter
{ _muzVel = 0.7
, _rifling = 0.8
, _bore = 2
, _gunBarrels = MultiBarrel
{_brlNum = 5
,_brlSpread = SpreadBarrels 0.5
,_brlInaccuracy = 0
}
}
-- , _itFloorPict = spreadGunPic
, _itTweaks = defaultBulletSelTweak
}
multGun :: Item
multGun = defaultGun
{ _itName = "MULTGUN"
+3 -3
View File
@@ -128,7 +128,7 @@ mntLSCond :: (Point2 -> Point3 -> Shape)
-> PlacementSpot
-> Placement
mntLSCond shp ps = -- updatePSToLevel 1 (const $ PSLnk shift (const id) Nothing) $
mntLS shp 0 (V3 0 (-40) 90)
mntLS shp 0 (V3 0 (-20) 96)
& plSpot .~ ps
-- note that this perhaps pushes the vshape light out too far
@@ -139,8 +139,8 @@ mntLight a b = RandomPlacement $ do
mntLightLnkCond :: PlacementSpot -> Placement
mntLightLnkCond ps = RandomPlacement $ do
shp <- takeOne [vShape,iShape,lShape,jShape,liShape]
return $ mntLSCond shp ps
shp <- takeOne [vShape,lShape,jShape,liShape]
return $ mntLSCond (fmap (fmap $ colorSH black) shp) ps
spanLSLightI :: LightSource -> Float -> Point2 -> Point2 -> Placement
spanLSLightI ls h a b = ps0j (PutLS $ ls & lsParam . lsPos .~ V3 x y h)
+1 -1
View File
@@ -21,7 +21,7 @@ door = defaultRoom
-- door extends into side walls (for shadows as rendered 12/03)
, _rmPmnts = [putAutoDoor (V2 0 20) (V2 40 20)]
, _rmName = "autoDoor"
-- note no bounds
, _rmBound = [rectNSWE 21 19 0 40]
}
where
lnks = [uncurry outLink (V2 20 35,0)
+13 -11
View File
@@ -136,16 +136,15 @@ roomMiniIntro = do
return $ chainUses [return $ UseAll corridor,return $ UseAll corridor,return $ UseAll corridor,return $ UseAll door, midroom,return $ UseAll corridor]
roomCenterPillar :: RandomGen g => State g Room
roomCenterPillar = randomiseAllLinks . restrictInLinks ((\p -> dist p (V2 120 0) < 10) . fst)
roomCenterPillar = shuffleLinks . restrictInLinks ((\p -> dist p (V2 120 0) < 10) . fst)
$ set rmPmnts plmnts $ roomRect 240 240 2 2
where
plmnts =
[ blockLine (V2 115 115) (V2 115 125)
, blockLine (V2 125 115) (V2 125 125)
--, sPS (V2 40 120) 0 putLamp
--, sPS (V2 200 120) 0 putLamp
, mntLightLnkCond useUnusedLnk
, mntLightLnkCond useUnusedLnk
, mntLightLnkCond (resetPLUse $ rprBool $ \rp _ -> isInLnk rp)
]
roomOctogon :: Room
@@ -179,7 +178,7 @@ randFirstWeapon = do
takeOne $ map PutFlIt $
replicate 10 pistol
++ replicate 5 ltAutoGun
++ replicate 5 spreadGun
++ replicate 5 (bangStick 3)
++ replicate 5 multGun
++ replicate 2 autoGun
++ [launcher]
@@ -200,24 +199,27 @@ weaponEmptyRoom = do
$ restrictRMInLinksPD f (roomRect w h 2 2 & rmPmnts .~ plmnts)
return $ treeFromTrunk [PassDown corridor] (singleUseAll rm )
weaponUnderCrits :: RandomGen g => State g (SubCompTree Room)
weaponUnderCrits = do
weaponUnderCrits :: RandomGen g => Int -> State g (SubCompTree Room)
weaponUnderCrits i = do
let plmnts =
[--sPS (V2 20 0) 0 $ RandPS randFirstWeapon
sPS (V2 20 0) (negate $ pi/2) randC1
,sPS (V2 20 20) (negate $ pi/2) randC1
]
addwpat p = rmPmnts %~ ((PickOnePlacement 0 $ sPS p 0 $ RandPS randFirstWeapon) :)
addwpat p = rmPmnts .:~ PickOnePlacement i (sPS p 0 $ RandPS randFirstWeapon)
let continuationRoom = treeFromTrunk
[PassDown $ addwpat (V2 20 0) corridorN,PassDown $ addwpat (V2 20 0) corridorN]
(singleUseAll (set rmPmnts plmnts corridorN))
rcp <- roomCenterPillar
rcp <- roomCenterPillar
rmpils <- roomPillars 30 240 240 2 2
deadEndRoom' <- takeOne
[ addwpat (V2 120 20) rmpils
, addwpat (V2 120 20) rcp]
junctionRoom <- takeOne [PassDown tEast,PassDown tWest]
return $ treeFromTrunk [PassDown corridorN,PassDown corridorN]
return $ treeFromTrunk
--[PassDown $ corridorN & rmPmnts .:~ mntLightLnkCond (resetPLUse $ rprBool $ \rp _ -> isInLnk rp)
[PassDown corridorN
,PassDown corridorN]
$ Node junctionRoom
[continuationRoom
,singleUseNone deadEndRoom'
@@ -294,9 +296,9 @@ deadEndRoom = defaultRoom
weaponRoom :: RandomGen g => State g (SubCompTree Room)
weaponRoom = join $ takeOne
-- [ weaponEmptyRoom
-- , weaponUnderCrits
[ weaponUnderCrits 0
-- , weaponBehindPillar
[ weaponBetweenPillars
-- , weaponBetweenPillars
-- , weaponLongCorridor
]