Revolver Tweaks and Det Buff (#13725)

* revolver changes and det yml

* remove ammo box

* remove comma

* other ammo providers change
This commit is contained in:
Scribbles0
2023-01-26 10:15:20 -08:00
committed by GitHub
parent d6f71db037
commit 058e2e2b56
4 changed files with 10 additions and 8 deletions

View File

@@ -15,7 +15,7 @@ public abstract partial class SharedGunSystem
protected virtual void InitializeChamberMagazine() protected virtual void InitializeChamberMagazine()
{ {
SubscribeLocalEvent<ChamberMagazineAmmoProviderComponent, TakeAmmoEvent>(OnChamberMagazineTakeAmmo); SubscribeLocalEvent<ChamberMagazineAmmoProviderComponent, TakeAmmoEvent>(OnChamberMagazineTakeAmmo);
SubscribeLocalEvent<ChamberMagazineAmmoProviderComponent, GetVerbsEvent<Verb>>(OnMagazineVerb); SubscribeLocalEvent<ChamberMagazineAmmoProviderComponent, GetVerbsEvent<AlternativeVerb>>(OnMagazineVerb);
SubscribeLocalEvent<ChamberMagazineAmmoProviderComponent, EntInsertedIntoContainerMessage>(OnMagazineSlotChange); SubscribeLocalEvent<ChamberMagazineAmmoProviderComponent, EntInsertedIntoContainerMessage>(OnMagazineSlotChange);
SubscribeLocalEvent<ChamberMagazineAmmoProviderComponent, EntRemovedFromContainerMessage>(OnMagazineSlotChange); SubscribeLocalEvent<ChamberMagazineAmmoProviderComponent, EntRemovedFromContainerMessage>(OnMagazineSlotChange);
SubscribeLocalEvent<ChamberMagazineAmmoProviderComponent, UseInHandEvent>(OnMagazineUse); SubscribeLocalEvent<ChamberMagazineAmmoProviderComponent, UseInHandEvent>(OnMagazineUse);

View File

@@ -14,7 +14,7 @@ public abstract partial class SharedGunSystem
protected virtual void InitializeMagazine() protected virtual void InitializeMagazine()
{ {
SubscribeLocalEvent<MagazineAmmoProviderComponent, TakeAmmoEvent>(OnMagazineTakeAmmo); SubscribeLocalEvent<MagazineAmmoProviderComponent, TakeAmmoEvent>(OnMagazineTakeAmmo);
SubscribeLocalEvent<MagazineAmmoProviderComponent, GetVerbsEvent<Verb>>(OnMagazineVerb); SubscribeLocalEvent<MagazineAmmoProviderComponent, GetVerbsEvent<AlternativeVerb>>(OnMagazineVerb);
SubscribeLocalEvent<MagazineAmmoProviderComponent, EntInsertedIntoContainerMessage>(OnMagazineSlotChange); SubscribeLocalEvent<MagazineAmmoProviderComponent, EntInsertedIntoContainerMessage>(OnMagazineSlotChange);
SubscribeLocalEvent<MagazineAmmoProviderComponent, EntRemovedFromContainerMessage>(OnMagazineSlotChange); SubscribeLocalEvent<MagazineAmmoProviderComponent, EntRemovedFromContainerMessage>(OnMagazineSlotChange);
SubscribeLocalEvent<MagazineAmmoProviderComponent, UseInHandEvent>(OnMagazineUse); SubscribeLocalEvent<MagazineAmmoProviderComponent, UseInHandEvent>(OnMagazineUse);
@@ -41,7 +41,7 @@ public abstract partial class SharedGunSystem
UpdateMagazineAppearance(component, magEnt.Value); UpdateMagazineAppearance(component, magEnt.Value);
} }
private void OnMagazineVerb(EntityUid uid, MagazineAmmoProviderComponent component, GetVerbsEvent<Verb> args) private void OnMagazineVerb(EntityUid uid, MagazineAmmoProviderComponent component, GetVerbsEvent<AlternativeVerb> args)
{ {
if (!args.CanInteract || !args.CanAccess) return; if (!args.CanInteract || !args.CanAccess) return;

View File

@@ -21,7 +21,7 @@ public partial class SharedGunSystem
SubscribeLocalEvent<RevolverAmmoProviderComponent, ComponentHandleState>(OnRevolverHandleState); SubscribeLocalEvent<RevolverAmmoProviderComponent, ComponentHandleState>(OnRevolverHandleState);
SubscribeLocalEvent<RevolverAmmoProviderComponent, ComponentInit>(OnRevolverInit); SubscribeLocalEvent<RevolverAmmoProviderComponent, ComponentInit>(OnRevolverInit);
SubscribeLocalEvent<RevolverAmmoProviderComponent, TakeAmmoEvent>(OnRevolverTakeAmmo); SubscribeLocalEvent<RevolverAmmoProviderComponent, TakeAmmoEvent>(OnRevolverTakeAmmo);
SubscribeLocalEvent<RevolverAmmoProviderComponent, GetVerbsEvent<Verb>>(OnRevolverVerbs); SubscribeLocalEvent<RevolverAmmoProviderComponent, GetVerbsEvent<AlternativeVerb>>(OnRevolverVerbs);
SubscribeLocalEvent<RevolverAmmoProviderComponent, InteractUsingEvent>(OnRevolverInteractUsing); SubscribeLocalEvent<RevolverAmmoProviderComponent, InteractUsingEvent>(OnRevolverInteractUsing);
SubscribeLocalEvent<RevolverAmmoProviderComponent, GetAmmoCountEvent>(OnRevolverGetAmmoCount); SubscribeLocalEvent<RevolverAmmoProviderComponent, GetAmmoCountEvent>(OnRevolverGetAmmoCount);
} }
@@ -166,18 +166,19 @@ public partial class SharedGunSystem
return false; return false;
} }
private void OnRevolverVerbs(EntityUid uid, RevolverAmmoProviderComponent component, GetVerbsEvent<Verb> args) private void OnRevolverVerbs(EntityUid uid, RevolverAmmoProviderComponent component, GetVerbsEvent<AlternativeVerb> args)
{ {
if (!args.CanAccess || !args.CanInteract || args.Hands == null) return; if (!args.CanAccess || !args.CanInteract || args.Hands == null) return;
args.Verbs.Add(new Verb() args.Verbs.Add(new AlternativeVerb()
{ {
Text = Loc.GetString("gun-revolver-empty"), Text = Loc.GetString("gun-revolver-empty"),
Disabled = !AnyRevolverCartridges(component), Disabled = !AnyRevolverCartridges(component),
Act = () => EmptyRevolver(component, args.User) Act = () => EmptyRevolver(component, args.User),
Priority = 1
}); });
args.Verbs.Add(new Verb() args.Verbs.Add(new AlternativeVerb()
{ {
Text = Loc.GetString("gun-revolver-spin"), Text = Loc.GetString("gun-revolver-spin"),
// Category = VerbCategory.G, // Category = VerbCategory.G,

View File

@@ -58,6 +58,7 @@
- id: BoxForensicPad - id: BoxForensicPad
- id: WeaponRevolverInspector - id: WeaponRevolverInspector
- id: DrinkDetFlask - id: DrinkDetFlask
- id: SpeedLoaderMagnum
- type: entity - type: entity
id: ClosetBombFilled id: ClosetBombFilled