Tweak weapons

This commit is contained in:
2021-09-06 21:58:36 +01:00
parent 60dc2d9342
commit 6ecd739d6f
6 changed files with 65 additions and 58 deletions
+5 -2
View File
@@ -32,10 +32,13 @@ autoGun = defaultAutoGun
, _itUse = useAmmoParams
, _itUseModifiers =
[ ammoCheckI
, charFiringStratI
[('S', hammerCheckI)
]
, useTimeCheckI
, charFiringStratI
[('M', torqueBefore 0.05)
,('S', hammerCheckI)
[('M', torqueBefore 0.08)
,('S', torqueBefore 0.05)
]
, withSoundI autoGunSound
, useAmmo 1
+9
View File
@@ -31,6 +31,7 @@ module Dodge.Item.Weapon.TriggerType
, shootL
, useTimeCheckI
, ammoCheckI
, randSpreadDir
)
where
import Dodge.Data
@@ -282,6 +283,14 @@ withMuzFlareI f it cr w = tempLightForAt 3 pos2 -- . muzzleFlashAt pos2
where
--pos = _crPos cr +.+ _crRad cr *.* unitVectorAtAngle (_crDir cr)
pos2 = _crPos cr +.+ (2 * _crRad cr) *.* unitVectorAtAngle (_crDir cr)
{- | Applies the effect to a randomly rotated creature,
- rotation amount given by wpSpread -}
randSpreadDir :: ChainEffect
randSpreadDir f it cr w = f it (cr & crDir +~ a) $ set randGen g w
where
acc = _wpSpread it
(a, g) = randomR (-acc,acc) $ _randGen w
{- | Applies the effect to a randomly rotated creature. -}
withRandomDirI
:: Float -- ^ Max possible rotation