Skip to content

Commit

Permalink
Merge branch 'master' into Posters
Browse files Browse the repository at this point in the history
  • Loading branch information
MilonPL authored Nov 28, 2024
2 parents df9239c + bf7a8d9 commit b7ff775
Show file tree
Hide file tree
Showing 21 changed files with 354 additions and 119 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/labeler-needsreview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,41 @@
on:
pull_request_target:
types: [review_requested]
pull_request_review:
types: [submitted]

permissions:
pull-requests: write
contents: write

jobs:
add_label:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request_target'
steps:
- uses: actions-ecosystem/action-add-labels@v1
with:
labels: "S: Needs Review"
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: "S: Awaiting Changes"

handle_review:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request_review'
steps:
- uses: actions-ecosystem/action-add-labels@v1
if: |
github.event.review.state == 'changes_requested' &&
(github.event.review.author_association == 'OWNER' ||
github.event.review.author_association == 'MEMBER')
with:
labels: "S: Awaiting Changes"

- uses: actions-ecosystem/action-remove-labels@v1
if: |
github.event.review.state == 'changes_requested' &&
(github.event.review.author_association == 'OWNER' ||
github.event.review.author_association == 'MEMBER')
with:
labels: "S: Needs Review"
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Content.Server.Silicons.Laws;
using Content.Shared.Emag.Components;
using Content.Shared.Emag.Systems;
using Content.Shared.Silicons.Laws;
using Content.Shared.Silicons.Laws.Components;
using Robust.Shared.Prototypes;

namespace Content.Server.Silicons.Borgs;

/// <summary>
/// Handles lawset patching when switching type.
/// If a borg is made emagged it needs its emag laws carried over.
/// </summary>
public sealed partial class BorgSwitchableTypeSystem
{
[Dependency] private readonly SiliconLawSystem _law = default!;

private void ConfigureLawset(EntityUid uid, ProtoId<SiliconLawsetPrototype> id)
{
var laws = _law.GetLawset(id);
_law.SetLaws(laws.Laws, uid);

// re-add law 0 and final law based on new lawset
if (CompOrNull<EmagSiliconLawComponent>(uid)?.OwnerName != null)
{
// raising the event manually to bypass re-emagging checks
var ev = new GotEmaggedEvent(uid); // user wont be used since OwnerName isnt null, safe to pass itself
RaiseLocalEvent(uid, ref ev);
}

// ion storms don't get mirrored because thats basically impossible to track
}
}
7 changes: 6 additions & 1 deletion Content.Server/Silicons/Borgs/BorgSwitchableTypeSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Content.Server.Silicons.Borgs;
/// <summary>
/// Server-side logic for borg type switching. Handles more heavyweight and server-specific switching logic.
/// </summary>
public sealed class BorgSwitchableTypeSystem : SharedBorgSwitchableTypeSystem
public sealed partial class BorgSwitchableTypeSystem : SharedBorgSwitchableTypeSystem // DeltaV: Made partial
{
[Dependency] private readonly BorgSystem _borgSystem = default!;
[Dependency] private readonly ServerInventorySystem _inventorySystem = default!;
Expand Down Expand Up @@ -59,6 +59,11 @@ protected override void SelectBorgModule(Entity<BorgSwitchableTypeComponent> ent
}
}

// Begin DeltaV Code: Custom lawset patching
if (prototype.Lawset is {} lawset)
ConfigureLawset(ent, lawset);
// End DeltaV Code

