Migrate LDTs to DTs

This commit is contained in:
2025-07-10 22:13:47 +01:00
parent 9543c2c789
commit cd46f34787
9 changed files with 169 additions and 95 deletions
+2 -2
View File
@@ -315,7 +315,7 @@ shineTargetLaser cr loc w = fromMaybe (w & pointittarg . itTgPos .~ Nothing) $ d
, _lpType = TargetingLaser (_itID itm)
}
where
o = locOrient loc cr
o = locOrient (locLDTToLocDT loc) cr
itmtree = loc ^. locLDT
(p, q) = o `Q.comp` (V3 5 0 0, Q.qID)
x = 1
@@ -341,7 +341,7 @@ shineTorch cr loc = fromMaybe id $ do
. (cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix invid . itConsumables . _Just -~ x)
where
itmtree = loc ^. locLDT
(p, q) = locOrient loc cr
(p, q) = locOrient (locLDTToLocDT loc) cr
x = 10
isammolink AmmoInLink{} = True
isammolink _ = False
+2 -1
View File
@@ -24,6 +24,7 @@ module Dodge.Creature.Test (
crSafeDistFromTarg,
) where
import Dodge.DoubleTree
import Dodge.Item.Grammar
import Dodge.Creature.Radius
import Dodge.Data.Equipment.Misc
@@ -97,7 +98,7 @@ crInAimStance as cr = crIsAiming cr && mitstance == Just as
i <- cr ^? crManipulation . manObject . imRootSelectedItem
--itm <- invRootTrees' (cr ^. crInv) ^? ix i
itm <- fmap (fmap (\(a,b,_) -> (a,b))) $ invRootTrees (cr ^. crInv) ^? ix i
return $ aimStance itm
return $ aimStance $ ldtToDT itm
--cr ^? crInv . ix i . itUse . heldAim . aimStance
oneH :: Creature -> Bool