From 795c4c1987947fc6d0cde5b6856a05fe3ba185f1 Mon Sep 17 00:00:00 2001 From: justin Date: Wed, 20 Jul 2022 16:30:30 +0100 Subject: [PATCH] Mid refactor of item ruse--broken --- src/Dodge/Combine/Module.hs | 2 +- src/Dodge/Data.hs | 2 +- src/Dodge/Data/Item/HeldUse.hs | 25 +++- src/Dodge/Default/Weapon.hs | 2 +- src/Dodge/HeldUse.hs | 183 +++++++++++++++++++++++ src/Dodge/Item/Equipment.hs | 2 +- src/Dodge/Item/Weapon/BatteryGuns.hs | 49 +----- src/Dodge/Item/Weapon/BulletGun/Cane.hs | 26 +--- src/Dodge/Item/Weapon/BulletGun/Rod.hs | 34 +---- src/Dodge/Item/Weapon/BulletGun/Stick.hs | 12 +- src/Dodge/Item/Weapon/Drone.hs | 7 +- src/Dodge/Item/Weapon/Launcher.hs | 16 +- src/Dodge/Item/Weapon/Radar.hs | 4 +- src/Dodge/Item/Weapon/Shatter.hs | 7 +- src/Dodge/Item/Weapon/SonicGuns.hs | 6 +- src/Dodge/Item/Weapon/Spawn.hs | 8 +- src/Dodge/Item/Weapon/SprayGuns.hs | 30 +--- src/Dodge/Projectile/Create.hs | 8 - 18 files changed, 238 insertions(+), 185 deletions(-) diff --git a/src/Dodge/Combine/Module.hs b/src/Dodge/Combine/Module.hs index b174857cb..418503834 100644 --- a/src/Dodge/Combine/Module.hs +++ b/src/Dodge/Combine/Module.hs @@ -39,7 +39,7 @@ moduleModification imt = case imt of where makeDirectedTele it = it & itTargeting .~ targetRBPress - & itUse . useMods .:~ withPosDirWallCheck directedTelPos + & itUse . useMods %~ ModWithDirectedTeleport -- .:~ withPosDirWallCheck directedTelPos -- for the camera: the simplest option is to remove all zoom/offset & itUse . useAim . aimZoom . itZoomFac .~ 1 & itUse . useAim . aimRange .~ 0 diff --git a/src/Dodge/Data.hs b/src/Dodge/Data.hs index d6895ef96..199911142 100644 --- a/src/Dodge/Data.hs +++ b/src/Dodge/Data.hs @@ -404,7 +404,7 @@ data ItemUse = RightUse { _rUse :: HeldUse -- Item -> Creature -> World -> World , _useDelay :: UseDelay - , _useMods :: [(Item -> Creature -> World -> World) -> Item -> Creature -> World -> World] + , _useMods :: HeldMod --[(Item -> Creature -> World -> World) -> Item -> Creature -> World -> World] , _useHammer :: HammerPosition , _useAim :: AimParams , _heldScroll :: HeldScroll --Float -> Creature -> Item -> Item diff --git a/src/Dodge/Data/Item/HeldUse.hs b/src/Dodge/Data/Item/HeldUse.hs index 64d9ced6d..bac53fbb1 100644 --- a/src/Dodge/Data/Item/HeldUse.hs +++ b/src/Dodge/Data/Item/HeldUse.hs @@ -18,4 +18,27 @@ data HeldUse = HeldDoNothing | HeldForceField | HeldShatter -data HeldUseMods = HeldModsDoNothing +data HeldMod = HeldModNothing + | PoisonSprayerMod + | FlameSpitterMod + | FlameThrowerMod + | LauncherMod + | TeslaMod + | CircleLaserMod + | LasWideMod + | DualBeamMod + | LasMod + | LauncherXMod + | ShatterMod + | AmmoCheckMod + | AmmoUseCheckMod + | AmmoHammerTimeUseOneMod + | BangCaneMod + | VolleyGunMod + | AutoRifleMod + | BangRodMod + | ElephantGunMod + | AutoAmrMod + | MachineGunMod + | ModWithDirectedTeleport HeldMod + | BangStickMod diff --git a/src/Dodge/Default/Weapon.hs b/src/Dodge/Default/Weapon.hs index 154349096..58574fe35 100644 --- a/src/Dodge/Default/Weapon.hs +++ b/src/Dodge/Default/Weapon.hs @@ -61,7 +61,7 @@ defaultrUse :: ItemUse defaultrUse = RightUse { _rUse = HeldDoNothing , _useDelay = FixedRate {_rateMax = 8, _rateTime = 0} - , _useMods = [] + , _useMods = HeldModNothing , _useHammer = HammerUp , _useAim = defaultAimParams , _heldScroll = HeldScrollDoNothing diff --git a/src/Dodge/HeldUse.hs b/src/Dodge/HeldUse.hs index 4d5bf5597..36897be89 100644 --- a/src/Dodge/HeldUse.hs +++ b/src/Dodge/HeldUse.hs @@ -17,6 +17,189 @@ import RandomHelp import Data.Traversable +useMod :: HeldMod -> [(Item -> Creature -> World -> World) -> Item -> Creature -> World -> World] +useMod hm = case hm of + HeldModNothing -> [] + PoisonSprayerMod -> + [ ammoCheckI + , withSoundForI foamSprayLoopS 5 + , useAmmoAmount 1 + ] + FlameSpitterMod -> + [ ammoCheckI + , useTimeCheck + , lockInvFor 10 + , repeatOnFrames [1..9] + , withRandomItemParams f + , useAmmoAmount 1 + , withSidePushI 5 + , withSidePushAfterI 20 + ] + FlameThrowerMod -> + [ ammoCheckI + , useAmmoAmount 1 + , withSidePushI 5 + --, withTempLight 1 100 (V3 1 0 0) + , withSidePushAfterI 20 + ] + LauncherMod -> + [ hammerCheckI + , ammoCheckI + , useTimeCheck + , withSoundStart tap4S + , useAmmoAmount 1 + ] + TeslaMod -> + [ ammoCheckI + , withTempLight 1 100 (V3 0 0 1) + , withSoundForI elecCrackleS 1 + , useAmmoAmount 1 + ] + CircleLaserMod -> + [ 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 + ] + LasWideMod -> + [ 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) + ] + DualBeamMod -> + [ 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 + ] + LasMod -> + [ 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 + ] + LauncherXMod -> + [ hammerCheckI + , ammoCheckI + , useTimeCheck + , withSoundStart tap4S + , useAmmoAmount i + ] + ShatterMod -> + [ ammoHammerCheck + , useTimeCheck +-- , withSoundStart tap3S + , useAmmoAmount 1 + ] + AmmoCheckMod -> [ ammoCheckI ] + AmmoUseCheckMod -> [ ammoUseCheck ] + AmmoHammerTimeUseOneMod -> + [ ammoHammerCheck + , useTimeCheck + , useAmmoAmount 1 + ] + BangCaneMod -> + [ ammoHammerCheck + , useTimeCheck + , withSoundStart tap3S + , useAmmoAmount 1 + , withTorqueAfter + , applyInaccuracy + , withRecoil + , withSmoke 1 black 20 200 5 + , withMuzFlareI + ] + VolleyGunMod -> + [ ammoHammerCheck + , useTimeCheck + , withSoundItemChoiceStart caneStickSoundChoice + , useAllAmmo + , withTorqueAfter + , duplicateLoadedBarrels + , applyInaccuracy + , withMuzFlareI + , withRecoil + ] + AutoRifleMod -> -- note this is the same as BangCanemMod with the first changed + [ ammoCheckI + , useTimeCheck + , withSoundStart tap3S + , useAmmoAmount 1 + , withTorqueAfter + , applyInaccuracy + , withRecoil + , withSmoke 1 black 20 200 5 + , withMuzFlareI + ] + BangRodMod -> + [ ammoHammerCheck + , useTimeCheck + , withSoundStart bangEchoS + , useAmmoAmount 1 + , withTorqueAfter + , applyInaccuracy + , withThickSmokeI + , withMuzFlareI + , withRecoil + ] + ElephantGunMod -> + [ ammoHammerCheck + , useTimeCheck + , withSoundStart bangEchoS + , useAmmoAmount 1 + , withTorqueAfter + , applyInaccuracy + , withThickSmokeI + , withMuzFlareI + , withRecoil + ] + AutoAmrMod -> + [ ammoCheckI -- cf ElephantGun + , useTimeCheck + , withSoundStart bangEchoS + , useAmmoAmount 1 + , withTorqueAfter + , applyInaccuracy + , withThickSmokeI + , withMuzFlareI + , withRecoil + ] + MachineGunMod -> + [ ammoCheckI + , rateIncAB (torqueBeforeAtLeast 0.1 0.1) withTorqueAfter + , withSoundStart bangEchoS + , withThinSmokeI + , withMuzFlareI + ] + ModWithDirectedTeleport hm' -> + withPosDirWallCheck directedTelPos : useMod hm' + BangStickMod -> + [ ammoHammerCheck + , useTimeCheck + , withSoundItemChoiceStart bangStickSoundChoice + , useAllAmmo + , withMuzFlareI + , withTorqueAfter + , spreadLoaded +-- , applyInaccuracy + , withRecoil + ] + where + f = do + nzpres <- state $ randomR (3,4) + return $ sprayNozzles . ix 0 . nzPressure .~ nzpres + useHeld :: HeldUse -> Item -> Creature -> World -> World useHeld hu = case hu of HeldDoNothing -> const $ const id diff --git a/src/Dodge/Item/Equipment.hs b/src/Dodge/Item/Equipment.hs index 231e53389..ff166371f 100644 --- a/src/Dodge/Item/Equipment.hs +++ b/src/Dodge/Item/Equipment.hs @@ -130,7 +130,7 @@ flatShield = defaultWeapon & itUse .~ defaultrUse { _rUse = HeldDoNothing , _useDelay = NoDelay - , _useMods = [] + , _useMods = HeldModNothing , _useHammer = HammerUp , _useAim = AimParams { _aimWeight = 5 diff --git a/src/Dodge/Item/Weapon/BatteryGuns.hs b/src/Dodge/Item/Weapon/BatteryGuns.hs index 45a365a06..7fa8bc9e0 100644 --- a/src/Dodge/Item/Weapon/BatteryGuns.hs +++ b/src/Dodge/Item/Weapon/BatteryGuns.hs @@ -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 diff --git a/src/Dodge/Item/Weapon/BulletGun/Cane.hs b/src/Dodge/Item/Weapon/BulletGun/Cane.hs index eda2fba4d..185eaca6f 100644 --- a/src/Dodge/Item/Weapon/BulletGun/Cane.hs +++ b/src/Dodge/Item/Weapon/BulletGun/Cane.hs @@ -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 diff --git a/src/Dodge/Item/Weapon/BulletGun/Rod.hs b/src/Dodge/Item/Weapon/BulletGun/Rod.hs index d02f36a1f..dbbe9f2dd 100644 --- a/src/Dodge/Item/Weapon/BulletGun/Rod.hs +++ b/src/Dodge/Item/Weapon/BulletGun/Rod.hs @@ -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 diff --git a/src/Dodge/Item/Weapon/BulletGun/Stick.hs b/src/Dodge/Item/Weapon/BulletGun/Stick.hs index 155cf9e6b..76438fe90 100644 --- a/src/Dodge/Item/Weapon/BulletGun/Stick.hs +++ b/src/Dodge/Item/Weapon/BulletGun/Stick.hs @@ -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 diff --git a/src/Dodge/Item/Weapon/Drone.hs b/src/Dodge/Item/Weapon/Drone.hs index 4cab836df..d5ca34d36 100644 --- a/src/Dodge/Item/Weapon/Drone.hs +++ b/src/Dodge/Item/Weapon/Drone.hs @@ -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 diff --git a/src/Dodge/Item/Weapon/Launcher.hs b/src/Dodge/Item/Weapon/Launcher.hs index 0b235c25b..c5d363611 100644 --- a/src/Dodge/Item/Weapon/Launcher.hs +++ b/src/Dodge/Item/Weapon/Launcher.hs @@ -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..] $ diff --git a/src/Dodge/Item/Weapon/Radar.hs b/src/Dodge/Item/Weapon/Radar.hs index 3e3614487..bd3223d6e 100644 --- a/src/Dodge/Item/Weapon/Radar.hs +++ b/src/Dodge/Item/Weapon/Radar.hs @@ -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) diff --git a/src/Dodge/Item/Weapon/Shatter.hs b/src/Dodge/Item/Weapon/Shatter.hs index dd1025363..c61c1ff82 100644 --- a/src/Dodge/Item/Weapon/Shatter.hs +++ b/src/Dodge/Item/Weapon/Shatter.hs @@ -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 diff --git a/src/Dodge/Item/Weapon/SonicGuns.hs b/src/Dodge/Item/Weapon/SonicGuns.hs index c96200242..558f47326 100644 --- a/src/Dodge/Item/Weapon/SonicGuns.hs +++ b/src/Dodge/Item/Weapon/SonicGuns.hs @@ -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 diff --git a/src/Dodge/Item/Weapon/Spawn.hs b/src/Dodge/Item/Weapon/Spawn.hs index 324f8b142..cc97785ca 100644 --- a/src/Dodge/Item/Weapon/Spawn.hs +++ b/src/Dodge/Item/Weapon/Spawn.hs @@ -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 diff --git a/src/Dodge/Item/Weapon/SprayGuns.hs b/src/Dodge/Item/Weapon/SprayGuns.hs index d129ef4cc..a27033f7e 100644 --- a/src/Dodge/Item/Weapon/SprayGuns.hs +++ b/src/Dodge/Item/Weapon/SprayGuns.hs @@ -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 diff --git a/src/Dodge/Projectile/Create.hs b/src/Dodge/Projectile/Create.hs index d2c142900..a0ea253ab 100644 --- a/src/Dodge/Projectile/Create.hs +++ b/src/Dodge/Projectile/Create.hs @@ -1,17 +1,9 @@ module Dodge.Projectile.Create where import Dodge.Data ---import Dodge.Payload ---import Dodge.SoundLogic ---import Dodge.Movement.Turn import Dodge.Item.Location ---import Dodge.EnergyBall ---import Dodge.WorldEvent.Cloud import LensHelp import qualified IntMapHelp as IM import Geometry ---import RandomHelp - ---import Data.Maybe createProjectile :: ProjectileCreate -> Item -> Creature -> World -> World createProjectile pt = case pt of