This commit is contained in:
2025-08-27 18:55:25 +01:00
parent 86696deb56
commit 40d2d316cb
35 changed files with 316 additions and 431 deletions
+1 -1
View File
@@ -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
-8
View File
@@ -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)
+1 -1
View File
@@ -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
-3
View File
@@ -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