Continue refactor of bullet gun effect chain
This commit is contained in:
+7
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user