Ling fixes and tweaks (#259)
* - fix: Bees fix. * - fix: Transform transfers body type. * - fix: Chemcap is transfered on transform. * - fix: Gulag objective actual fix. * - fix: Fix escape with identity not working. * - tweak: Fixes & objective tweaks. * - tweak: More slowdown from ling armor.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Linq;
|
||||
using Content.Server._Miracle.Components;
|
||||
using Content.Server._Miracle.GulagSystem;
|
||||
using Content.Server.Changeling.Objectives.Components;
|
||||
using Content.Server.Forensics;
|
||||
using Content.Server.Mind;
|
||||
@@ -20,6 +21,7 @@ public sealed class ChangelingConditionsSystem : EntitySystem
|
||||
[Dependency] private readonly TargetObjectiveSystem _target = default!;
|
||||
[Dependency] private readonly MindSystem _mind = default!;
|
||||
[Dependency] private readonly EmergencyShuttleSystem _emergencyShuttle = default!;
|
||||
[Dependency] private readonly GulagSystem _gulag = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -185,14 +187,19 @@ public sealed class ChangelingConditionsSystem : EntitySystem
|
||||
return;
|
||||
|
||||
var allHumans = _mind.GetAliveHumansExcept(args.MindId);
|
||||
allHumans = allHumans.Where(x => !HasComp<GulagBoundComponent>(x)).ToList();
|
||||
allHumans = allHumans.Where(x => !_gulag.IsMindGulagged(x)).ToList();
|
||||
if (allHumans.Count == 0)
|
||||
{
|
||||
args.Cancelled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
_target.SetTarget(uid, _random.Pick(allHumans), target);
|
||||
var targetMindId = _random.Pick(allHumans);
|
||||
|
||||
if (TryComp(targetMindId, out MindComponent? mind) && TryComp(mind.CurrentEntity, out DnaComponent? dna))
|
||||
component.DNA = dna.DNA;
|
||||
|
||||
_target.SetTarget(uid, targetMindId, target);
|
||||
}
|
||||
|
||||
private void OnEscapeWithIdentityGetProgress(EntityUid uid, EscapeWithIdentityConditionComponent component, ref ObjectiveGetProgressEvent args)
|
||||
@@ -200,10 +207,15 @@ public sealed class ChangelingConditionsSystem : EntitySystem
|
||||
if (!_target.GetTarget(uid, out var target))
|
||||
return;
|
||||
|
||||
args.Progress = GetEscapeWithIdentityProgress(args.Mind, target.Value);
|
||||
var fallbackDNA = string.Empty;
|
||||
|
||||
if (TryComp(uid, out PickRandomIdentityComponent? pickIdentity))
|
||||
fallbackDNA = pickIdentity.DNA;
|
||||
|
||||
args.Progress = GetEscapeWithIdentityProgress(args.Mind, target.Value, fallbackDNA);
|
||||
}
|
||||
|
||||
private float GetEscapeWithIdentityProgress(MindComponent mind, EntityUid target)
|
||||
private float GetEscapeWithIdentityProgress(MindComponent mind, EntityUid target, string DNA)
|
||||
{
|
||||
var progress = 0f;
|
||||
|
||||
@@ -213,24 +225,21 @@ public sealed class ChangelingConditionsSystem : EntitySystem
|
||||
if (!TryComp<MindComponent>(target, out var targetMind))
|
||||
return 0f;
|
||||
|
||||
if (!TryComp<DnaComponent>(targetMind.CurrentEntity, out var targetDna))
|
||||
return 0f;
|
||||
if (TryComp<DnaComponent>(targetMind.CurrentEntity, out var targetDna))
|
||||
DNA = targetDna.DNA;
|
||||
|
||||
if (!TryComp<ChangelingComponent>(mind.CurrentEntity, out var changeling))
|
||||
return 0f;
|
||||
|
||||
if (!changeling.AbsorbedEntities.ContainsKey(targetDna.DNA))
|
||||
if (!changeling.AbsorbedEntities.ContainsKey(DNA))
|
||||
return 0f;
|
||||
|
||||
//Target absorbed by this changeling, so 50% of work is done
|
||||
progress += 0.5f;
|
||||
|
||||
if (_emergencyShuttle.IsTargetEscaping(mind.CurrentEntity.Value) && selfDna.DNA == targetDna.DNA)
|
||||
if (_emergencyShuttle.IsTargetEscaping(mind.CurrentEntity.Value) && selfDna.DNA == DNA)
|
||||
progress += 0.5f;
|
||||
|
||||
if (_emergencyShuttle.ShuttlesLeft)
|
||||
return progress;
|
||||
|
||||
return progress;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user