Skip to content

Commit

Permalink
Return hijack objective (#1494)
Browse files Browse the repository at this point in the history
* Return hijack objective

* Return emmageble for EmergencyShuttleConsole

* Return objective

* Fix objective check
  • Loading branch information
Kirus59 authored Aug 4, 2024
1 parent 45be305 commit 80d70af
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Server.Objectives.Components;
using Content.Server.Objectives.Components;
using Content.Server.Shuttles.Components;
using Content.Server.Shuttles.Systems;
using Content.Shared.Cuffs.Components;
Expand Down Expand Up @@ -82,7 +82,7 @@ private bool IsShuttleHijacked(EntityUid shuttleGridId, EntityUid mindId)
if (!isHumanoid) // Only humanoids count as enemies
continue;

var isAntagonist = _role.MindIsAntagonist(mindId);
var isAntagonist = _role.MindIsAntagonist(crewMindId); //SS220 Return hijack objective
if (isAntagonist) // Allow antagonist
continue;

Expand Down
10 changes: 10 additions & 0 deletions Content.Server/Shuttles/Systems/EmergencyShuttleSystem.Console.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Content.Shared.CCVar;
using Content.Shared.Database;
using Content.Shared.DeviceNetwork;
using Content.Shared.Emag.Systems; //SS220 Return hijack objective
using Content.Shared.Popups;
using Content.Shared.Shuttles.BUIStates;
using Content.Shared.Shuttles.Events;
Expand Down Expand Up @@ -95,6 +96,7 @@ private void InitializeEmergencyConsole()
SubscribeLocalEvent<EmergencyShuttleConsoleComponent, EmergencyShuttleRepealMessage>(OnEmergencyRepeal);
SubscribeLocalEvent<EmergencyShuttleConsoleComponent, EmergencyShuttleRepealAllMessage>(OnEmergencyRepealAll);
SubscribeLocalEvent<EmergencyShuttleConsoleComponent, ActivatableUIOpenAttemptEvent>(OnEmergencyOpenAttempt);
SubscribeLocalEvent<EmergencyShuttleConsoleComponent, GotEmaggedEvent>(OnEmagged); //SS220 Return hijack objective
}

private void OnEmergencyOpenAttempt(EntityUid uid, EmergencyShuttleConsoleComponent component, ActivatableUIOpenAttemptEvent args)
Expand All @@ -107,6 +109,14 @@ private void OnEmergencyOpenAttempt(EntityUid uid, EmergencyShuttleConsoleCompon
}
}

//SS220 Return hijack objective begin
private void OnEmagged(EntityUid uid, EmergencyShuttleConsoleComponent component, ref GotEmaggedEvent args)
{
_logger.Add(LogType.EmergencyShuttle, LogImpact.Extreme, $"{ToPrettyString(args.UserUid):player} emagged shuttle console for early launch");
EarlyLaunch();
}
//SS220 Return hijack objective end

private void SetAuthorizeTime(float obj)
{
_authorizeTime = obj;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,10 +675,12 @@ public bool TryFTLDock(EntityUid shuttleUid, ShuttleComponent component, EntityU
if (config != null)
{
FTLDock((shuttleUid, shuttleXform), config);
Smimsh(shuttleUid, xform: shuttleXform); //SS220 Emergency shuttle gib
return true;
}

TryFTLProximity(shuttleUid, targetUid, shuttleXform, targetXform);
Smimsh(shuttleUid, xform: shuttleXform); //SS220 Emergency shuttle gib
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Objectives/objectiveGroups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
weights:
EscapeShuttleObjective: 1
DieObjective: 0.05
#HijackShuttleObjective: 0.02
HijackShuttleObjective: 0.02 #SS220 Return hijack objective

- type: weightedRandom
id: TraitorObjectiveGroupSocial
Expand Down
26 changes: 14 additions & 12 deletions Resources/Prototypes/Objectives/traitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,20 @@
- StealCondition
- type: DieCondition

#- type: entity
# parent: [BaseTraitorObjective, BaseLivingObjective]
# id: HijackShuttleObjective
# name: Hijack emergency shuttle
# description: Leave on the shuttle free and clear of the loyal Nanotrasen crew on board. Use ANY methods available to you. Syndicate agents, Nanotrasen enemies, and handcuffed hostages may remain alive on the shuttle. Ignore assistance from anyone other than a support agent.
# components:
# - type: Objective
# difficulty: 5 # insane, default config max difficulty
# icon:
# sprite: Objects/Tools/emag.rsi
# state: icon
# - type: HijackShuttleCondition
#SS220 Return hijack objective begin
- type: entity
parent: [BaseTraitorObjective, BaseLivingObjective]
id: HijackShuttleObjective
name: Hijack emergency shuttle
description: Leave on the shuttle free and clear of the loyal Nanotrasen crew on board. Use ANY methods available to you. Syndicate agents, Nanotrasen enemies, and handcuffed hostages may remain alive on the shuttle. Ignore assistance from anyone other than a support agent.
components:
- type: Objective
difficulty: 5 # insane, default config max difficulty
icon:
sprite: Objects/Tools/emag.rsi
state: icon
- type: HijackShuttleCondition
#SS220 Return hijack objective end

# kill

Expand Down

0 comments on commit 80d70af

Please sign in to comment.