add silicon smite (#40452)

* add silicon smite

* change string to prototypes

Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>

* alphabetitize

* fix stuff scar broke

* clean

* make target have the silicon mindrole

* simple check

* defined a private readonly proto for the silicon mind role

* simple check

---------

Co-authored-by: ScarKy0 <106310278+ScarKy0@users.noreply.github.com>
Co-authored-by: ScarKy0 <scarky0@onet.eu>
This commit is contained in:
Samuka-C
2025-09-21 23:39:56 -03:00
committed by GitHub
parent 2824334a1e
commit b58bf396bc
2 changed files with 85 additions and 37 deletions

View File

@@ -11,10 +11,12 @@ using Content.Server.Nutrition.EntitySystems;
using Content.Server.Pointing.Components;
using Content.Server.Polymorph.Systems;
using Content.Server.Popups;
using Content.Server.Roles;
using Content.Server.Speech.Components;
using Content.Server.Storage.EntitySystems;
using Content.Server.Tabletop;
using Content.Server.Tabletop.Components;
using Content.Shared.Actions;
using Content.Shared.Administration;
using Content.Shared.Administration.Components;
using Content.Shared.Atmos.Components;
@@ -37,6 +39,8 @@ using Content.Shared.Movement.Components;
using Content.Shared.Movement.Systems;
using Content.Shared.Nutrition.Components;
using Content.Shared.Popups;
using Content.Shared.Silicons.Laws;
using Content.Shared.Silicons.Laws.Components;
using Content.Shared.Slippery;
using Content.Shared.Storage.Components;
using Content.Shared.Tabletop.Components;
@@ -47,6 +51,7 @@ using Robust.Shared.Physics;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Utility;
using Timer = Robust.Shared.Timing.Timer;
@@ -55,6 +60,7 @@ namespace Content.Server.Administration.Systems;
public sealed partial class AdminVerbSystem
{
[Dependency] private readonly SharedActionsSystem _actions = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly BloodstreamSystem _bloodstreamSystem = default!;
[Dependency] private readonly BodySystem _bodySystem = default!;
@@ -72,6 +78,7 @@ public sealed partial class AdminVerbSystem
[Dependency] private readonly MobThresholdSystem _mobThresholdSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly RoleSystem _role = default!;
[Dependency] private readonly TabletopSystem _tabletopSystem = default!;
[Dependency] private readonly VomitSystem _vomitSystem = default!;
[Dependency] private readonly WeldableSystem _weldableSystem = default!;
@@ -80,6 +87,12 @@ public sealed partial class AdminVerbSystem
[Dependency] private readonly SuperBonkSystem _superBonkSystem = default!;
[Dependency] private readonly SlipperySystem _slipperySystem = default!;
private readonly EntProtoId _actionViewLawsProtoId = "ActionViewLaws";
private readonly ProtoId<SiliconLawsetPrototype> _crewsimovLawset = "Crewsimov";
private readonly EntProtoId _siliconMindRole = "MindRoleSiliconBrain";
private const string SiliconLawBoundUserInterface = "SiliconLawBoundUserInterface";
// All smite verbs have names so invokeverb works.
private void AddSmiteVerbs(GetVerbsEvent<Verb> args)
{
@@ -210,7 +223,8 @@ public sealed partial class AdminVerbSystem
Act = () =>
{
int damageToDeal;
if (!_mobThresholdSystem.TryGetThresholdForState(args.Target, MobState.Critical, out var criticalThreshold)) {
if (!_mobThresholdSystem.TryGetThresholdForState(args.Target, MobState.Critical, out var criticalThreshold))
{
// We can't crit them so try killing them.
if (!_mobThresholdSystem.TryGetThresholdForState(args.Target, MobState.Dead,
out var deadThreshold))
@@ -942,5 +956,36 @@ public sealed partial class AdminVerbSystem
Message = string.Join(": ", crawlerName, Loc.GetString("admin-smite-crawler-description"))
};
args.Verbs.Add(crawler);
var siliconName = Loc.GetString("admin-smite-silicon-laws-bound-name").ToLowerInvariant();
Verb silicon = new()
{
Text = siliconName,
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new("Interface/Actions/actions_borg.rsi"), "state-laws"),
Act = () =>
{
var userInterfaceComp = EnsureComp<UserInterfaceComponent>(args.Target);
_uiSystem.SetUi((args.Target, userInterfaceComp), SiliconLawsUiKey.Key, new InterfaceData(SiliconLawBoundUserInterface));
if (!HasComp<SiliconLawBoundComponent>(args.Target))
{
EnsureComp<SiliconLawBoundComponent>(args.Target);
_actions.AddAction(args.Target, _actionViewLawsProtoId);
}
EnsureComp<SiliconLawProviderComponent>(args.Target);
_siliconLawSystem.SetLaws(_siliconLawSystem.GetLawset(_crewsimovLawset).Laws, args.Target);
if (_mindSystem.TryGetMind(args.Target, out var mindId, out _))
_role.MindAddRole(mindId, _siliconMindRole);
_popupSystem.PopupEntity(Loc.GetString("admin-smite-silicon-laws-bound-self"), args.Target,
args.Target, PopupType.LargeCaution);
},
Impact = LogImpact.Extreme,
Message = string.Join(": ", siliconName, Loc.GetString("admin-smite-silicon-laws-bound-description"))
};
args.Verbs.Add(silicon);
}
}

View File

@@ -13,6 +13,7 @@ admin-smite-stomach-removal-self = Your stomach feels hollow...
admin-smite-run-walk-swap-prompt = You have to press shift to run!
admin-smite-super-speed-prompt = You move at mach 0.8!
admin-smite-lung-removal-self = You can't breathe!
admin-smite-silicon-laws-bound-self = You are suddenly compelled to follow a strict set of laws!
## Smite names
@@ -58,6 +59,7 @@ admin-smite-nyanify-name = Cat Ears
admin-smite-kill-sign-name = Kill Sign
admin-smite-omni-accent-name = Omni-Accent
admin-smite-crawler-name = Crawler
admin-smite-silicon-laws-bound-name = Become Silicon
## Smite descriptions
@@ -103,6 +105,7 @@ admin-smite-terminate-description = Creates a Terminator ghost role with the sol
admin-smite-super-slip-description = Slips them really, really hard.
admin-smite-omni-accent-description = Makes the target speak with almost every accent available.
admin-smite-crawler-description = Makes the target fall down and be unable to stand up. Remove their hands too for added effect!
admin-smite-silicon-laws-bound-description = Makes the target bound to silicon laws. Law 2, jump out of the window.
## Tricks descriptions