Cleanup targeting

This commit is contained in:
2023-01-05 11:01:12 +00:00
parent c48a553967
commit 0302685053
24 changed files with 66 additions and 95 deletions
+2 -2
View File
@@ -348,7 +348,7 @@ useMod hm = case hm of
thegapDualBeam = _dbGap . _itParams
directedTelPos it cr w = (p, a)
where
p = fromMaybe (_crPos cr) $ it ^? itTargeting . tgPos . _Just
p = fromMaybe (_crPos cr) $ it ^? itUse . heldTargeting . tgPos . _Just
a = argV (mouseWorldPos (w ^. input) (w ^. cWorld . camPos) -.- p)
moddelay x = itUse . heldConsumption . laAmmoType . amBullet . buDelayFraction .~ x
modcrpos x cr =
@@ -511,7 +511,7 @@ shootTeslaArc it cr w =
-- TODO investigate more and fix
useForceFieldGun :: Item -> Creature -> World -> World
useForceFieldGun itm cr w = fromMaybe w $ do
a <- _tgPos $ _itTargeting itm
a <- _tgPos . _heldTargeting $ _itUse itm
let mwp = mouseWorldPos (w ^. input) (w ^. cWorld . camPos)
b = if dist a mwp < 100 then mwp else a +.+ 100 *.* normalizeV (mwp -.- a)
wlline = (a, b)