Start work on crafting/combinations

This commit is contained in:
2021-12-02 00:50:29 +00:00
parent ce06845278
commit 85ededc158
28 changed files with 189 additions and 112 deletions
+1 -13
View File
@@ -10,7 +10,7 @@ module Dodge.Creature.Action
-- , startReloadingWeapon
, blinkAction
, sizeSelf
, crAutoReload
-- , crAutoReload
, copyInvItemToFloor
, youDropItem
, pickUpItem
@@ -144,18 +144,6 @@ performAction cr w ac = case ac of
(imps , _) -> (imps, Just $ DoReplicatePartial sac (t-1) sac)
NoAction -> ([],Nothing)
{- | Start reloading if clip is empty. -}
crAutoReload :: Creature -> Creature
crAutoReload cr = case cr ^? ptrItConsumption' . ammoLoaded of
Just 0 | _posture (_crStance cr) /= Aiming
-> cr & ptrItConsumption . reloadState .~ (strictify reloadT)
& ptrItConsumption . ammoLoaded %~ (`fromMaybe` maxA)
_ -> cr
where
ptrItConsumption = crInv . ix (_crInvSel cr) . itConsumption
ptrItConsumption' = crInv . ix (_crInvSel cr) . itConsumption
reloadT = cr ^? ptrItConsumption' . reloadTime
maxA = cr ^? ptrItConsumption' . ammoMax
{- | Teleport a creature to the mouse position -}
blinkAction
:: Creature