Fix rb scrolling
This commit is contained in:
@@ -3,6 +3,7 @@ module Dodge.Creature.State (
|
||||
doDamage,
|
||||
) where
|
||||
|
||||
import Data.Maybe
|
||||
import Dodge.Creature.Test
|
||||
import Data.Foldable
|
||||
import Dodge.Base
|
||||
@@ -64,13 +65,12 @@ stateUpdate f =
|
||||
]
|
||||
|
||||
heldAimEffects :: Creature -> World -> World
|
||||
heldAimEffects cr
|
||||
| crIsAiming cr = case cr ^? crInv . ix (cr ^. crInvSel . iselPos) of
|
||||
Just itm -> case itm ^? itEffect . ieWhileAiming of
|
||||
Just f -> doInvEffect f itm cr
|
||||
_ -> id
|
||||
_ -> id
|
||||
| otherwise = id
|
||||
heldAimEffects cr = fromMaybe id $ do
|
||||
guard (crIsAiming cr)
|
||||
ipos <- cr ^? crInvSel . iselPos
|
||||
itm <- cr ^? crInv . ix ipos
|
||||
f <- itm ^? itEffect . ieWhileAiming
|
||||
return $ doInvEffect f itm cr
|
||||
|
||||
checkDeath :: Creature -> World -> World
|
||||
checkDeath cr w
|
||||
|
||||
Reference in New Issue
Block a user