Simplify analyser machines somewhat

This commit is contained in:
2025-09-16 21:41:26 +01:00
parent 203919933c
commit 81d6727d8e
21 changed files with 418 additions and 464 deletions
+1 -30
View File
@@ -20,33 +20,4 @@ analyser proxreq pslight psmc = extTrigLitPos pslight $ \tp ->
defaultMachine & mcColor .~ aquamarine
& mcType .~ McTerminal
& mcHP .~ 100
& mcType .~ McSensor (defaultProximitySensor{_proxRequirement = proxreq})
--this can probably be deleted
--mcProximitySensorUpdate :: Machine -> World -> World
--mcProximitySensorUpdate mc w = case
-- (_proxStatus sens
-- , _sensToggle sens
-- , mcProxTest mc w
-- , dist (_crPos ycr) (_mcPos mc) < _proxDist sens) of
-- (_,True,_,_) -> w
-- (_,False,True,True) -> w
-- & machines . ix (_mcID mc) . mcSensor . sensToggle .~ True
-- & playsound dedaS
-- & machines . ix (_mcID mc) . mcSensor . proxStatus .~ IsClose
-- (NotClose,_,False,True) -> w & playsound dedumS
-- & machines . ix (_mcID mc) . mcSensor . proxStatus .~ IsClose
-- (_,_,_,False) -> w & machines . ix (_mcID mc) . mcSensor . proxStatus .~ NotClose
-- _ -> w
-- where
-- playsound sid = soundContinue (MachineAltSound (_mcID mc)) (_mcPos mc) sid Nothing
-- ycr = you w
-- sens = _mcSensor mc
--
--mcProxTest :: Machine -> World -> Bool
--mcProxTest mc w = case mc ^? mcSensor . proxRequirement of
-- Just (RequireHealth x) -> _crHP cr >= x
-- Just (RequireEquipment ct) -> any (\itm -> _iyBase (_itType itm) == ct) (_crInv cr)
-- _ -> False
-- where
-- cr = you w
& mcType .~ McProxSensor (defaultProximitySensor{_proxRequirement = proxreq})
+2 -2
View File
@@ -25,8 +25,8 @@ damageSensor dt wdth mtrid ps = pContID ps (PutLS $ lsPosCol (V3 0 0 30) 0.1) $
& mcMounts . at OTTrigger .~ mtrid
& mcMounts . at OTLightSource ?~ lsid
& mcType
.~ McSensor
( DamageSensor
.~ McDamSensor
( DamSensor
False
0
dt
-2
View File
@@ -10,7 +10,6 @@ import Data.Maybe
import Dodge.Data.GenWorld
import Dodge.Default
import Dodge.LevelGen.PlacementHelper
import Dodge.SoundLogic
import Dodge.WorldEffect
import Geometry
import LensHelp
@@ -36,7 +35,6 @@ putTerminalFull f col mc tm =
(reverse $ square 10)
( mc & mcMounts . at OTButton ?~ fromJust (_plMID btpl)
& mcMounts . at OTTerminal .~ _plMID tmpl
& mcCloseSound ?~ fridgeHumS
)
defaultSensorWall
Nothing