Refactor antag rule code (#23445)
* Initial Pass, Rev, Thief
* Zombie initial pass
* Rebase, Traitor
* Nukeops, More overloads
* Revert RevolutionaryRuleComponent
* Use TryRoundStartAttempt, Rewrite nukie spawning
* Comments, Add task scheduler to GameRuleSystem
* Zombie initial testing done
* Sort methods, rework GameRuleTask
* Add CCVar, Initial testing continues
* Might as well get rid of the obsolete logging
* Oops, i dont know how to log apparently
* Suggested formatting fixes
* Suggested changes
* Fix merge issues
* Minor optimisation
* Allowed thief to choose other antags
* Review changes
* Spawn items on floor first, then inserting
* minor tweaks
* Shift as much as possible to ProtoId<>
* Remove unneeded
* Add exclusive antag attribute
* Fix merge issues
* Minor formatting fix
* Convert to struct
* Cleanup
* Review cleanup (need to test a lot)
* Some fixes, (mostly) tested
* oop
* Pass tests (for real)
---------
Co-authored-by: Rainfall <rainfey0+git@gmail.com>
Co-authored-by: AJCM <AJCM@tutanota.com>
2024-02-29 06:25:10 +00:00
|
|
|
|
using Content.Shared.Dataset;
|
2024-10-18 14:55:43 +02:00
|
|
|
|
using Content.Shared.FixedPoint;
|
2024-03-18 07:23:25 +00:00
|
|
|
|
using Content.Shared.NPC.Prototypes;
|
Refactor antag rule code (#23445)
* Initial Pass, Rev, Thief
* Zombie initial pass
* Rebase, Traitor
* Nukeops, More overloads
* Revert RevolutionaryRuleComponent
* Use TryRoundStartAttempt, Rewrite nukie spawning
* Comments, Add task scheduler to GameRuleSystem
* Zombie initial testing done
* Sort methods, rework GameRuleTask
* Add CCVar, Initial testing continues
* Might as well get rid of the obsolete logging
* Oops, i dont know how to log apparently
* Suggested formatting fixes
* Suggested changes
* Fix merge issues
* Minor optimisation
* Allowed thief to choose other antags
* Review changes
* Spawn items on floor first, then inserting
* minor tweaks
* Shift as much as possible to ProtoId<>
* Remove unneeded
* Add exclusive antag attribute
* Fix merge issues
* Minor formatting fix
* Convert to struct
* Cleanup
* Review cleanup (need to test a lot)
* Some fixes, (mostly) tested
* oop
* Pass tests (for real)
---------
Co-authored-by: Rainfall <rainfey0+git@gmail.com>
Co-authored-by: AJCM <AJCM@tutanota.com>
2024-02-29 06:25:10 +00:00
|
|
|
|
using Content.Shared.Random;
|
2023-04-25 20:23:14 -04:00
|
|
|
|
using Content.Shared.Roles;
|
|
|
|
|
|
using Robust.Shared.Audio;
|
Refactor antag rule code (#23445)
* Initial Pass, Rev, Thief
* Zombie initial pass
* Rebase, Traitor
* Nukeops, More overloads
* Revert RevolutionaryRuleComponent
* Use TryRoundStartAttempt, Rewrite nukie spawning
* Comments, Add task scheduler to GameRuleSystem
* Zombie initial testing done
* Sort methods, rework GameRuleTask
* Add CCVar, Initial testing continues
* Might as well get rid of the obsolete logging
* Oops, i dont know how to log apparently
* Suggested formatting fixes
* Suggested changes
* Fix merge issues
* Minor optimisation
* Allowed thief to choose other antags
* Review changes
* Spawn items on floor first, then inserting
* minor tweaks
* Shift as much as possible to ProtoId<>
* Remove unneeded
* Add exclusive antag attribute
* Fix merge issues
* Minor formatting fix
* Convert to struct
* Cleanup
* Review cleanup (need to test a lot)
* Some fixes, (mostly) tested
* oop
* Pass tests (for real)
---------
Co-authored-by: Rainfall <rainfey0+git@gmail.com>
Co-authored-by: AJCM <AJCM@tutanota.com>
2024-02-29 06:25:10 +00:00
|
|
|
|
using Robust.Shared.Prototypes;
|
|
|
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
2023-04-25 20:23:14 -04:00
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.GameTicking.Rules.Components;
|
|
|
|
|
|
|
|
|
|
|
|
[RegisterComponent, Access(typeof(TraitorRuleSystem))]
|
2023-08-22 18:14:33 -07:00
|
|
|
|
public sealed partial class TraitorRuleComponent : Component
|
2023-04-25 20:23:14 -04:00
|
|
|
|
{
|
2023-08-28 16:53:24 -07:00
|
|
|
|
public readonly List<EntityUid> TraitorMinds = new();
|
2023-04-25 20:23:14 -04:00
|
|
|
|
|
Refactor antag rule code (#23445)
* Initial Pass, Rev, Thief
* Zombie initial pass
* Rebase, Traitor
* Nukeops, More overloads
* Revert RevolutionaryRuleComponent
* Use TryRoundStartAttempt, Rewrite nukie spawning
* Comments, Add task scheduler to GameRuleSystem
* Zombie initial testing done
* Sort methods, rework GameRuleTask
* Add CCVar, Initial testing continues
* Might as well get rid of the obsolete logging
* Oops, i dont know how to log apparently
* Suggested formatting fixes
* Suggested changes
* Fix merge issues
* Minor optimisation
* Allowed thief to choose other antags
* Review changes
* Spawn items on floor first, then inserting
* minor tweaks
* Shift as much as possible to ProtoId<>
* Remove unneeded
* Add exclusive antag attribute
* Fix merge issues
* Minor formatting fix
* Convert to struct
* Cleanup
* Review cleanup (need to test a lot)
* Some fixes, (mostly) tested
* oop
* Pass tests (for real)
---------
Co-authored-by: Rainfall <rainfey0+git@gmail.com>
Co-authored-by: AJCM <AJCM@tutanota.com>
2024-02-29 06:25:10 +00:00
|
|
|
|
[DataField]
|
|
|
|
|
|
public ProtoId<AntagPrototype> TraitorPrototypeId = "Traitor";
|
|
|
|
|
|
|
|
|
|
|
|
[DataField]
|
|
|
|
|
|
public ProtoId<NpcFactionPrototype> NanoTrasenFaction = "NanoTrasen";
|
|
|
|
|
|
|
|
|
|
|
|
[DataField]
|
|
|
|
|
|
public ProtoId<NpcFactionPrototype> SyndicateFaction = "Syndicate";
|
|
|
|
|
|
|
|
|
|
|
|
[DataField]
|
|
|
|
|
|
public ProtoId<DatasetPrototype> CodewordAdjectives = "adjectives";
|
|
|
|
|
|
|
|
|
|
|
|
[DataField]
|
|
|
|
|
|
public ProtoId<DatasetPrototype> CodewordVerbs = "verbs";
|
2023-04-25 20:23:14 -04:00
|
|
|
|
|
2024-05-10 12:01:02 +10:00
|
|
|
|
[DataField]
|
|
|
|
|
|
public ProtoId<DatasetPrototype> ObjectiveIssuers = "TraitorCorporations";
|
|
|
|
|
|
|
2024-10-18 14:55:43 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Give this traitor an Uplink on spawn.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataField]
|
|
|
|
|
|
public bool GiveUplink = true;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Give this traitor the codewords.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataField]
|
|
|
|
|
|
public bool GiveCodewords = true;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Give this traitor a briefing in chat.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataField]
|
|
|
|
|
|
public bool GiveBriefing = true;
|
|
|
|
|
|
|
2023-08-28 16:53:24 -07:00
|
|
|
|
public int TotalTraitors => TraitorMinds.Count;
|
2023-04-25 20:23:14 -04:00
|
|
|
|
public string[] Codewords = new string[3];
|
|
|
|
|
|
|
|
|
|
|
|
public enum SelectionState
|
|
|
|
|
|
{
|
|
|
|
|
|
WaitingForSpawn = 0,
|
Refactor antag rule code (#23445)
* Initial Pass, Rev, Thief
* Zombie initial pass
* Rebase, Traitor
* Nukeops, More overloads
* Revert RevolutionaryRuleComponent
* Use TryRoundStartAttempt, Rewrite nukie spawning
* Comments, Add task scheduler to GameRuleSystem
* Zombie initial testing done
* Sort methods, rework GameRuleTask
* Add CCVar, Initial testing continues
* Might as well get rid of the obsolete logging
* Oops, i dont know how to log apparently
* Suggested formatting fixes
* Suggested changes
* Fix merge issues
* Minor optimisation
* Allowed thief to choose other antags
* Review changes
* Spawn items on floor first, then inserting
* minor tweaks
* Shift as much as possible to ProtoId<>
* Remove unneeded
* Add exclusive antag attribute
* Fix merge issues
* Minor formatting fix
* Convert to struct
* Cleanup
* Review cleanup (need to test a lot)
* Some fixes, (mostly) tested
* oop
* Pass tests (for real)
---------
Co-authored-by: Rainfall <rainfey0+git@gmail.com>
Co-authored-by: AJCM <AJCM@tutanota.com>
2024-02-29 06:25:10 +00:00
|
|
|
|
ReadyToStart = 1,
|
|
|
|
|
|
Started = 2,
|
2023-04-25 20:23:14 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
Refactor antag rule code (#23445)
* Initial Pass, Rev, Thief
* Zombie initial pass
* Rebase, Traitor
* Nukeops, More overloads
* Revert RevolutionaryRuleComponent
* Use TryRoundStartAttempt, Rewrite nukie spawning
* Comments, Add task scheduler to GameRuleSystem
* Zombie initial testing done
* Sort methods, rework GameRuleTask
* Add CCVar, Initial testing continues
* Might as well get rid of the obsolete logging
* Oops, i dont know how to log apparently
* Suggested formatting fixes
* Suggested changes
* Fix merge issues
* Minor optimisation
* Allowed thief to choose other antags
* Review changes
* Spawn items on floor first, then inserting
* minor tweaks
* Shift as much as possible to ProtoId<>
* Remove unneeded
* Add exclusive antag attribute
* Fix merge issues
* Minor formatting fix
* Convert to struct
* Cleanup
* Review cleanup (need to test a lot)
* Some fixes, (mostly) tested
* oop
* Pass tests (for real)
---------
Co-authored-by: Rainfall <rainfey0+git@gmail.com>
Co-authored-by: AJCM <AJCM@tutanota.com>
2024-02-29 06:25:10 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Current state of the rule
|
|
|
|
|
|
/// </summary>
|
2023-04-25 20:23:14 -04:00
|
|
|
|
public SelectionState SelectionStatus = SelectionState.WaitingForSpawn;
|
Refactor antag rule code (#23445)
* Initial Pass, Rev, Thief
* Zombie initial pass
* Rebase, Traitor
* Nukeops, More overloads
* Revert RevolutionaryRuleComponent
* Use TryRoundStartAttempt, Rewrite nukie spawning
* Comments, Add task scheduler to GameRuleSystem
* Zombie initial testing done
* Sort methods, rework GameRuleTask
* Add CCVar, Initial testing continues
* Might as well get rid of the obsolete logging
* Oops, i dont know how to log apparently
* Suggested formatting fixes
* Suggested changes
* Fix merge issues
* Minor optimisation
* Allowed thief to choose other antags
* Review changes
* Spawn items on floor first, then inserting
* minor tweaks
* Shift as much as possible to ProtoId<>
* Remove unneeded
* Add exclusive antag attribute
* Fix merge issues
* Minor formatting fix
* Convert to struct
* Cleanup
* Review cleanup (need to test a lot)
* Some fixes, (mostly) tested
* oop
* Pass tests (for real)
---------
Co-authored-by: Rainfall <rainfey0+git@gmail.com>
Co-authored-by: AJCM <AJCM@tutanota.com>
2024-02-29 06:25:10 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// When should traitors be selected and the announcement made
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
|
public TimeSpan? AnnounceAt;
|
2023-06-07 10:15:22 +03:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Path to antagonist alert sound.
|
|
|
|
|
|
/// </summary>
|
Refactor antag rule code (#23445)
* Initial Pass, Rev, Thief
* Zombie initial pass
* Rebase, Traitor
* Nukeops, More overloads
* Revert RevolutionaryRuleComponent
* Use TryRoundStartAttempt, Rewrite nukie spawning
* Comments, Add task scheduler to GameRuleSystem
* Zombie initial testing done
* Sort methods, rework GameRuleTask
* Add CCVar, Initial testing continues
* Might as well get rid of the obsolete logging
* Oops, i dont know how to log apparently
* Suggested formatting fixes
* Suggested changes
* Fix merge issues
* Minor optimisation
* Allowed thief to choose other antags
* Review changes
* Spawn items on floor first, then inserting
* minor tweaks
* Shift as much as possible to ProtoId<>
* Remove unneeded
* Add exclusive antag attribute
* Fix merge issues
* Minor formatting fix
* Convert to struct
* Cleanup
* Review cleanup (need to test a lot)
* Some fixes, (mostly) tested
* oop
* Pass tests (for real)
---------
Co-authored-by: Rainfall <rainfey0+git@gmail.com>
Co-authored-by: AJCM <AJCM@tutanota.com>
2024-02-29 06:25:10 +00:00
|
|
|
|
[DataField]
|
2023-06-07 10:15:22 +03:00
|
|
|
|
public SoundSpecifier GreetSoundNotification = new SoundPathSpecifier("/Audio/Ambience/Antag/traitor_start.ogg");
|
2024-04-24 21:31:45 -04:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The amount of codewords that are selected.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataField]
|
|
|
|
|
|
public int CodewordCount = 4;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The amount of TC traitors start with.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataField]
|
2024-10-18 14:55:43 +02:00
|
|
|
|
public FixedPoint2 StartingBalance = 20;
|
2023-04-25 20:23:14 -04:00
|
|
|
|
}
|