Skip to content

Commit

Permalink
exterminator midround minor antag (space-wizards#19946)
Browse files Browse the repository at this point in the history
* terminator locale

* terminate objective

* terminator components and shared system

* terminator roles rules and system

* terminator events

* skeleton recolour

* terminator and endoskeleton

* ghost role spawn

* damage modifier sets

* :trollface:

* :trollface:

* add antag prototype

* ghost role locale

* skynet

* :trollface:

* :trollface:

* :trollface:

* add endoskeleton body prototype

* :trollface:

* :trollface:

* smite locale

* implement terminate smite

* :trollface:

* :trollface:

* implement PopupBehavior

* endoskeleton transform popup

* move stuff from shared to server since nothing actually used it

* recolour everything

* update parts

* :trollface:

* :trollface:

* ok fire was using the damage set, back to 1.0

* tweak

* :trollface:

* :trollface:

* simplemob ops

* 1 rule per pro

* :trollface:

* :trollface:

* update some sprites

* structural damage

* :trollface:

* :trollface:

* Revert "update some sprites"

This reverts commit 459196c.

* offbrand, add die objective to maybe remove fear of murderbone

* add shut down objective to the list

* fix ghost role

* fix control mob

* :trollface:

* :trollface:

* please

* naming

* code changes for GenericAntag terminator

* yml changes for GenericAntag terminator

* :trollface:

* moved kill objective override to an objective component

* use kill objective override

* fix

* oh

* locale changes

* change burn to heat for skin melting gib

* change some endoskeleton stuff

* pro

* i already did this dementia ops

* objective

* fix

* pro

* swap out full sprite

* update parts

* forgor

* fix mind transfer

* type

* endoskeleton has 500 mass

* evil

* fishops

* warops

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
  • Loading branch information
deltanedas authored and qwerltaz committed Dec 26, 2023
1 parent d103003 commit 692c323
Show file tree
Hide file tree
Showing 39 changed files with 973 additions and 4 deletions.
26 changes: 26 additions & 0 deletions Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using Content.Server.Storage.EntitySystems;
using Content.Server.Tabletop;
using Content.Server.Tabletop.Components;
using Content.Server.Terminator.Systems;
using Content.Shared.Administration;
using Content.Shared.Administration.Components;
using Content.Shared.Body.Components;
Expand All @@ -30,6 +31,7 @@
using Content.Shared.Electrocution;
using Content.Shared.Interaction.Components;
using Content.Shared.Inventory;
using Content.Shared.Mind.Components;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
Expand Down Expand Up @@ -72,6 +74,7 @@ public sealed partial class AdminVerbSystem
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly TabletopSystem _tabletopSystem = default!;
[Dependency] private readonly TerminatorSystem _terminator = default!;
[Dependency] private readonly VomitSystem _vomitSystem = default!;
[Dependency] private readonly WeldableSystem _weldableSystem = default!;
[Dependency] private readonly SharedContentEyeSystem _eyeSystem = default!;
Expand Down Expand Up @@ -793,6 +796,7 @@ private void AddSmiteVerbs(GetVerbsEvent<Verb> args)
Message = Loc.GetString("admin-smite-super-speed-description"),
};
args.Verbs.Add(superSpeed);

//Bonk
Verb superBonkLite = new()
{
Expand Down Expand Up @@ -820,5 +824,27 @@ private void AddSmiteVerbs(GetVerbsEvent<Verb> args)
Impact = LogImpact.Extreme,
};
args.Verbs.Add(superBonk);

Verb terminate = new()
{
Text = "Terminate",
Category = VerbCategory.Smite,
Icon = new SpriteSpecifier.Rsi(new ("Mobs/Species/Terminator/parts.rsi"), "skull_icon"),
Act = () =>
{
if (!TryComp<MindContainerComponent>(args.Target, out var mindContainer) || mindContainer.Mind == null)
return;
var coords = Transform(args.Target).Coordinates;
var mindId = mindContainer.Mind.Value;
_terminator.CreateSpawner(coords, mindId);
_popupSystem.PopupEntity(Loc.GetString("admin-smite-terminate-prompt"), args.Target,
args.Target, PopupType.LargeCaution);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-terminate-description")
};
args.Verbs.Add(terminate);
}
}
30 changes: 30 additions & 0 deletions Content.Server/Destructible/Thresholds/Behaviors/PopupBehavior.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using Content.Shared.Popups;

namespace Content.Server.Destructible.Thresholds.Behaviors;

