Skip to content

Commit

Permalink
Merge branch 'master' into hydroco-powdered-drinks
Browse files Browse the repository at this point in the history
  • Loading branch information
DisposableCrewmember42 authored Nov 19, 2024
2 parents de8cdb3 + a495efa commit 890eb98
Show file tree
Hide file tree
Showing 14 changed files with 251 additions and 31 deletions.
117 changes: 117 additions & 0 deletions Content.Server/Weapons/Ranged/Systems/GunSystem.AutoFire.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
using Content.Shared.Weapons.Ranged.Components;
using Content.Server.Power.Components; // Frontier
using Content.Server.Power.EntitySystems; // Frontier
using Content.Shared.Interaction; // Frontier
using Content.Shared.Examine; // Frontier
using Content.Shared.Power; // Frontier
using Content.Server.Popups; // Frontier

namespace Content.Server.Weapons.Ranged.Systems;

public sealed partial class GunSystem
{
[Dependency] public PopupSystem _popup = default!; // Frontier
public override void Update(float frameTime)
{
base.Update(frameTime);
Expand All @@ -26,4 +33,114 @@ public override void Update(float frameTime)
AttemptShoot(uid, gun);
}
}

// New Frontiers - Shuttle Gun Power Draw - makes shuttle guns require power if they
// have an ApcPowerReceiverComponent
// This code is licensed under AGPLv3. See AGPLv3.txt
private void OnGunExamine(EntityUid uid, AutoShootGunComponent component, ExaminedEvent args)
{
// Powered is already handled by other power components
var enabled = Loc.GetString(component.On ? "gun-comp-enabled" : "gun-comp-disabled");

args.PushMarkup(enabled);
}

private void OnActivateGun(EntityUid uid, AutoShootGunComponent component, ActivateInWorldEvent args)
{
if (args.Handled || !args.Complex)
return;

component.On ^= true;

if (!component.On)
{
if (TryComp<ApcPowerReceiverComponent>(uid, out var apcPower) && component.OriginalLoad != 0)
apcPower.Load = 1;

DisableGun(uid, component);
args.Handled = true;
_popup.PopupEntity(Loc.GetString("auto-fire-disabled"), uid, args.User);
}
else if (CanEnable(uid, component))
{
if (TryComp<ApcPowerReceiverComponent>(uid, out var apcPower) && component.OriginalLoad != apcPower.Load)
apcPower.Load = component.OriginalLoad;

EnableGun(uid, component);
args.Handled = true;
_popup.PopupEntity(Loc.GetString("auto-fire-enabled"), uid, args.User);
}
else
{
_popup.PopupEntity(Loc.GetString("auto-fire-enabled-no-power"), uid, args.User);
}
}

/// <summary>
/// Tries to disable the AutoShootGun.
/// </summary>
public void DisableGun(EntityUid uid, AutoShootGunComponent component)
{
if (component.CanFire)
component.CanFire = false;
}

public bool CanEnable(EntityUid uid, AutoShootGunComponent component)
{
var xform = Transform(uid);

// Must be anchored to fire.
if (!xform.Anchored)
return false;

// No power needed? Always works.
if (!HasComp<ApcPowerReceiverComponent>(uid))
return true;

// Not switched on? Won't work.
if (!component.On)
return false;

return this.IsPowered(uid, EntityManager);
}

public void EnableGun(EntityUid uid, AutoShootGunComponent component, TransformComponent? xform = null)
{
if (!component.CanFire)
component.CanFire = true;
}

private void OnAnchorChange(EntityUid uid, AutoShootGunComponent component, ref AnchorStateChangedEvent args)
{
if (args.Anchored && CanEnable(uid, component))
EnableGun(uid, component);
else
DisableGun(uid, component);
}

private void OnGunInit(EntityUid uid, AutoShootGunComponent component, ComponentInit args)
{
if (TryComp<ApcPowerReceiverComponent>(uid, out var apcPower) && component.OriginalLoad == 0)
component.OriginalLoad = apcPower.Load;

if (!component.On)
return;

if (CanEnable(uid, component))
EnableGun(uid, component);
}

private void OnGunShutdown(EntityUid uid, AutoShootGunComponent component, ComponentShutdown args)
{
DisableGun(uid, component);
}

private void OnPowerChange(EntityUid uid, AutoShootGunComponent component, ref PowerChangedEvent args)
{
if (args.Powered && CanEnable(uid, component))
EnableGun(uid, component);
else
DisableGun(uid, component);
}
// End of Frontier modified code
}
9 changes: 9 additions & 0 deletions Content.Server/Weapons/Ranged/Systems/GunSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using Robust.Shared.Containers;
using Content.Shared.Interaction; // Frontier
using Content.Shared.Examine; // Frontier
using Content.Shared.Power; // Frontier

namespace Content.Server.Weapons.Ranged.Systems;

