diff --git a/src/Dodge/Combine/Data.hs b/src/Dodge/Combine/Data.hs index 1949d2855..391d3e4c2 100644 --- a/src/Dodge/Combine/Data.hs +++ b/src/Dodge/Combine/Data.hs @@ -148,7 +148,6 @@ data HeldItemType | FLAMETORRENT | FLAMEWALL | BLOWTORCH - | AUTOGUN | SPARKGUN | TESLAGUN | LASGUN diff --git a/src/Dodge/Combine/Module.hs b/src/Dodge/Combine/Module.hs index 418503834..2800c3301 100644 --- a/src/Dodge/Combine/Module.hs +++ b/src/Dodge/Combine/Module.hs @@ -2,13 +2,9 @@ module Dodge.Combine.Module where import Dodge.Data import Dodge.Tesla import Dodge.Item.Weapon.ExtraEffect -import Dodge.Item.Weapon.TriggerType import LensHelp import Geometry import Dodge.Beam -import Dodge.Base.Coordinate - -import Data.Maybe moduleModification :: ItemModuleType -> Item -> Item moduleModification imt = case imt of @@ -45,10 +41,10 @@ moduleModification imt = case imt of & itUse . useAim . aimRange .~ 0 -- a better option would be to involve a "scope" centered on the firing -- position - directedTelPos it cr w = (p,a) - where - p = fromMaybe (_crPos cr) $ it ^? itTargeting . tgPos . _Just - a = argV (mouseWorldPos w -.- p) +-- directedTelPos it cr w = (p,a) +-- where +-- p = fromMaybe (_crPos cr) $ it ^? itTargeting . tgPos . _Just +-- a = argV (mouseWorldPos w -.- p) applyModules :: Item -> Item applyModules it = foldr moduleModification it (_iyModules (_itType it)) diff --git a/src/Dodge/Creature.hs b/src/Dodge/Creature.hs index 34b3cc4a9..00df8ee44 100644 --- a/src/Dodge/Creature.hs +++ b/src/Dodge/Creature.hs @@ -258,7 +258,6 @@ stackedInventory = IM.fromList $ zip [0..] , pipe ,rewindGun ,tractorGun - ,autoGun ,autoPistol ,pistol ,teslaGun diff --git a/src/Dodge/Creature/AutoCrit.hs b/src/Dodge/Creature/AutoCrit.hs index 8c69e4025..e1f576c62 100644 --- a/src/Dodge/Creature/AutoCrit.hs +++ b/src/Dodge/Creature/AutoCrit.hs @@ -12,7 +12,7 @@ import Control.Lens autoCrit :: Creature autoCrit = defaultCreature - { _crInv = IM.fromList [(0,autoGun),(1,medkit 100)] + { _crInv = IM.fromList [(0,autoRifle),(1,medkit 100)] , _crRad = 10 , _crHP = 300 , _crMvType = defaultAimMvType diff --git a/src/Dodge/Creature/Impulse/UseItem.hs b/src/Dodge/Creature/Impulse/UseItem.hs index 501652698..81686343b 100644 --- a/src/Dodge/Creature/Impulse/UseItem.hs +++ b/src/Dodge/Creature/Impulse/UseItem.hs @@ -26,7 +26,7 @@ useItem cr' w = fromMaybe (f w) $ do itemEffect :: Creature -> Item -> World -> World itemEffect cr it w = case it ^? itUse of Just RightUse {_rUse = eff,_useMods = usemods} - -> hammerTest $ tryReload cr it w $ foldr ($) (useHeld eff) usemods it cr + -> hammerTest $ tryReload cr it w $ foldr ($) (useHeld eff) (useMod usemods) it cr Just LeftUse {} -> doequipmentchange Just EquipUse{} -> doequipmentchange -- ConsumeUse will cause problems if the item is not selected diff --git a/src/Dodge/Data/Item/HeldUse.hs b/src/Dodge/Data/Item/HeldUse.hs index bac53fbb1..e91e2c4e4 100644 --- a/src/Dodge/Data/Item/HeldUse.hs +++ b/src/Dodge/Data/Item/HeldUse.hs @@ -25,10 +25,10 @@ data HeldMod = HeldModNothing | LauncherMod | TeslaMod | CircleLaserMod - | LasWideMod + | LasWideMod Int | DualBeamMod | LasMod - | LauncherXMod + | LauncherXMod Int | ShatterMod | AmmoCheckMod | AmmoUseCheckMod @@ -42,3 +42,11 @@ data HeldMod = HeldModNothing | MachineGunMod | ModWithDirectedTeleport HeldMod | BangStickMod + | PistolMod + | AutoPistolMod + | MachinePistolMod + | BurstRifleMod + | MiniGunMod Int + | SmgMod + | RevolverXMod + | BangConeMod diff --git a/src/Dodge/HeldUse.hs b/src/Dodge/HeldUse.hs index 36897be89..fca5b2a98 100644 --- a/src/Dodge/HeldUse.hs +++ b/src/Dodge/HeldUse.hs @@ -1,6 +1,11 @@ module Dodge.HeldUse where import Dodge.Data +import Dodge.Base.Coordinate +import Sound.Data import Dodge.Bullet +import Dodge.Item.Weapon.TriggerType +import Dodge.SoundLogic +import Dodge.WorldEvent.Flash import Dodge.Item.Location import Dodge.Item.Weapon.Radar import Dodge.Item.Weapon.BatteryGuns @@ -14,7 +19,9 @@ import Geometry import qualified IntMapHelp as IM import LensHelp import RandomHelp +import Color +import Data.Maybe import Data.Traversable useMod :: HeldMod -> [(Item -> Creature -> World -> World) -> Item -> Creature -> World -> World] @@ -61,23 +68,23 @@ useMod hm = case hm of , withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8 , withSoundForI tone440sawtoothquietS 2 , useAmmoAmount 1 - , withItemUpdate' increasecycle - , duplicateItem f + , withItemUpdate' increasecycleLasCircle + , duplicateItem fLasCircle ] - LasWideMod -> + LasWideMod n -> [ 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) + , withItemUpdate' (increasecycleLasWide n) + , withItem $ \it -> duplicateOffsetsV2 (xsLasWide 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 + , withItem $ \it -> withMuzPosShift (V2 0 (thegapDualBeam it)) $ flareCircleAt (_lasColor $ _itParams it) 0.8 + , withItem $ \it -> withMuzPosShift (V2 0 (-thegapDualBeam it)) $ flareCircleAt (_lasColor2 $ _itParams it) 0.8 , withSoundForI tone440sawtoothquietS 2 , useAmmoAmount 1 ] @@ -89,7 +96,7 @@ useMod hm = case hm of , useAmmoAmount 1 , crAtMuzPos ] - LauncherXMod -> + LauncherXMod i -> [ hammerCheckI , ammoCheckI , useTimeCheck @@ -195,10 +202,129 @@ useMod hm = case hm of -- , applyInaccuracy , withRecoil ] + PistolMod -> + [ ammoHammerCheck + , useTimeCheck + , useAmmoAmount 1 + , withSoundStart tap3S + , applyInaccuracy + , withTorqueAfter + , withRecoil + , withSidePushI 50 + , withMuzFlareI + ] + AutoPistolMod -> + [ ammoCheckI + , useTimeCheck + , useAmmoAmount 1 + , withSoundStart tap3S + , applyInaccuracy + , withTorqueAfter + , withRecoil + , withSidePushI 50 + , withMuzFlareI + ] + MachinePistolMod -> + [ ammoCheckI + , useTimeCheck + , useAmmoAmount 1 + , withSoundStart tap1S + , applyInaccuracy + , withTorqueAfter + , withSidePushI 50 + , withRecoil + , withMuzFlareI + ] + BurstRifleMod -> + [ ammoHammerCheck + , useTimeCheck + , sideEffectOnFrame 7 (torqueSideEffect 0.2) + , lockInvFor 7 + , \f' it -> repeatOnFrames (take (_laLoaded (_itConsumption it) - 1) [3,6]) f' it + , withSoundStart tap3S + , useAmmoAmount 1 + , applyInaccuracy + , withMuzFlareI + , withRecoil + ] + MiniGunMod i -> + [ ammoCheckI + , withWarmUp crankSlowS + , withSoundForI mini1S 2 + --, withThinSmokeI + , withSmoke 1 black 20 200 5 + , withMuzFlareI + , useAmmoAmount i + , withSidePushI (fromIntegral i * 50) + , torqueBefore (fromIntegral i * 0.05) + , afterRecoil (fromIntegral i * 5) + ] <> + [ trigDoAlso' (moddelay x) (modcrpos x) useAmmoParams + | x <- map ((/fromIntegral i) . fromIntegral) [1..i-1] + ] + SmgMod -> + [ ammoCheckI + , useTimeCheck + , useAmmoAmount 1 + , withSoundStart tap3S + , applyInaccuracy + , withTorqueAfter + , withRecoil + , withSidePushI 30 + , withMuzFlareI + ] + RevolverXMod -> + [ ammoHammerCheck + , useTimeCheck + -- rather than locking the inventory, a better solution may be to check + -- that the weapon is still in your hands in the repeated frames + , lockInvFor 10 + , \f' it -> repeatOnFrames (take (_laLoaded (_itConsumption it) - 1) [2,4,6,8,10]) f' it + , withSoundStart tap3S + , useAmmoUpTo 1 + , applyInaccuracy + , withMuzFlareI +-- , spreadLoaded + , withTorqueAfter + , withRecoil + ] + BangConeMod -> + [ ammoCheckI + , hammerCheckI + , useTimeCheck + , withSoundStart bangEchoS + , useAllAmmo + , withTorqueAfter + , withRecoil + , duplicateLoaded + , withMuzFlareI + , applyInaccuracy + , withRandomOffset + , withRandomItemUpdate coneRandItemUpdate + , withRandomItemParams coneRandItemParams + ] where f = do nzpres <- state $ randomR (3,4) return $ sprayNozzles . ix 0 . nzPressure .~ nzpres + increasecycleLasCircle it = it & itParams . lasCycle %~ (flip mod 2000 . (+ 1)) + --f it = [it & itParams . lasCycle +~ x | x <- [0,100 .. 1900] ] + fLasCircle it = [it & itParams . lasCycle +~ x | x <- [0,50 .. 1999] ] + increasecycleLasWide n it = case _useHammer (_itUse it) of + HammerUp -> it & itParams . lasCycle .~ 1 + _ -> it & itParams . lasCycle %~ (min (n * 5) . (+ 1)) + xsLasWide it = [ V2 ((0.2*yoff x) ^ (2::Int)) (yoff x) | x <- [(0::Int)..n'-1] ] + where + yoff x = fromIntegral x - fromIntegral (n'-1) / 2 + n' = _lasCycle (_itParams it) + thegapDualBeam = _dbGap . _itParams + directedTelPos it cr w = (p,a) + where + p = fromMaybe (_crPos cr) $ it ^? itTargeting . tgPos . _Just + a = argV (mouseWorldPos w -.- p) + moddelay x = itConsumption . laAmmoType . amBullet . buState .~ DelayedBullet x + modcrpos x cr = cr & crDir %~ tweenAngles x (_crOldDir cr) + & crPos %~ tweenPoints x (_crOldPos cr) useHeld :: HeldUse -> Item -> Creature -> World -> World useHeld hu = case hu of @@ -274,3 +400,26 @@ fireRemoteShell it cr w = set (creatures . ix cid . crInv . ix j . itUse . rUse) , PJRemoteDirection 340 0 cid itid ] j = crSel cr + +caneStickSoundChoice :: Item -> SoundID +caneStickSoundChoice it + | _laLoaded (_itConsumption it) < 2 = tap3S + | otherwise = shotgunS + +bangStickSoundChoice :: Item -> SoundID +bangStickSoundChoice it + | _laLoaded (_itConsumption it) < 2 = tap3S + | otherwise = shotgunS + +coneRandItemUpdate :: State StdGen (Item -> Item) +coneRandItemUpdate = do + wth <- state $ randomR (1,5) + return (itConsumption . laAmmoType . amBullet . buWidth .~ wth) +coneRandItemParams :: State StdGen (ItemParams -> ItemParams) +coneRandItemParams = do + muzv <- state $ randomR (0.5,1) + rifl <- state $ randomR (0.3,0.9) + return $ \itparams -> itparams + { _muzVel = muzv + , _rifling = rifl + } diff --git a/src/Dodge/Item.hs b/src/Dodge/Item.hs index 09a076242..b4bce54cd 100644 --- a/src/Dodge/Item.hs +++ b/src/Dodge/Item.hs @@ -92,7 +92,6 @@ itemFromHeldType ht = case ht of FLAMETORRENT -> flameTorrent FLAMEWALL -> flameWall BLOWTORCH -> blowTorch - AUTOGUN -> autoGun -- SPREADGUN -> spreadGun -- MULTGUN -> multGun SPARKGUN -> sparkGun diff --git a/src/Dodge/Item/Draw/SPic.hs b/src/Dodge/Item/Draw/SPic.hs index 82a0a23c0..ecc480014 100644 --- a/src/Dodge/Item/Draw/SPic.hs +++ b/src/Dodge/Item/Draw/SPic.hs @@ -85,7 +85,6 @@ heldItemSPic ht it = case ht of FLAMETORRENT -> flamerPic it FLAMEWALL -> flamerPic it BLOWTORCH -> flamerPic it - AUTOGUN -> defSPic SPARKGUN -> teslaGunPic TESLAGUN -> teslaGunPic LASGUN -> lasGunPic it diff --git a/src/Dodge/Item/Weapon/BatteryGuns.hs b/src/Dodge/Item/Weapon/BatteryGuns.hs index 7fa8bc9e0..69748c2b8 100644 --- a/src/Dodge/Item/Weapon/BatteryGuns.hs +++ b/src/Dodge/Item/Weapon/BatteryGuns.hs @@ -24,14 +24,6 @@ import Dodge.Beam import Dodge.Item.Weapon.LaserPath import Dodge.Item.Location import Dodge.Creature.HandPos ---import Dodge.Particle.TeslaArc ---import Dodge.Particle.Flame -import Dodge.SoundLogic.LoadSound -import Dodge.WorldEvent.Flash ---import Dodge.WorldEvent.Damage ---import Dodge.Default ---import Dodge.Item.Weapon.InventoryDisplay -import Dodge.Item.Weapon.TriggerType import Dodge.Default.Weapon import Dodge.Base --import Dodge.Zone @@ -115,24 +107,14 @@ lasCircle = lasGun & itUse . useAim . aimRange .~ 1 & itUse . useAim . aimStance .~ TwoHandTwist where - increasecycle it = it & itParams . lasCycle %~ (flip mod 2000 . (+ 1)) - --f it = [it & itParams . lasCycle +~ x | x <- [0,100 .. 1900] ] - f it = [it & itParams . lasCycle +~ x | x <- [0,50 .. 1999] ] lasWide :: Int -> Item lasWide n = lasGun & itType . iyBase .~ HELD (LASWIDE n) & itParams . lasColor .~ yellow & itParams . lasDamage .~ 2 - & itUse . useMods .~ LasWideMod + & itUse . useMods .~ LasWideMod n where - increasecycle it = case _useHammer (_itUse it) of - HammerUp -> it & itParams . lasCycle .~ 1 - _ -> it & itParams . lasCycle %~ (min (n * 5) . (+ 1)) - xs it = [ V2 ((0.2*yoff x) ^ (2::Int)) (yoff x) | x <- [(0::Int)..n'-1] ] - where - yoff x = fromIntegral x - fromIntegral (n'-1) / 2 - n' = _lasCycle (_itParams it) --lasWidePulse :: Item --lasWidePulse = lasGun -- & itType . iyBase .~ LASGUNWIDEPULSE @@ -220,7 +202,6 @@ dualBeam = lasGun & itUse . useAim . aimStance .~ TwoHandFlat & itType . iyModules . at ModDualBeam ?~ EMPTYMODULE where - thegap = _dbGap . _itParams --lasSwing :: Item --lasSwing = lasGun -- & itType . iyBase .~ LASGUNSWING diff --git a/src/Dodge/Item/Weapon/BulletGun/Cane.hs b/src/Dodge/Item/Weapon/BulletGun/Cane.hs index 185eaca6f..88a3a5d01 100644 --- a/src/Dodge/Item/Weapon/BulletGun/Cane.hs +++ b/src/Dodge/Item/Weapon/BulletGun/Cane.hs @@ -4,21 +4,13 @@ module Dodge.Item.Weapon.BulletGun.Cane , rifle , autoRifle , burstRifle --- , completeBurstRifle --- , fastBurstRifle , miniGunX ) where ---import Dodge.Particle.Bullet.HitEffect import Dodge.Reloading.Action import Dodge.Data -import Dodge.Bullet import Dodge.Default.Weapon import Dodge.Default -import Dodge.Item.Weapon.TriggerType -import Dodge.SoundLogic.LoadSound -import Picture import Geometry -import Sound.Data import LensHelp defaultBangCane :: Item @@ -73,10 +65,6 @@ volleyGun i = defaultBangCane } & itParams . torqueAfter .~ 0.48 + 0.2 * fromIntegral i & itType . iyBase .~ HELD (VOLLEYGUN i) -caneStickSoundChoice :: Item -> SoundID -caneStickSoundChoice it - | _laLoaded (_itConsumption it) < 2 = tap3S - | otherwise = shotgunS rifle :: Item rifle = defaultBangCane & itUse . useAim . aimStance .~ TwoHandTwist @@ -107,18 +95,7 @@ burstRifle = repeater & itType . iyBase .~ HELD BURSTRIFLE & itParams . gunBarrels . brlInaccuracy .~ 0.05 & itUse . useDelay . rateMax .~ 18 - & itUse . useMods .~ - [ ammoHammerCheck - , useTimeCheck - , sideEffectOnFrame 7 (torqueSideEffect 0.2) - , lockInvFor 7 - , \f it -> repeatOnFrames (take (_laLoaded (_itConsumption it) - 1) [3,6]) f it - , withSoundStart tap3S - , useAmmoAmount 1 - , applyInaccuracy - , withMuzFlareI - , withRecoil - ] + & itUse . useMods .~ BurstRifleMod --fastBurstRifle :: Item --fastBurstRifle = repeater -- & itType . iyBase .~ FASTBURSTRIFLE @@ -158,26 +135,8 @@ miniGunUse :: Int -> ItemUse miniGunUse i = defaultrUse & rUse .~ HeldUseAmmoParams & useDelay .~ NoDelay - & useMods .~ - [ ammoCheckI - , withWarmUp crankSlowS - , withSoundForI mini1S 2 - --, withThinSmokeI - , withSmoke 1 black 20 200 5 - , withMuzFlareI - , useAmmoAmount i - , withSidePushI (y * 50) - , torqueBefore (y * 0.05) - , afterRecoil (y * 5) - ] <> - [ trigDoAlso' (moddelay x) (modcrpos x) useAmmoParams - | x <- map ((/fromIntegral i) . fromIntegral) [1..i-1] - ] + & useMods .~ MiniGunMod i where - y = fromIntegral i - moddelay x = itConsumption . laAmmoType . amBullet . buState .~ DelayedBullet x - modcrpos x cr = cr & crDir %~ tweenAngles x (_crOldDir cr) - & crPos %~ tweenPoints x (_crOldPos cr) miniGunX :: Int -> Item miniGunX i = defaultAutoGun diff --git a/src/Dodge/Item/Weapon/BulletGun/Rod.hs b/src/Dodge/Item/Weapon/BulletGun/Rod.hs index dbbe9f2dd..c0b19f4e2 100644 --- a/src/Dodge/Item/Weapon/BulletGun/Rod.hs +++ b/src/Dodge/Item/Weapon/BulletGun/Rod.hs @@ -11,18 +11,10 @@ import Dodge.Reloading.Action import Dodge.Default.Weapon import Dodge.Item.Weapon.Bullet import Dodge.Default ---import Dodge.Item.Weapon.ZoomScope import Dodge.Item.Weapon.ExtraEffect -import Dodge.Item.Weapon.TriggerType -import Dodge.SoundLogic.LoadSound import Geometry import LensHelp ---import qualified Data.Sequence as Seq ---import Control.Lens ---import Control.Monad.State ---import System.Random - bangRod :: Item bangRod = defaultBulletWeapon & itParams .~ BulletShooter diff --git a/src/Dodge/Item/Weapon/BulletGun/Stick.hs b/src/Dodge/Item/Weapon/BulletGun/Stick.hs index 76438fe90..e18efc370 100644 --- a/src/Dodge/Item/Weapon/BulletGun/Stick.hs +++ b/src/Dodge/Item/Weapon/BulletGun/Stick.hs @@ -9,25 +9,10 @@ module Dodge.Item.Weapon.BulletGun.Stick ) where import Dodge.Reloading.Action import Dodge.Data -import Dodge.ChainEffect import Dodge.Default.Weapon -import Dodge.Item.Weapon.TriggerType -import Dodge.SoundLogic.LoadSound import Geometry -import Sound.Data import LensHelp ---import Data.Maybe ---import qualified Data.Sequence as Seq ---import Control.Lens ---import Control.Monad.State ---import System.Random - -bangStickSoundChoice :: Item -> SoundID -bangStickSoundChoice it - | _laLoaded (_itConsumption it) < 2 = tap3S - | otherwise = shotgunS - bangStick :: Int -> Item bangStick i = defaultBulletWeapon & itParams .~ BulletShooter @@ -65,47 +50,13 @@ revolver = pistol & laCycle .~ [loadPartialInsert 10 1] ) & itType . iyBase .~ HELD REVOLVER -pistolAfterHamMods :: [ChainEffect] -pistolAfterHamMods = - [ useTimeCheck - , useAmmoAmount 1 - , withSoundStart tap3S - , applyInaccuracy - , withTorqueAfter - , withRecoil - , withSidePushI 50 - , withMuzFlareI - ] -machinePistolAfterHamMods :: [ChainEffect] -machinePistolAfterHamMods = - [ useTimeCheck - , useAmmoAmount 1 - , withSoundStart tap1S - , applyInaccuracy - , withTorqueAfter - , withSidePushI 50 - , withRecoil - , withMuzFlareI - ] -smgAfterHamMods :: [ChainEffect] -smgAfterHamMods = - [ useTimeCheck - , useAmmoAmount 1 - , withSoundStart tap3S - , applyInaccuracy - , withTorqueAfter - , withRecoil - , withSidePushI 30 - , withMuzFlareI - ] - pistol :: Item pistol = bangStick 1 & itConsumption .~ ( defaultBulletLoadable & laMax .~ 15 & laCycle .~ [loadEject 5, loadInsert 5 , loadPrime 5] ) & itUse . useDelay . rateMax .~ 6 - & itUse . useMods .~ (ammoHammerCheck : pistolAfterHamMods) + & itUse . useMods .~ PistolMod & itParams %~ ( ( muzVel .~ 0.8 ) . ( rifling .~ 0.8 ) @@ -117,19 +68,19 @@ pistol = bangStick 1 & itType . iyBase .~ HELD PISTOL autoPistol :: Item autoPistol = pistol - & itUse . useMods .~ (ammoCheckI : pistolAfterHamMods) + & itUse . useMods .~ AutoPistolMod & itType . iyBase .~ HELD AUTOPISTOL & itType . iyModules . at ModAutoMag ?~ EMPTYMODULE machinePistol :: Item machinePistol = autoPistol & itUse . useDelay . rateMax .~ 2 - & itUse . useMods .~ (ammoCheckI : machinePistolAfterHamMods) + & itUse . useMods .~ MachinePistolMod -- (ammoCheckI : machinePistolAfterHamMods) & itType . iyBase .~ HELD MACHINEPISTOL & itType . iyModules . at ModAutoMag .~ Nothing & itParams . recoil .~ 20 smg :: Item smg = autoPistol -- & some parameter affecting stability - & itUse . useMods .~ (ammoCheckI : smgAfterHamMods) + & itUse . useMods .~ SmgMod --(ammoCheckI : smgAfterHamMods) & itType . iyBase .~ HELD SMG & itUse . useAim . aimStance .~ TwoHandTwist & itUse . useAim . aimHandlePos .~ 2 @@ -137,20 +88,6 @@ smg = autoPistol -- & some parameter affecting stability revolverX :: Int -> Item revolverX i = revolver & itUse . useDelay . rateMax .~ 8 - & itUse . useMods .~ - [ ammoHammerCheck - , useTimeCheck - -- rather than locking the inventory, a better solution may be to check - -- that the weapon is still in your hands in the repeated frames - , lockInvFor 10 - , \f it -> repeatOnFrames (take (_laLoaded (_itConsumption it) - 1) [2,4,6,8,10]) f it - , withSoundStart tap3S - , useAmmoUpTo 1 - , applyInaccuracy - , withMuzFlareI --- , spreadLoaded - , withTorqueAfter - , withRecoil - ] + & itUse . useMods .~ RevolverXMod & itConsumption . laMax .~ i * 6 & itType . iyBase .~ HELD (REVOLVERX i) diff --git a/src/Dodge/Item/Weapon/BulletGuns.hs b/src/Dodge/Item/Weapon/BulletGuns.hs index 217147cb7..736fc8bb4 100644 --- a/src/Dodge/Item/Weapon/BulletGuns.hs +++ b/src/Dodge/Item/Weapon/BulletGuns.hs @@ -4,8 +4,7 @@ module Dodge.Item.Weapon.BulletGuns , grapeCannon , grenadeLauncher , autogunSpread - , autoGun - , autoGunPic + --, autoGunPic , module Dodge.Item.Weapon.BulletGun.Stick , module Dodge.Item.Weapon.BulletGun.Cane , module Dodge.Item.Weapon.BulletGun.Rod @@ -14,81 +13,56 @@ import Dodge.Item.Weapon.BulletGun.Stick import Dodge.Reloading.Action import Dodge.Item.Weapon.BulletGun.Cane import Dodge.Item.Weapon.BulletGun.Rod ---import Dodge.Item.Weapon.BulletGun.Clip import Dodge.Data ---import Dodge.ChainEffect import Dodge.Default.Weapon -import Dodge.Default -import Dodge.Item.Attachment ---import Dodge.Item.Draw -import Dodge.Item.Weapon.TriggerType -import Dodge.SoundLogic.LoadSound -import Picture import Geometry -import ShapePicture -import Shape ---import Sound.Data import LensHelp -import qualified Data.Sequence as Seq ---import Control.Lens -import Control.Monad.State -import System.Random - -autoGun :: Item -autoGun = defaultAutoGun - { _itConsumption = defaultBulletLoadable - { _laMax = 30 - , _laLoaded = 30 - } - & laCycle .~ [loadEject 30, loadInsert 30 , loadPrime 10] --- , _itFloorPict = autoGunPic --- , _itZoom = defaultItZoom - , _itAttachment = AttachCharMode $ Seq.fromList "MS" - , _itParams = BulletShooter - { _muzVel = 1 - , _rifling = 0.9 - , _bore = 2 - , _gunBarrels = SingleBarrel 0.1 - , _recoil = 0 - , _torqueAfter = 0 - , _randomOffset = 0 - } - } - & itUse . useDelay . rateMax .~ 4 - & itUse . useMods .~ - [ ammoCheckI - , charFiringStratI - [('S', hammerCheckI) - ] - , useTimeCheck - , charFiringStratI - [('M', torqueBefore 0.08) - ,('S', torqueBefore 0.05) - ] - , withSoundForI autoBS 5 - --, withSoundForI seagullChatterS 5 - , useAmmoAmount 1 - , applyInaccuracy - , withMuzFlareI - , withSmoke 1 black 20 200 5 - ] - & itUse . useAim . aimWeight .~ 6 - & itUse . useAim . aimRange .~ 1 - & itUse . useAim . aimStance .~ TwoHandTwist - & itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5} - & itUse . heldScroll .~ HeldScrollCharMode - & itType . iyBase .~ HELD AUTOGUN -autoGunPic :: Item -> SPic -autoGunPic it = noPic $ - colorSH red (prismPoly - (map (addZ 5) $ rectNESW 2 12 (-2) (-8)) - (map (addZ 0) $ rectNESW 4 12 (-4) (-12)) - ) - <> translateSHf 0 (-1) (rotateSHx (negate $ pi/4) . upperPrismPoly 2 $ rectNESW (negate $ 3 + 0.25 * x) 0 3 (-5)) - where - x = fromIntegral $ _laLoaded $ _itConsumption it - +--autoGun :: Item +--autoGun = defaultAutoGun +-- { _itConsumption = defaultBulletLoadable +-- { _laMax = 30 +-- , _laLoaded = 30 +-- } +-- & laCycle .~ [loadEject 30, loadInsert 30 , loadPrime 10] +---- , _itFloorPict = autoGunPic +---- , _itZoom = defaultItZoom +-- , _itAttachment = AttachCharMode $ Seq.fromList "MS" +-- , _itParams = BulletShooter +-- { _muzVel = 1 +-- , _rifling = 0.9 +-- , _bore = 2 +-- , _gunBarrels = SingleBarrel 0.1 +-- , _recoil = 0 +-- , _torqueAfter = 0 +-- , _randomOffset = 0 +-- } +-- } +-- & itUse . useDelay . rateMax .~ 4 +-- & itUse . useMods .~ +-- [ ammoCheckI +-- , charFiringStratI +-- [('S', hammerCheckI) +-- ] +-- , useTimeCheck +-- , charFiringStratI +-- [('M', torqueBefore 0.08) +-- ,('S', torqueBefore 0.05) +-- ] +-- , withSoundForI autoBS 5 +-- --, withSoundForI seagullChatterS 5 +-- , useAmmoAmount 1 +-- , applyInaccuracy +-- , withMuzFlareI +-- , withSmoke 1 black 20 200 5 +-- ] +-- & itUse . useAim . aimWeight .~ 6 +-- & itUse . useAim . aimRange .~ 1 +-- & itUse . useAim . aimStance .~ TwoHandTwist +-- & itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5} +-- & itUse . heldScroll .~ HeldScrollCharMode +-- & itType . iyBase .~ HELD AUTOGUN + bangCone :: Item bangCone = defaultBulletWeapon { _itParams = BulletShooter @@ -104,38 +78,12 @@ bangCone = defaultBulletWeapon & itDimension . dimRad .~ 8 & itDimension . dimCenter .~ V3 5 0 0 & itUse . useDelay . rateMax .~ 20 - & itUse . useMods .~ - [ ammoCheckI - , hammerCheckI - , useTimeCheck - , withSoundStart bangEchoS - , useAllAmmo - , withTorqueAfter - , withRecoil - , duplicateLoaded - , withMuzFlareI - , applyInaccuracy - , withRandomOffset - , withRandomItemUpdate coneRandItemUpdate - , withRandomItemParams coneRandItemParams - ] + & itUse . useMods .~ BangConeMod & itUse . useAim . aimHandlePos .~ 5 & itUse . useAim . aimMuzPos .~ 15 & itType . iyBase .~ HELD BANGCONE & itConsumption . laMax .~ 5 & itConsumption . laCycle .~ [loadEject 5, loadInsert 20 , loadPrime 5] -coneRandItemUpdate :: State StdGen (Item -> Item) -coneRandItemUpdate = do - wth <- state $ randomR (1,5) - return (itConsumption . laAmmoType . amBullet . buWidth .~ wth) -coneRandItemParams :: State StdGen (ItemParams -> ItemParams) -coneRandItemParams = do - muzv <- state $ randomR (0.5,1) - rifl <- state $ randomR (0.3,0.9) - return $ \itparams -> itparams - { _muzVel = muzv - , _rifling = rifl - } blunderbuss :: Item blunderbuss = bangCone diff --git a/src/Dodge/Item/Weapon/Drone.hs b/src/Dodge/Item/Weapon/Drone.hs index d5ca34d36..64850ca81 100644 --- a/src/Dodge/Item/Weapon/Drone.hs +++ b/src/Dodge/Item/Weapon/Drone.hs @@ -1,10 +1,6 @@ module Dodge.Item.Weapon.Drone where ---import Dodge.Projectile.Draw import Dodge.Data import Dodge.Default.Weapon ---import Dodge.Default -import Dodge.SoundLogic.LoadSound -import Dodge.Item.Weapon.TriggerType import Geometry import Picture import ShapePicture diff --git a/src/Dodge/Item/Weapon/Launcher.hs b/src/Dodge/Item/Weapon/Launcher.hs index c5d363611..bc812d343 100644 --- a/src/Dodge/Item/Weapon/Launcher.hs +++ b/src/Dodge/Item/Weapon/Launcher.hs @@ -11,8 +11,6 @@ import Dodge.Payload import Dodge.Reloading.Action import Dodge.Default.Weapon import Dodge.Item.Location -import Dodge.SoundLogic.LoadSound -import Dodge.Item.Weapon.TriggerType import Geometry import qualified IntMapHelp as IM @@ -60,7 +58,7 @@ launcherX i = launcher & itConsumption . laMax .~ i & itConsumption . laLoaded .~ i & itUse . rUse .~ HeldPJCreationX i - & itUse . useMods .~ LauncherXMod + & itUse . useMods .~ LauncherXMod i 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 bd3223d6e..f51b7515c 100644 --- a/src/Dodge/Item/Weapon/Radar.hs +++ b/src/Dodge/Item/Weapon/Radar.hs @@ -2,7 +2,6 @@ module Dodge.Item.Weapon.Radar where import Dodge.Data import Dodge.RadarSweep import Dodge.Default -import Dodge.Item.Weapon.TriggerType import Dodge.Item.Weapon.ExtraEffect import Dodge.SoundLogic diff --git a/src/Dodge/Item/Weapon/Shatter.hs b/src/Dodge/Item/Weapon/Shatter.hs index c61c1ff82..99fa42e4e 100644 --- a/src/Dodge/Item/Weapon/Shatter.hs +++ b/src/Dodge/Item/Weapon/Shatter.hs @@ -10,18 +10,9 @@ import Dodge.Base.Collide import Dodge.Creature.HandPos --import Dodge.ChainEffect import Dodge.Default.Weapon ---import Dodge.Default ---import Dodge.Item.Attachment ---import Dodge.Item.Weapon.ExtraEffect ---import Dodge.Item.Weapon.InventoryDisplay ---import Dodge.Item.Draw -import Dodge.Item.Weapon.TriggerType ---import Dodge.SoundLogic.LoadSound import Geometry import LensHelp ---import qualified Data.IntMap.Strict as IM - shatterGun :: Item shatterGun = defaultWeapon & itType . iyBase .~ HELD SHATTERGUN diff --git a/src/Dodge/Item/Weapon/SonicGuns.hs b/src/Dodge/Item/Weapon/SonicGuns.hs index 558f47326..e47d3d338 100644 --- a/src/Dodge/Item/Weapon/SonicGuns.hs +++ b/src/Dodge/Item/Weapon/SonicGuns.hs @@ -2,14 +2,6 @@ module Dodge.Item.Weapon.SonicGuns where import Dodge.Data import Dodge.Reloading.Action import Dodge.Creature.HandPos ---import Dodge.Particle.TeslaArc ---import Dodge.SoundLogic.LoadSound ---import Dodge.WorldEvent ---import Dodge.WorldEvent.ThingsHit ---import Dodge.Default ---import Dodge.Item.Weapon.InventoryDisplay -import Dodge.Item.Weapon.TriggerType ---import Dodge.Item.Weapon.AmmoParams import Dodge.Default.Weapon --import Dodge.Item.Attachment --import Dodge.WorldEvent.HelperParticle diff --git a/src/Dodge/Item/Weapon/Spawn.hs b/src/Dodge/Item/Weapon/Spawn.hs index cc97785ca..ebbbe7754 100644 --- a/src/Dodge/Item/Weapon/Spawn.hs +++ b/src/Dodge/Item/Weapon/Spawn.hs @@ -1,10 +1,6 @@ module Dodge.Item.Weapon.Spawn where import Dodge.Data -import Dodge.Item.Weapon.TriggerType ---import Dodge.Item.Weapon.Remote import Dodge.Default.Weapon ---import Dodge.Default ---import Dodge.Item.Weapon.Grenade import Geometry import qualified IntMapHelp as IM diff --git a/src/Dodge/Item/Weapon/SprayGuns.hs b/src/Dodge/Item/Weapon/SprayGuns.hs index a27033f7e..62720e1fe 100644 --- a/src/Dodge/Item/Weapon/SprayGuns.hs +++ b/src/Dodge/Item/Weapon/SprayGuns.hs @@ -8,14 +8,10 @@ module Dodge.Item.Weapon.SprayGuns ) where import Dodge.Data import Dodge.Reloading.Action -import Dodge.SoundLogic.LoadSound import Dodge.Default -import Dodge.Item.Weapon.TriggerType import Geometry import LensHelp -import Control.Monad.State -import System.Random poisonSprayer :: Item poisonSprayer = flameThrower & itType . iyBase .~ HELD POISONSPRAYER diff --git a/src/Dodge/Item/Weapon/Utility.hs b/src/Dodge/Item/Weapon/Utility.hs index a9526a2a3..abdadd7bb 100644 --- a/src/Dodge/Item/Weapon/Utility.hs +++ b/src/Dodge/Item/Weapon/Utility.hs @@ -121,8 +121,9 @@ forceFieldGun = defaultWeapon } & itUse . rUse .~ HeldForceField --useForceFieldGun & itUse . useDelay .~ NoDelay - & itUse . useMods .~ - [ hammerCheckI , ammoCheckI , useAmmoAmount 1] + & itUse . useMods .~ AmmoHammerTimeUseOneMod -- this is slightly different + -- than the list below + --[ hammerCheckI , ammoCheckI , useAmmoAmount 1] & itType . iyBase .~ HELD FORCEFIELDGUN -- I believe because the targeting returns to nothing straight after you release -- the rmb, it is possible for this to do nothing