Files
wylab-station-14/Content.Server/_Wega/Objectives/Systems/BloodBrotherSharedEscapeConditionSystem.cs
wylab 6152a7b166
Some checks failed
Build & Test Debug / build (ubuntu-latest) (push) Failing after 58s
Build & Test Debug / Build & Test Debug (push) Has been skipped
Publish / build (push) Failing after 2m36s
RGA schema validator / YAML RGA schema validator (push) Failing after 23s
RSI Validator / Validate RSIs (push) Successful in 28s
Map file schema validator / YAML map schema validator (push) Failing after 24s
Build & Test Map Renderer / Build & Test Debug (push) Has been cancelled
Build & Test Map Renderer / build (ubuntu-latest) (push) Has been cancelled
Test Packaging / Test Packaging (push) Has been cancelled
YAML Linter / YAML Linter (push) Has been cancelled
feat: add Blood Brothers antagonist from wega fork
Blood Brothers are paired antagonists who must work together with shared
objectives. Two players are bonded and must:
- Escape together (mandatory)
- Complete shared kill/steal/protect objectives
- Both survive to win

Includes:
- 16 C# files (rule system, objective systems, components)
- Game rule and sub-gamemode prototypes
- 29 objective entity prototypes
- Russian localization
- Guidebook documentation

Requirements: 50h playtime + 25h Security
Min players: 20, Max antags: 8 (4 pairs)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 00:32:45 +01:00

56 lines
2.1 KiB
C#

using Content.Server.Objectives.Components;
using Content.Server.Shuttles.Systems;
using Content.Shared.Cuffs.Components;
using Content.Shared.Mind;
using Content.Shared.Objectives.Components;
namespace Content.Server.Objectives.Systems;
public sealed class BloodBrotherSharedEscapeConditionSystem : EntitySystem
{
[Dependency] private readonly EmergencyShuttleSystem _emergencyShuttle = default!;
[Dependency] private readonly SharedMindSystem _mind = default!;
[Dependency] private readonly BloodBrotherSharedConditionSystem _sharedCondition = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<BloodBrotherSharedEscapeConditionComponent, ObjectiveGetProgressEvent>(OnGetProgress);
}
private void OnGetProgress(EntityUid uid, BloodBrotherSharedEscapeConditionComponent comp, ref ObjectiveGetProgressEvent args)
{
args.Progress = GetProgress(uid, args.MindId, args.Mind);
}
private float GetProgress(EntityUid objectiveUid, EntityUid mindId, MindComponent mind)
{
if (_sharedCondition.TryGetSharedCondition(objectiveUid, mindId, out var sharedCondition)
&& !_sharedCondition.CheckBaseConditions(mindId, sharedCondition, mind))
return 0f;
var currentEscape = CheckEscape(mindId, mind);
var brotherEscape = 0f;
if (sharedCondition?.BrotherMind != null &&
TryComp<MindComponent>(sharedCondition.BrotherMind.Value, out var brotherMind))
{
brotherEscape = CheckEscape(sharedCondition.BrotherMind.Value, brotherMind);
}
return Math.Min(currentEscape, brotherEscape);
}
private float CheckEscape(EntityUid mindId, MindComponent mind)
{
if (mind.OwnedEntity == null || _mind.IsCharacterDeadIc(mind))
return 0f;
if (TryComp<CuffableComponent>(mind.OwnedEntity, out var cuffed) && cuffed.CuffedHandCount > 0)
return _emergencyShuttle.IsTargetEscaping(mind.OwnedEntity.Value) ? 0.5f : 0f;
return _emergencyShuttle.IsTargetEscaping(mind.OwnedEntity.Value) ? 1f : 0f;
}
}