forked from wylab/wylab-station-14
6152a7b166
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>
52 lines
1.7 KiB
C#
52 lines
1.7 KiB
C#
using System.Diagnostics.CodeAnalysis;
|
|
using Content.Server.Objectives.Components;
|
|
using Content.Shared.Mind;
|
|
|
|
namespace Content.Server.Objectives.Systems;
|
|
|
|
public sealed class BloodBrotherSharedConditionSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly SharedMindSystem _mind = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
}
|
|
|
|
public bool CheckBaseConditions(EntityUid mindId, BloodBrotherSharedConditionComponent comp, MindComponent? mind = null)
|
|
{
|
|
if (!Resolve(mindId, ref mind))
|
|
return false;
|
|
|
|
if (comp.RequireBothAlive && _mind.IsCharacterDeadIc(mind))
|
|
return false;
|
|
|
|
if (comp.RequireBothAlive && comp.BrotherMind.HasValue)
|
|
{
|
|
if (!TryComp<MindComponent>(comp.BrotherMind.Value, out var brotherMind) ||
|
|
_mind.IsCharacterDeadIc(brotherMind))
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public bool TryGetSharedCondition(EntityUid objectiveUid, EntityUid mindId, [NotNullWhen(true)] out BloodBrotherSharedConditionComponent? sharedCondition)
|
|
{
|
|
sharedCondition = null;
|
|
return TryComp(objectiveUid, out sharedCondition);
|
|
}
|
|
|
|
public void CopySharedConditionData(EntityUid sourceObjective, EntityUid targetObjective, EntityUid mindId1, EntityUid mindId2)
|
|
{
|
|
if (TryComp<BloodBrotherSharedConditionComponent>(sourceObjective, out var sourceCondition)
|
|
&& TryComp<BloodBrotherSharedConditionComponent>(targetObjective, out var targetCondition))
|
|
{
|
|
targetCondition.BrotherMind = mindId1;
|
|
targetCondition.RequireBothAlive = sourceCondition.RequireBothAlive;
|
|
|
|
sourceCondition.BrotherMind = mindId2;
|
|
}
|
|
}
|
|
}
|