Continue weapon effect chain refactor

This commit is contained in:
2024-09-16 19:27:21 +01:00
parent abc0dd1106
commit 1d1d1527e7
19 changed files with 358 additions and 340 deletions
+16 -14
View File
@@ -1,7 +1,6 @@
module Dodge.Item.Held.Cane (
volleyGun,
multiGun,
repeater,
rifle,
autoRifle,
burstRifle,
@@ -12,6 +11,7 @@ import Dodge.SoundLogic.ExternallyGeneratedSounds
import Dodge.Base
import Dodge.Data.Item
import Dodge.Default
import qualified Data.IntMap.Strict as IM
--import Dodge.Reloading.Action
import Geometry.Data
import LensHelp
@@ -32,23 +32,24 @@ defaultBangCane =
& itDimension . dimRad .~ 8
& itDimension . dimCenter .~ V3 5 0 0
& itUse . heldDelay . rateMax .~ 6
& itUse . heldMods .~ BangCaneMod
-- & itUse . heldMods .~ BangCaneMod
& itUse . heldAim . aimStance .~ OneHand
-- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.01 0 DefaultFlareType]
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.01 0 PistolFlare]
volleyGun :: Int -> Item
volleyGun i =
defaultBangCane
& itUse . heldMods .~ VolleyGunMod
-- & itUse . heldMods .~ VolleyGunMod
& itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimStance .~ TwoHandFlat
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldAim . aimMuzzles .~
([Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 3] <*> [0..] <*> repeat DefaultFlareType)
take i ([Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 3] <*> [0..] <*> repeat PistolFlare)
& itUse . heldParams . torqueAfter .~ 0.15 + 0.05 * fromIntegral i
& itType . iyBase .~ HELD (VOLLEYGUN i)
& itUse . heldAmmoTypes .~ IM.fromList (zip [0..i-1] $ repeat BulletAmmo)
multiGun :: Int -> Item
multiGun i =
@@ -71,26 +72,27 @@ rifle =
& itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 25 0) 0 0.01 0 DefaultFlareType]
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 25 0) 0 0.01 0 PistolFlare]
& itType . iyModules . at ModHeldAttach ?~ EMPTYMODULE
repeater :: Item
repeater =
rifle
& itType . iyModules . at ModRifleMag ?~ EMPTYMODULE
& itType . iyBase .~ HELD REPEATER
--repeater :: Item
--repeater =
-- rifle
-- & itType . iyModules . at ModRifleMag ?~ EMPTYMODULE
-- & itType . iyBase .~ HELD REPEATER
autoRifle :: Item
autoRifle =
repeater
rifle
& itType . iyBase .~ HELD AUTORIFLE
& itUse . heldMods .~ AutoRifleMod
& itUse . heldTriggerType .~ AutoTrigger
-- & itUse . heldMods .~ AutoRifleMod
& itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
-- & itUse . useDelay . rateMax .~ 6
burstRifle :: Item
burstRifle =
repeater
rifle
& itType . iyBase .~ HELD BURSTRIFLE
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0.05
& itUse . heldDelay . rateMax .~ 18
+11 -5
View File
@@ -45,7 +45,9 @@ pistol =
-- & itUse . heldAmmoTypes .~ [BulletAmmo]
& itUse . heldDelay . rateMax .~ 6
& itUse . heldMods .~ PistolMod
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 10 0) 0 0.05 0 DefaultFlareType]
& itUse . heldAim . aimMuzzles . ix 0 . mzPos %~ const (V2 10 0)
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy %~ const 0.05
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType %~ const PistolFlare
& itUse . heldParams
%~ ( (muzVel .~ 0.8)
. (rifling .~ 0.8)
@@ -58,7 +60,9 @@ pistol =
autoPistol :: Item
autoPistol =
pistol
& itUse . heldMods .~ AutoPistolMod
& itUse . heldMods .~ PistolMod
& itUse . heldTriggerType .~ AutoTrigger
& itUse . heldParams . bulGunSound .~ tap1S
& itType . iyBase .~ HELD AUTOPISTOL
& itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
@@ -66,7 +70,7 @@ machinePistol :: Item
machinePistol =
autoPistol
& itUse . heldDelay . rateMax .~ 2
& itUse . heldMods .~ MachinePistolMod -- (ammoCheckI : machinePistolAfterHamMods)
& itUse . heldMods .~ PistolMod -- (ammoCheckI : machinePistolAfterHamMods)
& itType . iyBase .~ HELD MACHINEPISTOL
& itType . iyModules . at ModAutoMag .~ Nothing
& itUse . heldParams . recoil .~ 20
@@ -74,9 +78,11 @@ machinePistol =
smg :: Item
smg =
autoPistol -- & some parameter affecting stability
& itUse . heldMods .~ SmgMod --(ammoCheckI : smgAfterHamMods)
& itUse . heldMods .~ PistolMod --(ammoCheckI : smgAfterHamMods)
& itType . iyBase .~ HELD SMG
& itUse . heldAim . aimStance .~ TwoHandUnder
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) 0 0 0 DefaultFlareType]
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 20 0
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
-- & itUse . heldAim . aimHandlePos .~ 2
& itUse . heldParams . torqueAfter .~ 0.05
& itUse . heldParams . sidePush .~ 30