Add basic vocalizations to chase creatures

This commit is contained in:
2021-11-18 01:46:37 +00:00
parent 5949ad2b3d
commit f6d5d5a201
34 changed files with 525 additions and 329 deletions
+15
View File
@@ -66,3 +66,18 @@ putLitButOnPos col f subpl
changeLight lsid = lightSources . ix lsid . lsIntensity .~ V3 0 0.5 0
ls = defaultLS { _lsRad = 75 , _lsIntensity = V3 0.5 0 0 }
thePS = PSLnk f (const id) Nothing
putLitButOnPosExtTrig :: Color -> (RoomPos -> Maybe PlacementSpot) -> Placement
putLitButOnPosExtTrig col f
= psPtCont thePS (PutTrigger (const False))
$ \tp -> Just $ plSpot .~ _plSpot tp $ mntLSOn aShape (Just col) ls 0 (V3 0 (-40) 40)
$ \plmnt -> let lsid = fromJust $ _plMID plmnt
in jps0 (PutButton (makeButton col (changeLight lsid . oneff (trigid tp)))
{_btPos = V2 0 (-1), _btRot = pi})
(const Nothing) <&> plSpot .~ _plSpot plmnt
where
trigid tp = fromJust $ _plMID tp
oneff tid = triggers . ix tid .~ const True
changeLight lsid = lightSources . ix lsid . lsIntensity .~ V3 0 0.5 0
ls = defaultLS { _lsRad = 75 , _lsIntensity = V3 0.5 0 0 }
thePS = PSLnk f (const id) Nothing
@@ -107,6 +107,13 @@ spanLSLightI ls h a b = ps0j (PutLS ls {_lsPos = V3 x y h})
where
V2 x y = 0.5 *.* (a +.+ b)
spanLS :: LightSource -> Point2 -> Point2 -> Placement
spanLS ls a b = Placement (PS (V2 x y) 0) (PutLS ls) Nothing
$ const $ Just $ sps0 $ PutForeground $ thinHighBar h a b
where
V3 _ _ h = _lsPos ls + 5
V2 x y = 0.5 *.* (a +.+ b)
spanColLightI :: Point3 -> Float -> Point2 -> Point2 -> Placement
spanColLightI col h a b = ps0j (PutLS $ colorLightAt col (V3 x y (h-5)) 0)
$ sps0 $ PutForeground $ thinHighBar h a b