Skip to content

Commit 9661813

Browse files
authored
Merge branch 'DeltaV-Station:master' into Pebble-Faxes
2 parents 694d8f1 + 3e33391 commit 9661813

24 files changed

Lines changed: 639 additions & 24 deletions

File tree

.wiki/_DV/Laws/AlertProcedure.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,4 +289,33 @@ Emergency alert status. ''Central Command has ordered the Epsilon security level
289289
| style="border: 1px solid #000000;" | Martial Law is in effect. Do not engage with Central Command Personnel. Await orders from Central Command Personnel.
290290
|}
291291

292+
== <span style="color:#ff8119;>Orange Alert</span> ==
293+
Emergency alert status. ''There is a critical station-wide structural or atmospheric threat and recovery is unlikely. Engineering staff are advised to minimize hazards and secure the Evacuation Dock. Crewmembers are advised to stay away from hazardous areas, and prepare for Evacuation.''
294+
295+
{| class="wikitable" style="width: 80%; border: 1px solid #000000;"
296+
!style="text-align:left; width:25%; padding:5px; padding-left:10px; background-color:#FF8119BF; border: 1px solid #000000;" | '''Condition'''
297+
!style="text-align:left; width:75%; padding:5px; padding-left:10px; background-color:#FF8119BF; border: 1px solid #000000;" | '''Description'''
298+
|-
299+
| style="border: 1px solid #000000;" | Chain of Command
300+
| style="border: 1px solid #000000;" | [[Standard_Operating_Procedure#Captain’s_Authority|CO]] > [[Chief Engineer]] > Engineering Personnel > Department Heads > Supervisory Roles
301+
|-
302+
| style="border: 1px solid #000000;" | Armoury Policy
303+
| style="border: 1px solid #000000;" | Issuing of lethal weapons disadvised. EVA protection heavily advised for all personnel.
304+
|-
305+
| style="border: 1px solid #000000;" | Discipline
306+
| style="border: 1px solid #000000;" | Report to supervisor for orders. Non-engineering personnel advised to evacuate affected areas. Security should seek to aid engineering staff where possible.
307+
|-
308+
| style="border: 1px solid #000000;" | Secure Areas
309+
| style="border: 1px solid #000000;" | Secure areas unbolted. [[Standard_Operating_Procedure#High_Security_Areas|HSAs]] and areas with an expectation of privacy, such as bedrooms, dorms, or medical treatment facilities, may be bolted as needed.
310+
|-
311+
| style="border: 1px solid #000000;" | Medical
312+
| style="border: 1px solid #000000;" | Full suit sensors heavily advised. EVA suits and functioning internals recommended for emergency responders.
313+
|-
314+
| style="border: 1px solid #000000;" | Engineering
315+
| style="border: 1px solid #000000;" | EVA suits heavily advised for engineers. Distribute emergency internals to crew. Ensure evacuation as soon as possible.
316+
|-
317+
| style="border: 1px solid #000000;" | Rules of Engagement
318+
| style="border: 1px solid #000000;" | Engage with minimal force required; prioritize de-escalation whenever possible.
319+
|}
320+
292321
{{Guides Menu}}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using Content.Shared._DV.Body.Components;
2+
using Content.Shared.Clothing.Components;
3+
using Content.Shared.Clothing.EntitySystems;
4+
using Robust.Client.GameObjects;
5+
6+
namespace Content.Client._DV.Body;
7+
8+
/// <summary>
9+
/// Colors feathers.
10+
/// </summary>
11+
public sealed class FeatherVisualizer : VisualizerSystem<FeatherComponent>
12+
{
13+
[Dependency] private readonly ClothingSystem _clothing = default!;
14+
15+
protected override void OnAppearanceChange(EntityUid uid, FeatherComponent component, ref AppearanceChangeEvent args)
16+
{
17+
if (!AppearanceSystem.TryGetData<Color>(uid, FeatherVisuals.BloodColor, out var bloodColor, args.Component) ||
18+
!AppearanceSystem.TryGetData<Color>(uid, FeatherVisuals.FeatherColor, out var featherColor, args.Component))
19+
{
20+
return;
21+
}
22+
23+
SpriteSystem.LayerSetColor(uid, FeatherVisualLayers.Feather, featherColor);
24+
SpriteSystem.LayerSetColor(uid, FeatherVisualLayers.Blood, bloodColor);
25+
26+
if (TryComp<ClothingComponent>(uid, out var clothing))
27+
{
28+
foreach (var slotPair in clothing.ClothingVisuals)
29+
{
30+
_clothing.SetLayerColor(clothing, slotPair.Key, "feather", featherColor);
31+
}
32+
}
33+
}
34+
}
35+
36+
public enum FeatherVisualLayers : byte
37+
{
38+
Feather,
39+
Blood,
40+
}

Content.Shared/Random/Helpers/SharedRandomExtensions.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Content.Shared.Dataset;
44
using Content.Shared.FixedPoint;
55
using Robust.Shared.Random;
6+
using Robust.Shared.Timing;
67

78
namespace Content.Shared.Random.Helpers
89
{
@@ -210,5 +211,34 @@ public static int HashCodeCombine(IReadOnlyCollection<int> values)
210211
}
211212
return hash;
212213
}
214+
215+
// TODO: REPLACE ALL OF THIS WITH PREDICTED RANDOM WHEN ENGINE PR IS MERGED
216+
/// <summary>
217+
/// Creates an instance of System.Random that will be the same for both the server and client.
218+
/// This allows for the client and server to roll the same results when determining things randomly, preventing mispredictions.
219+
/// We generate a unique seed by getting 2-3 unique but predictable integers into a Hashcode.
220+
/// </summary>
221+
/// <param name="timing">An instance if IGameTiming.
222+
/// We use the integer value of the current tick to ensure a different seed every tick.</param>
223+
/// <param name="netEnt">The relevant net entity to our seed.
224+
/// This allows different entities to have different seeds and therefore different results on the same game-tick.</param>
225+
/// <param name="netEnt2">An optional relevant net entity to our seed.
226+
/// Typically used if we have an entity checking random potentially multiple times per tick, to ensure we get a unique seed each time.
227+
/// This entity should not be the same entity as <see cref="netEnt"/>.</param>
228+
public static System.Random PredictedRandom(IGameTiming timing, NetEntity netEnt, NetEntity? netEnt2 = null)
229+
{
230+
var seed = HashCodeCombine((int)timing.CurTick.Value, netEnt.Id, netEnt2?.Id ?? 0);
231+
return new System.Random(seed);
232+
}
233+
234+
/// <summary>
235+
/// Checks a probability against a <see cref="PredictedRandom"/> instance.
236+
/// Returns true if the amount rolled is below the probability.
237+
/// </summary>
238+
public static bool PredictedProb(IGameTiming timing, float probability, NetEntity netEnt1, NetEntity? netEnt2 = null)
239+
{
240+
var rand = PredictedRandom(timing, netEnt1, netEnt2);
241+
return rand.Prob(probability);
242+
}
213243
}
214244
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Robust.Shared.GameStates;
2+
using Robust.Shared.Serialization;
3+
4+
namespace Content.Shared._DV.Body.Components;
5+
6+
/// <summary>
7+
/// Marks this entity as a feather, that probably has a custom color
8+
/// </summary>
9+
[RegisterComponent, NetworkedComponent]
10+
public sealed partial class FeatherComponent : Component;
11+
12+
/// <summary>
13+
/// Visual data for feathers
14+
/// </summary>
15+
[Serializable, NetSerializable]
16+
public enum FeatherVisuals : byte
17+
{
18+
FeatherColor,
19+
BloodColor,
20+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
using Content.Shared.Chat.Prototypes;
2+
using Content.Shared.Damage;
3+
using Content.Shared.Damage.Prototypes;
4+
using Content.Shared.FixedPoint;
5+
using Robust.Shared.GameStates;
6+
using Robust.Shared.Prototypes;
7+
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
8+
9+
namespace Content.Shared._DV.Body.Components;
10+
11+
/// <summary>
12+
/// This is used for Avali feather preening functionality.
13+
/// </summary>
14+
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
15+
public sealed partial class PreenableComponent : Component
16+
{
17+
[DataField]
18+
public EntProtoId FeatherPrototype;
19+
20+
[DataField]
21+
public HashSet<ProtoId<DamageGroupPrototype>>? ValidDamageGroups = new()
22+
{
23+
"Brute",
24+
};
25+
26+
[DataField]
27+
public LocId SelfPreeningMessage = "preening-popup-self";
28+
29+
[DataField]
30+
public LocId GettingPreenedMessage = "preening-popup-self-recipient";
31+
32+
[DataField]
33+
public LocId PreeningOtherMessage = "preening-popup-other";
34+
35+
[DataField]
36+
public LocId FeatherBloodiedNameString = "feather-bloody-name-modifier";
37+
38+
[DataField]
39+
public LocId FeatherBloodiedDescString = "feather-bloody-desc";
40+
41+
[DataField]
42+
public LocId PreeningVerbString = "preening-action-verb";
43+
44+
[DataField]
45+
public LocId DroppedFeatherString = "preening-feather-dropped-injured";
46+
47+
[DataField]
48+
public ProtoId<EmotePrototype> ScreamEmote = "Scream";
49+
50+
/// <summary>
51+
/// The minimum amount of damage that must be taken from one attack to have a chance to shed a feather.
52+
/// </summary>
53+
[DataField]
54+
public FixedPoint2 ShedDamageThreshold = 9;
55+
56+
/// <summary>
57+
/// The chance for a feather to be shed on hit, per point of damage taken.
58+
/// </summary>
59+
[DataField]
60+
public float ShedScalingChance = 0.0125f;
61+
62+
[DataField]
63+
public DamageModifierSet? VulnerabilityModifier;
64+
65+
[DataField, AutoNetworkedField]
66+
public int MaximumFeathers = 3;
67+
68+
[DataField, AutoNetworkedField]
69+
public int CurrentFeathers;
70+
71+
[DataField]
72+
public TimeSpan ReplenishDelay = TimeSpan.FromSeconds(150);
73+
74+
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField, AutoPausedField]
75+
public TimeSpan? ReplenishTime;
76+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
using Content.Shared.DoAfter;
2+
using Robust.Shared.Serialization;
3+
4+
namespace Content.Shared._DV.Body.Events;
5+
6+
[Serializable, NetSerializable]
7+
public sealed partial class PreeningEvent : SimpleDoAfterEvent;

0 commit comments

Comments
 (0)