// Configure special components
if (Prototypes.TryIndex(ent.Comp.SelectedBorgType, out var previousPrototype))
{
Expand Down
3 changes: 2 additions & 1 deletion Content.Server/Silicons/Laws/SiliconLawSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ private void OnEmagLawsAdded(EntityUid uid, SiliconLawProviderComponent componen
component.Lawset = GetLawset(component.Laws);

// Add the first emag law before the others
var name = CompOrNull<EmagSiliconLawComponent>(uid)?.OwnerName ?? Name(args.UserUid); // DeltaV: Reuse emagger name if possible
component.Lawset?.Laws.Insert(0, new SiliconLaw
{
LawString = Loc.GetString("law-emag-custom", ("name", Name(args.UserUid)), ("title", Loc.GetString(component.Lawset.ObeysTo))),
LawString = Loc.GetString("law-emag-custom", ("name", name), ("title", Loc.GetString(component.Lawset.ObeysTo))), // DeltaV: pass name from variable
Order = 0
});

Expand Down
32 changes: 32 additions & 0 deletions Content.Server/_CD/Engraving/EngraveableComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
namespace Content.Server._CD.Engraving;

/// <summary>
/// Allows an items' description to be modified with an engraving
/// </summary>
[RegisterComponent, Access(typeof(EngraveableSystem))]
public sealed partial class EngraveableComponent : Component
{
/// <summary>
/// Message given to user to notify them a message was sent
/// </summary>
[DataField]
public string EngravedMessage = string.Empty;

/// <summary>
/// The inspect text to use when there is no engraving
/// </summary>
[DataField]
public LocId NoEngravingText = "engraving-dogtags-no-message";

/// <summary>
/// The message to use when successfully engraving the item
/// </summary>
[DataField]
public LocId EngraveSuccessMessage = "engraving-dogtags-succeed";

/// <summary>
/// The inspect text to use when there is an engraving. The message will be shown seperately afterwards.
/// </summary>
[DataField]
public LocId HasEngravingText = "engraving-dogtags-has-message";
}
83 changes: 83 additions & 0 deletions Content.Server/_CD/Engraving/EngraveableSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
using Content.Server.Administration;
using Content.Server.Administration.Logs;
using Content.Server.Popups;
using Content.Shared.Database;
using Content.Shared.Popups;
using Content.Shared.Examine;
using Content.Shared.Verbs;
using Robust.Shared.Player;
using Robust.Shared.Utility;

namespace Content.Server._CD.Engraving;

public sealed class EngraveableSystem : EntitySystem
{
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly QuickDialogSystem _dialog = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<EngraveableComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<EngraveableComponent, GetVerbsEvent<ActivationVerb>>(AddEngraveVerb);
}

private void OnExamined(Entity<EngraveableComponent> ent, ref ExaminedEvent args)
{
var msg = new FormattedMessage();
msg.AddMarkupOrThrow(Loc.GetString(ent.Comp.EngravedMessage == string.Empty
? ent.Comp.NoEngravingText
: ent.Comp.HasEngravingText));

if (ent.Comp.EngravedMessage != string.Empty)
msg.AddMarkupPermissive(Loc.GetString(ent.Comp.EngravedMessage));

args.PushMessage(msg, 1);
}

private void AddEngraveVerb(Entity<EngraveableComponent> ent, ref GetVerbsEvent<ActivationVerb> args)
{
// First check if it's already been engraved. If it has, don't let them do it again.
if (ent.Comp.EngravedMessage != string.Empty)
return;

// We need an actor to give the verb.
if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
return;

// Make sure ghosts can't engrave stuff.
if (!args.CanInteract)
return;

var engraveVerb = new ActivationVerb
{
Text = Loc.GetString("engraving-verb-engrave"),
Act = () =>
{
_dialog.OpenDialog(actor.PlayerSession,
Loc.GetString("engraving-verb-engrave"),
Loc.GetString("engraving-popup-ui-message"),
(string message) =>
{
// If either the actor or comp have magically vanished
if (actor.PlayerSession.AttachedEntity == null || !HasComp<EngraveableComponent>(ent))
return;

ent.Comp.EngravedMessage = message;
_popup.PopupEntity(Loc.GetString(ent.Comp.EngraveSuccessMessage),
actor.PlayerSession.AttachedEntity.Value,
actor.PlayerSession,
PopupType.Medium);
_adminLogger.Add(LogType.Action,
LogImpact.Low,
$"{ToPrettyString(actor.PlayerSession.AttachedEntity):player} engraved an item with message: {message}");
});
},
Impact = LogImpact.Low,
};
engraveVerb.Impact = LogImpact.Low;
args.Verbs.Add(engraveVerb);
}
}
10 changes: 9 additions & 1 deletion Content.Shared/Silicons/Borgs/BorgTypePrototype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Shared.Inventory;
using Content.Shared.Radio;
using Content.Shared.Silicons.Borgs.Components;
using Content.Shared.Silicons.Laws; // DeltaV
using Content.Shared.Whitelist;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
Expand All @@ -12,7 +13,7 @@ namespace Content.Shared.Silicons.Borgs;
/// Information for a borg type that can be selected by <see cref="BorgSwitchableTypeComponent"/>.
/// </summary>
/// <seealso cref="SharedBorgSwitchableTypeSystem"/>
[Prototype]
[Prototype(-5)] // DeltaV - force load after shaders
public sealed partial class BorgTypePrototype : IPrototype
{
[ValidatePrototypeId<SoundCollectionPrototype>]
Expand Down Expand Up @@ -83,6 +84,13 @@ public sealed partial class BorgTypePrototype : IPrototype
[DataField]
public EntProtoId[] DefaultModules = [];

/// <summary>
/// DeltaV: Lawset to use instead of crewsimov.
/// If the chassis is emagged or ion stormed this is ignored.
/// </summary>
[DataField]
public ProtoId<SiliconLawsetPrototype>? Lawset;

/// <summary>
/// Additional components to add to the borg entity when this type is selected.
/// </summary>
Expand Down
57 changes: 30 additions & 27 deletions Resources/Changelog/DeltaVChangelog.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,4 @@
Entries:
- author: DebugOk
changes:
- message: Enabled gamerule voting on periapsis
type: Tweak
- message: Enabled map voting on periapsis
type: Tweak
id: 211
time: '2024-01-19T22:33:21.0000000+00:00'
- author: DebugOk
changes:
- message: Added gridinv, sorry.
type: Add
id: 212
time: '2024-01-21T18:58:28.0000000+00:00'
- author: TadJohnson00
changes:
- message: Pride vend has received an adjusted inventory. Make sure to check out
the new cloaks available!
type: Tweak
id: 213
time: '2024-01-30T14:22:13.0000000+00:00'
- author: Colin-Tel
changes:
- message: Updated Asterisk Station.
type: Tweak
id: 214
time: '2024-01-30T21:09:41.0000000+00:00'
- author: DebugOk
changes:
- message: You should be able to exit cryo even after leaving now, meaning it just
Expand Down Expand Up @@ -3776,3 +3749,33 @@
id: 710
time: '2024-11-26T18:19:14.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2292
- author: Stop-Signs
changes:
- message: psych chems are no longer stronger nocturine
type: Tweak
id: 711
time: '2024-11-27T20:22:30.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2302
- author: deltanedas
changes:
- message: Fixed borgs with special lawsets fixing their emag laws when switched
to.
type: Fix
id: 712
time: '2024-11-28T07:22:06.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2299
- author: Kr8art
changes:
- message: Added customizable dogtags from Cosmatic Drift to the trinket loadout!
type: Add
id: 713
time: '2024-11-28T12:04:17.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2301
- author: Kr8art
changes:
- message: The nuke core container now displays an appropriate message when hasty
syndicate agents try to insert the nuke core while it is still closed!
type: Fix
id: 714
time: '2024-11-28T19:36:26.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2309
6 changes: 6 additions & 0 deletions Resources/Locale/en-US/_CD/engraving/engraving.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
engraving-verb-engrave = Engrave
engraving-popup-ui-message = Description
engraving-dogtags-no-message = The dogtags don't seem to have any kind of engraving.
engraving-dogtags-has-message = The dogtags are engraved with a message that reads:{" "}
engraving-dogtags-succeed = You successfully engrave the dogtags with your message.
1 change: 1 addition & 0 deletions Resources/Locale/en-US/nuke/nuke-core-container.ftl
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
nuke-core-container-whitelist-fail-popup = That doesn't fit into the container.
nuke-core-container-sealed-popup = The {$container} is sealed shut!
nuke-core-container-closed-fail-popup = You need to open the container first!
3 changes: 2 additions & 1 deletion Resources/Prototypes/DeltaV/Catalog/uplink_catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@
productEntity: BaseBallBatHomeRun
icon:
entity: BaseBallBatHomeRun
discountCategory: usualDiscounts
discountDownTo:
Telecrystal: 10
Telecrystal: 6
cost:
Telecrystal: 16
categories:
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/DeltaV/borg_types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
- BorgModuleSecurityPatrol
- BorgModuleSecurityBastion

lawset: SiliconPolice

addComponents:
- type: SiliconLawProvider
laws: SiliconPolice
- type: FlashImmunity
- type: ShowMindShieldIcons
- type: ShowCriminalRecordIcons
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
whitelist:
tags:
- PlutoniumCore
lockedFailPopup: nuke-core-container-closed-fail-popup
whitelistFailPopup: nuke-core-container-whitelist-fail-popup
- type: GenericVisualizer
visuals:
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Loadouts/loadout_groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
- SilverRing # DeltaV
- Cane # DeltaV
- WhiteCane #DeltaV
- CDDogtags # _CD

- type: loadoutGroup
id: Glasses
Expand Down
14 changes: 14 additions & 0 deletions Resources/Prototypes/_CD/Entities/Objects/Misc/dogtags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- type: entity
id: CDDogtags
parent: ClothingNeckBase
name: dogtags
description: A set of dogtags, hanging from a small piece of cord for wearing and carrying.
components:
- type: Sprite
sprite: _CD/Objects/Misc/dogtags.rsi
layers:
- state: dogtag
- type: Clothing
sprite: _CD/Objects/Misc/dogtags.rsi
- type: Appearance
- type: Engraveable
5 changes: 5 additions & 0 deletions Resources/Prototypes/_CD/Loadouts/Miscellaneous/trinkets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- type: loadout
id: CDDogtags
storage:
back:
- CDDogtags
Loading

0 comments on commit b7ff775

Please sign in to comment.