Add sounds, move data types out into separate folders

This commit is contained in:
2022-07-16 17:06:51 +01:00
parent f8f4766012
commit e4a4766ddf
48 changed files with 658 additions and 496 deletions
+11 -9
View File
@@ -15,28 +15,30 @@ import Shape
import qualified Data.Map.Strict as M
import Control.Lens
damageSensor
:: DamageType -- Left gets sensed, Right does damage
damageSensor
:: DamageType
-> Float
-> Maybe Int
-> PlacementSpot -> Placement
-> PlacementSpot
-> Placement
damageSensor dt wdth mtrid ps = pContID ps (PutLS $ lsPosCol (V3 0 0 30) 0.1)
$ \lsid -> Just $ spNoID ps $ PutUsingGenParams
$ \gw -> (,) gw $ PutMachine (reverse $ square wdth) $ defaultMachine
& mcColor .~ yellow
& mcMounts . at ObTrigger .~ mtrid
& mcMounts . at ObLightSource ?~ lsid
& mcDraw .~ sensorSPic wdth (_sensorCoding (_genParams gw) M.! dt)
& mcSensor .~ SensorToggleAmount False 0
& mcLSs .~ [lsid]
& mcSensor .~ DamageSensor False 0 dt
lightSensor :: Float -- -> (Machine -> World -> World)
lightSensor :: Float
-> Maybe Int
-> PlacementSpot -> Placement
-> PlacementSpot
-> Placement
lightSensor = damageSensor LASERING
sensorSPic :: Float -> (PaletteColor,DecorationShape) -> Machine -> SPic
sensorSPic wdth (pc,ds) mc = noPic
$ colorSH (_mcColor mc) (upperPrismPoly 25 (square wdth))
<> decorationToShape ds wdth wdth 25 col col
$ colorSH (_mcColor mc) (upperPrismPoly 25 (square wdth))
<> decorationToShape ds wdth wdth 25 col col
where
col = paletteToColor pc
+1 -1
View File
@@ -94,7 +94,7 @@ accessTerminal mtmid w = case mtmid of
TerminalReady -> tm
TerminalBusy -> tm
TerminalOff -> tm
& tmFutureLines .~ _tmProgram tm tm w
& tmFutureLines .~ _tmBootProgram tm tm w
& tmStatus .~ TerminalBusy
simpleTermMessage :: [String] -> Terminal
+1 -3
View File
@@ -1,9 +1,7 @@
module Dodge.Placement.Instance.Turret where
import Color
import Dodge.Data
--import Dodge.Reloading
import Dodge.Creature.State
import Dodge.Creature.Damage
import Dodge.Creature.Impulse
import Dodge.LevelGen.Data
import Dodge.Default
@@ -76,7 +74,7 @@ updateTurret rotSpeed mc w
& crDir .~ mcdir
& crUpdate .~ stateUpdate followThenClearImpulses
& crStance . posture .~ Aiming
& crApplyDamage .~ applyNoDamage
& crMaterial .~ Crystal
Just cid -> w'
& creatures . ix cid . crPos .~ mcpos
& creatures . ix cid . crDir .~ mcdir