Fix hijack objective (#21241)

* Fix hijack

* Max difficulty
This commit is contained in:
Morb
2023-10-28 05:33:18 +03:00
committed by GitHub
parent 2c7e2b62dc
commit d27df9705d
5 changed files with 28 additions and 13 deletions

View File

@@ -1,8 +0,0 @@
using Content.Server.Objectives.Systems;
namespace Content.Server.Objectives.Components;
[RegisterComponent, Access(typeof(HijackShuttleConditionSystem))]
public sealed partial class HijackShuttleComponent : Component
{
}

View File

@@ -0,0 +1,11 @@
using Content.Server.Objectives.Systems;
namespace Content.Server.Objectives.Components;
/// <summary>
/// Objective condition that requires the player to leave station of escape shuttle with only antags on board or handcuffed humanoids
/// </summary>
[RegisterComponent, Access(typeof(HijackShuttleConditionSystem))]
public sealed partial class HijackShuttleConditionComponent : Component
{
}

View File

@@ -23,17 +23,17 @@ public sealed class HijackShuttleConditionSystem : EntitySystem
{ {
base.Initialize(); base.Initialize();
SubscribeLocalEvent<HijackShuttleComponent, ObjectiveGetProgressEvent>(OnGetProgress); SubscribeLocalEvent<HijackShuttleConditionComponent, ObjectiveGetProgressEvent>(OnGetProgress);
} }
private void OnGetProgress(EntityUid uid, HijackShuttleComponent comp, ref ObjectiveGetProgressEvent args) private void OnGetProgress(EntityUid uid, HijackShuttleConditionComponent comp, ref ObjectiveGetProgressEvent args)
{ {
args.Progress = GetProgress(args.MindId, args.Mind); args.Progress = GetProgress(args.MindId, args.Mind);
} }
private float GetProgress(EntityUid mindId, MindComponent mind) private float GetProgress(EntityUid mindId, MindComponent mind)
{ {
// not escaping alive if you're deleted/dead // Not escaping alive if you're deleted/dead
if (mind.OwnedEntity == null || _mind.IsCharacterDeadIc(mind)) if (mind.OwnedEntity == null || _mind.IsCharacterDeadIc(mind))
return 0f; return 0f;

View File

@@ -1,2 +0,0 @@
objective-condition-hijack-shuttle-title = Hijack emergency shuttle
objective-condition-hijack-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.

View File

@@ -64,6 +64,20 @@
- StealCondition - StealCondition
- type: DieCondition - type: DieCondition
- type: entity
noSpawn: true
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
# kill # kill
- type: entity - type: entity