97 lines
2.8 KiB
Haskell
97 lines
2.8 KiB
Haskell
module Dodge.Item.Held.Launcher where
|
|
|
|
import Dodge.SoundLogic.ExternallyGeneratedSounds
|
|
import Control.Applicative
|
|
import Dodge.Default.Item
|
|
--import Dodge.Reloading.Action
|
|
import Control.Lens
|
|
import Dodge.Data.Item
|
|
import qualified IntMapHelp as IM
|
|
import Geometry.Data
|
|
|
|
launcher :: Item
|
|
launcher =
|
|
defaultHeldItem
|
|
& itParams
|
|
.~ ShellLauncher
|
|
{ _shellSpinDrag = 1
|
|
, _shellSpinAmount = 2
|
|
, _shellThrustDelay = 20
|
|
}
|
|
& itTweaks
|
|
.~ Tweakable
|
|
{ _tweakParams = basicAmPjMoves
|
|
}
|
|
& itInvSize .~ 3
|
|
& itDimension . dimRad .~ 9
|
|
& itDimension . dimCenter .~ V3 10 0 0
|
|
& itUse . heldDelay . rateMax .~ 20
|
|
& itUse . heldAim . aimWeight .~ 8
|
|
& itUse . heldAim . aimRange .~ 0.5
|
|
& itUse . heldAim . aimStance .~ TwoHandOver
|
|
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
|
|
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleLauncher
|
|
& itUse . heldAmmoTypes .~ singleAmmo ProjectileAmmo
|
|
& itType .~ HELD LAUNCHER
|
|
& itUse . heldParams . muzVel .~ ConstFloat 0
|
|
& itUse . heldParams . rifling .~ ConstFloat 0
|
|
& itUse . heldParams . recoil .~ 0
|
|
& itUse . heldParams . torqueAfter .~ 0
|
|
& itUse . heldParams . bulGunSound ?~ (tap4S, 0)
|
|
|
|
launcherX :: Int -> Item
|
|
launcherX i =
|
|
launcher
|
|
& itType .~ HELD (LAUNCHERX i)
|
|
& itUse . heldAim . aimMuzzles .~ getZipList
|
|
(ZipList [Muzzle (V2 20 0) a 0 | a <- angles]
|
|
<*> ZipList [0..]
|
|
<*> pure DefaultFlareType
|
|
<*> pure MuzzleLauncher
|
|
)
|
|
& itUse . heldAmmoTypes .~ IM.fromList [(j,ProjectileAmmo) | j <- [0..i-1]]
|
|
where
|
|
angles = take i [0,2*pi/ fromIntegral i ..]
|
|
--angles = take i [1,2 ..]
|
|
|
|
--remoteLauncher :: Item
|
|
--remoteLauncher =
|
|
-- launcher
|
|
-- & itType . iyBase .~ HELD REMOTELAUNCHER
|
|
---- & itUse . heldUse .~ HeldFireRemoteShell --fireRemoteShell
|
|
---- & itUse . heldMods .~ FireRemoteShellMod
|
|
-- & itScope .~ RemoteScope (V2 0 0) 1
|
|
---- & itUse . heldConsumption . laAmmoType . amPjDraw .~ DrawRemoteShell
|
|
|
|
basicAmPjMoves :: IM.IntMap TweakParam
|
|
basicAmPjMoves =
|
|
IM.fromList . zip [0 ..] $
|
|
[ spinDrag
|
|
, spinStart
|
|
, thrustParam
|
|
]
|
|
|
|
spinDrag :: TweakParam
|
|
spinDrag =
|
|
TweakParam
|
|
{ _tweakType = TweakSpinDrag
|
|
, _tweakVal = 1
|
|
, _tweakMax = 5
|
|
}
|
|
|
|
spinStart :: TweakParam
|
|
spinStart =
|
|
TweakParam
|
|
{ _tweakType = TweakSpinAmount
|
|
, _tweakVal = 2
|
|
, _tweakMax = 5
|
|
}
|
|
|
|
thrustParam :: TweakParam
|
|
thrustParam =
|
|
TweakParam
|
|
{ _tweakType = TweakThrustDelay
|
|
, _tweakVal = 1
|
|
, _tweakMax = 5
|
|
}
|