Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
Adds wielding for all large guns (space-wizards#26970)
Browse files Browse the repository at this point in the history
* Adds wielding assets

* Modifies meta.json files and adds artist credit

* Adds wieldable component to a bunch of weapons

* Moves shotgun inhands and wield inhands to their own folders (because its the only way the sprites would work)

* Removes the wieldable component from some guns

* Adds wielding sprites for wieldable guns that didnt have them

* Adds gun wielding bonuses and base innaccuracy to wieldable guns.

* Corrects wielded accuracy to be default accuracy instead of perfect

* Makes the drozd smg and bulldog shotgun wieldable

* Makes nukie c20r wieldable and adds sprites

* Adds BaseGunWieldable

* Makes all the newly wieldable gun use the base inheritable

* Adds accuracy to smgs to resolve inheritance conflict

* Makes all wieldable shotguns require wielding to fire because of a bug involving spread innacuracy

* Adds wield bonus message on examine
  • Loading branch information
SpaceRox1244 authored and dvir001 committed Jun 1, 2024
1 parent 55da5d7 commit 9b93ab2
Show file tree
Hide file tree
Showing 79 changed files with 569 additions and 352 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ public sealed partial class GunWieldBonusComponent : Component
/// </summary>
[DataField, AutoNetworkedField]
public Angle AngleIncrease = Angle.FromDegrees(0);

[DataField]
public LocId? WieldBonusExamineMessage = "gunwieldbonus-component-examine";
}
8 changes: 8 additions & 0 deletions Content.Shared/Wieldable/WieldableSystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Shared.Examine;
using Content.Shared.Hands;
using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems;
Expand Down Expand Up @@ -47,6 +48,7 @@ public override void Initialize()
SubscribeLocalEvent<GunWieldBonusComponent, ItemWieldedEvent>(OnGunWielded);
SubscribeLocalEvent<GunWieldBonusComponent, ItemUnwieldedEvent>(OnGunUnwielded);
SubscribeLocalEvent<GunWieldBonusComponent, GunRefreshModifiersEvent>(OnGunRefreshModifiers);
SubscribeLocalEvent<GunWieldBonusComponent, ExaminedEvent>(OnExamine);

SubscribeLocalEvent<IncreaseDamageOnWieldComponent, GetMeleeDamageEvent>(OnGetMeleeDamage);
}
Expand Down Expand Up @@ -110,6 +112,12 @@ private void OnGunRefreshModifiers(Entity<GunWieldBonusComponent> bonus, ref Gun
}
}

private void OnExamine(EntityUid uid, GunWieldBonusComponent component, ref ExaminedEvent args)
{
if (component.WieldBonusExamineMessage != null)
args.PushText(Loc.GetString(component.WieldBonusExamineMessage));
}

