Fold in more ammo parameters, distinguish loadable and charging weapons
This commit is contained in:
@@ -35,12 +35,12 @@ onBoth :: (a -> b -> c) -> (d -> a) -> (d -> b) -> d -> c
|
||||
onBoth f g h x = f (g x) (h x)
|
||||
|
||||
crIsReloading :: (World, Creature) -> Bool
|
||||
crIsReloading (_,cr) = case cr ^? crInv . ix (_crInvSel cr) . wpReloadState of
|
||||
crIsReloading (_,cr) = case cr ^? crInv . ix (_crInvSel cr) . wpAmmo . wpReloadState of
|
||||
Just t -> t > 0
|
||||
_ -> False
|
||||
|
||||
crIsReloadingR :: Creature -> Reader World Bool
|
||||
crIsReloadingR cr = return $ case cr ^? crInv . ix (_crInvSel cr) . wpReloadState of
|
||||
crIsReloadingR cr = return $ case cr ^? crInv . ix (_crInvSel cr) . wpAmmo . wpReloadState of
|
||||
Just t -> t > 0
|
||||
_ -> False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user