Move towards allowing equipable targeting items

This commit is contained in:
2023-01-06 11:01:32 +00:00
parent bf479ca080
commit 612ee85579
23 changed files with 152 additions and 145 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 ^? itUse . heldTargeting . tgPos . _Just
p = fromMaybe (_crPos cr) $ cr ^? crTargeting . ctPos . _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 . _heldTargeting $ _itUse itm
a <- cr ^? crTargeting . ctPos . _Just
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)