-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into cherrypick-shoot-over-bodies
- Loading branch information
Showing
80 changed files
with
1,934 additions
and
964 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
555 changes: 440 additions & 115 deletions
555
Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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,63 @@ | ||
namespace Content.Server.Speech.Components; | ||
|
||
/// <summary> | ||
/// Sends a random message from a list with a provided min/max time. | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class RandomBarkComponent : Component | ||
{ | ||
/// <summary> | ||
/// Should the message be sent to the chat log? | ||
/// </summary> | ||
[DataField] | ||
public bool ChatLog = false; | ||
|
||
/// <summary> | ||
/// Minimum time an animal will go without speaking | ||
/// </summary> | ||
[DataField] | ||
public int MinTime = 45; | ||
|
||
/// <summary> | ||
/// Maximum time an animal will go without speaking | ||
/// </summary> | ||
[DataField] | ||
public int MaxTime = 350; | ||
|
||
/// <summary> | ||
/// Accumulator for counting time since the last bark | ||
/// </summary> | ||
[DataField] | ||
public float BarkAccumulator = 8f; | ||
|
||
/// <summary> | ||
/// Multiplier applied to the random time. Good for changing the frequency without having to specify exact values | ||
/// </summary> | ||
[DataField] | ||
public float BarkMultiplier = 1f; | ||
|
||
/// <summary> | ||
/// List of things to be said. Filled with garbage to be modified by an accent, but can be specified in the .yml | ||
/// </summary> | ||
[DataField] | ||
public IReadOnlyList<string> Barks = new[] | ||
{ | ||
"Bark", | ||
"Boof", | ||
"Woofums", | ||
"Rawrl", | ||
"Eeeeeee", | ||
"Barkums", | ||
"Awooooooooooooooooooo awoo awoooo", | ||
"Grrrrrrrrrrrrrrrrrr", | ||
"Rarrwrarrwr", | ||
"Goddamn I love gold fish crackers", | ||
"Bork bork boof boof bork bork boof boof boof bork", | ||
"Bark", | ||
"Boof", | ||
"Woofums", | ||
"Rawrl", | ||
"Eeeeeee", | ||
"Barkums", | ||
}; | ||
} |
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,47 @@ | ||
using Content.Server.Chat.Systems; | ||
using Content.Shared.Mind.Components; | ||
using Robust.Shared.Random; | ||
using Content.Server.Speech.Components; | ||
|
||
namespace Content.Server.Speech.Systems; | ||
|
||
public sealed class RandomBarkSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IRobustRandom _random = default!; | ||
[Dependency] private readonly ChatSystem _chat = default!; | ||
[Dependency] private readonly EntityManager _entity = default!; | ||
|
||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<RandomBarkComponent, ComponentInit>(OnInit); | ||
} | ||
|
||
|
||
private void OnInit(EntityUid uid, RandomBarkComponent barker, ComponentInit args) | ||
{ | ||
barker.BarkAccumulator = _random.NextFloat(barker.MinTime, barker.MaxTime) * barker.BarkMultiplier; | ||
} | ||
|
||
public override void Update(float frameTime) | ||
{ | ||
base.Update(frameTime); | ||
|
||
var query = EntityQueryEnumerator<RandomBarkComponent>(); | ||
while (query.MoveNext(out var uid, out var barker)) | ||
{ | ||
barker.BarkAccumulator -= frameTime; | ||
if (barker.BarkAccumulator > 0) | ||
continue; | ||
|
||
barker.BarkAccumulator = _random.NextFloat(barker.MinTime, barker.MaxTime) * barker.BarkMultiplier; | ||
if (_entity.TryGetComponent<MindContainerComponent>(uid, out var actComp) && | ||
actComp.HasMind) | ||
continue; | ||
|
||
_chat.TrySendInGameICMessage(uid, _random.Pick(barker.Barks), InGameICChatType.Speak, barker.ChatLog ? ChatTransmitRange.Normal : ChatTransmitRange.HideChat); | ||
} | ||
} | ||
} |
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
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
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
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,27 @@ | ||
using Content.Shared.Throwing; | ||
using Content.Shared.Weapons.Ranged.Components; | ||
using Content.Shared.Weapons.Ranged.Systems; | ||
using Robust.Shared.Random; | ||
|
||
namespace Content.Server.Weapons.Ranged.Systems; | ||
|
||
public sealed class FireOnDropSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly SharedGunSystem _gun = default!; | ||
[Dependency] private readonly IRobustRandom _random = default!; | ||
|
||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<GunComponent, ThrowDoHitEvent>(HandleLand); | ||
} | ||
|
||
|
||
private void HandleLand(EntityUid uid, GunComponent component, ref ThrowDoHitEvent args) | ||
{ | ||
if (_random.Prob(component.FireOnDropChance)) | ||
_gun.AttemptShoot(uid, uid, component, Transform(uid).Coordinates.Offset(Transform(uid).LocalRotation.ToVec())); | ||
} | ||
} |
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
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
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
Oops, something went wrong.