From 6f972bb3162e65b955de8e75775876a1942db20d Mon Sep 17 00:00:00 2001 From: justin Date: Wed, 18 Sep 2024 22:12:14 +0100 Subject: [PATCH] Implement launcher using attachment weapon chain effects --- src/Dodge/Creature.hs | 7 ++++--- src/Dodge/Item/Ammo.hs | 5 +++++ src/Dodge/Item/Held/Launcher.hs | 12 ++++++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/Dodge/Creature.hs b/src/Dodge/Creature.hs index 4faa80be4..ef03eb91d 100644 --- a/src/Dodge/Creature.hs +++ b/src/Dodge/Creature.hs @@ -276,9 +276,10 @@ stackedInventory = , bulletSynthesizer , drumMag , launcher - , shellMag - , shellMag - , shellMag + , launcherX 3 + , megaShellMag + , megaShellMag + , megaShellMag , pipe , scrollWatch , rewindWatch diff --git a/src/Dodge/Item/Ammo.hs b/src/Dodge/Item/Ammo.hs index d3371e409..ac8a62b70 100644 --- a/src/Dodge/Item/Ammo.hs +++ b/src/Dodge/Item/Ammo.hs @@ -46,6 +46,11 @@ beltMag = & itUse . amagLoadStatus . iaMax .~ 20000 & itUse . amagType .~ BeltBulletAmmo +megaShellMag :: Item +megaShellMag = shellMag + & itUse . amagLoadStatus . iaMax .~ 1000000 + & itUse . amagLoadStatus . iaLoaded .~ 1000000 + shellMag :: Item shellMag = defaultHeldItem & itType . iyBase .~ AMMOMAG SHELLMAG diff --git a/src/Dodge/Item/Held/Launcher.hs b/src/Dodge/Item/Held/Launcher.hs index 7bf6d7c39..177797311 100644 --- a/src/Dodge/Item/Held/Launcher.hs +++ b/src/Dodge/Item/Held/Launcher.hs @@ -1,5 +1,6 @@ module Dodge.Item.Held.Launcher where +import Dodge.SoundLogic.ExternallyGeneratedSounds import Control.Applicative import Dodge.Default.Item --import Dodge.Reloading.Action @@ -26,7 +27,8 @@ launcher = & itDimension . dimCenter .~ V3 10 0 0 & itUse . heldDelay . rateMax .~ 20 -- & itUse . heldUse .~ HeldPJCreation --usePjCreation - & itUse . heldMods .~ LauncherMod +-- & itUse . heldMods .~ LauncherMod + & itUse . heldMods .~ PistolMod & itUse . heldAim . aimWeight .~ 8 & itUse . heldAim . aimRange .~ 0.5 & itUse . heldAim . aimStance .~ TwoHandOver @@ -36,19 +38,25 @@ launcher = & itUse . heldAmmoTypes .~ singleAmmo ProjectileAmmo & itType . iyBase .~ HELD LAUNCHER & itType . iyModules . at ModLauncherHoming ?~ EMPTYMODULE + & itUse . heldParams . muzVel .~ ConstFloat 0 + & itUse . heldParams . rifling .~ ConstFloat 0 + & itUse . heldParams . recoil .~ 0 + & itUse . heldParams . torqueAfter .~ 0 + & itUse . heldParams . bulGunSound .~ (tap4S, 0) launcherX :: Int -> Item launcherX i = launcher & itType . iyBase .~ HELD (LAUNCHERX i) -- & itUse . heldUse .~ HeldPJCreationX i - & itUse . heldMods .~ LauncherXMod i +-- & itUse . heldMods .~ LauncherXMod i & itUse . heldAim . aimMuzzles .~ getZipList (ZipList [Muzzle (V2 20 0) a 0 | a <- angles] <*> ZipList [0..] <*> pure DefaultFlareType <*> pure MuzzleLauncher ) + & itUse . heldAmmoTypes .~ IM.fromList [(j,ProjectileAmmo) | j <- [0..i-1]] where angles = take i [0,2*pi/ fromIntegral i ..] --angles = take i [1,2 ..]