forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1835 from DexlerXD/upstream-merge-61
Upstream merge 61
- Loading branch information
Showing
334 changed files
with
99,188 additions
and
28,407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
Content.Server/GameTicking/Rules/Components/DragonRuleComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
namespace Content.Server.GameTicking.Rules.Components; | ||
|
||
[RegisterComponent] | ||
public sealed partial class DragonRuleComponent : Component; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using Content.Server.Antag; | ||
using Content.Server.GameTicking.Rules.Components; | ||
using Content.Server.Station.Components; | ||
using Content.Server.Station.Systems; | ||
using Content.Shared.Localizations; | ||
using Robust.Server.GameObjects; | ||
|
||
namespace Content.Server.GameTicking.Rules; | ||
|
||
public sealed class DragonRuleSystem : GameRuleSystem<DragonRuleComponent> | ||
{ | ||
[Dependency] private readonly TransformSystem _transform = default!; | ||
[Dependency] private readonly AntagSelectionSystem _antag = default!; | ||
[Dependency] private readonly StationSystem _station = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<DragonRuleComponent, AfterAntagEntitySelectedEvent>(AfterAntagEntitySelected); | ||
} | ||
|
||
private void AfterAntagEntitySelected(Entity<DragonRuleComponent> ent, ref AfterAntagEntitySelectedEvent args) | ||
{ | ||
_antag.SendBriefing(args.EntityUid, MakeBriefing(args.EntityUid), null, null); | ||
} | ||
|
||
private string MakeBriefing(EntityUid dragon) | ||
{ | ||
var direction = string.Empty; | ||
|
||
var dragonXform = Transform(dragon); | ||
|
||
var station = _station.GetStationInMap(dragonXform.MapID); | ||
EntityUid? stationGrid = null; | ||
if (TryComp<StationDataComponent>(station, out var stationData)) | ||
stationGrid = _station.GetLargestGrid(stationData); | ||
|
||
if (stationGrid is not null) | ||
{ | ||
var stationPosition = _transform.GetWorldPosition((EntityUid)stationGrid); | ||
var dragonPosition = _transform.GetWorldPosition(dragon); | ||
|
||
var vectorToStation = stationPosition - dragonPosition; | ||
direction = ContentLocalizationManager.FormatDirection(vectorToStation.GetDir()); | ||
} | ||
|
||
var briefing = Loc.GetString("dragon-role-briefing", ("direction", direction)); | ||
|
||
return briefing; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
Content.Server/Materials/Components/ProduceMaterialExtractorComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using Content.Shared.Chemistry.Reagent; | ||
using Content.Shared.Materials; | ||
using Robust.Shared.Audio; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.Materials.Components; | ||
|
||
/// <summary> | ||
/// This is used for a machine that turns produce into a specified material. | ||
/// </summary> | ||
[RegisterComponent, Access(typeof(ProduceMaterialExtractorSystem))] | ||
public sealed partial class ProduceMaterialExtractorComponent : Component | ||
{ | ||
/// <summary> | ||
/// The material that produce is converted into | ||
/// </summary> | ||
[DataField] | ||
public ProtoId<MaterialPrototype> ExtractedMaterial = "Biomass"; | ||
|
||
/// <summary> | ||
/// List of reagents that determines how much material is yielded from a produce. | ||
/// </summary> | ||
[DataField] | ||
public List<ProtoId<ReagentPrototype>> ExtractionReagents = new() | ||
{ | ||
"Nutriment" | ||
}; | ||
|
||
[DataField] | ||
public SoundSpecifier? ExtractSound = new SoundPathSpecifier("/Audio/Effects/waterswirl.ogg"); | ||
} |
Oops, something went wrong.