forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Please read these guidelines before opening your PR: https://docs.spacestation14.io/en/getting-started/pr-guideline --> <!-- The text between the arrows are comments - they will not be visible on your PR. --> ## About the PR Some of the admins asked for this ## Why / Balance These changes SUCKED and nobody LOVED them ## Technical details Just a bunch of reverts ## Media ## Requirements - [-] I have read and I am following the [Pull Request Guidelines](https://docs.spacestation14.com/en/general-development/codebase-info/pull-request-guidelines.html). I understand that not doing so may get my pr closed at maintainer’s discretion - [-] I have added screenshots/videos to this PR showcasing its changes ingame, **or** this PR does not require an ingame showcase ## Breaking changes lol, lmao **Changelog** :cl: - add: Reverted some honestly terrible changes. Nuclear core removal and salv shuttle are back.
- Loading branch information
Showing
44 changed files
with
614 additions
and
69 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
Content.Server/Objectives/Components/StoreUnlockerComponent.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,14 @@ | ||
using Content.Shared.Store; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.Objectives.Components; | ||
|
||
/// <summary> | ||
/// Unlocks store listings that use <see cref="ObjectiveUnlockCondition"/>. | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class StoreUnlockerComponent : Component | ||
{ | ||
[DataField(required: true)] | ||
public List<ProtoId<ListingPrototype>> Listings = new(); | ||
} |
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,34 @@ | ||
using Content.Server.Objectives.Components; | ||
using Content.Shared.Mind; | ||
|
||
namespace Content.Server.Objectives.Systems; | ||
|
||
/// <summary> | ||
/// Provides api for listings with <c>ObjectiveUnlockRequirement</c> to use. | ||
/// </summary> | ||
public sealed class StoreUnlockerSystem : EntitySystem | ||
{ | ||
private EntityQuery<StoreUnlockerComponent> _query; | ||
|
||
public override void Initialize() | ||
{ | ||
_query = GetEntityQuery<StoreUnlockerComponent>(); | ||
} | ||
|
||
/// <summary> | ||
/// Returns true if a listing id is unlocked by any objectives on a mind. | ||
/// </summary> | ||
public bool IsUnlocked(MindComponent mind, string id) | ||
{ | ||
foreach (var obj in mind.Objectives) | ||
{ | ||
if (!_query.TryComp(obj, out var comp)) | ||
continue; | ||
|
||
if (comp.Listings.Contains(id)) | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
Content.Server/Store/Conditions/ObjectiveUnlockCondition.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,21 @@ | ||
using Content.Shared.Mind; | ||
using Content.Shared.Store; | ||
using Content.Server.Objectives.Systems; | ||
|
||
namespace Content.Server.Store.Conditions; | ||
|
||
/// <summary> | ||
/// Requires that the buyer have an objective that unlocks this listing. | ||
/// </summary> | ||
public sealed partial class ObjectiveUnlockCondition : ListingCondition | ||
{ | ||
public override bool Condition(ListingConditionArgs args) | ||
{ | ||
var minds = args.EntityManager.System<SharedMindSystem>(); | ||
if (!minds.TryGetMind(args.Buyer, out _, out var mind)) | ||
return false; | ||
|
||
var unlocker = args.EntityManager.System<StoreUnlockerSystem>(); | ||
return unlocker.IsUnlocked(mind, args.Listing.ID); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared.Cabinet; | ||
|
||
/// <summary> | ||
/// Item cabinet that cannot be opened if it has an item inside. | ||
/// The only way to open it after that is to emag it. | ||
/// </summary> | ||
[RegisterComponent, NetworkedComponent] | ||
public sealed partial class SealingCabinetComponent : Component | ||
{ | ||
/// <summary> | ||
/// Popup shown when trying to open the cabinet once sealed. | ||
/// </summary> | ||
[DataField(required: true)] | ||
public LocId SealedPopup = string.Empty; | ||
|
||
/// <summary> | ||
/// Set to false to disable emag unsealing. | ||
/// </summary> | ||
[DataField] | ||
public bool Emaggable = true; | ||
} |
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,45 @@ | ||
using Content.Shared.Emag.Systems; | ||
using Content.Shared.Nutrition.Components; | ||
using Content.Shared.Nutrition.EntitySystems; | ||
using Content.Shared.Popups; | ||
|
||
namespace Content.Shared.Cabinet; | ||
|
||
public sealed class SealingCabinetSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly ItemCabinetSystem _cabinet = default!; | ||
[Dependency] private readonly OpenableSystem _openable = default!; | ||
[Dependency] private readonly SharedPopupSystem _popup = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<SealingCabinetComponent, OpenableOpenAttemptEvent>(OnOpenAttempt); | ||
SubscribeLocalEvent<SealingCabinetComponent, GotEmaggedEvent>(OnEmagged); | ||
} | ||
|
||
private void OnOpenAttempt(Entity<SealingCabinetComponent> ent, ref OpenableOpenAttemptEvent args) | ||
{ | ||
if (!_cabinet.HasItem(ent.Owner)) | ||
return; | ||
|
||
args.Cancelled = true; | ||
if (args.User is {} user) | ||
_popup.PopupClient(Loc.GetString(ent.Comp.SealedPopup, ("container", ent.Owner)), ent, user); | ||
} | ||
|
||
private void OnEmagged(Entity<SealingCabinetComponent> ent, ref GotEmaggedEvent args) | ||
{ | ||
if (!ent.Comp.Emaggable) | ||
return; | ||
|
||
if (!_cabinet.HasItem(ent.Owner) || _openable.IsOpen(ent)) | ||
return; | ||
|
||
_openable.SetOpen(ent, true); | ||
|
||
args.Handled = true; | ||
args.Repeatable = true; | ||
} | ||
} |
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,2 @@ | ||
nuke-core-container-whitelist-fail-popup = That doesn't fit into the container. | ||
nuke-core-container-sealed-popup = The {$container} is sealed shut! |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,48 @@ | ||
- type: entityTable | ||
id: FillSalvageSpecialistHardsuitSpatio | ||
table: !type:AllSelector | ||
children: | ||
- id: OxygenTankFilled | ||
- id: ClothingShoesBootsMag | ||
- id: ClothingOuterHardsuitSpatio | ||
- id: ClothingMaskGasExplorer | ||
|
||
- type: entityTable | ||
id: LockerFillSalvageSpecialist | ||
table: !type:AllSelector | ||
children: | ||
- id: ClothingBeltUtilityFilled | ||
- id: SurvivalKnife | ||
- id: HandheldGPSBasic | ||
- id: RadioHandheld | ||
- id: AppraisalTool | ||
- id: FireExtinguisher | ||
- id: Flare | ||
prob: 0.3 | ||
rolls: !type:ConstantNumberSelector | ||
value: 3 | ||
|
||
- type: entity | ||
id: LockerSalvageSpecialistFilledHardsuit | ||
suffix: Filled, Hardsuit | ||
parent: LockerSalvageSpecialist | ||
components: | ||
- type: EntityTableContainerFill | ||
containers: | ||
entity_storage: !type:AllSelector | ||
children: | ||
- !type:NestedSelector | ||
tableId: FillSalvageSpecialistHardsuitSpatio | ||
- !type:NestedSelector | ||
tableId: LockerFillSalvageSpecialist | ||
- type: StorageFill | ||
contents: | ||
- id: ClothingOuterHardsuitSpatio | ||
- id: ClothingShoesBootsMag | ||
- id: ClothingMaskGasExplorer | ||
- id: ClothingBeltUtilityFilled | ||
- id: SurvivalKnife | ||
- id: HandheldGPSBasic | ||
- id: RadioHandheld | ||
- id: SeismicCharge | ||
amount: 2 | ||
- id: OreBag | ||
prob: 0.5 | ||
- id: Flare | ||
prob: 0.3 | ||
- id: Flare | ||
prob: 0.3 | ||
- id: Flare | ||
prob: 0.3 | ||
|
||
- type: entity | ||
id: LockerSalvageSpecialistFilled | ||
suffix: Filled | ||
parent: LockerSalvageSpecialist | ||
components: | ||
- type: EntityTableContainerFill | ||
containers: | ||
entity_storage: !type:NestedSelector | ||
tableId: LockerFillSalvageSpecialist | ||
- type: StorageFill | ||
contents: | ||
# Currently do not function as 'true' mesons, so they're useless for salvagers. | ||
# - id: ClothingEyesGlassesMeson | ||
- id: ClothingBeltUtilityFilled | ||
- id: SurvivalKnife | ||
- id: HandheldGPSBasic | ||
- id: RadioHandheld | ||
- id: SeismicCharge | ||
amount: 2 | ||
- id: OreBag | ||
prob: 0.5 | ||
- id: Flare | ||
prob: 0.3 | ||
- id: Flare | ||
prob: 0.3 | ||
- id: Flare | ||
prob: 0.3 |
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
Oops, something went wrong.