Continue refactor of bullet gun effect chain

This commit is contained in:
2024-09-16 23:34:54 +01:00
parent 40378d3de4
commit e23c7a0154
23 changed files with 404 additions and 396 deletions
+5
View File
@@ -5,6 +5,11 @@ import Dodge.Data.World
import Dodge.Default.Item
import Dodge.Item.Weapon.Bullet
megaTinMag :: Item
megaTinMag = tinMag
& itUse . amagLoadStatus . iaMax .~ 150000
& itUse . amagLoadStatus . iaLoaded .~ 150000
tinMag :: Item
tinMag =
defaultHeldItem & itType . iyBase .~ AMMOMAG TINMAG
-1
View File
@@ -168,7 +168,6 @@ heldItemSPic ht it = case ht of
GRAPECANNON _ -> noPic $ bangConeShape 20
MINIGUNX i -> miniGunXPictItem i it
VOLLEYGUN i -> noPic $ volleyGunShape i -- <> addBullets it
MULTIGUN i -> noPic $ volleyGunShape i -- <> addBullets it
RIFLE -> noPic $ baseRifleShape -- <> addBullets it
-- REPEATER -> noPic $ baseRifleShape <> addTinClip it
AUTORIFLE -> noPic $ baseRifleShape <> addTinClip it
-1
View File
@@ -37,7 +37,6 @@ itemFromHeldType ht = case ht of
GRAPECANNON i -> grapeCannon i
MINIGUNX i -> miniGunX i
VOLLEYGUN i -> volleyGun i
MULTIGUN i -> multiGun i
RIFLE -> rifle
-- REPEATER -> repeater
AUTORIFLE -> autoRifle
+9 -18
View File
@@ -1,6 +1,5 @@
module Dodge.Item.Held.Cane (
volleyGun,
multiGun,
rifle,
autoRifle,
burstRifle,
@@ -15,14 +14,15 @@ import qualified Data.IntMap.Strict as IM
--import Dodge.Reloading.Action
import Geometry.Data
import LensHelp
import Control.Applicative
defaultBangCane :: Item
defaultBangCane =
defaultBulletWeapon
& itUse . heldParams
.~ BulletShooterParams
{ _muzVel = 0.8
, _rifling = 0.9
{ _muzVel = ConstFloat 0.8
, _rifling = ConstFloat 0.9
, _recoil = 50
, _torqueAfter = 0.1
, _randomOffset = 0
@@ -45,25 +45,16 @@ volleyGun i =
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimStance .~ TwoHandFlat
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldAim . aimMuzzles .~
take i ([Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 3] <*> [0..] <*> repeat PistolFlare)
& itUse . heldAim . aimMuzzles .~ getZipList
(ZipList [Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 6]
<*> ZipList [0..i-1]
<*> pure PistolFlare
)
& itUse . heldParams . torqueAfter .~ 0.15 + 0.05 * fromIntegral i
& itUse . heldParams . recoil .~ 10 + 5 * fromIntegral i
& itType . iyBase .~ HELD (VOLLEYGUN i)
& itUse . heldAmmoTypes .~ IM.fromList (zip [0..i-1] $ repeat BulletAmmo)
multiGun :: Int -> Item
multiGun i =
defaultBangCane
& itUse . heldMods .~ MultiGunMod
& 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)
& itUse . heldParams . torqueAfter .~ 0.15 + 0.05 * fromIntegral i
& itType . iyBase .~ HELD (MULTIGUN i)
rifle :: Item
rifle =
defaultBangCane
+4 -4
View File
@@ -14,12 +14,12 @@ bangCone =
& itDimension . dimRad .~ 8
& itDimension . dimCenter .~ V3 5 0 0
& itUse . heldDelay . rateMax .~ 20
& itUse . heldMods .~ BangConeMod
& itUse . heldMods .~ PistolMod
-- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.5 0 DefaultFlareType]
& itUse . heldAim . aimMuzzles .~ replicate 15 (Muzzle (V2 15 0) 0 0.5 0 DefaultFlareType)
& itUse . heldParams .~ BulletShooterParams
{ _muzVel = 0.7
, _rifling = 0.8
{ _muzVel = UniRandFloat 0.5 0.8
, _rifling = UniRandFloat 0.3 0.9
, _recoil = 150
, _torqueAfter = 0.1
, _randomOffset = 12
+2 -2
View File
@@ -20,8 +20,8 @@ bangRod =
defaultBulletWeapon
& itUse . heldParams
.~ BulletShooterParams
{ _muzVel = 0.8
, _rifling = 1
{ _muzVel = ConstFloat 0.8
, _rifling = ConstFloat 1
, _recoil = 50
, _torqueAfter = 0.3
, _randomOffset = 0
+4 -4
View File
@@ -19,8 +19,8 @@ bangStick i =
defaultBulletWeapon
& itUse . heldParams
.~ BulletShooterParams
{ _muzVel = 0.8
, _rifling = 0.8
{ _muzVel = ConstFloat 0.8
, _rifling = ConstFloat 0.8
, _recoil = 25
, _torqueAfter = 0.18 + 0.02 * fromIntegral i
, _randomOffset = 0
@@ -49,8 +49,8 @@ pistol =
& 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)
%~ ( (muzVel .~ ConstFloat 0.8)
. (rifling .~ ConstFloat 0.8)
. (recoil .~ 10)
. (torqueAfter .~ 0.2)
. (sidePush .~ 50)
+1 -2
View File
@@ -71,8 +71,7 @@ heldInfo hit = case hit of
GRAPECANNON 1 -> "A large container for debris on the end of a stick. Explosive action propels the debris away from the user."
GRAPECANNON i -> "An " ++ replicate (i -1) 'X' ++ "L container for debris on the end of a stick. Explosive action propels the debris away from the user."
MINIGUNX i -> over _head toUpper (showInt i) ++ " gun barrels that revolve rapidly around a central stick. Requires considerable time to warm up, but has an extremely rapid rate of fire. It is also extremely difficult to stabilise."
VOLLEYGUN i -> over _head toUpper (showInt i) ++ " gun barrels lined up to be roughly parallel. Draws bullets from a single magazine. All loaded barrels discharge simultaneously."
MULTIGUN i -> over _head toUpper (showInt i) ++ " gun barrels lined up to be roughly parallel. Each barrel requires a separate magazine. All barrels must be loaded to fire."
VOLLEYGUN i -> over _head toUpper (showInt i) ++ " gun barrels lined up to be roughly parallel. Each barrel requires a separate magazine. All barrels must be loaded to fire."
RIFLE -> "A firearm with a mid length barrel that requires reloading after each shot."
-- REPEATER -> "A firearm fed by a magazine. The entire magazine must be replaced when reloading the weapon."
AUTORIFLE -> "A firearm automatically fed by a magazine. The entire magazine must be replaced when reloading the weapon."
-1
View File
@@ -36,7 +36,6 @@ heldBounds hit = case hit of
GRAPECANNON _ -> bbs
MINIGUNX _ -> minis
VOLLEYGUN _ -> undefined
MULTIGUN _ -> undefined
RIFLE -> rs
-- REPEATER -> rs
AUTORIFLE -> rs