Cleanup
This commit is contained in:
@@ -168,7 +168,7 @@ dropExcept :: Creature -> Int -> World -> World
|
||||
dropExcept cr invid w =
|
||||
foldr (dropItem cr) w . IM.keys $
|
||||
-- invid `IM.delete` _crInv cr
|
||||
invid `IM.delete` (_unNIntMap $ _crInv cr)
|
||||
invid `IM.delete` _unNIntMap (_crInv cr)
|
||||
|
||||
-- why not a cid (Int)?
|
||||
dropItem :: Creature -> Int -> World -> World
|
||||
|
||||
@@ -36,14 +36,6 @@ equipSitePQ = \case
|
||||
translatePointToRightHand :: Creature -> Point3 -> Point3
|
||||
translatePointToRightHand cr p = fst (rightHandPQ cr `Q.comp` (p,Q.qID))
|
||||
|
||||
--equipSitePQ :: EquipSite -> IM.IntMap Item -> Creature -> Point3Q
|
||||
--equipSitePQ = \case
|
||||
-- OnRightWrist -> rightHandPQ
|
||||
-- OnLeftWrist -> leftHandPQ
|
||||
-- OnBack -> backPQ
|
||||
-- OnChest -> chestPQ
|
||||
-- _ -> undefined
|
||||
|
||||
rightHandPQ :: Creature -> Point3Q
|
||||
rightHandPQ cr
|
||||
| oneH cr = (V3 11 (-3) 20, Q.qID)
|
||||
|
||||
@@ -19,7 +19,7 @@ import Dodge.Item.Location
|
||||
useItem :: Int -> Int -> World -> Maybe World
|
||||
useItem invid pt w = fmap (worldEventFlags . at InventoryChange ?~ ()) $ do
|
||||
cr <- w ^? cWorld . lWorld . creatures . ix 0
|
||||
itmloc <- invIndents (fmap (\k -> w ^?! cWorld . lWorld . items . ix k) $ _crInv cr) ^? ix invid . _2
|
||||
itmloc <- invIndents ((\k -> w ^?! cWorld . lWorld . items . ix k) <$> _crInv cr) ^? ix invid . _2
|
||||
useItemLoc cr itmloc pt w
|
||||
|
||||
useItemLoc :: Creature -> LocationDT OItem -> Int -> World -> Maybe World
|
||||
|
||||
@@ -87,9 +87,6 @@ crAwayFromPost cr = case find sentinelGoal . _apGoal $ _crActionPlan cr of
|
||||
sentinelGoal (SentinelAt _ _) = True
|
||||
sentinelGoal _ = False
|
||||
|
||||
--crCanShoot :: Creature -> Bool
|
||||
--crCanShoot cr = crIsAiming cr && crWeaponReady cr
|
||||
|
||||
crInAimStance :: AimStance -> Creature -> Bool
|
||||
crInAimStance as cr = cr ^? crStance . posture . aimStance == Just as
|
||||
|
||||
|
||||
Reference in New Issue
Block a user