Fix minigun

This commit is contained in:
2022-07-18 11:20:29 +01:00
parent ce36aa8295
commit 13f2255ba7
5 changed files with 41 additions and 79 deletions
+11 -16
View File
@@ -176,7 +176,7 @@ burstRifle = repeater
-- ]
miniGunUse :: Int -> ItemUse
miniGunUse i = defaultrUse
& rUse .~ useAmmoParams (Just 1)
& rUse .~ useAmmoParams
& useDelay .~ NoDelay
& useMods .~
[ ammoCheckI
@@ -186,23 +186,18 @@ miniGunUse i = defaultrUse
, withSmoke 1 black 20 200 5
, withMuzFlareI
, useAmmoAmount i
, withSidePushI (y * 50)
, torqueBefore (y * 0.05)
, afterRecoil (y * 5)
] <>
concat [
[ withSidePushI 50
, torqueBefore 0.05
, afterRecoil recoilAmount
, withRandomOffset
, withOldDir x
, trigDoAlso (useAmmoParams $ Just x)
] | x <- map ((/fromIntegral i) . fromIntegral) [1..i-1]
]
<>
[ withSidePushI 50
, afterRecoil recoilAmount
, withRandomOffset
]
[ trigDoAlso' (moddelay x) (modcrpos x) useAmmoParams
| x <- map ((/fromIntegral i) . fromIntegral) [1..i-1]
]
where
recoilAmount = 5
y = fromIntegral i
moddelay x = itConsumption . laAmmoType . amBullet . buState .~ DelayedBullet x
modcrpos x cr = cr & crDir %~ tweenAngles x (_crOldDir cr)
& crPos %~ tweenPoints x (_crOldPos cr)
miniGunX :: Int -> Item
miniGunX i = defaultAutoGun
+8
View File
@@ -12,6 +12,7 @@ module Dodge.Item.Weapon.TriggerType
, crAtMuzPos
, withOldDir
, trigDoAlso
, trigDoAlso'
, withTempLight
, withItem
, withItemUpdate
@@ -96,6 +97,13 @@ lockInvFor :: Int -> ChainEffect
lockInvFor i f it cr = f it cr . (delayedEvents .:~ (i, unlockInv (_crID cr)))
. lockInv (_crID cr)
trigDoAlso'
:: (Item -> Item)
-> (Creature -> Creature)
-> (Item -> Creature -> World -> World)
-> ChainEffect
trigDoAlso' fit fcr f g itm cr = g itm cr . f (fit itm) (fcr cr)
-- Note that this uses the "base" creature and item values
trigDoAlso
:: (Item -> Creature -> World -> World)