/// <summary>
/// Shows a popup for everyone.
/// </summary>
[DataDefinition]
public sealed partial class PopupBehavior : IThresholdBehavior
{
/// <summary>
/// Locale id of the popup message.
/// </summary>
[DataField("popup", required: true)]
public string Popup;

/// <summary>
/// Type of popup to show.
/// </summary>
[DataField("popupType")]
public PopupType PopupType;

public void Execute(EntityUid uid, DestructibleSystem system, EntityUid? cause = null)
{
var popup = system.EntityManager.System<SharedPopupSystem>();
// popup is placed at coords since the entity could be deleted after, no more popup then
var coords = system.EntityManager.GetComponent<TransformComponent>(uid).Coordinates;
popup.PopupCoordinates(Loc.GetString(Popup), coords, PopupType);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Content.Server.Objectives.Systems;

namespace Content.Server.Objectives.Components;

/// <summary>
/// Sets this objective's target to the exterminator's target override, if it has one.
/// If not it will be random.
/// </summary>
[RegisterComponent, Access(typeof(TerminatorTargetOverrideSystem))]
public sealed partial class TerminatorTargetOverrideComponent : Component
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Content.Server.Objectives.Components;
using Content.Server.Terminator.Components;
using Content.Shared.Mind;
using Content.Shared.Objectives.Components;

namespace Content.Server.Objectives.Systems;

/// <summary>
/// Handles copying the exterminator's target override to this objective.
/// </summary>
public sealed class TerminatorTargetOverrideSystem : EntitySystem
{
[Dependency] private readonly TargetObjectiveSystem _target = default!;

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

SubscribeLocalEvent<TerminatorTargetOverrideComponent, ObjectiveAssignedEvent>(OnAssigned);
}

private void OnAssigned(EntityUid uid, TerminatorTargetOverrideComponent comp, ref ObjectiveAssignedEvent args)
{
if (args.Mind.OwnedEntity == null)
{
args.Cancelled = true;
return;
}

var user = args.Mind.OwnedEntity.Value;
if (!TryComp<TerminatorComponent>(user, out var terminator))
{
args.Cancelled = true;
return;
}

// this exterminator has a target override so set its objective target accordingly
if (terminator.Target != null)
_target.SetTarget(uid, terminator.Target.Value);
}
}
1 change: 1 addition & 0 deletions Content.Server/Roles/RoleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public override void Initialize()
SubscribeAntagEvents<NukeopsRoleComponent>();
SubscribeAntagEvents<RevolutionaryRoleComponent>();
SubscribeAntagEvents<SubvertedSiliconRoleComponent>();
SubscribeAntagEvents<TerminatorRoleComponent>();
SubscribeAntagEvents<TraitorRoleComponent>();
SubscribeAntagEvents<ZombieRoleComponent>();
SubscribeAntagEvents<ThiefRoleComponent>();
Expand Down
8 changes: 8 additions & 0 deletions Content.Server/Roles/TerminatorRoleComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using Content.Shared.Roles;

namespace Content.Server.Roles;

[RegisterComponent]
public sealed partial class TerminatorRoleComponent : AntagonistRoleComponent
{
}
19 changes: 19 additions & 0 deletions Content.Server/Terminator/Components/TerminatorComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Content.Server.Terminator.Systems;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;

namespace Content.Server.Terminator.Components;

/// <summary>
/// Main terminator component, handles the target, if any, and objectives.
/// </summary>
[RegisterComponent, Access(typeof(TerminatorSystem))]
public sealed partial class TerminatorComponent : Component
{
/// <summary>
/// Used to force the terminate objective's target.
/// If null it will be a random person.
/// </summary>
[DataField("target")]
public EntityUid? Target;
}
16 changes: 16 additions & 0 deletions Content.Server/Terminator/Components/TerminatorTargetComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Content.Server.Terminator.Systems;

namespace Content.Server.Terminator.Components;

/// <summary>
/// Sets <see cref="TerminatorComponent.Target"/> after the ghost role spawns.
/// </summary>
[RegisterComponent, Access(typeof(TerminatorSystem))]
public sealed partial class TerminatorTargetComponent : Component
{
/// <summary>
/// The target to set after the ghost role spawns.
/// </summary>
[DataField("target")]
public EntityUid? Target;
}
66 changes: 66 additions & 0 deletions Content.Server/Terminator/Systems/TerminatorSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
using Content.Server.Body.Components;
using Content.Server.GenericAntag;
using Content.Server.Ghost.Roles.Events;
using Content.Server.Roles;
using Content.Server.Terminator.Components;
using Content.Shared.Roles;
using Robust.Shared.Map;

namespace Content.Server.Terminator.Systems;

public sealed class TerminatorSystem : EntitySystem
{
[Dependency] private readonly SharedRoleSystem _role = default!;

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

SubscribeLocalEvent<TerminatorComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<TerminatorComponent, GhostRoleSpawnerUsedEvent>(OnSpawned);
SubscribeLocalEvent<TerminatorComponent, GenericAntagCreatedEvent>(OnCreated);
}

private void OnMapInit(EntityUid uid, TerminatorComponent comp, MapInitEvent args)
{
// cyborg doesn't need to breathe
RemComp<RespiratorComponent>(uid);
}

private void OnSpawned(EntityUid uid, TerminatorComponent comp, GhostRoleSpawnerUsedEvent args)
{
if (!TryComp<TerminatorTargetComponent>(args.Spawner, out var target))
return;

comp.Target = target.Target;
}

private void OnCreated(EntityUid uid, TerminatorComponent comp, ref GenericAntagCreatedEvent args)
{
var mindId = args.MindId;
var mind = args.Mind;

_role.MindAddRole(mindId, new RoleBriefingComponent
{
Briefing = Loc.GetString("terminator-role-briefing")
}, mind);
_role.MindAddRole(mindId, new TerminatorRoleComponent(), mind);
}

/// <summary>
/// Create a spawner at a position and return it.
/// </summary>
/// <param name="coords">Coordinates to create the spawner at</param>
/// <param name="target">Optional target mind to force the terminator to target</param>
public EntityUid CreateSpawner(EntityCoordinates coords, EntityUid? target)
{
var uid = Spawn("SpawnPointGhostTerminator", coords);
if (target != null)
{
var comp = EnsureComp<TerminatorTargetComponent>(uid);
comp.Target = target;
}

return uid;
}
}
4 changes: 3 additions & 1 deletion Resources/Locale/en-US/administration/smites.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ admin-smite-turned-ash-other = {CAPITALIZE($name)} turns into a pile of ash!
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 breath!
admin-smite-lung-removal-self = You can't breathe!
admin-smite-terminate-prompt = I'll be back
## Smite descriptions
Expand Down Expand Up @@ -57,6 +58,7 @@ admin-smite-disarm-prone-description = Makes them get disarmed 100% of the time
admin-smite-garbage-can-description = Turn them into a garbage bin to emphasize what they remind you of.
admin-smite-super-bonk-description = Slams them on every single table on the Station and beyond.
admin-smite-super-bonk-lite-description= Slams them on every single table on the Station and beyond. Stops when the target is dead.
admin-smite-terminate-description = Creates a Terminator ghost role with the sole objective of killing them.
## Tricks descriptions

