Add roots and parents to adjacency function from Double Trees
This commit is contained in:
+13
-13
@@ -6,14 +6,14 @@ module Dodge.Creature.State (
|
||||
import Dodge.Item.Display -- this should not really be imported... TODO move canAttachTargetingBelow
|
||||
import Control.Applicative
|
||||
import Data.Foldable
|
||||
import Data.Maybe
|
||||
--import Data.Maybe
|
||||
import Dodge.Base
|
||||
import Dodge.Corpse.Make
|
||||
import Dodge.Creature.Action
|
||||
import Dodge.Creature.Damage
|
||||
import Dodge.Creature.Impulse.Movement
|
||||
import Dodge.Creature.State.WalkCycle
|
||||
import Dodge.Creature.Test
|
||||
--import Dodge.Creature.Test
|
||||
import Dodge.Damage
|
||||
import Dodge.Data.World
|
||||
import Dodge.EnergyBall
|
||||
@@ -62,20 +62,20 @@ stateUpdate f =
|
||||
, updateInv -- upInv must be called before invSideEff 22.05.23
|
||||
, invSideEff
|
||||
, equipmentEffects
|
||||
, heldItemEffects
|
||||
, heldAimEffects
|
||||
-- , heldItemEffects
|
||||
-- , heldAimEffects
|
||||
]
|
||||
|
||||
heldItemEffects :: Creature -> World -> World
|
||||
heldItemEffects _ = id
|
||||
--heldItemEffects :: Creature -> World -> World
|
||||
--heldItemEffects _ = id
|
||||
|
||||
heldAimEffects :: Creature -> World -> World
|
||||
heldAimEffects cr = fromMaybe id $ do
|
||||
guard (crIsAiming cr)
|
||||
ipos <- cr ^? crManipulation . manObject . inInventory . ispItem
|
||||
itm <- cr ^? crInv . ix ipos
|
||||
f <- itm ^? itEffect . ieWhileAiming
|
||||
return $ doInvEffect f itm cr
|
||||
--heldAimEffects :: Creature -> World -> World
|
||||
--heldAimEffects cr = fromMaybe id $ do
|
||||
-- guard (crIsAiming cr)
|
||||
-- ipos <- cr ^? crManipulation . manObject . inInventory . ispItem
|
||||
-- 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