Fix minigun inter-frame bullet speed

This commit is contained in:
2024-06-22 11:42:33 +01:00
parent a9ac974a2c
commit 35a56eef56
7 changed files with 96 additions and 80 deletions
+6 -6
View File
@@ -290,7 +290,7 @@ useMod hm = case hm of
MiniGunMod i ->
[ duplicateNumBarrels 1
, repeatTransformed
[ (moddelay x, modcrpos x)
[ (id, modcrpos x)
| x <- map ((/ (fromIntegral i - 1)) . fromIntegral) [0 .. i -1]
]
, afterRecoil (fromIntegral i * 5)
@@ -368,11 +368,11 @@ useMod hm = case hm of
where
p = fromMaybe (_crPos cr) $ cr ^? crTargeting . ctPos . _Just
a = argV (mouseWorldPos (w ^. input) (w ^. wCam) -.- p)
moddelay x = id
--moddelay x = itUse . heldConsumption . laAmmoType . amBullet . buDelayFraction .~ x
modcrpos x cr =
cr & crDir %~ tweenAngles x (_crOldDir cr)
modcrpos x cr = fromMaybe cr $ do
invid <- cr ^? crManipulation . manObject . inInventory . ispItem
return $ cr & crDir %~ tweenAngles x (_crOldDir cr)
& crPos %~ alongSegBy x (_crOldPos cr)
& crInv . ix (invid + 1) . itUse . attachParams . ammoParams . ampBullet . buDelayFraction .~ x
lasWideRate :: Int
lasWideRate = 2
@@ -385,7 +385,7 @@ mcUseHeld hit = case hit of
useHeld :: Huse -> Item -> Creature -> World -> World
useHeld hu = case hu of
HeldDoNothing -> const $ const id
HeldUseAmmoParams -> useAmmoParams
HeldUseAmmoParams -> shootBullet
HeldOverNozzlesUseGasParams -> overNozzles useGasParams
HeldPJCreation -> usePjCreation
HeldPJCreationX i -> usePjCreationX i