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

89 lines
2.5 KiB
Haskell

module Dodge.Item.Held.Launcher where
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 . heldUse .~ HeldPJCreation --usePjCreation
& itUse . heldMods .~ LauncherMod
& itUse . heldAim . aimWeight .~ 8
& itUse . heldAim . aimRange .~ 0.5
& itUse . heldAim . aimStance .~ TwoHandOver
-- & itUse . heldAim . aimHandlePos .~ V2 3 0
-- & itUse . heldAim . aimMuzPos .~ 20
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) 0 0]
& itUse . heldConsumption .~ [ProjectileAmmo]
& itType . iyBase .~ HELD LAUNCHER
& itType . iyModules . at ModLauncherHoming ?~ EMPTYMODULE
launcherX :: Int -> Item
launcherX i =
launcher
& itType . iyBase .~ HELD (LAUNCHERX i)
& itUse . heldUse .~ HeldPJCreationX i
& itUse . heldMods .~ LauncherXMod i
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) a 0 | a <- angles]
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
& 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
}