Skip to content

Commit

Permalink
hopefully fully rename it
Browse files Browse the repository at this point in the history
  • Loading branch information
deltanedas committed Feb 13, 2024
1 parent 9c200c4 commit 392fdbc
Show file tree
Hide file tree
Showing 16 changed files with 86 additions and 74 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Content.Server.DeltaV.ParadoxAnomaly.Systems;
using Robust.Shared.Prototypes;

namespace Content.Server.DeltaV.ParadoxAnomaly.Components;

/// <summary>
/// Creates a random paradox anomaly and tranfers mind to it when taken by a player.
/// </summary>
[RegisterComponent, Access(typeof(ParadoxAnomalySystem))]
public sealed partial class ParadoxAnomalySpawnerComponent : Component
{
/// <summary>
/// Antag game rule to start for the paradox anomaly.
/// </summary>
[DataField]
public EntProtoId Rule = "ParadoxAnomaly";
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Server.DeltaV.EvilTwin.Components;
using Content.Server.DeltaV.ParadoxAnomaly.Components;
using Content.Server.DetailExaminable;
using Content.Server.GenericAntag;
using Content.Server.Psionics;
Expand All @@ -18,13 +18,13 @@
using Robust.Shared.Utility;
using System.Diagnostics.CodeAnalysis;

namespace Content.Server.DeltaV.EvilTwin.Systems;
namespace Content.Server.DeltaV.ParadoxAnomaly.Systems;

/// <summary>
/// 90% of the work is done by exterminator since its a reskin.
/// All the logic here is spawning since thats tricky.
/// </summary>
public sealed class EvilTwinSystem : EntitySystem
public sealed class ParadoxAnomalySystem : EntitySystem
{
[Dependency] private readonly GenericAntagSystem _genericAntag = default!;
[Dependency] private readonly IPrototypeManager _proto = default!;
Expand All @@ -42,22 +42,22 @@ public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<EvilTwinSpawnerComponent, PlayerAttachedEvent>(OnPlayerAttached);
SubscribeLocalEvent<ParadoxAnomalySpawnerComponent, PlayerAttachedEvent>(OnPlayerAttached);
}

private void OnPlayerAttached(Entity<EvilTwinSpawnerComponent> ent, ref PlayerAttachedEvent args)
private void OnPlayerAttached(Entity<ParadoxAnomalySpawnerComponent> ent, ref PlayerAttachedEvent args)
{
if (!_mind.TryGetMind(args.Player, out var mindId, out var mind))
return;

if (!TrySpawnEvilTwin(ent.Comp.Rule, out var twin))
if (!TrySpawnParadoxAnomaly(ent.Comp.Rule, out var twin))
return;

_mind.TransferTo(mindId, twin, ghostCheckOverride: true, mind: mind);
QueueDel(ent);
}

private bool TrySpawnEvilTwin(string rule, [NotNullWhen(true)] out EntityUid? twin)
private bool TrySpawnParadoxAnomaly(string rule, [NotNullWhen(true)] out EntityUid? twin)
{
twin = null;

Expand All @@ -83,11 +83,11 @@ private bool TrySpawnEvilTwin(string rule, [NotNullWhen(true)] out EntityUid? tw
candidates.Add((uid, mindId, species, profile));
}

twin = SpawnEvilTwin(candidates, rule);
twin = SpawnParadoxAnomaly(candidates, rule);
return twin != null;
}

private EntityUid? SpawnEvilTwin(List<(EntityUid, EntityUid, SpeciesPrototype, HumanoidCharacterProfile)> candidates, string rule)
private EntityUid? SpawnParadoxAnomaly(List<(EntityUid, EntityUid, SpeciesPrototype, HumanoidCharacterProfile)> candidates, string rule)
{
// Select a candidate.
if (candidates.Count == 0)
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/GenericAntag/GenericAntagSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void MakeAntag(EntityUid uid, EntityUid mindId, GenericAntagComponent? co
}

/// <summary>
/// DeltaV - used by evil twin
/// DeltaV - used by paradox anomaly
/// </summary>
public void MakeAntag(EntityUid uid, string rule)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void CloneAppearance(EntityUid source, EntityUid target, HumanoidAppearan
grammar.Gender = sourceHumanoid.Gender;
}

targetHumanoid.LastProfileLoaded = sourceHumanoid.LastProfileLoaded; // DeltaV - let evil twin be cloned
targetHumanoid.LastProfileLoaded = sourceHumanoid.LastProfileLoaded; // DeltaV - let paradox anomaly be cloned

Dirty(targetHumanoid);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public sealed partial class MidRoundAntagRuleComponent : Component
"SpawnPointGhostRatKing",
//"SpawnPointGhostVampSpider",
//"SpawnPointGhostFugitive",
"SpawnPointGhostEvilTwin"
"SpawnPointGhostParadoxAnomaly"
};
}
4 changes: 2 additions & 2 deletions Content.Server/Terminator/Systems/TerminatorSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public override void Initialize()
private void OnMapInit(EntityUid uid, TerminatorComponent comp, MapInitEvent args)
{
// cyborg doesn't need to breathe
//RemComp<RespiratorComponent>(uid); // DeltaV - evil twin does actually need to breathe
//RemComp<RespiratorComponent>(uid); // DeltaV - paradox anomaly does actually need to breathe
}

