Half add explicit death event for machines

This commit is contained in:
2022-06-05 10:37:40 +01:00
parent 7398791194
commit fcc6d3952c
9 changed files with 26 additions and 10 deletions
+7 -6
View File
@@ -5,6 +5,7 @@ module Dodge.Placement.Instance.Terminal
, simpleTermMessage
, genTermMessage
, topFlushStrings
, terminalColor
) where
import Dodge.Data
import Dodge.LevelGen.Data
@@ -35,14 +36,14 @@ putTerminal' col mcf = ps0PushPS (PutButton termButton)
})
$ const Nothing
putTerminal :: (World -> TerminalParams) -> Placement
putTerminal f = ps0PushPSw PutNothing $ \_ _ -> Just $
putTerminal :: Color -> (World -> TerminalParams) -> Placement
putTerminal col f = ps0PushPSw PutNothing $ \_ _ -> Just $
ps0PushPS (PutButton $ termButton & btTerminalParams .~ f)
$ \pl -> Just $ pt0 (PutMachine terminalColor (reverse $ square 10) defaultMachine
{ _mcDraw = noPic . terminalShape terminalColor
$ \pl -> Just $ pt0 (PutMachine col (reverse $ square 10) defaultMachine
{ _mcDraw = noPic . terminalShape col
, _mcHP = 100
, _mcUpdate = machineAddSound fridgeHumS
$ machineUpdateDeathEff $ \mc -> (buttons . at (fromJust (_plMID pl)) .~ Nothing)
, _mcUpdate = machineAddSound fridgeHumS (\_ -> id)
, _mcDeath = \mc -> (buttons . at (fromJust (_plMID pl)) .~ Nothing)
. makeExplosionAt (_mcPos mc)
})
$ const Nothing