Continue refactor of bullet gun effect chain

This commit is contained in:
2024-09-16 23:34:54 +01:00
parent 40378d3de4
commit e23c7a0154
23 changed files with 404 additions and 396 deletions
+7 -2
View File
@@ -69,13 +69,18 @@ shootBullet itm cr w = fromMaybe (error "cannot find bullet ammo when expected t
& buPos .~ _crPos cr
& buTrajectory %~ settrajectory
& buVel %~ (rotateV dir . (muzvel *.*))
& buDrag *~ _rifling (_heldParams $ _itUse it)
& buDrag *~ drag
)
where
it = itm ^. ldtValue
sp = _crPos cr +.+ (muzlength ^?! _head . _x) *.* unitVectorAtAngle dir
dir = _crDir cr
muzvel = _muzVel $ _heldParams $ _itUse it
drag = case _rifling (_heldParams $ _itUse it) of
ConstFloat x -> x
UniRandFloat x y -> fst . randomR (x,y) $ _randGen w
muzvel = case _muzVel $ _heldParams $ _itUse it of
ConstFloat x -> x
UniRandFloat x y -> fst . randomR (x,y) $ _randGen w
muzlength = aimingMuzzlePos cr it
settrajectory traj = case traj of
BasicBulletTrajectory -> BasicBulletTrajectory