Files
wylab-station-14/Content.Server/_Wega/Objectives/Systems/BloodBrotherSharedKeepAliveConditionSystem.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

45 lines
1.5 KiB
C#

using Content.Server.Objectives.Components;
using Content.Shared.Mind;
using Content.Shared.Objectives.Components;
namespace Content.Server.Objectives.Systems;
public sealed class BloodBrotherSharedKeepAliveConditionSystem : EntitySystem
{
[Dependency] private readonly SharedMindSystem _mind = default!;
[Dependency] private readonly TargetObjectiveSystem _target = default!;
[Dependency] private readonly BloodBrotherSharedConditionSystem _sharedCondition = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<BloodBrotherSharedKeepAliveConditionComponent, ObjectiveGetProgressEvent>(OnGetProgress);
}
private void OnGetProgress(EntityUid uid, BloodBrotherSharedKeepAliveConditionComponent 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;
if (!_target.GetTarget(objectiveUid, out var target))
return 0f;
return CalculateProtectProgress(target.Value);
}
private float CalculateProtectProgress(EntityUid target)
{
if (!TryComp<MindComponent>(target, out var mind))
return 0f;
return _mind.IsCharacterDeadIc(mind) ? 0f : 1f;
}
}