Start adding machines for storing/distributing items

This commit is contained in:
2025-12-08 22:37:43 +00:00
parent 9e98cdc34b
commit 8b028c7f94
12 changed files with 251 additions and 181 deletions
+11
View File
@@ -1,5 +1,6 @@
module Dodge.Machine.Draw (drawMachine) where
import Dodge.Room.Foreground
import Control.Lens
import qualified Data.Map.Strict as M
import Data.Maybe
@@ -20,10 +21,18 @@ drawMachine cw mc = case _mcType mc of
McTurret tu -> drawBaseMachine 20 mc <> drawTurret lw tu mc
McDamSensor se -> drawBaseMachine 25 mc <> drawDamSensor gp se
McProxSensor {} -> drawBaseMachine 25 mc
McStorage {} -> noPic $ colorSH (mcColor mc) storageShape
McDistributer {} -> drawBaseMachine 25 mc
where
lw = cw ^. lWorld
gp = cw ^. cwGen . cwgParams . sensorCoding
storageShape :: Shape
storageShape = upperBox Large Typical 31 (polyCirc 4 20) <>
foldMap toprail (take 8 [0, pi / 4 ..])
where
toprail a = rotateSH a $ thinHighBar 31 (V2 0 20) (rotateV (pi / 4) $ V2 0 20)
drawDamSensor ::
M.Map SensorType (PaletteColor, DecorationShape) ->
DamageSensor ->
@@ -76,6 +85,8 @@ mcColor mc = case mc ^. mcType of
McDamSensor {} -> yellow
McProxSensor {} -> aquamarine
McTurret {} -> blue
McStorage {} -> orange
McDistributer {} -> red
drawTurret :: LWorld -> Turret -> Machine -> SPic
+2
View File
@@ -36,6 +36,8 @@ mcTypeUpdate mc = \case
McTurret tu -> updateTurret (_tuTurnSpeed tu) mc
McDamSensor se -> mcDamSensorTriggerUpdate se mc . mcDamSensorUpdate se mc
McProxSensor se -> mcProxSensorTriggerUpdate se mc . mcProxSensorUpdate se mc
McStorage {} -> id
McDistributer {} -> id
terminalScreenGlow :: Machine -> World -> World
terminalScreenGlow mc w = fromMaybe w $ do