Add key card item lock/key system

This commit is contained in:
2022-03-22 14:33:54 +00:00
parent 873abea79f
commit 774738f993
13 changed files with 74 additions and 73 deletions
+4 -2
View File
@@ -17,6 +17,7 @@ import Dodge.RandomHelp
import Dodge.WorldEvent
--import Dodge.WallCreatureCollisions
import Dodge.Creature.Action
--import Dodge.Hammer
import Geometry
import Picture
import qualified IntMapHelp as IM
@@ -51,9 +52,10 @@ stateUpdateDamage :: (Creature -> Creature)
-- -> CRUpdate
-> Creature -> World -> World
stateUpdateDamage damageupdate u cr w = case u (updateMovement cr) w of
(f, upcr) -> invSideEff upcr . movementSideEff cr . deathEff . f $ w
(f, upcr) -> mvcrhammerup . invSideEff upcr . movementSideEff cr . deathEff . f $ w
& creatures . at (_crID cr) .~ (stepReloading . damageupdate <$> crOrCorpse upcr)
where
where
mvcrhammerup = creatures . ix (_crID cr) . crHammerPosition %~ moveHammerUp
crOrCorpse cr'
| cr' ^. crHP > 0 = Just cr'
| otherwise = Nothing