forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into upstream-merge-68
- Loading branch information
Showing
88 changed files
with
2,400 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
|
||
using Content.Server.SS220.Surgery.Systems; | ||
|
||
namespace Content.Client.SS220.Surgery; | ||
|
||
public sealed partial class SurgerySystem : SharedSurgerySystem | ||
{ | ||
// exist only in to make prediction | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
Content.Server/SS220/MindSlave/Components/MindSlaveDisfunctionComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
|
||
using Content.Shared.Damage; | ||
|
||
namespace Content.Server.SS220.MindSlave.Components; | ||
|
||
[RegisterComponent] | ||
public sealed partial class MindSlaveDisfunctionComponent : Component | ||
{ | ||
|
||
[ViewVariables] | ||
public Dictionary<MindSlaveDisfunctionType, List<string>> Disfunction => DisfunctionParameters.Disfunction; | ||
|
||
[ViewVariables] | ||
public DamageSpecifier DeadlyStageDamage => DisfunctionParameters.DeadlyStageDamage; | ||
|
||
[DataField(required: true)] | ||
public DisfunctionParameters DisfunctionParameters = new(); | ||
|
||
[ViewVariables(VVAccess.ReadOnly)] | ||
public List<IComponent> DisfunctionComponents = new(); | ||
|
||
[ViewVariables(VVAccess.ReadWrite)] | ||
public MindSlaveDisfunctionType DisfunctionStage = MindSlaveDisfunctionType.None; | ||
|
||
[ViewVariables(VVAccess.ReadWrite)] | ||
public bool Active = true; | ||
|
||
[ViewVariables(VVAccess.ReadWrite)] | ||
public bool Deadly = false; | ||
|
||
[ViewVariables(VVAccess.ReadWrite)] | ||
public bool Weakened = false; | ||
|
||
[ViewVariables(VVAccess.ReadWrite)] | ||
public TimeSpan NextProgressTime; | ||
|
||
[ViewVariables(VVAccess.ReadWrite)] | ||
public TimeSpan NextDeadlyDamageTime; | ||
|
||
[ViewVariables(VVAccess.ReadWrite)] | ||
public TimeSpan PausedTime; | ||
|
||
[ViewVariables(VVAccess.ReadWrite)] | ||
public float ConstMinutesBetweenStages = 35; | ||
|
||
[ViewVariables(VVAccess.ReadWrite)] | ||
public float MaxRandomMinutesBetweenStages = 7; | ||
|
||
} | ||
|
||
public enum MindSlaveDisfunctionType | ||
{ | ||
None = 0, | ||
Initial, | ||
Progressive, | ||
Terminal, | ||
Deadly | ||
} |
25 changes: 25 additions & 0 deletions
25
Content.Server/SS220/MindSlave/Components/MindSlaveDisfunctionProviderComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
|
||
using Content.Shared.Damage; | ||
|
||
namespace Content.Server.SS220.MindSlave.Components; | ||
|
||
[RegisterComponent] | ||
public sealed partial class MindSlaveDisfunctionProviderComponent : Component | ||
{ | ||
[DataField(required: true)] | ||
public DisfunctionParameters Disfunction = new(); | ||
} | ||
|
||
[DataDefinition] | ||
public sealed partial class DisfunctionParameters | ||
{ | ||
[DataField(required: true)] | ||
public Dictionary<MindSlaveDisfunctionType, List<string>> Disfunction = new(); | ||
|
||
[DataField(required: true)] | ||
public DamageSpecifier DeadlyStageDamage = new(); | ||
|
||
[DataField(required: true)] | ||
public string ProgressionPopup; | ||
} |
23 changes: 23 additions & 0 deletions
23
Content.Server/SS220/MindSlave/Components/MindSlaveStopWordContainerComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
|
||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.SS220.MindSlave.Components; | ||
|
||
[RegisterComponent] | ||
public sealed partial class MindSlaveStopWordContainerComponent : Component | ||
{ | ||
// to pass tests add values | ||
[DataField] | ||
public string Collection = "nanotrasen_central_command"; | ||
[DataField] | ||
public string Group = "roundstart"; | ||
[DataField] | ||
public string Form = "hos_mindslave_briefing"; | ||
|
||
/// <summary> | ||
/// This stamp will be applied to list | ||
/// </summary> | ||
[DataField] | ||
public List<EntProtoId> StampList = new(); | ||
} |
10 changes: 10 additions & 0 deletions
10
Content.Server/SS220/MindSlave/DisfunctionComponents/MindSlaveDisfunctionAccentComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
|
||
namespace Content.Server.SS220.MindSlave.DisfunctionComponents; | ||
|
||
[RegisterComponent] | ||
public sealed partial class MindSlaveDisfunctionAccentComponent : Component | ||
{ | ||
[DataField] | ||
public float Prob = 0.33f; | ||
} |
7 changes: 7 additions & 0 deletions
7
Content.Server/SS220/MindSlave/DisfunctionComponents/WieldUnabilityComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
|
||
namespace Content.Server.SS220.MindSlave.DisfunctionComponents; | ||
|
||
[RegisterComponent] | ||
public sealed partial class WieldUnabilityComponent : Component | ||
{ } |
43 changes: 43 additions & 0 deletions
43
Content.Server/SS220/MindSlave/DisfunctionSystems/MindSlaveDisfunctionAccentSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
|
||
using Content.Server.Speech; | ||
using Robust.Shared.Random; | ||
|
||
namespace Content.Server.SS220.MindSlave.DisfunctionComponents; | ||
|
||
public sealed class MindSlaveDisfunctionAccentSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IRobustRandom _random = default!; | ||
|
||
private readonly List<string> _vowels = ["а", "е", "у", "о", "и", "я"]; | ||
private readonly List<string> _consonants = ["в", "п", "р", "к", "м", "т", "с"]; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<MindSlaveDisfunctionAccentComponent, AccentGetEvent>(OnAccent); | ||
} | ||
|
||
private void OnAccent(Entity<MindSlaveDisfunctionAccentComponent> entity, ref AccentGetEvent args) | ||
{ | ||
var message = args.Message; | ||
var vowel = _random.Pick(_vowels); | ||
var consonant = _random.Pick(_consonants); | ||
args.Message = TryChangeInString(TryChangeInString(message, vowel, consonant, entity.Comp.Prob), | ||
consonant, vowel, entity.Comp.Prob); | ||
} | ||
|
||
private string TryChangeInString(string value, string key, string keyAddition, float prob) | ||
{ | ||
var result = value; | ||
var index = value.IndexOf(key); | ||
if (index != -1) | ||
{ | ||
if (_random.Prob(prob)) | ||
{ | ||
result = value.Replace(key, key + keyAddition + key); | ||
} | ||
} | ||
return result; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
Content.Server/SS220/MindSlave/DisfunctionSystems/WieldUnabilitySystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
|
||
using Content.Server.Popups; | ||
using Content.Server.SS220.MindSlave.DisfunctionComponents; | ||
using Content.Shared.Wieldable; | ||
|
||
namespace Content.Server.SS220.MindSlave.DisfunctionSystem; | ||
|
||
public sealed class WieldUnabilitySystem : EntitySystem | ||
{ | ||
[Dependency] private readonly PopupSystem _popup = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<WieldUnabilityComponent, BeforeWieldEvent>(OnWieldAttempt); | ||
} | ||
|
||
private void OnWieldAttempt(Entity<WieldUnabilityComponent> entity, ref BeforeWieldEvent args) | ||
{ | ||
if (args.Cancelled) | ||
return; | ||
|
||
_popup.PopupCursor(Loc.GetString("unable-to-wield", ("user", entity.Owner)), entity); | ||
args.Cancel(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt | ||
|
||
/// <summary> | ||
/// Event raised right after Mindslave component added to Entity on slave entity | ||
/// </summary> | ||
public sealed class AfterEntityMindSlavedEvent(EntityUid master, EntityUid slave) : EventArgs | ||
{ | ||
public EntityUid Master { get; } = master; | ||
public EntityUid Slave { get; } = slave; | ||
} | ||
|
||
/// <summary> | ||
/// Event raised right after Mindslave component added to Entity om master entity | ||
/// </summary> | ||
public sealed class AfterEntityMindSlavedMasterEvent(EntityUid master, EntityUid slave) : EventArgs | ||
{ | ||
public EntityUid Master { get; } = master; | ||
public EntityUid Slave { get; } = slave; | ||
} | ||
|
||
public sealed class StopWordGeneratedEvent(string stopWord) : EventArgs | ||
{ | ||
public string StopWord { get; } = stopWord; | ||
} |
Oops, something went wrong.