Start adding machines for storing/distributing items
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user