diff --git a/src/Dodge/Creature/State.hs b/src/Dodge/Creature/State.hs index 4cc5907de..20cbe5eab 100644 --- a/src/Dodge/Creature/State.hs +++ b/src/Dodge/Creature/State.hs @@ -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 diff --git a/src/Dodge/Creature/Test.hs b/src/Dodge/Creature/Test.hs index b5c5adb73..de9b95864 100644 --- a/src/Dodge/Creature/Test.hs +++ b/src/Dodge/Creature/Test.hs @@ -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 diff --git a/src/Dodge/Data/DoubleTree.hs b/src/Dodge/Data/DoubleTree.hs index e2db9f3a8..ee01a0aec 100644 --- a/src/Dodge/Data/DoubleTree.hs +++ b/src/Dodge/Data/DoubleTree.hs @@ -98,7 +98,7 @@ data ContextDT a , _cdtCloseRight :: [DTree a] } -data LocationDT b a = LocDT +data LocationDT a = LocDT { _locDtContext :: ContextDT a , _locDT :: DTree a } @@ -107,10 +107,15 @@ makeLenses ''DTree makeLenses ''LDTree makeLenses ''LocationLDT makeLenses ''ContextLDT +makeLenses ''LocationDT +makeLenses ''ContextDT instance Functor (LocationLDT b) where fmap f (LocLDT c t) = LocLDT (fmap f c) (fmap f t) +instance Functor (LocationDT) where + fmap f (LocDT c t) = LocDT (fmap f c) (fmap f t) + instance Functor (ContextLDT b) where fmap f = \case TopLDT -> TopLDT @@ -128,5 +133,20 @@ instance Functor (ContextLDT b) where l (fmap (fmap (fmap f)) cr) +instance Functor (ContextDT) where + fmap f = \case + TopDT -> TopDT + LeftwardDT u cl p cr fr -> LeftwardDT + (fmap f u) + (fmap (fmap ( f)) cl) + (f p) + (fmap (fmap ( f)) cr) + (fmap (fmap ( f)) fr) + RightwardDT u fl cl p cr -> RightwardDT (fmap f u) + (fmap (fmap ( f)) fl) + (fmap (fmap ( f)) cl) + (f p) + (fmap (fmap ( f)) cr) + --deriveJSON defaultOptions ''DoubleTree --deriveJSON defaultOptions ''LabelDoubleTree diff --git a/src/Dodge/DoubleTree.hs b/src/Dodge/DoubleTree.hs index 0fd407164..75526a5ab 100644 --- a/src/Dodge/DoubleTree.hs +++ b/src/Dodge/DoubleTree.hs @@ -1,10 +1,11 @@ +{-# LANGUAGE LambdaCase #-} module Dodge.DoubleTree where +import Dodge.Data.DoubleTree import Control.Lens import Data.Bifunctor import qualified Data.IntMap.Strict as IM import Data.Monoid -import Dodge.Data.DoubleTree singleDT :: a -> DTree a singleDT x = DT x [] [] @@ -15,6 +16,25 @@ singleLDT x = LDT x [] [] ldtToDT :: LDTree b a -> DTree a ldtToDT (LDT x l r) = DT x (map (ldtToDT . snd) l) (map (ldtToDT . snd) r) +locLDTToLocDT :: LocationLDT b a -> LocationDT a +locLDTToLocDT (LocLDT con t) = LocDT (conLDTToConDT con) (ldtToDT t) + +conLDTToConDT :: ContextLDT b a -> ContextDT a +conLDTToConDT = \case + TopLDT -> TopDT + LeftwardLDT u cl p _ cr fr -> LeftwardDT + (conLDTToConDT u) + (map (ldtToDT . snd) cl) + p + (map (ldtToDT . snd) cr) + (map (ldtToDT . snd) fr) + RightwardLDT u fl cl p _ cr -> RightwardDT + (conLDTToConDT u) + (map (ldtToDT . snd) fl) + (map (ldtToDT . snd) cl) + p + (map (ldtToDT . snd) cr) + dtStartPropagate :: (a -> c) -> (c -> a -> c) -> DTree a -> DTree c dtStartPropagate g f (DT x l r) = DT z (fmap (\(t) -> (dtPropagate' z f t)) l) @@ -265,6 +285,22 @@ locUp (LocLDT c@RightwardLDT{} t) = locToTop :: LocationLDT b a -> LocationLDT b a locToTop loc = maybe loc locToTop $ locUp loc +locUp' :: LocationDT a -> Maybe (LocationDT a) +locUp' (LocDT TopDT _) = Nothing +locUp' (LocDT c@LeftwardDT{} t) = + Just $ + LocDT + (_cdtUp c) + (DT (_cdtParent c) (_cdtCloseLeft c ++ (( t) : _cdtCloseRight c)) (_cdtFarRight c)) +locUp' (LocDT c@RightwardDT{} t) = + Just $ + LocDT + (_cdtUp c) + (DT (_cdtParent c) (_cdtFarLeft c) (_cdtCloseLeft c ++ (( t) : _cdtCloseRight c))) + +locToTop' :: LocationDT a -> LocationDT a +locToTop' loc = maybe loc locToTop' $ locUp' loc + --locToTop = fix $ \x -> fromMaybe x $ locUp x locLeftmost :: LocationLDT b a -> LocationLDT b a diff --git a/src/Dodge/HeldUse.hs b/src/Dodge/HeldUse.hs index 835ddd5ec..d79aed4a8 100644 --- a/src/Dodge/HeldUse.hs +++ b/src/Dodge/HeldUse.hs @@ -8,6 +8,7 @@ module Dodge.HeldUse ( heldEffectMuzzles, ) where +import Dodge.DoubleTree import Color import Control.Applicative import Control.Monad @@ -498,7 +499,7 @@ applyRecoil loc cr = +~ rotateV (_crDir cr + Q.qToAng q) (V2 ((- recoilAmount itm) / crMass (_crType cr)) 0) where itm = loc ^. locLDT . ldtValue . _1 - (_, q) = locOrient loc cr + (_, q) = locOrient (locLDTToLocDT loc) cr recoilAmount :: Item -> Float recoilAmount itm @@ -704,7 +705,7 @@ makeMuzzleFlare mz loc cr = case mz ^. mzFlareType of TeslaGunFlare -> cWorld . lWorld . lights .:~ LSParam (pos `v2z` 10) 100 (V3 0 0 1) where (V3 x y _, q) = - locOrient loc cr + locOrient (locLDTToLocDT loc) cr `Q.comp` (_mzPos mz `v2z` 0, Q.axisAngle (V3 0 0 1) (_mzRot mz)) pos = _crPos cr + rotateV (_crDir cr) (V2 x y) dir = _crDir cr + Q.qToAng q @@ -881,7 +882,7 @@ creatureShootLaser loc cr mz w = itmtree = loc ^. locLDT istree = fmap (\(i, _, _) -> i) itmtree (V3 x y _, q) = - locOrient loc cr + locOrient (locLDTToLocDT loc) cr `Q.comp` ((_mzPos mz + V2 0 offset) `v2z` 0, Q.axisAngle (V3 0 0 1) (_mzRot mz)) pos = _crPos cr + rotateV (_crDir cr) (V2 x y) dir = _crDir cr + Q.qToAng q + a @@ -991,7 +992,7 @@ shootBullet :: Bullet -> LocationLDT ItemLink OItem -> Creature -> Muzzle -> Wor shootBullet bu loc cr mz w = makeBullet bu itm bulpos dir . (randGen .~ g) $ w where (V3 x y _, q) = - locOrient loc cr + locOrient (locLDTToLocDT loc) cr `Q.comp` ((_mzPos mz + V2 0 offset) `v2z` 0, Q.axisAngle (V3 0 0 1) (_mzRot mz)) itm = loc ^. locLDT . ldtValue . _1 bulpos = _crPos cr + rotateV (_crDir cr) (V2 x y) @@ -1134,7 +1135,7 @@ useGasParams mmagid mz loc cr w = fueltype <- cr ^? crInv . ix magid >>= magAmmoParams >>= (^? ampCreateGas) gasType hit fueltype (V3 x y _, q) = - locOrient loc cr + locOrient (locLDTToLocDT loc) cr `Q.comp` ((_mzPos mz + V2 0 offset) `v2z` 0, Q.axisAngle (V3 0 0 1) (_mzRot mz)) -- (moff, mrot) = heldItemOrient2D itm cr (_mzPos mz) (_mzRot mz) pos = _crPos cr + rotateV (_crDir cr) (V2 x y) @@ -1231,7 +1232,7 @@ shootTeslaArc loc cr mz w = invid = itm ^?! itLocation . ilInvID (w', ip) = makeTeslaArc (itm ^. itParams) pos dir w (V3 x y _, q) = - locOrient loc cr + locOrient (locLDTToLocDT loc) cr `Q.comp` ((_mzPos mz + V2 0 offset) `v2z` 0, Q.axisAngle (V3 0 0 1) (_mzRot mz)) pos = _crPos cr + rotateV (_crDir cr) (V2 x y) dir = _crDir cr + Q.qToAng q diff --git a/src/Dodge/Item/AimStance.hs b/src/Dodge/Item/AimStance.hs index 0db1621d5..9db48cd87 100644 --- a/src/Dodge/Item/AimStance.hs +++ b/src/Dodge/Item/AimStance.hs @@ -7,13 +7,13 @@ import Dodge.Data.DoubleTree import Control.Lens import Dodge.Data.AimStance -aimStance :: LDTree ItemLink CItem -> AimStance -aimStance ldt +aimStance :: DTree CItem -> AimStance +aimStance dt | islasweapon = TwoHandFlat - | otherwise = itemBaseStance $ ldt ^. ldtValue . _1 + | otherwise = itemBaseStance $ dt ^. dtValue . _1 where - islasweapon = ldt ^. ldtValue . _1 . itType == CRAFT TRANSFORMER - && ldt ^? ldtRight . ix 0 . _2 . ldtValue . _2 == Just LaserWeaponSF + islasweapon = dt ^. dtValue . _1 . itType == CRAFT TRANSFORMER + && dt ^? dtRight . ix 0 . dtValue . _2 == Just LaserWeaponSF itemBaseStance :: Item -> AimStance itemBaseStance itm = case itm ^. itType of diff --git a/src/Dodge/Item/Grammar.hs b/src/Dodge/Item/Grammar.hs index 866728bf2..25eb88882 100644 --- a/src/Dodge/Item/Grammar.hs +++ b/src/Dodge/Item/Grammar.hs @@ -1,5 +1,6 @@ {-# LANGUAGE TupleSections #-} module Dodge.Item.Grammar ( + invDT, invLDT, invLDT', invAdj, @@ -239,6 +240,11 @@ invLDT = joinItemsInList tryAttachItems . IM.elems . fmap (singleLDT . baseCI) +invDT :: IM.IntMap Item -> [DTree CItem] +invDT = fmap ldtToDT . + joinItemsInList tryAttachItems . IM.elems + . fmap (singleLDT . baseCI) + invLDT' :: IM.IntMap Item -> [LDTree ItemLink OItem] invLDT' = fmap propagateOrientation . invLDT diff --git a/src/Dodge/Item/HeldOffset.hs b/src/Dodge/Item/HeldOffset.hs index 46a97b619..4096233cf 100644 --- a/src/Dodge/Item/HeldOffset.hs +++ b/src/Dodge/Item/HeldOffset.hs @@ -29,8 +29,8 @@ transToHandle itm = (-.-.- V3 x y 0) where V2 x y = handlePos itm -handleOrient :: LocationLDT ItemLink CItem -> Point3Q -handleOrient loc = case loc ^. locLDT . ldtValue . _1 . itType of +handleOrient :: LocationDT CItem -> Point3Q +handleOrient loc = case loc ^. locDT . dtValue . _1 . itType of HELD FLAMETHROWER -> (V3 (-1) 0 0, Q.qID) _ -> (V3 (-3) 0 0, Q.qID) @@ -54,20 +54,22 @@ handOrient cr = case cr ^. crStance . posture of f i = 0.1 * fromIntegral (sLen - i) / fromIntegral sLen sLen = _strideLength $ _crStance cr -locOrient :: LocationLDT ItemLink OItem -> Creature -> Point3Q +locOrient :: LocationDT OItem -> Creature -> Point3Q locOrient loc cr = - handHandleOrient (fmap (\(x, y, _) -> (x, y)) $ locToTop loc) cr - `Q.comp` (loc ^. locLDT . ldtValue . _3) + handHandleOrient (fmap (\(x, y, _) -> (x, y)) $ locToTop' loc) cr + `Q.comp` (loc ^. locDT . dtValue . _3) heldItemOffset :: LocationLDT ItemLink CItem -> Creature -> Point3 -> Point3 heldItemOffset loc cr p = x + Q.rotate q p where - (x, q) = handHandleOrient loc cr + (x, q) = handHandleOrient (locLDTToLocDT loc) cr -handHandleOrient :: LocationLDT ItemLink CItem -> Creature -> Point3Q +handHandleOrient :: LocationDT CItem -> Creature -> Point3Q handHandleOrient loc cr = - handOrient cr (aimStance (loc ^. locLDT)) - `Q.comp` handleOrient loc + handOrient cr (aimStance (loc' ^. locDT)) + `Q.comp` handleOrient loc' + where + loc' = locToTop' loc shoulderHeight :: Float shoulderHeight = 18 diff --git a/tags b/tags index 265972500..04405dbce 100644 --- a/tags +++ b/tags @@ -537,7 +537,7 @@ DoorStatus src/Dodge/Data/Door.hs 23;" t DoubleRes src/Dodge/Data/Config.hs 97;" C DoubleStack src/DoubleStack.hs 1;" m DoubleTree src/Dodge/Data/DoubleTree.hs 7;" m -DoubleTree src/Dodge/DoubleTree.hs 1;" m +DoubleTree src/Dodge/DoubleTree.hs 2;" m DoubleTreeNodeType src/Dodge/Data/DoubleTree.hs 16;" t DrWdId src/Dodge/Data/WorldEffect.hs 67;" C DrWdMakeDoorDebris src/Dodge/Data/WorldEffect.hs 68;" C @@ -977,7 +977,7 @@ Kill src/Dodge/Data/ActionPlan.hs 198;" C LASER src/Dodge/Data/Item/Combine.hs 168;" C LDT src/Dodge/Data/DoubleTree.hs 34;" C LDTBottomNode src/Dodge/Data/DoubleTree.hs 29;" C -LDTComb src/Dodge/Item/Grammar.hs 185;" t +LDTComb src/Dodge/Item/Grammar.hs 186;" t LDTMidAboveNode src/Dodge/Data/DoubleTree.hs 27;" C LDTMidBelowNode src/Dodge/Data/DoubleTree.hs 28;" C LDTRootNode src/Dodge/Data/DoubleTree.hs 25;" C @@ -3366,8 +3366,8 @@ airlockDoor src/Dodge/Room/Airlock.hs 51;" f airlockDoubleDoor src/Dodge/Room/Airlock.hs 54;" f airlockSimple src/Dodge/Room/Airlock.hs 66;" f airlockZ src/Dodge/Room/Airlock.hs 91;" f -allInvLocs src/Dodge/Item/Grammar.hs 283;" f -allInvLocs' src/Dodge/Item/Grammar.hs 304;" f +allInvLocs src/Dodge/Item/Grammar.hs 289;" f +allInvLocs' src/Dodge/Item/Grammar.hs 310;" f allVisibleWalls src/Dodge/Base/Collide.hs 132;" f alongSegBy src/Geometry.hs 40;" f alteRifle src/Dodge/Item/Held/Cane.hs 22;" f @@ -3468,7 +3468,7 @@ barrel src/Dodge/Creature/Inanimate.hs 17;" f barrelShape src/Dodge/Render/ShapePicture.hs 46;" f baseAMRShape src/Dodge/Item/Draw/SPic.hs 405;" f baseBlockPane src/Dodge/Placement/Instance/Wall.hs 86;" f -baseCI src/Dodge/Item/Grammar.hs 182;" f +baseCI src/Dodge/Item/Grammar.hs 183;" f baseCaneShape src/Dodge/Item/Draw/SPic.hs 311;" f baseDebris src/Dodge/Block/Debris.hs 122;" f baseFloorTileSize src/Tile.hs 45;" f @@ -3640,7 +3640,7 @@ clampPath src/Dodge/Room/Procedural.hs 166;" f clang1S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 549;" f clang2S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 663;" f clangS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 531;" f -cldtPropagateFold src/Dodge/DoubleTree.hs 283;" f +cldtPropagateFold src/Dodge/DoubleTree.hs 334;" f cleanUpPreload src/Preload.hs 10;" f cleanUpRenderPreload src/Preload/Render.hs 217;" f cleanUpSoundPreload src/Preload.hs 15;" f @@ -3708,6 +3708,7 @@ composeNode src/Dodge/Tree/Compose.hs 76;" f composeTree src/Dodge/Tree/Compose.hs 46;" f computerBeepingS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 627;" f conEffects src/Dodge/Concurrent.hs 12;" f +conLDTToConDT src/Dodge/DoubleTree.hs 22;" f concurrentIS src/Dodge/Update/Input/InGame.hs 290;" f connectItemS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 707;" f connectionBlurb src/Dodge/Terminal.hs 102;" f @@ -4110,7 +4111,7 @@ doubleCorridorBarrels src/Dodge/Room/Room.hs 265;" f doubleLampCover src/Dodge/Placement/Instance/LightSource/Cover.hs 28;" f doublePair src/Geometry.hs 161;" f doublePairSet src/Geometry.hs 165;" f -doubleTreeToIndentList src/Dodge/DoubleTree.hs 95;" f +doubleTreeToIndentList src/Dodge/DoubleTree.hs 130;" f doubleV2 src/Geometry.hs 168;" f drawARHUD src/Dodge/Creature/State.hs 285;" f drawAimSweep src/Dodge/Render/Picture.hs 271;" f @@ -4250,15 +4251,17 @@ dssNearCirc src/Dodge/Zoning/Cloud.hs 39;" f dssNearPoint src/Dodge/Zoning/Cloud.hs 30;" f dssNearRect src/Dodge/Zoning/Cloud.hs 36;" f dssNearSeg src/Dodge/Zoning/Cloud.hs 33;" f -dtIL src/Dodge/DoubleTree.hs 98;" f -dtToAdjRootParent src/Dodge/DoubleTree.hs 161;" f -dtToAdjRootParentEither src/Dodge/DoubleTree.hs 169;" f -dtToAdjacency src/Dodge/DoubleTree.hs 106;" f -dtToIntMapWithRoot src/Dodge/DoubleTree.hs 114;" f -dtToLRAdj src/Dodge/DoubleTree.hs 134;" f -dtToLRAdjEither src/Dodge/DoubleTree.hs 146;" f -dtToRootIntMap' src/Dodge/DoubleTree.hs 119;" f -dtToUpDownAdj src/Dodge/DoubleTree.hs 124;" f +dtIL src/Dodge/DoubleTree.hs 133;" f +dtPropagate' src/Dodge/DoubleTree.hs 46;" f +dtStartPropagate src/Dodge/DoubleTree.hs 38;" f +dtToAdjRootParent src/Dodge/DoubleTree.hs 196;" f +dtToAdjRootParentEither src/Dodge/DoubleTree.hs 204;" f +dtToAdjacency src/Dodge/DoubleTree.hs 141;" f +dtToIntMapWithRoot src/Dodge/DoubleTree.hs 149;" f +dtToLRAdj src/Dodge/DoubleTree.hs 169;" f +dtToLRAdjEither src/Dodge/DoubleTree.hs 181;" f +dtToRootIntMap' src/Dodge/DoubleTree.hs 154;" f +dtToUpDownAdj src/Dodge/DoubleTree.hs 159;" f dummyMenuOption src/Dodge/Menu/Option.hs 74;" f dustColor src/Shader/Poke/Cloud.hs 71;" f dustSpringVel src/Dodge/Update.hs 796;" f @@ -4292,11 +4295,11 @@ eqConstr src/SameConstr.hs 17;" f eqPosText src/Dodge/Equipment/Text.hs 5;" f eqSiteToPositions src/Dodge/Inventory/RBList.hs 77;" f equipAllocString src/Dodge/Render/HUD.hs 308;" f -equipAttachPos src/Dodge/Item/Draw.hs 31;" f +equipAttachPos src/Dodge/Item/Draw.hs 32;" f equipBackgroundEffect src/Dodge/Euse.hs 15;" f equipInfo src/Dodge/Item/Info.hs 140;" f equipItemSPic src/Dodge/Item/Draw/SPic.hs 147;" f -equipPosition src/Dodge/Item/Draw.hs 39;" f +equipPosition src/Dodge/Item/Draw.hs 40;" f equipSiteInfo src/Dodge/Item/Info.hs 253;" f equipType src/Dodge/Data/EquipType.hs 10;" f equipmentStrValue src/Dodge/Creature/Statistics.hs 51;" f @@ -4323,8 +4326,8 @@ extTrigLitPos src/Dodge/Placement/Instance/Button.hs 84;" f extendAway src/Dodge/Placement/Instance/LightSource.hs 200;" f extendConeToScreenEdge src/Dodge/Debug/Picture.hs 82;" f extraPics src/Dodge/Render/ShapePicture.hs 73;" f -extraWeaponLinks src/Dodge/Item/Grammar.hs 116;" f -extraWeaponLinksBelow src/Dodge/Item/Grammar.hs 125;" f +extraWeaponLinks src/Dodge/Item/Grammar.hs 117;" f +extraWeaponLinksBelow src/Dodge/Item/Grammar.hs 126;" f extractRoomPos src/Dodge/RoomPos.hs 6;" f faceEdges src/Polyhedra.hs 65;" f facesToVF src/Polyhedra/Geodesic.hs 69;" f @@ -4443,11 +4446,11 @@ geometryTests test/Spec.hs 17;" f geometryUnitTests test/Spec.hs 22;" f geqConstr src/SameConstr.hs 21;" f getAimZoom src/Dodge/Update/Camera.hs 135;" f -getAmmoLinks src/Dodge/Item/Grammar.hs 132;" f +getAmmoLinks src/Dodge/Item/Grammar.hs 133;" f getArguments src/Dodge/Update/Scroll.hs 178;" f getArguments' src/Dodge/Update/Scroll.hs 166;" f getAttachedSFLink src/Dodge/HeldUse.hs 802;" f -getAutoSpringLinks src/Dodge/Item/Grammar.hs 111;" f +getAutoSpringLinks src/Dodge/Item/Grammar.hs 112;" f getAvailableListLines src/Dodge/SelectionList.hs 10;" f getBulHitDams src/Dodge/Bullet.hs 171;" f getBulletType src/Dodge/HeldUse.hs 927;" f @@ -4538,7 +4541,7 @@ handleMouseButtonEvent src/Dodge/Event/Input.hs 63;" f handleMouseMotionEvent src/Dodge/Event/Input.hs 47;" f handleMouseWheelEvent src/Dodge/Event/Input.hs 58;" f handleOrient src/Dodge/Item/HeldOffset.hs 32;" f -handlePos src/Dodge/Item/HeldOffset.hs 87;" f +handlePos src/Dodge/Item/HeldOffset.hs 89;" f handleResizeEvent src/Dodge/Event.hs 53;" f handleTextInput src/Dodge/Event/Input.hs 18;" f handleWindowMoveEvent src/Dodge/Event.hs 44;" f @@ -4552,7 +4555,7 @@ hat src/Dodge/Item/Equipment.hs 76;" f head src/DoubleStack.hs 14;" f headLamp src/Dodge/Item/Equipment.hs 79;" f headLampShape src/Dodge/Item/Draw/SPic.hs 441;" f -headMap src/Dodge/DoubleTree.hs 214;" f +headMap src/Dodge/DoubleTree.hs 249;" f heal src/Dodge/Item/Consumable.hs 17;" f heal25 src/Dodge/Item/Consumable.hs 14;" f healS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 483;" f @@ -4563,7 +4566,7 @@ heldAimStance src/Dodge/Item/AimStance.hs 23;" f heldAimZoom src/Dodge/Update/Camera.hs 140;" f heldEffect src/Dodge/HeldUse.hs 60;" f heldEffectMuzzles src/Dodge/HeldUse.hs 127;" f -heldHandlePos src/Dodge/Item/HeldOffset.hs 92;" f +heldHandlePos src/Dodge/Item/HeldOffset.hs 94;" f heldInfo src/Dodge/Item/Info.hs 90;" f heldItemAmmoSlots src/Dodge/Item/AmmoSlots.hs 18;" f heldItemBulkiness src/Dodge/Creature/YourControl.hs 177;" f @@ -4598,7 +4601,7 @@ humanoidAIList src/Dodge/Humanoid.hs 182;" f iShape src/Dodge/Placement/Instance/LightSource.hs 73;" f icosahedronPoints src/Polyhedra/Geodesic.hs 12;" f icosohedronFaces src/Polyhedra/Geodesic.hs 19;" f -ildtPropagate src/Dodge/DoubleTree.hs 77;" f +ildtPropagate src/Dodge/DoubleTree.hs 112;" f impulsiveAIBefore src/Dodge/Creature/Impulse.hs 23;" f inLink src/Dodge/RoomLink.hs 113;" f inSegArea src/Geometry/Intersect.hs 298;" f @@ -4663,18 +4666,19 @@ interweave src/Justify.hs 17;" f introScan src/Dodge/Item/Scope.hs 57;" f introScanValue src/Dodge/Inventory/SelectionList.hs 79;" f intsToPos src/Dodge/Room/Modify/Girder.hs 160;" f -invAdj src/Dodge/Item/Grammar.hs 260;" f +invAdj src/Dodge/Item/Grammar.hs 266;" f invCursorParams src/Dodge/ListDisplayParams.hs 36;" f invDP src/Dodge/ListDisplayParams.hs 30;" f +invDT src/Dodge/Item/Grammar.hs 243;" f invDimColor src/Dodge/DisplayInventory.hs 192;" f invHead src/Dodge/Render/HUD.hs 405;" f invItemLocUpdate src/Dodge/Creature/State.hs 153;" f -invLDT src/Dodge/Item/Grammar.hs 237;" f -invLDT' src/Dodge/Item/Grammar.hs 242;" f +invLDT src/Dodge/Item/Grammar.hs 238;" f +invLDT' src/Dodge/Item/Grammar.hs 248;" f invRootItemEffs src/Dodge/Creature/State.hs 146;" f -invRootMap src/Dodge/Item/Grammar.hs 249;" f -invRootTrees src/Dodge/Item/Grammar.hs 270;" f -invRootTrees' src/Dodge/Item/Grammar.hs 276;" f +invRootMap src/Dodge/Item/Grammar.hs 255;" f +invRootTrees src/Dodge/Item/Grammar.hs 276;" f +invRootTrees' src/Dodge/Item/Grammar.hs 282;" f invSelectionItem src/Dodge/Inventory/SelectionList.hs 32;" f invSetSelection src/Dodge/Inventory.hs 185;" f invSetSelectionPos src/Dodge/Inventory.hs 193;" f @@ -4730,7 +4734,7 @@ itemCombinations src/Dodge/Combine/Combinations.hs 56;" f itemCombinationsEdges src/Dodge/Combine/Graph.hs 61;" f itemDetectorEffect src/Dodge/HeldUse.hs 808;" f itemDisplay src/Dodge/Inventory/SelectionList.hs 49;" f -itemEquipPict src/Dodge/Item/Draw.hs 18;" f +itemEquipPict src/Dodge/Item/Draw.hs 19;" f itemExternalValue src/Dodge/Inventory/SelectionList.hs 84;" f itemFromAmmoMag src/Dodge/Item.hs 41;" f itemFromAttachType src/Dodge/Item.hs 50;" f @@ -4751,8 +4755,8 @@ itemScrollDisplay src/Dodge/Inventory/SelectionList.hs 120;" f itemScrollValue src/Dodge/Inventory/SelectionList.hs 147;" f itemSidePush src/Dodge/HeldUse.hs 419;" f itemString src/Dodge/Item/Display.hs 56;" f -itemToBreakLists src/Dodge/Item/Grammar.hs 55;" f -itemToFunction src/Dodge/Item/Grammar.hs 138;" f +itemToBreakLists src/Dodge/Item/Grammar.hs 56;" f +itemToFunction src/Dodge/Item/Grammar.hs 139;" f itemTreeSPic src/Dodge/Item/Draw/SPic.hs 24;" f itemTriggerType src/Dodge/BaseTriggerType.hs 15;" f itemWeight src/Dodge/Creature/Statistics.hs 66;" f @@ -4764,7 +4768,7 @@ itmSpaceInfo src/Dodge/Item/Info.hs 25;" f itmUsageInfo src/Dodge/Item/Info.hs 230;" f jShape src/Dodge/Placement/Instance/LightSource.hs 85;" f jaggedShape src/Dodge/Block/Debris.hs 191;" f -joinItemsInList src/Dodge/Item/Grammar.hs 227;" f +joinItemsInList src/Dodge/Item/Grammar.hs 228;" f joystick src/Dodge/Item/Scope.hs 149;" f jps0' src/Dodge/LevelGen/PlacementHelper.hs 60;" f jps0PushPS src/Dodge/LevelGen/PlacementHelper.hs 63;" f @@ -4798,26 +4802,26 @@ lasTunnel src/Dodge/Room/LasTurret.hs 126;" f lasTunnelRunPast src/Dodge/Room/LasTurret.hs 167;" f lasTurret src/Dodge/Placement/Instance/Turret.hs 38;" f laser src/Dodge/Item/Held/BatteryGuns.hs 41;" f -lastMap src/Dodge/DoubleTree.hs 218;" f +lastMap src/Dodge/DoubleTree.hs 253;" f launcherCrit src/Dodge/Creature/LauncherCrit.hs 12;" f layoutLevelFromSeed src/Dodge/LevelGen.hs 47;" f ldpVerticalSelection src/Dodge/Update/Input/ScreenLayer.hs 74;" f -ldtIL src/Dodge/DoubleTree.hs 190;" f -ldtPropagate src/Dodge/DoubleTree.hs 35;" f -ldtPropagate' src/Dodge/DoubleTree.hs 26;" f -ldtPropagateFold src/Dodge/DoubleTree.hs 47;" f -ldtPropagateFoldTree src/Dodge/DoubleTree.hs 64;" f -ldtPropagateIndices src/Dodge/DoubleTree.hs 87;" f -ldtStartPropagate src/Dodge/DoubleTree.hs 18;" f -ldtToDT src/Dodge/DoubleTree.hs 15;" f -ldtToIM src/Dodge/DoubleTree.hs 184;" f -ldtToIndentList src/Dodge/DoubleTree.hs 187;" f -ldtToLoc src/Dodge/DoubleTree.hs 233;" f +ldtIL src/Dodge/DoubleTree.hs 225;" f +ldtPropagate src/Dodge/DoubleTree.hs 70;" f +ldtPropagate' src/Dodge/DoubleTree.hs 61;" f +ldtPropagateFold src/Dodge/DoubleTree.hs 82;" f +ldtPropagateFoldTree src/Dodge/DoubleTree.hs 99;" f +ldtPropagateIndices src/Dodge/DoubleTree.hs 122;" f +ldtStartPropagate src/Dodge/DoubleTree.hs 53;" f +ldtToDT src/Dodge/DoubleTree.hs 16;" f +ldtToIM src/Dodge/DoubleTree.hs 219;" f +ldtToIndentList src/Dodge/DoubleTree.hs 222;" f +ldtToLoc src/Dodge/DoubleTree.hs 268;" f left src/DoubleStack.hs 16;" f -leftChildList src/Dodge/Item/Grammar.hs 201;" f -leftIsParentCombine src/Dodge/Item/Grammar.hs 187;" f +leftChildList src/Dodge/Item/Grammar.hs 202;" f +leftIsParentCombine src/Dodge/Item/Grammar.hs 188;" f leftPad src/Padding.hs 15;" f -leftRightCombine src/Dodge/Item/Grammar.hs 213;" f +leftRightCombine src/Dodge/Item/Grammar.hs 214;" f legsSPic src/Dodge/Item/Draw/SPic.hs 475;" f liShape src/Dodge/Placement/Instance/LightSource.hs 98;" f light src/Color.hs 104;" f @@ -4859,14 +4863,17 @@ loadSounds src/Dodge/SoundLogic/LoadSound.hs 18;" f loadingScreen src/Dodge/Concurrent.hs 56;" f loadingScreen src/Dodge/Menu/Loading.hs 8;" f loadme src/Dodge/Debug/Terminal.hs 139;" f -locGoHelp src/Dodge/DoubleTree.hs 273;" f -locGoLeft src/Dodge/DoubleTree.hs 262;" f -locGoRight src/Dodge/DoubleTree.hs 267;" f -locLeftmost src/Dodge/DoubleTree.hs 255;" f +locGoHelp src/Dodge/DoubleTree.hs 324;" f +locGoLeft src/Dodge/DoubleTree.hs 313;" f +locGoRight src/Dodge/DoubleTree.hs 318;" f +locLDTToLocDT src/Dodge/DoubleTree.hs 19;" f +locLeftmost src/Dodge/DoubleTree.hs 306;" f locOrient src/Dodge/Item/HeldOffset.hs 57;" f -locRightmost src/Dodge/DoubleTree.hs 258;" f -locToTop src/Dodge/DoubleTree.hs 250;" f -locUp src/Dodge/DoubleTree.hs 237;" f +locRightmost src/Dodge/DoubleTree.hs 309;" f +locToTop src/Dodge/DoubleTree.hs 285;" f +locToTop' src/Dodge/DoubleTree.hs 301;" f +locUp src/Dodge/DoubleTree.hs 272;" f +locUp' src/Dodge/DoubleTree.hs 288;" f lockInv src/Dodge/Inventory/Lock.hs 9;" f lockInvFor src/Dodge/Item/Weapon/TriggerType.hs 50;" f lockRoomKeyItems src/Dodge/LockAndKey.hs 25;" f @@ -5365,8 +5372,8 @@ preCritStart src/Dodge/Room/Start.hs 82;" f preloadRender src/Preload/Render.hs 30;" f premapMaybe src/FoldlHelp.hs 26;" f prependTwo src/Geometry.hs 176;" f -prettyDT src/Dodge/DoubleTree.hs 223;" f -prettyLDT src/Dodge/DoubleTree.hs 228;" f +prettyDT src/Dodge/DoubleTree.hs 258;" f +prettyLDT src/Dodge/DoubleTree.hs 263;" f prettyShort src/AesonHelp.hs 11;" f primeS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 581;" f printColumnTitles src/Dodge/Tree/Shift.hs 142;" f @@ -5387,6 +5394,7 @@ propSetToggleAnd src/Dodge/Prop/Update.hs 41;" f propUpdateIf src/Dodge/Prop/Update.hs 25;" f propUpdatePosition src/Dodge/Prop/Update.hs 30;" f propagateOrientation src/Dodge/Item/Orientation.hs 42;" f +propagateOrientation' src/Dodge/Item/Orientation.hs 48;" f ps0 src/Dodge/LevelGen/PlacementHelper.hs 51;" f ps0PushPS src/Dodge/LevelGen/PlacementHelper.hs 79;" f ps0PushPSw src/Dodge/LevelGen/PlacementHelper.hs 83;" f @@ -5490,7 +5498,7 @@ rectXH src/Geometry/Polygon.hs 32;" f rectXY src/Geometry/Polygon.hs 35;" f rectanglePairs src/Dodge/LevelGen/DoorPane.hs 7;" f red src/Color.hs 14;" f -reduceLocLDT src/Dodge/DoubleTree.hs 318;" f +reduceLocLDT src/Dodge/DoubleTree.hs 369;" f reflDirWall src/Dodge/Base/Wall.hs 16;" f reflVelWall src/Dodge/Base/Wall.hs 24;" f reflVelWallDamp src/Dodge/Base/Wall.hs 20;" f @@ -5554,8 +5562,8 @@ rezText' src/Dodge/Story.hs 17;" f rhombus src/Polyhedra.hs 72;" f rifle src/Dodge/Item/Held/Cane.hs 19;" f right src/DoubleStack.hs 16;" f -rightChildList src/Dodge/Item/Grammar.hs 207;" f -rightIsParentCombine src/Dodge/Item/Grammar.hs 194;" f +rightChildList src/Dodge/Item/Grammar.hs 208;" f +rightIsParentCombine src/Dodge/Item/Grammar.hs 195;" f rightPad src/Padding.hs 19;" f rightPadNoSquash src/Padding.hs 23;" f rlPosDir src/Dodge/RoomLink.hs 94;" f @@ -5806,7 +5814,7 @@ shootingRange src/Dodge/Room/Room.hs 332;" f shortPoint2 src/Dodge/ShortShow.hs 4;" f shortShow src/ShortShow.hs 9;" f shotgunS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 693;" f -shoulderHeight src/Dodge/Item/HeldOffset.hs 72;" f +shoulderHeight src/Dodge/Item/HeldOffset.hs 74;" f shoulderSH src/Dodge/Creature/Picture.hs 133;" f shoulderSP src/Dodge/Creature/HandPos.hs 170;" f showAttachItem src/Dodge/Item/Display.hs 91;" f @@ -5830,8 +5838,8 @@ sineRaisePitchOneSecS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 667;" f sineRaisePitchTwoSecS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 463;" f singleAmmo src/Dodge/Item/AmmoSlots.hs 62;" f singleBlock src/Dodge/Placement/Instance/Wall.hs 30;" f -singleDT src/Dodge/DoubleTree.hs 9;" f -singleLDT src/Dodge/DoubleTree.hs 12;" f +singleDT src/Dodge/DoubleTree.hs 10;" f +singleLDT src/Dodge/DoubleTree.hs 13;" f singleton src/DoubleStack.hs 11;" f singletonTrie src/SimpleTrie.hs 19;" f sizeFBOs src/Framebuffer/Update.hs 22;" f @@ -5956,7 +5964,7 @@ strFromEquipment src/Dodge/Creature/Statistics.hs 48;" f strFromHeldItem src/Dodge/Creature/Statistics.hs 60;" f strengthFactor src/Dodge/Creature/Impulse/Movement.hs 35;" f strictify src/MaybeHelp.hs 37;" f -strideRot src/Dodge/Item/HeldOffset.hs 75;" f +strideRot src/Dodge/Item/HeldOffset.hs 77;" f stringToList src/Picture/Base.hs 313;" f stringToListGrad src/Picture/Text.hs 12;" f stripZ src/Geometry/Vector3D.hs 97;" f @@ -6145,7 +6153,7 @@ treeMaxDepthFromTrunk src/Dodge/Layout/Generate.hs 21;" f treePath src/Dodge/Tree/GenerateStructure.hs 13;" f treePaths src/TreeHelp.hs 138;" f treePost src/TreeHelp.hs 45;" f -treeToPotentialFunction src/Dodge/Item/Grammar.hs 172;" f +treeToPotentialFunction src/Dodge/Item/Grammar.hs 173;" f triLootRoom src/Dodge/Room/Treasure.hs 22;" f triggerDoorRoom src/Dodge/Room/Door.hs 30;" f triggerSwitch src/Dodge/Placement/Instance/Button.hs 47;" f @@ -6154,7 +6162,7 @@ triggerSwitchSPicLight src/Dodge/Placement/Instance/Button.hs 31;" f truncFaces src/Polyhedra/Geodesic.hs 53;" f truncate src/Polyhedra/Geodesic.hs 38;" f trunkDepth src/TreeHelp.hs 161;" f -tryAttachItems src/Dodge/Item/Grammar.hs 35;" f +tryAttachItems src/Dodge/Item/Grammar.hs 36;" f tryClickUse src/Dodge/Creature/YourControl.hs 221;" f tryCombine src/Dodge/Update/Input/InGame.hs 526;" f tryDropSelected src/Dodge/Update/Input/InGame.hs 125;" f @@ -6180,7 +6188,7 @@ twinSlowDoorChasers src/Dodge/Room/LongDoor.hs 80;" f twinSlowDoorRoom src/Dodge/Room/LongDoor.hs 28;" f twists src/Dodge/Creature/Test.hs 109;" f twoFlat src/Dodge/Creature/Test.hs 106;" f -twoFlatHRot src/Dodge/Item/HeldOffset.hs 84;" f +twoFlatHRot src/Dodge/Item/HeldOffset.hs 86;" f twoHandTwistAmount src/Dodge/Creature/YourControl.hs 150;" f twoRoomPoss src/Dodge/PlacementSpot.hs 147;" f twoStep1S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 533;" f