Introduce destructible switches
This commit is contained in:
@@ -24,6 +24,7 @@ destroyMcType mt mc w = case mt of
|
||||
McTurret tu -> fromMaybe w $ do
|
||||
itm <- w ^? cWorld . lWorld . items . ix (tu ^. tuWeapon)
|
||||
return $ copyItemToFloor (_mcPos mc) itm w
|
||||
McTrigger i -> w & cWorld . lWorld . triggers . ix i %~ not
|
||||
_ -> w
|
||||
|
||||
mcKillTerm :: Machine -> World -> World
|
||||
|
||||
@@ -23,7 +23,7 @@ drawMachine cw mc = case _mcType mc of
|
||||
McProxSensor {} -> drawBaseMachine 25 mc
|
||||
McStorage {} -> noPic $ colorSH (mcColor mc) storageShape
|
||||
McDistributer {} -> drawBaseMachine 25 mc
|
||||
McInterrupter {} -> drawBaseMachine 25 mc
|
||||
McTrigger {} -> drawBaseMachine 25 mc
|
||||
where
|
||||
lw = cw ^. lWorld
|
||||
gp = cw ^. cwGen . cwgParams . sensorCoding
|
||||
@@ -88,7 +88,7 @@ mcColor mc = case mc ^. mcType of
|
||||
McTurret {} -> blue
|
||||
McStorage {} -> orange
|
||||
McDistributer {} -> green
|
||||
McInterrupter {} -> red
|
||||
McTrigger {} -> red
|
||||
|
||||
|
||||
drawTurret :: LWorld -> Turret -> Machine -> SPic
|
||||
|
||||
@@ -39,7 +39,7 @@ mcTypeUpdate mc = \case
|
||||
McProxSensor se -> mcProxSensorTriggerUpdate se mc . mcProxSensorUpdate se mc
|
||||
McStorage{} -> id
|
||||
McDistributer{} -> id
|
||||
McInterrupter{} -> id
|
||||
McTrigger{} -> id
|
||||
|
||||
terminalScreenGlow :: Machine -> World -> World
|
||||
terminalScreenGlow mc w = fromMaybe w $ do
|
||||
@@ -157,7 +157,7 @@ mcBackgroundSound mc = case mc ^. mcType of
|
||||
McProxSensor{} -> Just (throbC4S,0.5)
|
||||
McStorage{} -> Nothing
|
||||
McDistributer{} -> Just (whirS,0.5)
|
||||
McInterrupter{} -> Just (throbC4S,0.5)
|
||||
McTrigger{} -> Just (throbC4S,0.5)
|
||||
|
||||
mcApplyDamage :: [Damage] -> Machine -> World -> World
|
||||
mcApplyDamage ds mc = case mc ^? mcType . _McDamSensor of
|
||||
|
||||
Reference in New Issue
Block a user