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

83 lines
2.9 KiB
Haskell

module Dodge.Item.Held.Stick (
bangStick,
pistol,
autoPistol,
machinePistol,
smg,
) where
import Dodge.SoundLogic.ExternallyGeneratedSounds
import Dodge.Base
import Dodge.Data.Item
import Dodge.Default.Item
--import Dodge.Reloading.Action
import Geometry
import LensHelp
bangStick :: Int -> Item
bangStick i =
defaultBulletWeapon
& itUse . heldParams . recoil .~ 25
& itUse . heldParams . torqueAfter .~ 0.18 + 0.02 * fromIntegral i
& itType . iyBase .~ HELD (BANGSTICK i)
& itInvSize .~ fromIntegral i / 3
& itDimension . dimRad .~ 5
& itDimension . dimCenter .~ V3 5 0 0
& itUse . heldDelay . rateMax .~ 8
-- & itUse . heldMods .~ BangStickMod
-- & itUse . heldMods .~ PistolMod
& itUse . heldAim . aimMuzzles
.~ [Muzzle (V2 10 0) a 0.01 0 DefaultFlareType MuzzleShootBullet | a <- spreadAroundCenter i baseStickSpread]
baseStickSpread :: Float
baseStickSpread = 0.2
pistol :: Item
pistol =
bangStick 1
-- & itUse . heldAmmoTypes .~ [BulletAmmo]
& itUse . heldDelay . rateMax .~ 6
-- & itUse . heldMods .~ PistolMod
& itUse . heldAim . aimMuzzles . ix 0 . mzPos %~ const (V2 10 0)
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy %~ const 0.05
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType %~ const PistolFlare
& itUse . heldParams
%~ ( (muzVel .~ ConstFloat 0.8)
. (rifling .~ ConstFloat 0.8)
. (recoil .~ 10)
. (torqueAfter .~ 0.2)
. (sidePush .~ 50)
)
& itType . iyBase .~ HELD PISTOL
autoPistol :: Item
autoPistol =
pistol
-- & itUse . heldMods .~ PistolMod
& itUse . heldTriggerType .~ AutoTrigger
& itUse . heldParams . bulGunSound ?~ (tap1S,0)
& itType . iyBase .~ HELD AUTOPISTOL
& itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
machinePistol :: Item
machinePistol =
autoPistol
& itUse . heldDelay .~ WarmUpNoDelay {_warmTime = 0, _warmMax = 50, _warmSound = crankSlowS}
--rateMax .~ 2
-- & itUse . heldMods .~ PistolMod -- (ammoCheckI : machinePistolAfterHamMods)
& itType . iyBase .~ HELD MACHINEPISTOL
& itType . iyModules . at ModAutoMag .~ Nothing
& itUse . heldParams . recoil .~ 20
smg :: Item
smg =
autoPistol -- & some parameter affecting stability
-- & itUse . heldMods .~ PistolMod --(ammoCheckI : smgAfterHamMods)
& itType . iyBase .~ HELD SMG
& itUse . heldAim . aimStance .~ TwoHandUnder
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 20 0
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
-- & itUse . heldAim . aimHandlePos .~ 2
& itUse . heldParams . torqueAfter .~ 0.05
& itUse . heldParams . sidePush .~ 30