Start moving bullet ammo parameters to more sensible places

This commit is contained in:
2024-06-22 00:08:42 +01:00
parent 944b40cb56
commit a3eca3a674
15 changed files with 271 additions and 248 deletions
+4 -2
View File
@@ -56,6 +56,8 @@ updateBulVel bt = case _buTrajectory bt of
where
t = _buTimer bt
-- should be made safe?
-- should be renamed to shootBullet or something
useAmmoParams :: Item -> Creature -> World -> World
useAmmoParams it cr w =
w & cWorld . lWorld . instantBullets
@@ -63,13 +65,13 @@ useAmmoParams it cr w =
& buPos .~ _crPos cr
& buTrajectory %~ settrajectory
& buVel %~ (rotateV dir . (muzvel *.*))
& buDrag *~ _rifling (_itParams it)
& buDrag *~ _rifling (_heldParams $ _itUse it)
)
where
sp = _crPos cr +.+ (muzlength ^?! _head . _x) *.* unitVectorAtAngle dir
dir = _crDir cr
bultype = _laAmmoType $ _heldConsumption $ _itUse it
muzvel = _muzVel $ _itParams it
muzvel = _muzVel $ _heldParams $ _itUse it
muzlength = aimingMuzzlePos cr it
settrajectory traj = case traj of
BasicBulletTrajectory -> BasicBulletTrajectory