Skip to content

Commit 79571cb

Browse files
authored
Cognizine makes hostile mobs solo antagonists (funky-station#264)
* initial commit * this is probably a tiny bit more efficient * okay so Rider told me that using was deprecated for some reason
1 parent 376b5ab commit 79571cb

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

Content.Server/EntityEffects/Effects/MakeSentientEntityEffectSystem.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
using Content.Shared.EntityEffects;
44
using Content.Shared.EntityEffects.Effects;
55
using Content.Shared.Mind.Components;
6+
using Content.Shared.NPC.Components;
7+
using Content.Shared.NPC.Systems;
68
using Content.Shared.Speech.Components;
79

810
namespace Content.Server.EntityEffects.Effects;
@@ -14,6 +16,14 @@ namespace Content.Server.EntityEffects.Effects;
1416
/// <inheritdoc cref="EntityEffectSystem{T,TEffect}"/>
1517
public sealed partial class MakeSentientEntityEffectSystem : EntityEffectSystem<MetaDataComponent, MakeSentient>
1618
{
19+
// Funky start
20+
[Dependency] private NpcFactionSystem _npcFaction = default!;
21+
22+
// These two are used in functions that don't like literal values
23+
private static readonly string MindRoleGhostRoleSoloAntagonist = "MindRoleGhostRoleSoloAntagonist";
24+
private static readonly string NanoTrasen = "NanoTrasen";
25+
// Funky end
26+
1727
protected override void Effect(Entity<MetaDataComponent> entity, ref EntityEffectEvent<MakeSentient> args)
1828
{
1929
// Let affected entities speak normally to make this effect different from, say, the "random sentience" event
@@ -40,5 +50,21 @@ protected override void Effect(Entity<MetaDataComponent> entity, ref EntityEffec
4050

4151
ghostRole.RoleName = entity.Comp.EntityName;
4252
ghostRole.RoleDescription = Loc.GetString("ghost-role-information-cognizine-description");
53+
54+
// Funky start
55+
// If the entity doesn't have a faction, assume they're friendly
56+
if (!TryComp(entity, out NpcFactionMemberComponent? faction))
57+
return;
58+
// If any of the entity's faction wants to hurt NT personnel, make them a ghost solo antagonist and amend the ghost role rules
59+
foreach (var i in faction.Factions)
60+
{
61+
if (_npcFaction.IsFactionHostile(i.Id, NanoTrasen))
62+
{
63+
ghostRole.RoleRules = Loc.GetString("ghost-role-information-sentient-hostile-rules");
64+
ghostRole.MindRoles.Add(MindRoleGhostRoleSoloAntagonist);
65+
return;
66+
}
67+
}
68+
// Funky end
4369
}
4470
}

Resources/Locale/en-US/_Funkystation/ghost/roles/ghost-role-component.ftl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
ghost-role-information-sentient-hostile-rules = You are a [color={role-type-solo-antagonist-color}][bold]{role-type-solo-antagonist-name}[/bold][/color]. While you are now sapient and capable of rationalizing, you are still hostile to the station's personnel, and are [color=red]NOT[/color] permitted to be "friendly" or ally with them.
2+
You don't remember any of your previous life, and you don't remember anything you learned as a ghost.
3+
You are allowed to remember knowledge about the game in general, such as how to cook, how to use objects, etc.
4+
You are absolutely [color=red]NOT[/color] allowed to remember, say, the name, appearance, etc. of your previous character.
5+
16
ghost-role-information-narsie-goose-name = Servant of Nar'sie
27
ghost-role-information-narsie-goose-description = Blood must flow, only those who follow the true god Nar'sie shall be spared.
38
ghost-role-information-narsie-goose-rules = You are a servant of Nar'sie. Relentlessly murder all those who do not follow nar'sie. If there are none on the station then all are your enemy.
@@ -13,4 +18,4 @@ ghost-role-information-zleeb-zlorb-description = Glorp zleeb zleeble gnranish! G
1318
ghost-role-information-zleeb-zlorb-rules = You are a small alien SPACE COP. You must enforce your laws (NOT NANOTRASEN'S!). These laws are up to you to decide but should match no more than 50% of NT's space law. This will probably put you at odds with sec that's okay. You are a free agent after all. Whatever you do, DON'T be a boot licker. Enforce YOUR version of galactic law to your best ability. Good luck, SPACE COP!
1419
1520
ghost-role-information-meowl-name = Meowl
16-
ghost-role-information-meowl-description = A highly invasive apex predator. The sole cause of the rapid decline of mothroaches.
21+
ghost-role-information-meowl-description = A highly invasive apex predator. The sole cause of the rapid decline of mothroaches.

0 commit comments

Comments
 (0)