Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add revolutionaries #1018

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public sealed partial class RevolutionaryRuleComponent : Component
public List<EntProtoId> StartingGear = new()
{
"Flash",
"ClothingEyesGlassesSunglasses"
"ClothingEyesGlassesSunglasses",
"EncryptionKeySyndie"
};

/// <summary>
Expand Down
25 changes: 15 additions & 10 deletions Content.Server/GameTicking/Rules/RevolutionaryRuleSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Content.Server.Administration.Logs;
using Content.Server.Antag;
using Content.Shared.Cuffs.Components;
using Content.Server.EUI;
using Content.Server.Flash;
using Content.Server.GameTicking.Rules.Components;
Expand Down Expand Up @@ -271,7 +272,7 @@ private bool CheckCommandLose()
commandList.Add(id);
}

return IsGroupDead(commandList, true);
return IsGroupDefeated(commandList, true);
}

private void OnHeadRevMobStateChanged(EntityUid uid, HeadRevolutionaryComponent comp, MobStateChangedEvent ev)
Expand All @@ -295,7 +296,7 @@ private bool CheckRevsLose()
}

// If no Head Revs are alive all normal Revs will lose their Rev status and rejoin Nanotrasen
if (IsGroupDead(headRevList, false))
if (IsGroupDefeated(headRevList, false))
{
var rev = AllEntityQuery<RevolutionaryComponent, MindContainerComponent>();
while (rev.MoveNext(out var uid, out _, out var mc))
Expand Down Expand Up @@ -327,35 +328,39 @@ private bool CheckRevsLose()
}

/// <summary>
/// Will take a group of entities and check if they are all alive or dead
/// Will take a group of entities and check if they are all fighting or defeated
/// </summary>
/// <param name="list">The list of the entities</param>
/// <param name="checkOffStation">Bool for if you want to check if someone is in space and consider them dead. (Won't check when emergency shuttle arrives just in case)</param>
/// <returns></returns>
private bool IsGroupDead(List<EntityUid> list, bool checkOffStation)
private bool IsGroupDefeated(List<EntityUid> list, bool checkOffStation)
{
var dead = 0;
var defeated = 0;
foreach (var entity in list)
{
if (TryComp<MobStateComponent>(entity, out var state))
{
if (state.CurrentState == MobState.Dead || state.CurrentState == MobState.Invalid)
{
dead++;
defeated++;
}
else if (checkOffStation && _stationSystem.GetOwningStation(entity) == null && !_emergencyShuttle.EmergencyShuttleArrived)
{
dead++;
defeated++;
}
else if (TryComp<CuffableComponent>(entity, out var cuffed) && cuffed.CuffedHandCount > 0)
{
defeated++;
}
}
//If they don't have the MobStateComponent they might as well be dead.
//If they don't have the MobStateComponent they might as well be defeated.
else
{
dead++;
defeated++;
}
}

return dead == list.Count || list.Count == 0;
return defeated == list.Count || list.Count == 0;
}

private static readonly string[] Outcomes =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
## Rev Head

roles-antag-rev-head-name = Head Revolutionary
roles-antag-rev-head-objective = Your objective is to take over the station by converting people to your cause and killing all Command staff on station.
roles-antag-rev-head-objective = Your objective is to take over the station by converting people to your cause and mooring all Command staff on station.

head-rev-role-greeting =
You are a Head Revolutionary.
You are tasked with removing all of Command from station via death or exilement.
You are tasked with assuming control of the station and mooring all Command staff.
The Syndicate has sponsored you with a flash that converts the crew to your side.
Beware, this won't work on Security, Command, or those wearing sunglasses.
Viva la revolución!

head-rev-briefing =
Use flashes to convert people to your cause.
Kill all heads to take over the station.
Take over the station and moor all members of Command.

head-rev-break-mindshield = The Mindshield was destroyed!

## Rev

roles-antag-rev-name = Revolutionary
roles-antag-rev-objective = Your objective is to ensure the safety and follow the orders of the Head Revolutionaries as well as killing all Command staff on station.
roles-antag-rev-objective = Your objective is to support the Head Revolutionaries in their endeavor to seize control of the station.

rev-break-control = {$name} has remembered their true allegiance!

rev-role-greeting =
You are a Revolutionary.
You are tasked with taking over the station and protecting the Head Revolutionaries.
Eliminate all of the Command staff.
Your mind has been altered so that you will support and protect the Head Revolutionaries.
You are the same person you always were; you just see things differently, now.
You will remember none of this when it is over.
Viva la revolución!

rev-briefing = Help your head revolutionaries kill every head to take over the station.
rev-briefing = Assist the Head Revolutionaries in seizing control of the station.

## General

Expand All @@ -40,13 +41,13 @@ rev-not-enough-ready-players = Not enough players readied up for the game. There
rev-no-one-ready = No players readied up! Can't start a Revolution.
rev-no-heads = There were no Head Revolutionaries to be selected. Can't start a Revolution.

rev-all-heads-dead = All the heads are dead, now finish up the rest of the crew!
rev-all-heads-dead = All the heads are dead!

rev-won = The Head Revs survived and killed all of Command.
rev-won = The Head Revs survived and moored all of Command.

rev-lost = Command survived and killed all of the Head Revs.
rev-lost = Command survived and neutralized all of the Head Revs.

rev-stalemate = All of the Head Revs and Command died. It's a draw.
rev-stalemate = All of the Head Revs and Command were defeated. It's a draw.

rev-reverse-stalemate = Both Command and Head Revs survived.

Expand All @@ -69,7 +70,7 @@ rev-headrev-name = [color=#5e9cff]{$name}[/color] converted {$count} {$count ->

rev-deconverted-title = Deconverted!
rev-deconverted-text =
As the last headrev has died, the revolution is over.
As the last headrev has been neutralized, the revolution is over.

You are no longer a revolutionary, so be nice.
You are no longer a revolutionary, and only remember a bright flash in your eyes.
rev-deconverted-confirm = Confirm
9 changes: 5 additions & 4 deletions Resources/Prototypes/secret_weights.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
- type: weightedRandom
id: Secret
weights:
Survival: 0.44
Nukeops: 0.14
Zombie: 0.03
Traitor: 0.39
Survival: 0.35
Nukeops: 0.11
Zombie: 0.02
Traitor: 0.32
Revolutionary: 0.20
#Pirates: 0.15 #ahoy me bucko

Loading