Refactor, try to limit dependencies
This commit is contained in:
@@ -0,0 +1,170 @@
|
||||
module Dodge.Item.Held.BatteryGuns where
|
||||
|
||||
import Dodge.Data.Beam
|
||||
import Dodge.Default.Item
|
||||
import Color
|
||||
import Control.Lens
|
||||
import qualified Data.Map.Strict as M
|
||||
import Dodge.Data.Item
|
||||
import Dodge.Reloading.Action
|
||||
import Dodge.Tesla.ItemParams
|
||||
import Geometry.Data
|
||||
import qualified IntMapHelp as IM
|
||||
|
||||
sparkGun :: Item
|
||||
sparkGun =
|
||||
teslaGun
|
||||
& itType . iyBase .~ HELD SPARKGUN
|
||||
& itParams . arcSize .~ 10
|
||||
|
||||
teslaGun :: Item
|
||||
teslaGun =
|
||||
defaultBatteryGun
|
||||
& itUse . heldConsumption . laMax .~ 200
|
||||
& itUse . heldConsumption . laCycle .~ [loadEject 10, loadInsert 10, loadPrime 60]
|
||||
& itDimension . dimRad .~ 9
|
||||
& itDimension . dimCenter .~ V3 4 0 0
|
||||
& itParams .~ teslaParams
|
||||
& itUse . heldUse .~ HeldTeslaArc --shootTeslaArc
|
||||
& itUse . heldDelay .~ NoDelay
|
||||
& itUse . heldMods .~ TeslaMod
|
||||
& itUse . heldAim . aimWeight .~ 6
|
||||
& itUse . heldAim . aimStance .~ TwoHandFlat
|
||||
& itUse . heldAim . aimHandlePos .~ 4
|
||||
& itUse . heldAim . aimMuzPos .~ 4
|
||||
& itType . iyBase .~ HELD TESLAGUN
|
||||
|
||||
lasGun :: Item
|
||||
lasGun =
|
||||
defaultAutoBatteryGun
|
||||
& itUse . heldConsumption
|
||||
.~ ( defaultLoadable
|
||||
& laMax .~ 200
|
||||
& laCycle .~ [loadEject 10, loadInsert 10, loadPrime 60]
|
||||
)
|
||||
& itParams
|
||||
.~ Refracting
|
||||
{ _phaseV = 1
|
||||
, _lasColor = yellow
|
||||
, _lasColor2 = yellow
|
||||
, _lasCycle = 0
|
||||
, _lasDamage = 11
|
||||
}
|
||||
& itTweaks
|
||||
.~ Tweakable
|
||||
{ _tweakParams = IM.fromList [(0, lasGunTweak)]
|
||||
}
|
||||
& itDimension . dimRad .~ 10
|
||||
& itDimension . dimCenter .~ V3 15 0 0
|
||||
& itUse . heldUse .~ HeldLaser --shootLaser
|
||||
& itUse . heldDelay .~ NoDelay
|
||||
& itUse . heldMods .~ LasMod
|
||||
& itUse . heldAim . aimWeight .~ 6
|
||||
& itUse . heldAim . aimRange .~ 1
|
||||
& itUse . heldAim . aimStance .~ TwoHandTwist
|
||||
& itUse . heldAim . aimHandlePos .~ 5
|
||||
& itUse . heldAim . aimMuzPos .~ 30
|
||||
& itType . iyBase .~ HELD LASGUN
|
||||
|
||||
lasGunTweak :: TweakParam
|
||||
lasGunTweak =
|
||||
TweakParam
|
||||
{ _tweakType = TweakPhaseV
|
||||
, _tweakVal = 1
|
||||
, _tweakMax = 3
|
||||
}
|
||||
|
||||
tractorGun :: Item
|
||||
tractorGun =
|
||||
lasGun
|
||||
& itUse . heldConsumption
|
||||
.~ ( defaultLoadable
|
||||
& laMax .~ 10000
|
||||
& laCycle .~ [loadEject 10, loadInsert 10, loadPrime 60]
|
||||
)
|
||||
& itParams .~ Attracting{_attractionPower = 1}
|
||||
& itTweaks
|
||||
.~ Tweakable
|
||||
{ _tweakParams = IM.fromList [(0, tractorGunTweak)]
|
||||
}
|
||||
& itUse . heldUse .~ HeldTractor --aTractorBeam
|
||||
& itUse . heldDelay .~ NoDelay
|
||||
& itUse . heldMods .~ AmmoCheckMod
|
||||
& itUse . heldAim . aimWeight .~ 6
|
||||
& itUse . heldAim . aimRange .~ 1
|
||||
& itUse . heldAim . aimStance .~ TwoHandTwist
|
||||
& itUse . heldAim . aimHandlePos .~ 5
|
||||
& itUse . heldAim . aimMuzPos .~ 30
|
||||
& itType . iyBase .~ HELD TRACTORGUN
|
||||
|
||||
tractorGunTweak :: TweakParam
|
||||
tractorGunTweak =
|
||||
TweakParam
|
||||
{ _tweakType = TweakTractionPower
|
||||
, _tweakVal = 1
|
||||
, _tweakMax = 4
|
||||
}
|
||||
|
||||
lasWide :: Int -> Item
|
||||
lasWide n =
|
||||
lasGun
|
||||
& itType . iyBase .~ HELD (LASWIDE n)
|
||||
& itParams . lasColor .~ yellow
|
||||
& itParams . lasDamage .~ 2
|
||||
& itUse . heldMods .~ LasWideMod n
|
||||
|
||||
defaultBatteryGun :: Item
|
||||
defaultBatteryGun =
|
||||
defaultHeldItem
|
||||
& itType . iyModules .~ batteryModules
|
||||
|
||||
batteryModules :: M.Map ModuleSlot ItemModuleType
|
||||
batteryModules =
|
||||
M.fromList
|
||||
[ (ModBattery, EMPTYMODULE)
|
||||
, (ModTeleport, EMPTYMODULE)
|
||||
]
|
||||
|
||||
defaultAutoBatteryGun :: Item
|
||||
defaultAutoBatteryGun =
|
||||
defaultHeldItem
|
||||
& itType . iyModules .~ batteryModules
|
||||
|
||||
lasCircle :: Item
|
||||
lasCircle =
|
||||
lasGun
|
||||
& itType . iyBase .~ HELD LASCIRCLE
|
||||
& itParams . lasColor .~ orange
|
||||
& itParams . lasDamage .~ 2
|
||||
& itUse . heldConsumption . laMax .~ 10000
|
||||
& itUse . heldUse .~ HeldLaser --shootLaser
|
||||
& itUse . heldDelay .~ NoDelay
|
||||
& itUse . heldUse .~ HeldCircleLaser --circleLaser
|
||||
& itUse . heldMods .~ CircleLaserMod
|
||||
& itUse . heldAim . aimWeight .~ 6
|
||||
& itUse . heldAim . aimRange .~ 1
|
||||
& itUse . heldAim . aimStance .~ TwoHandTwist
|
||||
|
||||
dualBeam :: Item
|
||||
dualBeam =
|
||||
lasGun
|
||||
& itType . iyBase .~ HELD DUALBEAM
|
||||
& itUse . heldAim . aimMuzPos .~ 0
|
||||
& itParams
|
||||
.~ DualBeam
|
||||
{ _phaseV = 1
|
||||
, _lasColor = red
|
||||
, _lasColor2 = green
|
||||
, _lasCycle = 0
|
||||
, _lasDamage = 11
|
||||
, _lasBeam = BeamCombine LasBeamCombine
|
||||
, _subParams = Nothing
|
||||
, _dbGap = 20
|
||||
}
|
||||
& itUse . heldUse .~ HeldDualLaser --shootDualLaser
|
||||
& itUse . heldDelay .~ NoDelay
|
||||
& itUse . heldMods .~ DualBeamMod
|
||||
& itUse . heldAim . aimWeight .~ 6
|
||||
& itUse . heldAim . aimRange .~ 1
|
||||
& itUse . heldAim . aimStance .~ TwoHandFlat
|
||||
& itType . iyModules . at ModDualBeam ?~ EMPTYMODULE
|
||||
Reference in New Issue
Block a user