Start implementing attachable scroll items
This commit is contained in:
@@ -25,6 +25,7 @@ module Dodge.Creature.Test (
|
||||
) where
|
||||
|
||||
--import MaybeHelp
|
||||
--import Control.Applicative
|
||||
import Control.Lens
|
||||
import Data.List (find)
|
||||
import Data.Maybe
|
||||
@@ -46,6 +47,15 @@ crWeaponReady cr = fromMaybe False $ do
|
||||
AboveSource -> do
|
||||
x <- cr ^? crInv . ix (i - 1) . itUse . equipEffect . eeUse . euseAmmoAmount
|
||||
return (x > 0)
|
||||
BelowSource -> do
|
||||
x <- cr ^? crInv . ix (i + 1) . itUse . equipEffect . eeUse . euseAmmoAmount
|
||||
return (x > 0)
|
||||
EitherSource -> return $
|
||||
justIsPositive (cr ^? crInv . ix (i - 1) . itUse . equipEffect . eeUse . euseAmmoAmount)
|
||||
|| justIsPositive (cr ^? crInv . ix (i + 1) . itUse . equipEffect . eeUse . euseAmmoAmount)
|
||||
where
|
||||
justIsPositive Nothing = False
|
||||
justIsPositive (Just x) = x > 0
|
||||
|
||||
crCanSeeCr :: Creature -> (World, Creature) -> Bool
|
||||
crCanSeeCr tcr (w, cr) = hasLOS (_crPos cr) (_crPos tcr) w
|
||||
|
||||
@@ -137,7 +137,8 @@ wasdWithAiming w speed cr
|
||||
(argV (_mousePos (_input w)) + (w ^. wCam . camRot))
|
||||
$ do
|
||||
itRef <- cr ^? crManipulation . manObject . inInventory . ispItem
|
||||
_ <- cr ^? crInv . ix itRef . itScope . scopePos
|
||||
-- _ <- cr ^? crInv . ix itRef . itScope . scopePos
|
||||
_ <- cr ^? crInv . ix itRef . itScope . remotePos
|
||||
return . argV $ mouseWorldPos (w ^. input) (w ^. wCam) -.- _crPos cr
|
||||
|
||||
aimTurn :: Float -> Creature -> Creature
|
||||
|
||||
Reference in New Issue
Block a user