private void AddToggleWieldVerb(EntityUid uid, WieldableComponent component, GetVerbsEvent<InteractionVerb> args)
{
if (args.Hands == null || !args.CanAccess || !args.CanInteract)
Expand Down
3 changes: 2 additions & 1 deletion Resources/Locale/en-US/wieldable/wieldable-component.ftl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Locale for wielding items; i.e. two-handing them
### Locale for wielding items; i.e. two-handing them

wieldable-verb-text-wield = Wield
wieldable-verb-text-unwield = Unwield
Expand All @@ -17,3 +17,4 @@ wieldable-component-not-in-hands = { CAPITALIZE(THE($item)) } isn't in your hand
wieldable-component-requires = { CAPITALIZE(THE($item))} must be wielded!
gunwieldbonus-component-examine = This weapon has improved accuracy when wielded.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# A basic inheritable template for a gun that is wieldable and has the standard inaccuracy.
- type: entity
id: BaseGunWieldable
abstract: true
components:
- type: Wieldable
- type: GunWieldBonus
minAngle: -20
maxAngle: -30
- type: Gun
minAngle: 21
maxAngle: 32
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@

- type: entity
name: laser rifle
parent: BaseWeaponBattery
parent: [BaseWeaponBattery, BaseGunWieldable]
id: WeaponLaserCarbine
description: A simple civilian grade laser carbine, the workhorse of many private security organizations.
components:
Expand Down Expand Up @@ -271,7 +271,7 @@

- type: entity
name: pulse carbine
parent: BaseWeaponBattery
parent: [BaseWeaponBattery, BaseGunWieldable]
id: WeaponPulseCarbine
description: A high tech energy carbine favoured by the NT-ERT operatives. On the handle is a label that says 'for authorized use only.'
components:
Expand Down Expand Up @@ -302,7 +302,7 @@

- type: entity
name: pulse rifle
parent: BaseWeaponBattery
parent: [BaseWeaponBattery, BaseGunWieldable]
id: WeaponPulseRifle
description: A weapon that is almost as infamous as its users. On the handle is a label that says 'for authorized use only.'
components:
Expand All @@ -329,7 +329,7 @@

- type: entity
name: laser cannon
parent: BaseWeaponBattery
parent: [BaseWeaponBattery, BaseGunWieldable]
id: WeaponLaserCannon
description: A heavy duty, high powered laser weapon. On the handle is a label that says 'for authorized use only.'
components:
Expand Down Expand Up @@ -388,7 +388,7 @@

- type: entity
name: x-ray cannon
parent: BaseWeaponBattery
parent: [BaseWeaponBattery, BaseGunWieldable]
id: WeaponXrayCannon
description: An illegal and experimental weapon that uses concentrated x-ray energy against its target.
components:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

- type: entity
name: china lake
parent: BaseWeaponLauncher
parent: [BaseWeaponLauncher, BaseGunWieldable]
id: WeaponLauncherChinaLake
description: PLOOP
components:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- type: entity
name: BaseWeaponRifle
parent: BaseItem
parent: [BaseItem, BaseGunWieldable]
id: BaseWeaponRifle
description: A rooty tooty point and shooty.
abstract: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

- type: entity
name: C-20r sub machine gun
parent: BaseWeaponSubMachineGun
parent: [BaseWeaponSubMachineGun, BaseGunWieldable]
id: WeaponSubMachineGunC20r
description: An illegal firearm that is often used by the infamous nuclear operatives. Uses .35 auto ammo.
components:
Expand All @@ -94,6 +94,8 @@
- type: Clothing
sprite: Objects/Weapons/Guns/SMGs/c20r.rsi
- type: Gun
minAngle: 21
maxAngle: 32
shotsPerBurst: 5
availableModes:
- SemiAuto
Expand All @@ -112,7 +114,7 @@

- type: entity
name: Drozd
parent: BaseWeaponSubMachineGun
parent: [BaseWeaponSubMachineGun, BaseGunWieldable]
id: WeaponSubMachineGunDrozd
description: An excellent fully automatic Heavy SMG. An illegal firearm often used by Syndicate agents.
components:
Expand All @@ -126,6 +128,8 @@
- type: Clothing
sprite: Objects/Weapons/Guns/SMGs/drozd.rsi
- type: Gun
minAngle: 21
maxAngle: 32
fireRate: 6
selectedMode: FullAuto
soundGunshot:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
- type: entity
name: Bulldog
# Don't parent to BaseWeaponShotgun because it differs significantly
parent: BaseItem
parent: [BaseItem, BaseGunWieldable]
id: WeaponShotgunBulldog
description: It's a magazine-fed shotgun designed for close quarters combat. Uses .50 shotgun shells. An illegal firearm often used by Syndicate agents.
components:
Expand All @@ -66,6 +66,7 @@
- Back
- suitStorage
- type: AmmoCounter
- type: GunRequiresWield #remove when inaccuracy on spreads is fixed
- type: Gun
fireRate: 2
selectedMode: FullAuto
Expand Down Expand Up @@ -102,7 +103,7 @@

- type: entity
name: double-barreled shotgun
parent: BaseWeaponShotgun
parent: [BaseWeaponShotgun, BaseGunWieldable]
id: WeaponShotgunDoubleBarreled
description: An immortal classic. A civilian grade shotgun. Uses .50 shotgun shells.
components:
Expand All @@ -112,8 +113,8 @@
size: Normal
shape:
- 0,0,4,0
sprite: Objects/Weapons/Guns/Shotguns/inhands_64x.rsi
heldPrefix: db
sprite: Objects/Weapons/Guns/Shotguns/db_shotgun_inhands_64x.rsi
- type: GunRequiresWield #remove when inaccuracy on spreads is fixed
- type: Gun
fireRate: 2
- type: BallisticAmmoProvider
Expand All @@ -137,7 +138,7 @@

- type: entity
name: Enforcer
parent: BaseWeaponShotgun
parent: [BaseWeaponShotgun, BaseGunWieldable]
id: WeaponShotgunEnforcer
description: A premium combat shotgun based on the Kammerer design, featuring an upgraded clip capacity. .50 shotgun shells. On the receiver is a label that says 'for authorized use only.'
components:
Expand All @@ -146,9 +147,9 @@
- type: Clothing
sprite: Objects/Weapons/Guns/Shotguns/enforcer.rsi
- type: Item
sprite: Objects/Weapons/Guns/Shotguns/inhands_64x.rsi
heldPrefix: enforcer
sprite: Objects/Weapons/Guns/Shotguns/enforcer_inhands_64x.rsi
- type: BallisticAmmoProvider
- type: GunRequiresWield #remove when inaccuracy on spreads is fixed

- type: entity
parent: WeaponShotgunEnforcer
Expand All @@ -160,20 +161,20 @@

- type: entity
name: Kammerer
parent: BaseWeaponShotgun
parent: [BaseWeaponShotgun, BaseGunWieldable]
id: WeaponShotgunKammerer
description: When an old Remington design meets modern materials, this is the result. A civilian grade shotgun, favored by militia forces throughout many worlds. Uses .50 shotgun shells.
components:
- type: Item
size: Normal
shape:
- 0,0,4,0
sprite: Objects/Weapons/Guns/Shotguns/inhands_64x.rsi
heldPrefix: pump
sprite: Objects/Weapons/Guns/Shotguns/pump_inhands_64x.rsi
- type: Sprite
sprite: Objects/Weapons/Guns/Shotguns/pump.rsi
- type: Clothing
sprite: Objects/Weapons/Guns/Shotguns/pump.rsi
- type: GunRequiresWield #remove when inaccuracy on spreads is fixed
- type: BallisticAmmoProvider
capacity: 4
- type: Tag
Expand All @@ -192,8 +193,7 @@
sprite: Objects/Weapons/Guns/Shotguns/sawn.rsi
- type: Item
size: Small
sprite: Objects/Weapons/Guns/Shotguns/inhands_64x.rsi
heldPrefix: sawn
sprite: Objects/Weapons/Guns/Shotguns/sawn_inhands_64x.rsi
- type: Gun
fireRate: 4
- type: BallisticAmmoProvider
Expand Down Expand Up @@ -241,7 +241,7 @@

- type: entity
name: blunderbuss
parent: BaseWeaponShotgun
parent: [BaseWeaponShotgun, BaseGunWieldable]
id: WeaponShotgunBlunderbuss
suffix: Pirate
description: Deadly at close range, an illegal shotgun often found at the side of a pirate.
Expand All @@ -252,6 +252,7 @@
- 0,0,4,0
- type: Sprite
sprite: Objects/Weapons/Guns/Shotguns/blunderbuss.rsi
- type: GunRequiresWield #remove when inaccuracy on spreads is fixed
- type: Gun
fireRate: 2
- type: BallisticAmmoProvider
Expand All @@ -261,7 +262,7 @@

- type: entity
name: improvised shotgun
parent: BaseWeaponShotgun
parent: [BaseWeaponShotgun, BaseGunWieldable]
id: WeaponShotgunImprovised
description: A shitty, but legal, hand-made shotgun that uses .50 shotgun shells. It can only hold one round in the chamber.
components:
Expand All @@ -273,8 +274,8 @@
size: Normal
shape:
- 0,0,4,0
sprite: Objects/Weapons/Guns/Shotguns/inhands_64x.rsi
heldPrefix: improvised
sprite: Objects/Weapons/Guns/Shotguns/improvised_shotgun_inhands_64x.rsi
- type: GunRequiresWield #remove when inaccuracy on spreads is fixed
- type: Gun
fireRate: 4 #No reason to stifle the firerate since you have to manually reload every time anyways.
- type: BallisticAmmoProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

- type: entity
name: Kardashev-Mosin
parent: BaseWeaponSniper
parent: [BaseWeaponSniper, BaseGunWieldable]
id: WeaponSniperMosin
description: A civilian grade weapon for hunting, or endless trench warfare. Uses .30 rifle ammo.
components:
Expand All @@ -51,7 +51,7 @@

- type: entity
name: Hristov
parent: BaseWeaponSniper
parent: [BaseWeaponSniper, BaseGunWieldable]
id: WeaponSniperHristov
description: A portable anti-materiel rifle. Fires armor piercing 14.5mm shells. Uses .60 anti-materiel ammo. On the receiver is a label that says 'for authorized use only.'
components:
Expand Down
Loading

0 comments on commit 9b93ab2

Please sign in to comment.