Files
loop/src/Dodge/Item/Held/Stick.hs
T

76 lines
2.3 KiB
Haskell

module Dodge.Item.Held.Stick (
bangStick,
pistol,
autoPistol,
machinePistol,
smg,
) where
import Dodge.Base
import Dodge.Data.Item
import Dodge.Default.Item
import Dodge.SoundLogic.ExternallyGeneratedSounds
import Geometry
import LensHelp
bangStick :: Int -> Item
bangStick i =
defaultBulletWeapon
-- & itUse . heldParams . recoil .~ 25
& itUse . heldParams . torqueAfter .~ 0.18 + 0.02 * fromIntegral i
& itType .~ HELD (BANGSTICK i)
& itUse . heldDelay . rateMax .~ 8
& itUse . heldMuzzles
.~ [ Muzzle
(V2 10 0)
a
0.01
0
NoFlare
MuzzleShootBullet
(UseExactly 1)
0
| a <- spreadAroundCenter i baseStickSpread
]
& itUse . heldMuzzles . ix 0 . mzFlareType .~ NoLightFlare
& itUse . heldMuzzles . ix (i `div` 2) . mzFlareType .~ MiniGunFlare
& itUse . heldMuzzles . ix (i-1) . mzFlareType .~ NoLightFlare
baseStickSpread :: Float
baseStickSpread = 0.2
pistol :: Item
pistol =
bangStick 1
& itUse . heldDelay . rateMax .~ 6
& itUse . heldMuzzles . ix 0 . mzPos %~ const (V2 10 0)
& itUse . heldMuzzles . ix 0 . mzInaccuracy %~ const 0.05
& itUse . heldMuzzles . ix 0 . mzFlareType %~ const BasicFlare
& itUse . heldParams
%~ ( (muzVel .~ ConstFloat 0.8)
. (rifling .~ ConstFloat 0.8)
-- . (recoil .~ 10)
. (torqueAfter .~ 0.2)
. (sidePush .~ 50)
)
& itType .~ HELD PISTOL
autoPistol :: Item
autoPistol = pistol & itType .~ HELD AUTOPISTOL
machinePistol :: Item
machinePistol =
autoPistol
& itUse . heldDelay .~ WarmUpNoDelay{_warmTime = 0, _warmMax = 50, _warmSound = crankSlowS}
& itType .~ HELD MACHINEPISTOL
-- & itUse . heldParams . recoil .~ 20
smg :: Item
smg =
autoPistol -- & some parameter affecting stability
& itType .~ HELD SMG
& itUse . heldMuzzles . ix 0 . mzPos .~ V2 20 0
& itUse . heldMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldParams . torqueAfter .~ 0.05
& itUse . heldParams . sidePush .~ 30