Use a creature to "use" the weapon of a turret

This commit is contained in:
2021-12-11 18:06:04 +00:00
parent 15e1fbc060
commit cdeb3dfa67
10 changed files with 80 additions and 34 deletions
+3
View File
@@ -20,6 +20,9 @@ icTryStartReloading am
crStopReloading :: Creature -> Creature
crStopReloading cr = cr & crInv . ix (_crInvSel cr) . itConsumption . reloadState .~ Nothing'
crUpCrUp :: (Creature -> Creature) -> Creature -> World -> World
crUpCrUp f cr = creatures . ix (_crID cr) %~ f
stepReloading :: Creature -> Creature
stepReloading cr = case cr ^? crInv . ix isel . itConsumption . reloadState . _Just' of
Just 0 -> cr & crInv . ix isel . itConsumption %~ doload