Expand All @@ -48,6 +51,12 @@ public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<BallisticAmmoProviderComponent, PriceCalculationEvent>(OnBallisticPrice);
SubscribeLocalEvent<AutoShootGunComponent, ActivateInWorldEvent>(OnActivateGun); // Frontier
SubscribeLocalEvent<AutoShootGunComponent, ComponentInit>(OnGunInit); // Frontier
SubscribeLocalEvent<AutoShootGunComponent, ComponentShutdown>(OnGunShutdown); // Frontier
SubscribeLocalEvent<AutoShootGunComponent, ExaminedEvent>(OnGunExamine); // Frontier
SubscribeLocalEvent<AutoShootGunComponent, PowerChangedEvent>(OnPowerChange); // Frontier
SubscribeLocalEvent<AutoShootGunComponent, AnchorStateChangedEvent>(OnAnchorChange); // Frontier
}

private void OnBallisticPrice(EntityUid uid, BallisticAmmoProviderComponent component, ref PriceCalculationEvent args)
Expand Down
17 changes: 17 additions & 0 deletions Content.Shared/Weapons/Ranged/Components/AutoShootGunComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,21 @@ public sealed partial class AutoShootGunComponent : Component
{
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public bool Enabled;

/// <summary>
/// Frontier - Whether the gun is switched on (e.g. through user interaction)
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public bool On { get; set; } = true;

/// <summary>
/// Frontier - Whether or not the gun can actually fire (i.e. switched on and receiving power if needed)
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public bool CanFire;

/// <summary>
/// Frontier - Amount of power this gun needs from an APC in Watts to function.
/// </summary>
public float OriginalLoad { get; set; } = 0;
}
3 changes: 3 additions & 0 deletions Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ public void AttemptShoot(EntityUid gunUid, GunComponent gun)

