Files
wwdpublic/Content.Server/Speech/AccentSystem.cs
GNUtopia 31457e3f85 Chem Tweaks (#2293)
Makes an assortment of changes related to chems.
Morphine has been made more accessible at roundstart, adding a pain pen
to the prefilled advanced medical belt and swapping a pain pen for a
morphine bottle in the prefilled syringe case. Morphine also now blocks
pain for longer, hopefully alleviating an issue where the effect would
wear off during heart transplants. Also fixes an error which required
the patient to have *both* ForcedSleep and NoScream to block the surgery
pain moodlet. Additionally adds a morphine autoinjector cartridge.
Adds enunciase, which removes stuttering statuses and temporarily
disables all accents, and formic acid, which can react to make water or
enunciase.
Haloperidol also now removes less severe stuttering and ousiana dust now
removes psionic insulation and power blocking statuses.
Salicylic acid now works on corpses to reflect the description.
Additionally fixes a missing locale from the Goob chem port and tweaks
the text for the proto medical multitool.

---

<details><summary><h1>Media</h1></summary>
<p>

![formic
acid](https://github.com/user-attachments/assets/7344bfec-4bb0-4b6c-9182-0b3ca2bce111)

![enunciase](https://github.com/user-attachments/assets/46ded0e3-39ea-4943-bcd8-d1721de81052)

![haloperidol](https://github.com/user-attachments/assets/04d67bc9-ce7b-49b8-82b5-fbc9ee5b83b1)
![ousiana
dust](https://github.com/user-attachments/assets/5cb1a0b4-5591-492d-88ce-9717b6606cbb)

![morphine](https://github.com/user-attachments/assets/78893dc4-805d-4adf-8804-1db5aeb9020f)
![updated stamina change
text](https://github.com/user-attachments/assets/acba97d3-35a8-4b52-a04f-f76aeea4e183)
![tweaked appearances for morphine and
artiplates](https://github.com/user-attachments/assets/09864b45-25af-4dda-b61b-91fbe114d5dc)
(dylovene to the left for comparison)
![enunciase being
used](https://github.com/user-attachments/assets/99f1fdac-9c9c-4746-9994-9b31a2eaede9)
![formic acid reacting with sulfuric
acid](https://github.com/user-attachments/assets/f530fdf6-be8f-4add-aa9b-4e606f572907)
![morphine ACTUALLY blocking the moodlet this
time](https://github.com/user-attachments/assets/919c70f0-8ab0-4ffa-be70-da7114194322)

</p>

</details>

---

🆑
- add: Added formic acid
- add: Added enunciase
- add: Added morphine autoinjector cartridge
- tweak: Haloperidol now counteracts stuttering from chems
- tweak: Ousiana dust now counteracts psionic insulation/blocking
statuses
- tweak: Morphine blocks pain for longer
- tweak: Morphine and artiplates are more visually distinct
- tweak: Increased distribution of morphine roundstart
- tweak: Changed wording of stamina change effect
- tweak: Salicylic acid works on corpses
- fix: Fixed missing locale text for some stamina-affecting chems
- fix: Fixed guidebook falsely saying effects accumulate
- fix: Fixed capitalisation of proto medical multitool
- fix: Fixed morphine not blocking surgery pain moodlet

---------

Signed-off-by: GNUtopia <93669372+GNUtopia@users.noreply.github.com>

      - CartridgePain # Morphine Tweaks#
2025-07-20 13:09:28 +10:00

49 lines
1.4 KiB
C#

using System.Text.RegularExpressions;
using Content.Server.Chat;
using Content.Server.Chat.Systems;
using Content.Server.Speech.Components;
namespace Content.Server.Speech
{
public sealed class AccentSystem : EntitySystem
{
public static readonly Regex SentenceRegex = new(@"(?<=[\.!\?])", RegexOptions.Compiled);
public override void Initialize()
{
SubscribeLocalEvent<TransformSpeechEvent>(AccentHandler);
}
private void AccentHandler(TransformSpeechEvent args)
{
var accentEvent = new AccentGetEvent(args.Sender, args.Message);
if (!HasComp<DisableAccentComponent>(args.Sender))
{
RaiseLocalEvent(args.Sender, accentEvent, true);
args.Message = accentEvent.Message;
}
}
}
public sealed class AccentGetEvent : EntityEventArgs
{
/// <summary>
/// The entity to apply the accent to.
/// </summary>
public EntityUid Entity { get; }
/// <summary>
/// The message to apply the accent transformation to.
/// Modify this to apply the accent.
/// </summary>
public string Message { get; set; }
public AccentGetEvent(EntityUid entity, string message)
{
Entity = entity;
Message = message;
}
}
}