Move bullet modifications from weapons to magazines
This commit is contained in:
+5
-3
@@ -59,9 +59,11 @@ updateBulVel bt = case _buTrajectory bt of
|
||||
-- should be made safe?
|
||||
-- should be renamed to shootBullet or something
|
||||
useAmmoParams :: Item -> Creature -> World -> World
|
||||
useAmmoParams it cr w =
|
||||
w & cWorld . lWorld . instantBullets
|
||||
.:~ ( _amBullet bultype
|
||||
useAmmoParams it cr w = fromMaybe (error "cannot find bullet ammo when expected to") $ do
|
||||
invid <- it ^? itLocation . ipInvID
|
||||
thebullet <- cr ^? crInv . ix (invid + 1) . itUse . attachParams . ammoParams . ampBullet
|
||||
return $ w & cWorld . lWorld . instantBullets
|
||||
.:~ ( thebullet
|
||||
& buPos .~ _crPos cr
|
||||
& buTrajectory %~ settrajectory
|
||||
& buVel %~ (rotateV dir . (muzvel *.*))
|
||||
|
||||
Reference in New Issue
Block a user