Work on held item usage
This commit is contained in:
+5
-2
@@ -3,6 +3,7 @@ module Dodge.Bullet (
|
||||
useAmmoParams,
|
||||
) where
|
||||
|
||||
import Linear
|
||||
import Dodge.Item.Weapon.Bullet
|
||||
import System.Random
|
||||
import Data.Foldable
|
||||
@@ -59,13 +60,15 @@ useAmmoParams :: Item -> Creature -> World -> World
|
||||
useAmmoParams it cr w =
|
||||
w & cWorld . lWorld . instantBullets
|
||||
.:~ ( _amBullet bultype
|
||||
& buPos .~ sp
|
||||
-- & buPos .~ sp
|
||||
& buPos .~ _crPos cr
|
||||
& buTrajectory %~ settrajectory
|
||||
& buVel %~ (rotateV dir . (muzvel *.*))
|
||||
& buDrag *~ _rifling (_itParams it)
|
||||
)
|
||||
where
|
||||
sp = _crPos cr +.+ (muzlength + 10) *.* unitVectorAtAngle dir
|
||||
--sp = _crPos cr +.+ (muzlength + 10) *.* unitVectorAtAngle dir
|
||||
sp = _crPos cr +.+ (muzlength ^?! _head . _x) *.* unitVectorAtAngle dir
|
||||
dir = _crDir cr
|
||||
bultype = _laAmmoType $ _heldConsumption $ _itUse it
|
||||
muzvel = _muzVel $ _itParams it
|
||||
|
||||
Reference in New Issue
Block a user