Mid refactor of item ruse--broken
This commit is contained in:
@@ -130,7 +130,7 @@ flatShield = defaultWeapon
|
||||
& itUse .~ defaultrUse
|
||||
{ _rUse = HeldDoNothing
|
||||
, _useDelay = NoDelay
|
||||
, _useMods = []
|
||||
, _useMods = HeldModNothing
|
||||
, _useHammer = HammerUp
|
||||
, _useAim = AimParams
|
||||
{ _aimWeight = 5
|
||||
|
||||
@@ -77,12 +77,7 @@ teslaGun = defaultBatteryGun
|
||||
& itParams .~ teslaParams
|
||||
& itUse . rUse .~ HeldTeslaArc --shootTeslaArc
|
||||
& itUse . useDelay .~ NoDelay
|
||||
& itUse . useMods .~
|
||||
[ ammoCheckI
|
||||
, withTempLight 1 100 (V3 0 0 1)
|
||||
, withSoundForI elecCrackleS 1
|
||||
, useAmmoAmount 1
|
||||
]
|
||||
& itUse . useMods .~ TeslaMod
|
||||
& itUse . useAim . aimWeight .~ 6
|
||||
& itUse . useAim . aimStance .~ TwoHandFlat
|
||||
& itUse . useAim . aimHandlePos .~ 4
|
||||
@@ -115,15 +110,7 @@ lasCircle = lasGun
|
||||
& itUse . rUse .~ HeldLaser --shootLaser
|
||||
& itUse . useDelay .~ NoDelay
|
||||
& itUse . rUse .~ HeldCircleLaser --circleLaser
|
||||
& itUse . useMods .~
|
||||
[ ammoCheckI
|
||||
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
|
||||
, withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
|
||||
, withSoundForI tone440sawtoothquietS 2
|
||||
, useAmmoAmount 1
|
||||
, withItemUpdate' increasecycle
|
||||
, duplicateItem f
|
||||
]
|
||||
& itUse . useMods .~ CircleLaserMod
|
||||
& itUse . useAim . aimWeight .~ 6
|
||||
& itUse . useAim . aimRange .~ 1
|
||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||
@@ -137,16 +124,7 @@ lasWide n = lasGun
|
||||
& itType . iyBase .~ HELD (LASWIDE n)
|
||||
& itParams . lasColor .~ yellow
|
||||
& itParams . lasDamage .~ 2
|
||||
& itUse . useMods .~
|
||||
[ ammoCheckI
|
||||
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
|
||||
, withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
|
||||
, withSoundForI tone440sawtoothquietS 2
|
||||
, useAmmoAmount 1
|
||||
, crAtMuzPos
|
||||
, withItemUpdate' increasecycle
|
||||
, withItem $ \it -> duplicateOffsetsV2 (xs it)
|
||||
]
|
||||
& itUse . useMods .~ LasWideMod
|
||||
where
|
||||
increasecycle it = case _useHammer (_itUse it) of
|
||||
HammerUp -> it & itParams . lasCycle .~ 1
|
||||
@@ -236,13 +214,7 @@ dualBeam = lasGun
|
||||
}
|
||||
& itUse . rUse .~ HeldDualLaser --shootDualLaser
|
||||
& itUse . useDelay .~ NoDelay
|
||||
& itUse . useMods .~
|
||||
[ ammoCheckI
|
||||
, withItem $ \it -> withMuzPosShift (V2 0 (thegap it)) $ flareCircleAt (_lasColor $ _itParams it) 0.8
|
||||
, withItem $ \it -> withMuzPosShift (V2 0 (-thegap it)) $ flareCircleAt (_lasColor2 $ _itParams it) 0.8
|
||||
, withSoundForI tone440sawtoothquietS 2
|
||||
, useAmmoAmount 1
|
||||
]
|
||||
& itUse . useMods .~ DualBeamMod
|
||||
& itUse . useAim . aimWeight .~ 6
|
||||
& itUse . useAim . aimRange .~ 1
|
||||
& itUse . useAim . aimStance .~ TwoHandFlat
|
||||
@@ -288,14 +260,7 @@ lasGun = defaultAutoBatteryGun
|
||||
& itDimension . dimCenter .~ V3 15 0 0
|
||||
& itUse . rUse .~ HeldLaser --shootLaser
|
||||
& itUse . useDelay .~ NoDelay
|
||||
& itUse . useMods .~
|
||||
[ ammoCheckI
|
||||
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
|
||||
, withSoundForI tone440sawtoothquietS 2
|
||||
, withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
|
||||
, useAmmoAmount 1
|
||||
, crAtMuzPos
|
||||
]
|
||||
& itUse . useMods .~ LasMod
|
||||
& itUse . useAim . aimWeight .~ 6
|
||||
& itUse . useAim . aimRange .~ 1
|
||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||
@@ -334,9 +299,7 @@ tractorGun = lasGun
|
||||
}
|
||||
& itUse . rUse .~ HeldTractor --aTractorBeam
|
||||
& itUse . useDelay .~ NoDelay
|
||||
& itUse . useMods .~
|
||||
[ ammoCheckI
|
||||
]
|
||||
& itUse . useMods .~ AmmoCheckMod
|
||||
& itUse . useAim . aimWeight .~ 6
|
||||
& itUse . useAim . aimRange .~ 1
|
||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||
|
||||
@@ -37,17 +37,7 @@ defaultBangCane = defaultBulletWeapon
|
||||
& itDimension . dimRad .~ 8
|
||||
& itDimension . dimCenter .~ V3 5 0 0
|
||||
& itUse . useDelay . rateMax .~ 6
|
||||
& itUse . useMods .~
|
||||
[ ammoHammerCheck
|
||||
, useTimeCheck
|
||||
, withSoundStart tap3S
|
||||
, useAmmoAmount 1
|
||||
, withTorqueAfter
|
||||
, applyInaccuracy
|
||||
, withRecoil
|
||||
, withSmoke 1 black 20 200 5
|
||||
, withMuzFlareI
|
||||
]
|
||||
& itUse . useMods .~ BangCaneMod
|
||||
& itUse . useAim . aimStance .~ OneHand
|
||||
& itUse . useAim . aimHandlePos .~ 5
|
||||
& itUse . useAim . aimMuzPos .~ 15
|
||||
@@ -57,17 +47,7 @@ defaultBangCane = defaultBulletWeapon
|
||||
volleyGun :: Int -> Item
|
||||
volleyGun i = defaultBangCane
|
||||
& itUse . useDelay . rateMax .~ 6
|
||||
& itUse . useMods .~
|
||||
[ ammoHammerCheck
|
||||
, useTimeCheck
|
||||
, withSoundItemChoiceStart caneStickSoundChoice
|
||||
, useAllAmmo
|
||||
, withTorqueAfter
|
||||
, duplicateLoadedBarrels
|
||||
, applyInaccuracy
|
||||
, withMuzFlareI
|
||||
, withRecoil
|
||||
]
|
||||
& itUse . useMods .~ VolleyGunMod
|
||||
& itUse . useAim . aimWeight .~ 6
|
||||
& itUse . useAim . aimRange .~ 1
|
||||
& itUse . useAim . aimStance .~ TwoHandFlat
|
||||
@@ -119,7 +99,7 @@ repeater = rifle
|
||||
autoRifle :: Item
|
||||
autoRifle = repeater
|
||||
& itType . iyBase .~ HELD AUTORIFLE
|
||||
& itUse . useMods %~ ((ammoCheckI :) . tail)
|
||||
& itUse . useMods .~ AutoRifleMod
|
||||
& itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
|
||||
-- & itUse . useDelay . rateMax .~ 6
|
||||
burstRifle :: Item
|
||||
|
||||
@@ -35,17 +35,7 @@ bangRod = defaultBulletWeapon
|
||||
, _randomOffset = 0
|
||||
}
|
||||
& itUse . useDelay . rateMax .~ 12
|
||||
& itUse . useMods .~
|
||||
[ ammoHammerCheck
|
||||
, useTimeCheck
|
||||
, withSoundStart bangEchoS
|
||||
, useAmmoAmount 1
|
||||
, withTorqueAfter
|
||||
, applyInaccuracy
|
||||
, withThickSmokeI
|
||||
, withMuzFlareI
|
||||
, withRecoil
|
||||
]
|
||||
& itUse . useMods .~ BangRodMod
|
||||
& itDimension . dimRad .~ 12
|
||||
& itDimension . dimCenter .~ V3 5 0 0
|
||||
& itConsumption . laMax .~ 1
|
||||
@@ -63,17 +53,7 @@ elephantGun = bangRod
|
||||
& itType . iyBase .~ HELD ELEPHANTGUN
|
||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||
& itParams . gunBarrels .~ SingleBarrel 0.05
|
||||
& itUse . useMods .~
|
||||
[ ammoHammerCheck
|
||||
, useTimeCheck
|
||||
, withSoundStart bangEchoS
|
||||
, useAmmoAmount 1
|
||||
, withTorqueAfter
|
||||
, applyInaccuracy
|
||||
, withThickSmokeI
|
||||
, withMuzFlareI
|
||||
, withRecoil
|
||||
]
|
||||
& itUse . useMods .~ ElephantGunMod
|
||||
& itParams . recoil .~ 50
|
||||
& itParams . torqueAfter .~ 0.1
|
||||
amr :: Item
|
||||
@@ -84,7 +64,7 @@ amr = elephantGun
|
||||
autoAmr :: Item
|
||||
autoAmr = amr
|
||||
& itType . iyBase .~ HELD AUTOAMR
|
||||
& itUse . useMods %~ ((ammoCheckI :) . tail)
|
||||
& itUse . useMods .~ AutoAmrMod
|
||||
|
||||
sniperRifle :: Item
|
||||
sniperRifle = elephantGun
|
||||
@@ -99,13 +79,7 @@ machineGun :: Item
|
||||
machineGun = bangRod
|
||||
& itType . iyBase .~ HELD MACHINEGUN
|
||||
& itUse . useDelay . rateMax .~ 25
|
||||
& itUse . useMods .~
|
||||
[ ammoCheckI
|
||||
, rateIncAB (torqueBeforeAtLeast 0.1 0.1) withTorqueAfter
|
||||
, withSoundStart bangEchoS
|
||||
, withThinSmokeI
|
||||
, withMuzFlareI
|
||||
]
|
||||
& itUse . useMods .~ MachineGunMod
|
||||
& itUse . useAim . aimWeight .~ 8
|
||||
& itUse . useAim . aimRange .~ 1
|
||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||
|
||||
@@ -47,17 +47,7 @@ bangStick i = defaultBulletWeapon
|
||||
& itDimension . dimRad .~ 5
|
||||
& itDimension . dimCenter .~ V3 5 0 0
|
||||
& itUse . useDelay . rateMax .~ 8
|
||||
& itUse . useMods .~
|
||||
[ ammoHammerCheck
|
||||
, useTimeCheck
|
||||
, withSoundItemChoiceStart bangStickSoundChoice
|
||||
, useAllAmmo
|
||||
, withMuzFlareI
|
||||
, withTorqueAfter
|
||||
, spreadLoaded
|
||||
-- , applyInaccuracy
|
||||
, withRecoil
|
||||
]
|
||||
& itUse . useMods .~ BangStickMod
|
||||
& itType . iyBase .~ HELD (BANGSTICK i)
|
||||
& itUse . useAim . aimHandlePos .~ 5
|
||||
& itUse . useAim . aimMuzPos .~ 10
|
||||
|
||||
@@ -16,12 +16,7 @@ droneLauncher :: Item
|
||||
droneLauncher = defaultWeapon
|
||||
& itUse . useDelay . rateMax .~ 20
|
||||
-- & itUse . rUse .~ aDroneWithItemParams
|
||||
& itUse . useMods .~
|
||||
[ ammoCheckI
|
||||
, useTimeCheck
|
||||
, withSoundStart tap4S
|
||||
, useAmmoAmount 1
|
||||
]
|
||||
& itUse . useMods .~ AmmoUseCheckMod
|
||||
& itUse . useAim . aimWeight .~ 8
|
||||
& itUse . useAim . aimRange .~ 0.5
|
||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||
|
||||
@@ -45,13 +45,7 @@ launcher = defaultWeapon
|
||||
& itDimension . dimCenter .~ V3 10 0 0
|
||||
& itUse . useDelay . rateMax .~ 20
|
||||
& itUse . rUse .~ HeldPJCreation --usePjCreation
|
||||
& itUse . useMods .~
|
||||
[ hammerCheckI
|
||||
, ammoCheckI
|
||||
, useTimeCheck
|
||||
, withSoundStart tap4S
|
||||
, useAmmoAmount 1
|
||||
]
|
||||
& itUse . useMods .~ LauncherMod
|
||||
& itUse . useAim . aimWeight .~ 8
|
||||
& itUse . useAim . aimRange .~ 0.5
|
||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||
@@ -66,13 +60,7 @@ launcherX i = launcher
|
||||
& itConsumption . laMax .~ i
|
||||
& itConsumption . laLoaded .~ i
|
||||
& itUse . rUse .~ HeldPJCreationX i
|
||||
& itUse . useMods .~
|
||||
[ hammerCheckI
|
||||
, ammoCheckI
|
||||
, useTimeCheck
|
||||
, withSoundStart tap4S
|
||||
, useAmmoAmount i
|
||||
]
|
||||
& itUse . useMods .~ LauncherXMod
|
||||
|
||||
basicAmPjMoves :: IM.IntMap TweakParam
|
||||
basicAmPjMoves = IM.fromList . zip [0..] $
|
||||
|
||||
@@ -14,9 +14,7 @@ clickDetector :: Detector -> Item
|
||||
clickDetector dt = defaultWeapon
|
||||
& itUse . useDelay . rateMax .~ 20
|
||||
& itUse . rUse .~ HeldDetectorEffect dt --detectorEffect dt
|
||||
& itUse . useMods .~
|
||||
[ ammoUseCheck
|
||||
]
|
||||
& itUse . useMods .~ AmmoUseCheckMod
|
||||
& itUse . useAim . aimRange .~ 1
|
||||
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1}
|
||||
& itType . iyBase .~ HELD (HELDDETECTOR dt)
|
||||
|
||||
@@ -27,12 +27,7 @@ shatterGun = defaultWeapon
|
||||
& itType . iyBase .~ HELD SHATTERGUN
|
||||
& itUse . useDelay . rateMax .~ 10
|
||||
& itUse . rUse .~ HeldShatter --shootShatter
|
||||
& itUse . useMods .~
|
||||
[ ammoHammerCheck
|
||||
, useTimeCheck
|
||||
-- , withSoundStart tap3S
|
||||
, useAmmoAmount 1
|
||||
]
|
||||
& itUse . useMods .~ ShatterMod
|
||||
& itUse . useAim . aimStance .~ TwoHandFlat
|
||||
|
||||
shootShatter :: Item -> Creature -> World -> World
|
||||
|
||||
@@ -38,11 +38,7 @@ sonicGun = defaultAutoGun
|
||||
& itDimension . dimCenter .~ V3 15 0 0
|
||||
& itUse . useDelay . rateMax .~ 8
|
||||
& itUse . rUse .~ HeldSonicWave --aSonicWave
|
||||
& itUse . useMods .~
|
||||
[ ammoHammerCheck
|
||||
, useTimeCheck
|
||||
, useAmmoAmount 1
|
||||
]
|
||||
& itUse . useMods .~ AmmoHammerTimeUseOneMod
|
||||
& itUse . useAim . aimWeight .~ 6
|
||||
& itUse . useAim . aimRange .~ 1
|
||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||
|
||||
@@ -18,10 +18,10 @@ spawnGun :: Creature -> Item
|
||||
spawnGun _ = defaultWeapon
|
||||
& itUse . useDelay . rateMax .~ 100
|
||||
& itUse . rUse .~ HeldDoNothing --(\_ -> spawnCrNextTo cr)
|
||||
& itUse . useMods .~
|
||||
[ ammoCheckI
|
||||
, hammerCheckI
|
||||
]
|
||||
& itUse . useMods .~ HeldModNothing
|
||||
-- [ ammoCheckI
|
||||
-- , hammerCheckI
|
||||
-- ]
|
||||
& itType . iyBase .~ LEFT SPAWNER
|
||||
spawnCrNextTo
|
||||
:: Creature -- ^ Creature to spawn
|
||||
|
||||
@@ -23,12 +23,7 @@ poisonSprayer = flameThrower
|
||||
{ _amString = "POISONGAS"
|
||||
, _amCreateGas = CreatePoisonGas --aGasCloud
|
||||
}
|
||||
& itUse . useMods .~
|
||||
[ ammoCheckI
|
||||
, withSoundForI foamSprayLoopS 5
|
||||
, useAmmoAmount 1
|
||||
-- , spreadNumI
|
||||
]
|
||||
& itUse . useMods .~ PoisonSprayerMod
|
||||
|
||||
flameSpitter :: Item
|
||||
flameSpitter = flameThrower
|
||||
@@ -38,20 +33,7 @@ flameSpitter = flameThrower
|
||||
& itParams . sprayNozzles . ix 0 . nzPressure .~ 4
|
||||
& itUse . useAim . aimStance .~ OneHand
|
||||
& itUse . useDelay .~ FixedRate {_rateMax =12,_rateTime = 0}
|
||||
& itUse . useMods .~
|
||||
[ ammoCheckI
|
||||
, useTimeCheck
|
||||
, lockInvFor 10
|
||||
, repeatOnFrames [1..9]
|
||||
, withRandomItemParams f
|
||||
, useAmmoAmount 1
|
||||
, withSidePushI 5
|
||||
, withSidePushAfterI 20
|
||||
]
|
||||
where
|
||||
f = do
|
||||
nzpres <- state $ randomR (3,4)
|
||||
return $ sprayNozzles . ix 0 . nzPressure .~ nzpres
|
||||
& itUse . useMods .~ FlameSpitterMod
|
||||
|
||||
flameTorrent :: Item
|
||||
flameTorrent = flameThrower
|
||||
@@ -106,13 +88,7 @@ flameThrower = defaultAutoGun
|
||||
& itDimension . dimCenter .~ V3 9 0 0
|
||||
& itUse . rUse .~ HeldOverNozzlesUseGasParams -- overNozzles useGasParams
|
||||
& itUse . useDelay .~ NoDelay
|
||||
& itUse . useMods .~
|
||||
[ ammoCheckI
|
||||
, useAmmoAmount 1
|
||||
, withSidePushI 5
|
||||
--, withTempLight 1 100 (V3 1 0 0)
|
||||
, withSidePushAfterI 20
|
||||
]
|
||||
& itUse . useMods .~ FlameThrowerMod
|
||||
& itUse . useAim . aimWeight .~ 5
|
||||
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomMax = 5, _itZoomMin = 1.5}
|
||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||
|
||||
Reference in New Issue
Block a user