private void AttemptShoot(EntityUid user, EntityUid gunUid, GunComponent gun)
{
if (TryComp<AutoShootGunComponent>(gunUid, out var auto) && !auto.CanFire) // Frontier
return; // Frontier

if (gun.FireRateModified <= 0f ||
!_actionBlockerSystem.CanAttack(user))
return;
Expand Down
6 changes: 6 additions & 0 deletions Resources/Audio/DeltaV/Jukebox/attributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
copyright: "DOS=HIGH, UMB by MASTER BOOT RECORD may be used non-commercially in the Delta-V fork of SS14. Converted from FLAC to OGG, then converted to mono."
source: "https://masterbootrecord.bandcamp.com/album/c-edit-config-sys"

- files: ["deck_the_halls_b.ogg"]
license: "CC-BY-SA-4.0"
copyright: "Deck the Halls B Kevin MacLeod (incompetech.com) Licensed under Creative Commons: By Attribution 4.0 License http://creativecommons.org/licenses/by/4.0/"
source: "https://incompetech.com/music/royalty-free/mp3-royaltyfree/Deck%20the%20Halls%20B.mp3"

- files: ["drozerix_-_alone.xm-MONO.ogg"]
license: "Custom"
copyright: "Alone by Drozerix, converted to mono"
Expand Down Expand Up @@ -90,3 +95,4 @@
license: "CC-BY-SA-3.0"
copyright: "Lone Digger by Caravan Palace, converted to mono"
source: "https://vimeo.com/144736865"

Binary file not shown.
42 changes: 22 additions & 20 deletions Resources/Changelog/DeltaVChangelog.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
Entries:
- author: BramvanZijp
changes:
- message: Security dogs now can wear an id card and radio, are able to drag things,
and have received additional combat training.
type: Tweak
id: 184
time: '2023-12-28T09:32:10.0000000+00:00'
- author: Adrian16199
changes:
- message: Gives shoukou an oxygen miner until air actualy works.
type: Fix
id: 185
time: '2023-12-28T21:38:57.0000000+00:00'
- author: Master2112
changes:
- message: Crime Assist program to Security and Lawyer PDA's, to help identify a
crime with a simple yes/no question tree.
type: Add
id: 186
time: '2023-12-29T19:34:56.0000000+00:00'
- author: ps3moira
changes:
- message: Added Scottish Trait.
Expand Down Expand Up @@ -3739,3 +3719,25 @@
id: 683
time: '2024-11-18T02:08:58.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2214
- author: Stareostar, Mylegsaresharp, Aikakakah
changes:
- message: Added new lobby art to the rotation!
type: Add
id: 684
time: '2024-11-18T17:05:11.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2226
- author: Lyndomen, SleepyApril
changes:
- message: Normal kill targets now just need to be killed once- but it needs to
teach them a lesson that will be remembered
type: Tweak
id: 685
time: '2024-11-19T03:58:49.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2225
- author: Lyndomen
changes:
- message: Added holiday cheer
type: Add
id: 686
time: '2024-11-19T05:46:09.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2233
6 changes: 6 additions & 0 deletions Resources/Locale/en-US/_NF/weapons/gun.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gun-comp-enabled = The gun is turned [color=green]on[/color].
gun-comp-disabled = The gun is turned [color=red]off[/color].
auto-fire-enabled = Gun turned on.
auto-fire-disabled = Gun turned off.
auto-fire-enabled-no-power = Gun turned on; but it has no power!
18 changes: 18 additions & 0 deletions Resources/Locale/en-US/deltav/paper/book-salvage.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,21 @@ book-text-fishops = FISHOPS ADVANCED USER MANUAL FIRST EDITION
CHAPTER 6: Fish War
In the event of fish war there will be double the fish, more than could possibly be carried. A reinforcement or two will be required to carry the surplus fish. A fish war has never happened in recorded history, so it is currently purely theoretical. Its destructive power would rival several neutronium bombs.
book-text-vulpkanin = Vulpkanin for Dummies, an Exhaustive Guide
So, you're new to the sector and keep seeing these fine folks running around?
Those are Vulpkanin, basically space foxes (or wolves, depending who you ask)!
We've accumulated some quick tips you might use when engaging with these fluff balls.
No Chocolate! Seriously, it's like poison to them. Stick to burgers and fries.
Watch the Tail: A wagging tail usually means they're happy. A puffed-up tail? Back away slowly...
They Come in All Colors: From fiery reds to snowy whites, every Vulpkanin is unique!
Learn their Language: While most Vulpkanin speak common, knowing a few phrases in their native tongue can go a long way in building rapport.
How to Kiss: Kiss
Don't Underestimate Them: Vulpkanin may look cute and cuddly, but they can be fierce fighters when provoked. Treat them with respect and avoid unnecessary conflict.
6 changes: 6 additions & 0 deletions Resources/Prototypes/DeltaV/Catalog/Jukebox/Standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
path:
path: /Audio/DeltaV/Jukebox/DOS=HIGH,_UMB.ogg

- type: jukebox
id: DeckTheHalls
name: Deck The Halls - Kevin Macleod
path:
path: /Audio/DeltaV/Jukebox/deck_the_halls_b.ogg

- type: jukebox
id: DrozAlone
name: Drozerix - Alone
Expand Down
23 changes: 23 additions & 0 deletions Resources/Prototypes/DeltaV/Entities/Objects/Misc/books.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,26 @@
color: "#2c5491"
- type: Paper
content: book-text-fishops

- type: entity
parent: BookBase
id: BookVulpFAQ
name: Vulpkanin 101
suffix: library salvage
description: You seriously didn't purchase a "For Dummies" book in 2425?
components:
- type: Sprite
sprite: Objects/Misc/books.rsi
layers:
- state: paper
- state: cover_strong
color: "#c836aa"
- state: decor_spine
color: "#961cc8"
- state: detail_bookmark
color: "#eee039"
- state: icon_question
- state: detail_bookmark
color: "#2c5491"
- type: Paper
content: book-text-vulpkanin
20 changes: 9 additions & 11 deletions Resources/Prototypes/DeltaV/Loadouts/Jobs/Security/detective.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
- type: loadout
id: SecurityRevolverWeaponRevolverLucky
storage:
belt:
- WeaponRevolverLucky
equipment:
pocket1: WeaponRevolverLucky

- type: loadout
id: SecurityRevolverInspector
storage:
belt:
- WeaponRevolverInspector
equipment:
pocket1: WeaponRevolverInspector

- type: loadout
id: SecurityFirearmWeaponRevolverFitz
equipment:
pocket1: WeaponRevolverFitz

- type: loadout
id: SecurityFirearmSpeedLoaderMagnumRubber
Expand All @@ -34,11 +37,6 @@
back:
- SpeedLoaderSpecial

- type: loadout
id: SecurityFirearmWeaponRevolverFitz
equipment:
pocket1: WeaponRevolverFitz

- type: loadout
id: SecurityFirearmWeaponRevolverK38Master
equipment:
Expand Down
3 changes: 3 additions & 0 deletions Resources/Prototypes/Entities/Structures/Shuttles/cannons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -363,3 +363,6 @@
count: 5
- type: Machine
board: ShuttleGunKineticCircuitboard
- type: ExtensionCableReceiver # Frontier
- type: ApcPowerReceiver # Frontier
powerLoad: 1500 # Frontier
12 changes: 12 additions & 0 deletions Resources/Prototypes/lobbyscreens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,15 @@
- type: lobbyBackground
id: breakingspace
background: /Textures/LobbyScreens/breakingspace.webp

- type: lobbyBackground
id: StationCrewBoard
background: /Textures/LobbyScreens/station-crew-board.webp

- type: lobbyBackground
id: CorporateRats
background: /Textures/LobbyScreens/Corporate_Rats.webp

- type: lobbyBackground
id: SecurityCamera
background: /Textures/LobbyScreens/DeltaVContestWinner.webp

0 comments on commit 890eb98

Please sign in to comment.