Shotgun spread refactor (#27773)

* Moves spread data to new component

* Refactors shotgun spread code

* Makes shotgun cartridges and projectiles use new component

* Attempts to fix nullable build error

* Fixes hitscan weapons that I broke :(

* Saviour commit?

---------

Co-authored-by: EmoGarbage404 <retron404@gmail.com>
This commit is contained in:
RiceMar1244
2024-08-03 09:26:32 -04:00
committed by GitHub
parent 64273cb914
commit b432dc6125
6 changed files with 144 additions and 61 deletions

View File

@@ -9,8 +9,6 @@
- Cartridge
- ShellShotgun
- type: CartridgeAmmo
count: 6
spread: 15
soundEject:
collection: ShellEject
- type: Sprite
@@ -32,7 +30,6 @@
map: [ "enum.AmmoVisualLayers.Base" ]
- type: CartridgeAmmo
proto: PelletShotgunBeanbag
count: 1
- type: SpentAmmoVisuals
state: "beanbag"
@@ -47,8 +44,6 @@
map: [ "enum.AmmoVisualLayers.Base" ]
- type: CartridgeAmmo
proto: PelletShotgunSlug
count: 1
spread: 0
- type: SpentAmmoVisuals
state: "slug"
@@ -63,7 +58,6 @@
map: [ "enum.AmmoVisualLayers.Base" ]
- type: CartridgeAmmo
proto: PelletShotgunFlare
count: 1
- type: SpentAmmoVisuals
state: "flare"
@@ -77,7 +71,7 @@
- state: base
map: [ "enum.AmmoVisualLayers.Base" ]
- type: CartridgeAmmo
proto: PelletShotgun
proto: PelletShotgunSpread
- type: entity
id: ShellShotgunIncendiary
@@ -89,7 +83,7 @@
- state: incendiary
map: [ "enum.AmmoVisualLayers.Base" ]
- type: CartridgeAmmo
proto: PelletShotgunIncendiary
proto: PelletShotgunIncendiarySpread
- type: SpentAmmoVisuals
state: "incendiary"
@@ -103,7 +97,7 @@
- state: practice
map: [ "enum.AmmoVisualLayers.Base" ]
- type: CartridgeAmmo
proto: PelletShotgunPractice
proto: PelletShotgunPracticeSpread
- type: SpentAmmoVisuals
state: "practice"
@@ -118,7 +112,6 @@
map: [ "enum.AmmoVisualLayers.Base" ]
- type: CartridgeAmmo
proto: PelletShotgunTranquilizer
count: 1
- type: ChemicalAmmo
- type: SolutionContainerManager
solutions:
@@ -145,9 +138,7 @@
graph: ImprovisedShotgunShellGraph
node: shell
- type: CartridgeAmmo
count: 10
spread: 45
proto: PelletShotgunImprovised
proto: PelletShotgunImprovisedSpread
- type: SpentAmmoVisuals
state: "improvised"
@@ -161,8 +152,6 @@
- state: depleted-uranium
map: [ "enum.AmmoVisualLayers.Base" ]
- type: CartridgeAmmo
count: 5
spread: 6
proto: PelletShotgunUranium
proto: PelletShotgunUraniumSpread
- type: SpentAmmoVisuals
state: "depleted-uranium"

View File

@@ -42,6 +42,16 @@
types:
Piercing: 10
- type: entity
id: PelletShotgunSpread
noSpawn: true
parent: PelletShotgun
components:
- type: ProjectileSpread
proto: PelletShotgun
count: 6
spread: 15
- type: entity
id: PelletShotgunIncendiary
name: pellet (.50 incendiary)
@@ -59,6 +69,16 @@
- type: IgnitionSource
ignited: true
- type: entity
id: PelletShotgunIncendiarySpread
noSpawn: true
parent: PelletShotgunIncendiary
components:
- type: ProjectileSpread
proto: PelletShotgunIncendiary
count: 6
spread: 15
- type: entity
id: PelletShotgunPractice
name: pellet (.50 practice)
@@ -73,6 +93,16 @@
types:
Blunt: 1
- type: entity
id: PelletShotgunPracticeSpread
noSpawn: true
parent: PelletShotgunPractice
components:
- type: ProjectileSpread
proto: PelletShotgunPractice
count: 6
spread: 15
- type: entity
id: PelletShotgunImprovised
name: improvised pellet
@@ -88,6 +118,15 @@
Piercing: 3
Slash: 3
- type: entity
id: PelletShotgunImprovisedSpread
noSpawn: true
parent: PelletShotgunImprovised
components:
- type: ProjectileSpread
proto: PelletShotgunImprovised
count: 10
spread: 45
- type: entity
id: PelletShotgunTranquilizer
@@ -178,6 +217,16 @@
Radiation: 5
Piercing: 5
- type: entity
id: PelletShotgunUraniumSpread
noSpawn: true
parent: PelletShotgunUranium
components:
- type: ProjectileSpread
proto: PelletShotgunUranium
count: 5
spread: 6
- type: entity
id: PelletGrapeshot #tally fucking ho
name: grapeshot pellet
@@ -196,6 +245,16 @@
Piercing: 25
Structural: 5
- type: entity
id: PelletGrapeshotSpread
noSpawn: true
parent: PelletGrapeshot
components:
- type: ProjectileSpread
proto: PelletGrapeshot
count: 5
spread: 40
- type: entity
id: PelletGlass
name: glass shard
@@ -215,3 +274,13 @@
damage:
types:
Slash: 25
- type: entity
id: PelletGlassSpread
parent: PelletGlass
noSpawn: true
components:
- type: ProjectileSpread
proto: PelletGlass
count: 5
spread: 10

View File

@@ -175,9 +175,7 @@
parent: BaseCannonBall
components:
- type: CartridgeAmmo
proto: PelletGrapeshot
count: 5
spread: 40
proto: PelletGrapeshotSpread
deleteOnSpawn: true
- type: Sprite
sprite: Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi
@@ -190,9 +188,7 @@
parent: BaseCannonBall
components:
- type: CartridgeAmmo
proto: PelletGlass
count: 5
spread: 10
proto: PelletGlassSpread
deleteOnSpawn: true
- type: Sprite
sprite: Objects/Weapons/Guns/Ammunition/Explosives/explosives.rsi