Move targeting to dedicated datatype within item

This commit is contained in:
2022-02-22 21:49:10 +00:00
parent 055fcf4cce
commit 8a7d06783d
9 changed files with 48 additions and 29 deletions
+4 -4
View File
@@ -119,7 +119,9 @@ moduleCombinations =
)
]
where
makeDirectedTele it = it & itEffect .~ rbSetTarget
makeDirectedTele it = it
-- & itEffect .~ rbSetTarget
& itTargeting' .~ targetRBPress
& itUse . useMods .:~ withPosDirWallCheck directedTelPos
-- for the camera: the simplest option is to remove all zoom/offset
& itUse . useAim . aimZoom . itZoomFac .~ 1
@@ -128,9 +130,7 @@ moduleCombinations =
-- position
directedTelPos it cr w = (p,a)
where
p = fromMaybe (_crPos cr) $ do
(g,_) <- _itTargeting it
g w
p = fromMaybe (_crPos cr) $ it ^? itTargeting' . tgPos . _Just
a = argV (mouseWorldPos w -.- p)
f ameff = itConsumption . aoType . amBulEff .~ ameff
amod cts str func = (cts,ItemModule [str] 1 func)