83 lines
2.6 KiB
Haskell
83 lines
2.6 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
|
|
.~ BulletShooterParams
|
|
{ _muzVel = 0.8
|
|
, _rifling = 0.8
|
|
, _recoil = 25
|
|
, _torqueAfter = 0.18 + 0.02 * fromIntegral i
|
|
, _randomOffset = 0
|
|
, _sidePush = 0
|
|
, _bulGunSound = tap3S
|
|
}
|
|
& 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 . heldAim . aimMuzzles
|
|
.~ [Muzzle (V2 10 0) a 0.01 0 DefaultFlareType | 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 .~ [Muzzle (V2 10 0) 0 0.05 0 DefaultFlareType]
|
|
& itUse . heldParams
|
|
%~ ( (muzVel .~ 0.8)
|
|
. (rifling .~ 0.8)
|
|
. (recoil .~ 10)
|
|
. (torqueAfter .~ 0.2)
|
|
. (sidePush .~ 50)
|
|
)
|
|
& itType . iyBase .~ HELD PISTOL
|
|
|
|
autoPistol :: Item
|
|
autoPistol =
|
|
pistol
|
|
& itUse . heldMods .~ AutoPistolMod
|
|
& itType . iyBase .~ HELD AUTOPISTOL
|
|
& itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
|
|
|
|
machinePistol :: Item
|
|
machinePistol =
|
|
autoPistol
|
|
& itUse . heldDelay . rateMax .~ 2
|
|
& itUse . heldMods .~ MachinePistolMod -- (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 .~ SmgMod --(ammoCheckI : smgAfterHamMods)
|
|
& itType . iyBase .~ HELD SMG
|
|
& itUse . heldAim . aimStance .~ TwoHandUnder
|
|
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) 0 0 0 DefaultFlareType]
|
|
-- & itUse . heldAim . aimHandlePos .~ 2
|
|
& itUse . heldParams . torqueAfter .~ 0.05
|