Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix plasma guns #95

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Content.Client/Weapons/Ranged/Systems/GunSystem.Magazine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ protected override void InitializeMagazine()
{
base.InitializeMagazine();
SubscribeLocalEvent<MagazineAmmoProviderComponent, UpdateAmmoCounterEvent>(OnMagazineAmmoUpdate);
SubscribeLocalEvent<MagazineAmmoProviderComponent, AmmoCounterControlEvent>(OnMagazineControl);
}

private void OnMagazineAmmoUpdate(EntityUid uid, MagazineAmmoProviderComponent component, UpdateAmmoCounterEvent args)
Expand All @@ -26,4 +27,11 @@ private void OnMagazineAmmoUpdate(EntityUid uid, MagazineAmmoProviderComponent c

RaiseLocalEvent(ent.Value, args, false);
}

private void OnMagazineControl(EntityUid uid, MagazineAmmoProviderComponent component, AmmoCounterControlEvent args)
{
var ent = GetMagazineEntity(uid);
if (ent == null) return;
RaiseLocalEvent(ent.Value, args, false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- type: Sprite
sprite: TS/Objects/Weapons/Ammunition/Magazine/Plasma/light_plasma_mag.rsi
state: base
- type: AmmoCounter
- type: ProjectileBatteryAmmoProvider
proto: LargeRedPlasmaBullet
fireCost: 1
Expand Down Expand Up @@ -56,6 +57,7 @@
- type: Sprite
sprite: TS/Objects/Weapons/Ammunition/Magazine/Plasma/medium_plasma_mag.rsi
state: base
- type: AmmoCounter
- type: ProjectileBatteryAmmoProvider
proto: MediumRedPlasmaBullet
fireCost: 1
Expand Down Expand Up @@ -98,6 +100,7 @@
- type: Sprite
sprite: TS/Objects/Weapons/Ammunition/Magazine/Plasma/heavy_plasma_mag.rsi
state: base
- type: AmmoCounter
- type: ProjectileBatteryAmmoProvider
proto: LightRedPlasmaBullet
fireCost: 1
Expand Down
18 changes: 15 additions & 3 deletions Resources/Prototypes/TS/Entities/Objects/Weapons/projectiles.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
- type: entity
id: LightBluePlasmaBullet
id: BasePlasmaBullet
parent: BaseBullet
noSpawn: true
abstract: true
components:
- type: Reflective
reflective:
- Energy
- type: Ammo


- type: entity
id: LightBluePlasmaBullet
parent: BasePlasmaBullet
noSpawn: true
components:
- type: Sprite
sprite: TS/Objects/Weapons/Guns/Projectiles/plasma.rsi
Expand All @@ -16,7 +28,7 @@

- type: entity
id: MediumBluePlasmaBullet
parent: BaseBullet
parent: BasePlasmaBullet
noSpawn: true
components:
- type: Sprite
Expand All @@ -32,7 +44,7 @@

- type: entity
id: LargeBluePlasmaBullet
parent: BaseBullet
parent: BasePlasmaBullet
noSpawn: true
components:
- type: Sprite
Expand Down
27 changes: 0 additions & 27 deletions Resources/Prototypes/TS/Entities/Objects/Weapons/troop_weapon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
- type: ContainerContainer
containers:
gun_magazine: !type:ContainerSlot
power_magazine: !type:ContainerSlot
- type: MagazineAmmoProvider
- type: MagazineVisuals
magState: mag
Expand All @@ -51,14 +50,6 @@
whitelist:
tags:
- LightPlasmaMagazine
power_magazine:
name: Power
startingItem: PowerCellSmall
insertSound: /Audio/Weapons/Guns/MagIn/batrifle_magin.ogg
ejectSound: /Audio/Weapons/Guns/MagOut/batrifle_magout.ogg
whitelist:
components:
- PowerCell
- type: StaticPrice
price: 1500

Expand Down Expand Up @@ -101,7 +92,6 @@
- type: ContainerContainer
containers:
gun_magazine: !type:ContainerSlot
power_magazine: !type:ContainerSlot
- type: MagazineAmmoProvider
- type: MagazineVisuals
magState: mag
Expand All @@ -116,14 +106,6 @@
whitelist:
tags:
- MediumPlasmaMagazine
power_magazine:
name: Power
startingItem: PowerCellSmall
insertSound: /Audio/Weapons/Guns/MagIn/batrifle_magin.ogg
ejectSound: /Audio/Weapons/Guns/MagOut/batrifle_magout.ogg
whitelist:
components:
- PowerCell
- type: StaticPrice
price: 1500

Expand Down Expand Up @@ -174,7 +156,6 @@
- type: ContainerContainer
containers:
gun_magazine: !type:ContainerSlot
power_magazine: !type:ContainerSlot
- type: MagazineAmmoProvider
- type: ItemSlots
slots:
Expand All @@ -185,13 +166,5 @@
whitelist:
tags:
- HeavyPlasmaMagazine
power_magazine:
name: Power
startingItem: PowerCellSmall
insertSound: /Audio/Weapons/Guns/MagIn/batrifle_magin.ogg
ejectSound: /Audio/Weapons/Guns/MagOut/batrifle_magout.ogg
whitelist:
components:
- PowerCell
- type: StaticPrice
price: 2500
Loading