Skip to content

Commit

Permalink
Changes for RoundstartFugitiveRuleSystem, moved Fugitive from midroun…
Browse files Browse the repository at this point in the history
…d.yml to events.yml
  • Loading branch information
Kr8art committed Nov 26, 2024
1 parent 93982f2 commit 5ed4d5e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 32 deletions.
28 changes: 18 additions & 10 deletions Content.Server/GameTicking/Rules/RoundstartFugitiveRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Content.Server.GameTicking.Rules;
/// <summary>
/// Copy of ThiefRuleSystem
/// </summary>
public sealed class RoundstartFugitiveRuleSystem : GameRuleSystem<RoundstartFugitiveRuleComponent> //Also need this somehow: StationEventSystem : StationEventSystem<FugitiveRuleComponent>
public sealed class RoundstartFugitiveRuleSystem : GameRuleSystem<RoundstartFugitiveRuleComponent>
{
[Dependency] private readonly AntagSelectionSystem _antag = default!;
[Dependency] private readonly InventorySystem _inventory = default!;
Expand All @@ -46,15 +46,18 @@ public override void Initialize()
SubscribeLocalEvent<RoundstartFugitiveRuleComponent, AfterAntagEntitySelectedEvent>(AfterAntagSelected);

SubscribeLocalEvent<RoundstartFugitiveRoleComponent, GetBriefingEvent>(OnGetBriefing);

}

//Moved this bit of code down below so AfterAntagSelcted isn't duplicate

// Greeting upon thief activation
private void AfterAntagSelected(Entity<RoundstartFugitiveRuleComponent> mindId,
ref AfterAntagEntitySelectedEvent args)
{
var ent = args.EntityUid;
_antag.SendBriefing(ent, MakeBriefing(ent), null, null);
}
//private void AfterAntagSelected(Entity<RoundstartFugitiveRuleComponent> mindId,
// ref AfterAntagEntitySelectedEvent args)
//{
// var ent = args.EntityUid;
// _antag.SendBriefing(ent, MakeBriefing(ent), null, null);
//}

// Character screen briefing
private void OnGetBriefing(Entity<RoundstartFugitiveRoleComponent> role, ref GetBriefingEvent args)
Expand Down Expand Up @@ -111,9 +114,14 @@ protected override void ActiveTick(EntityUid uid, RoundstartFugitiveRuleComponen
RemCompDeferred(uid, comp);
}

private void OnEntitySelected(Entity<RoundstartFugitiveRuleComponent> ent, ref AfterAntagEntitySelectedEvent args)
private void AfterAntagSelected(Entity<RoundstartFugitiveRuleComponent> mindId, ref AfterAntagEntitySelectedEvent args)
{
var (uid, comp) = ent;
{
var ent = args.EntityUid;
_antag.SendBriefing(ent, MakeBriefing(ent), null, null);
}

var (uid, comp) = mindId;
if (comp.NextAnnounce != null)
{
Log.Error("Fugitive rule spawning multiple fugitives isn't supported, sorry.");
Expand All @@ -125,7 +133,7 @@ private void OnEntitySelected(Entity<RoundstartFugitiveRuleComponent> ent, ref A
comp.Station = _station.GetOwningStation(fugi);
comp.NextAnnounce = Timing.CurTime + comp.AnnounceDelay;

_popup.PopupEntity(Loc.GetString("fugitive-spawn"), fugi, fugi);
// _popup.PopupEntity(Loc.GetString("fugitive-spawn"), fugi, fugi); //I think this does the 'You fall from the ceiling popup? If so, can be removed later

// give the fugi a report so they know what their charges are
var report = SpawnReport(comp, Transform(fugi));
Expand Down
27 changes: 27 additions & 0 deletions Resources/Prototypes/DeltaV/GameRules/events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,30 @@
sound: /Audio/Effects/clang.ogg
mindRoles:
- MindRoleFugitive

- type: entity
parent: BaseGameRule
id: RoundstartFugitive #Roundstart Fugi here
components:
- type: StationEvent
minimumPlayers: 1 # TESTING NUMBER
duration: null
- type: RoundstartFugitiveRule #EVENT THAT SHOULD SPAWN THE WARRANT BUT IT DOESN'T
- type: AntagLoadProfileRule #What does this even do
- type: AntagObjectives
objectives:
- RoundstartFugitiveEscapeObjective
- type: AntagSelection
agentName: roundstartfugitive-round-end-agent-name
definitions:
- prefRoles: [ RoundstartFugitive ] # What does this in the brackets do? Who knows? Not me.
max: 1
playerRatio: 15
lateJoinAdditional: true
allowNonHumans: false
multiAntagSetting: NotExclusive # What is this?
startingGear: RoundstartFugitiveGear
mindRoles:
- MindRoleRoundstartFugitive
briefing:
sound: "/Audio/Misc/thief_greeting.ogg" # Change the sound
22 changes: 0 additions & 22 deletions Resources/Prototypes/GameRules/midround.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,3 @@
briefing:
sound: "/Audio/Misc/thief_greeting.ogg"

- type: entity
parent: BaseGameRule
id: RoundstartFugitive #Roundstart Fugi here
components:
- type: RoundstartFugitiveRule
- type: AntagObjectives
objectives:
- RoundstartFugitiveEscapeObjective
- type: AntagSelection
agentName: roundstartfugitive-round-end-agent-name
definitions:
- prefRoles: [ RoundstartFugitive ] # What does this in the brackets do? Who knows? Not me.
max: 1
playerRatio: 15
lateJoinAdditional: true
allowNonHumans: false
multiAntagSetting: NotExclusive # What is this?
startingGear: RoundstartFugitiveGear
mindRoles:
- MindRoleRoundstartFugitive
briefing:
sound: "/Audio/Misc/thief_greeting.ogg" # Change the sound

0 comments on commit 5ed4d5e

Please sign in to comment.