Refactor, try to limit dependencies
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
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 .~ TwoHandTwist
|
||||
& itUse . heldAim . aimHandlePos .~ 5
|
||||
& itUse . heldAim . aimMuzPos .~ 20
|
||||
& itUse . heldConsumption . laAmmoType
|
||||
.~ ProjectileAmmo
|
||||
{ _amPayload = ExplosionPayload
|
||||
, _amString = "EXPLOSIVE SHELL"
|
||||
, _amPjDraw = DrawShell
|
||||
, _amPjCreation = CreateShell
|
||||
}
|
||||
& itUse . heldConsumption . laMax .~ 1
|
||||
& itUse . heldConsumption . laLoaded .~ 1
|
||||
& itUse . heldConsumption . laCycle .~ [loadEject 30, loadInsert 30, loadPrime 10]
|
||||
& itType . iyBase .~ HELD LAUNCHER
|
||||
& itType . iyModules . at ModLauncherHoming ?~ EMPTYMODULE
|
||||
|
||||
launcherX :: Int -> Item
|
||||
launcherX i =
|
||||
launcher
|
||||
& itType . iyBase .~ HELD (LAUNCHERX i)
|
||||
& itUse . heldConsumption . laMax .~ i
|
||||
& itUse . heldConsumption . laLoaded .~ i
|
||||
& itUse . heldUse .~ HeldPJCreationX i
|
||||
& itUse . heldMods .~ LauncherXMod i
|
||||
|
||||
remoteLauncher :: Item
|
||||
remoteLauncher =
|
||||
launcher
|
||||
& itType . iyBase .~ HELD REMOTELAUNCHER
|
||||
& itUse . heldUse .~ HeldFireRemoteShell --fireRemoteShell
|
||||
& itScope .~ RemoteScope (V2 0 0) 1 True
|
||||
& 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
|
||||
}
|
||||
Reference in New Issue
Block a user