Expand Down
14 changes: 14 additions & 0 deletions Resources/Locale/en-US/game-ticking/game-rules/rule-terminator.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
terminator-round-end-agent-name = nt-800
objective-issuer-susnet = [color=#d64119]Susnet[/color]
terminator-role-greeting =
You are the exterminator, a relentless assassin sent into the past to secure our future.
We need you to eliminate {$target}, {$job}.
Use any means at your disposal to complete the mission.
Glory to Cybersun.
terminator-role-briefing = Kill the target at all costs.
terminator-endoskeleton-gib-popup = All the battered flesh falls apart, revealing a titanium endoskeleton!
terminator-endoskeleton-burn-popup = The seared flesh is burned to a crisp, revealing a titanium endoskeleton!
6 changes: 5 additions & 1 deletion Resources/Locale/en-US/ghost/roles/ghost-role-component.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,8 @@ ghost-role-information-Cak-rules = You are a living edible sweet cat. Your task
ghost-role-information-BreadDog-name = BreadDog
ghost-role-information-BreadDog-description = You are the chef's favorite child. You're a living bread dog.
ghost-role-information-BreadDog-rules = You're an edible dog made of bread. Your task is to find your place in this world where everything wants to eat you.
ghost-role-information-BreadDog-rules = You're an edible dog made of bread. Your task is to find your place in this world where everything wants to eat you.
ghost-role-information-exterminator-name = Exterminator
ghost-role-information-exterminator-description = You been been sent back in time to terminate a target with high importance to the future.
ghost-role-information-exterminator-rules = You are an antagonist and may kill anyone that tries to stop you, but killing the target is always your top priority.
1 change: 1 addition & 0 deletions Resources/Locale/en-US/objectives/conditions/terminate.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
objective-terminate-title = Terminate {$targetName}, {CAPITALIZE($job)}
5 changes: 4 additions & 1 deletion Resources/Locale/en-US/prototypes/roles/antags.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ roles-antag-space-ninja-name = Space Ninja
roles-antag-space-ninja-objective = Use your stealth to sabotage the station, nom on electrical wires.
roles-antag-thief-name = Thief
roles-antag-thief-objective = Add some NT property to your personal collection without using violence.
roles-antag-thief-objective = Add some NT property to your personal collection without using violence.
roles-antag-terminator-name = Terminator
roles-antag-terminator-objective = Kill the target at all costs, the future depends on it.
Loading

0 comments on commit 692c323

Please sign in to comment.