Add sound, cleanup
This commit is contained in:
+14
-14
@@ -1,6 +1,5 @@
|
||||
module Dodge.Machine.Draw (drawMachine) where
|
||||
|
||||
import Dodge.Room.Foreground
|
||||
import Control.Lens
|
||||
import qualified Data.Map.Strict as M
|
||||
import Data.Maybe
|
||||
@@ -8,6 +7,7 @@ import Dodge.Data.CWorld
|
||||
import Dodge.Item.Draw.SPic
|
||||
import Dodge.Item.HeldOffset
|
||||
import Dodge.Placement.TopDecoration
|
||||
import Dodge.Room.Foreground
|
||||
import Dodge.Terminal.Color
|
||||
import Geometry
|
||||
import Picture
|
||||
@@ -20,17 +20,18 @@ drawMachine cw mc = case _mcType mc of
|
||||
McTerminal -> terminalSPic lw mc
|
||||
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
|
||||
McTrigger {} -> drawBaseMachine 25 mc
|
||||
McProxSensor{} -> drawBaseMachine 25 mc
|
||||
McStorage{} -> noPic $ colorSH (mcColor mc) storageShape
|
||||
McDistributer{} -> drawBaseMachine 25 mc
|
||||
McTrigger{} -> 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 ..])
|
||||
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)
|
||||
|
||||
@@ -83,13 +84,12 @@ mcColor :: Machine -> Color
|
||||
mcColor mc = case mc ^. mcType of
|
||||
McStatic -> blue
|
||||
McTerminal -> dark magenta
|
||||
McDamSensor {} -> yellow
|
||||
McProxSensor {} -> aquamarine
|
||||
McTurret {} -> blue
|
||||
McStorage {} -> orange
|
||||
McDistributer {} -> green
|
||||
McTrigger {} -> red
|
||||
|
||||
McDamSensor{} -> yellow
|
||||
McProxSensor{} -> aquamarine
|
||||
McTurret{} -> blue
|
||||
McStorage{} -> orange
|
||||
McDistributer{} -> green
|
||||
McTrigger{} -> red
|
||||
|
||||
drawTurret :: LWorld -> Turret -> Machine -> SPic
|
||||
drawTurret lw tu mc = fold $ do
|
||||
|
||||
@@ -162,7 +162,7 @@ mcBackgroundSound mc = case mc ^. mcType of
|
||||
McProxSensor{} -> Just (throbC4S,0.5)
|
||||
McStorage{} -> Nothing
|
||||
McDistributer{} -> Just (whirS,0.5)
|
||||
McTrigger{} -> Just (throbC4S,0.5)
|
||||
McTrigger{} -> Just (throb1S,0.5)
|
||||
|
||||
mcApplyDamage :: [Damage] -> Machine -> World -> World
|
||||
mcApplyDamage ds mc = case mc ^? mcType . _McDamSensor of
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user