private void OnSpawned(EntityUid uid, TerminatorComponent comp, GhostRoleSpawnerUsedEvent args)
Expand All @@ -48,7 +48,7 @@ private void OnCreated(EntityUid uid, TerminatorComponent comp, ref GenericAntag
}

/// <summary>
/// DeltaV - used for evil twin.
/// DeltaV - used for paradox anomaly.
/// </summary>
public void SetTarget(Entity<TerminatorComponent?> ent, EntityUid mindId)
{
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Humanoid/HumanoidAppearanceComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public sealed partial class HumanoidAppearanceComponent : Component
public Color? CachedFacialHairColor;

/// <summary>
/// DeltaV - allows for evil twins to be cloned.
/// DeltaV - let paradox anomaly be cloned
/// </summary>
[ViewVariables]
public HumanoidCharacterProfile? LastProfileLoaded;
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public virtual void LoadProfile(EntityUid uid, HumanoidCharacterProfile profile,

humanoid.Age = profile.Age;

humanoid.LastProfileLoaded = profile; // DeltaV - let evil twin be cloned
humanoid.LastProfileLoaded = profile; // DeltaV - let paradox anomaly be cloned

Dirty(humanoid);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
objective-paradox-anomaly-friend-title = Keep your new friend {$targetName} alive
4 changes: 2 additions & 2 deletions Resources/Locale/en-US/prototypes/roles/antags.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ roles-antag-space-ninja-objective = Use your stealth to sabotage the station, no
roles-antag-thief-name = Thief
roles-antag-thief-objective = Add some NT property to your personal collection without using violence.
roles-antag-terminator-name = Paradox Anomaly # DeltaV - evil twin
roles-antag-terminator-objective = Replace your double, or befriend them. # DeltaV - evil twin
roles-antag-terminator-name = Paradox Anomaly # DeltaV - paradox anomaly
roles-antag-terminator-objective = Replace your double, or befriend them. # DeltaV - paradox anomaly
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@

- type: entity
parent: SpawnPointGhostTerminator # for terminator skull icon
id: SpawnPointGhostEvilTwin
name: evil twin spawn point
id: SpawnPointGhostParadoxAnomaly
name: paradox anomaly spawn point
components:
- type: GhostRole
name: ghost-role-information-evil-twin-name
description: ghost-role-information-evil-twin-description
rules: ghost-role-information-evil-twin-rules
- type: EvilTwinSpawner
name: ghost-role-information-paradox-anomaly-name
description: ghost-role-information-paradox-anomaly-description
rules: ghost-role-information-paradox-anomaly-rules
- type: ParadoxAnomalySpawner
9 changes: 5 additions & 4 deletions Resources/Prototypes/DeltaV/GameRules/midround.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
- type: entity
noSpawn: true
parent: BaseGameRule
id: EvilTwin
id: ParadoxAnomaly
components:
- type: GenericAntagRule
agentName: evil-twin-round-end-agent-name
agentName: paradox-anomaly-round-end-agent-name
objectives:
- EvilTwinKillObjective
- EvilTwinEscapeObjective
- ParadoxAnomalyKillObjective
- ParadoxAnomalyFriendObjective
- ParadoxAnomalyEscapeObjective
31 changes: 0 additions & 31 deletions Resources/Prototypes/DeltaV/Objectives/eviltwin.yml

This file was deleted.

38 changes: 38 additions & 0 deletions Resources/Prototypes/DeltaV/Objectives/paradox_anomaly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
- type: entity
abstract: true
parent: BaseTerminatorObjective # mrp terminator real
id: BaseParadoxAnomalyObjective
components:
- type: Objective
issuer: self

- type: entity
noSpawn: true
parent: [BaseParadoxAnomalyObjective, BaseKillObjective]
id: ParadoxAnomalyKillObjective
description: This universe doesn't have room for both of us.
components:
- type: TerminatorTargetOverride
- type: KillPersonCondition
requireDead: true

- type: entity
noSpawn: true
parent: [BaseParadoxAnomalyObjective, BaseKeepAliveObjective]
id: ParadoxAnomalyFriendObjective
description: Perhaps there is room, as friends.
components:
- type: TargetObjective
title: objective-condition-paradox-anomaly-friend-title
- type: TerminatorTargetOverride

- type: entity
noSpawn: true
parent: [BaseParadoxAnomalyObjective, BaseLivingObjective]
id: ParadoxAnomalyEscapeObjective
components:
- type: Objective
icon:
sprite: Structures/Furniture/chairs.rsi
state: shuttle
- type: EscapeShuttleCondition
2 changes: 1 addition & 1 deletion Resources/Prototypes/GameRules/events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
lightBreakChancePerSecond: 0.0003
doorToggleChancePerSecond: 0.001

# - type: entity # DeltaV - replaced terminator with evil twin
# - type: entity # DeltaV - replaced terminator with paradox anomaly in midroundantag rule
# parent: BaseGameRule
# id: TerminatorSpawn
# noSpawn: true
Expand Down

0 comments on commit 392fdbc

Please sign in to comment.