mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
## Mirror of PR #26340: [Make parrots talk like parrots](https://github.com/space-wizards/space-station-14/pull/26340) from <img src="https://avatars.githubusercontent.com/u/10567778?v=4" alt="space-wizards" width="22"/> [space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14) ###### `cd4eda44b88a75d7498efca42c464dd4c73c5684` PR opened by <img src="https://avatars.githubusercontent.com/u/85356?v=4" width="16"/><a href="https://github.com/Tayrtahn"> Tayrtahn</a> at 2024-03-22 17:22:18 UTC --- PR changed 8 files with 168 additions and 0 deletions. The PR had the following labels: --- <details open="true"><summary><h1>Original Body</h1></summary> > <!-- Please read these guidelines before opening your PR: https://docs.spacestation14.io/en/getting-started/pr-guideline --> > <!-- The text between the arrows are comments - they will not be visible on your PR. --> > > ## About the PR > <!-- What did you change in this PR? --> > In the rare cases that parrot become controlled by players, they now sound a bit more parrot-y. > > - Added the parrot squawk sound as a speech sound, so they no longer speak silently. > - Gave parrots a speech verb set, so they "squawk", "tweet", and "chirp" their messages, instead of just "say"-ing them. > - Parrots can "scream" now (which just plays the squawk sound). > - Parrots have their own accent that gets applied to everything they say! It adds some random squawks to the beginnings and ends of messages. Sometimes they repeat the longest word in a message. RAAWK! Sometimes! > > ## Why / Balance > <!-- Why was it changed? Link any discussions or issues here. Please discuss how this would affect game balance. --> > There are a lot of animals, but very little that sets them apart from each other. This makes parrots a little more interesting (though there's plenty more to be done). > > And no, I've never seen a player-controlled parrot in the game either. But it could happen! And when it does, now it'll be cooler. > > ## Technical details > <!-- If this is a code change, summarize at high level how your new code works. This makes it easier to review. --> > Added a few components to the parrot entity prototype, and made EmoteSounds, SpeechSounds, and SpeechVerb for parrots. > > Added ParrotAccentComponent/System, which handle the accent. > > ## Media > <!-- > PRs which make ingame changes (adding clothing, items, new features, etc) are required to have media attached that showcase the changes. > Small fixes/refactors are exempt. > Any media may be used in SS14 progress reports, with clear credit given. > > If you're unsure whether your PR will require media, ask a maintainer. > > Check the box below to confirm that you have in fact seen this (put an X in the brackets, like [X]): > --> > > https://github.com/space-wizards/space-station-14/assets/85356/a863f384-8244-4d03-b9bb-2c0394b44488 > > Sorry for the lack of audio; blame Apple. There are squawking noises whenever the parrot chats or screams. > - [X] I have added screenshots/videos to this PR showcasing its changes ingame, **or** this PR does not require an ingame showcase > > ## Breaking changes > <!-- > List any breaking changes, including namespace, public class/method/field changes, prototype renames; and provide instructions for fixing them. This will be pasted in #codebase-changes. > --> > > **Changelog** > <!-- > Make players aware of new features and changes that could affect how they play the game by adding a Changelog entry. Please read the Changelog guidelines located at: https://docs.spacestation14.io/en/getting-started/pr-guideline#changelog > --> > > <!-- > Make sure to take this Changelog template out of the comment block in order for it to show up. > 🆑 > - add: Added fun! > - remove: Removed fun! > - tweak: Changed fun! > - fix: Fixed fun! > --> > 🆑 > - add: Parrots now sound more like parrots when they talk. RAWWK! </details> Co-authored-by: SimpleStation14 <Unknown>
48 lines
1.5 KiB
C#
48 lines
1.5 KiB
C#
namespace Content.Server.Speech.Components;
|
|
|
|
/// <summary>
|
|
/// Makes this entity speak like a parrot in all chat messages it sends.
|
|
/// </summary>
|
|
[RegisterComponent]
|
|
public sealed partial class ParrotAccentComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// Chance that a message will have a squawk sound added before the first character.
|
|
/// If it fails, the message with have a squawk as a postfix instead.
|
|
/// If the longest word is repeated, no pre- or postfix will be added.
|
|
/// </summary>
|
|
[DataField]
|
|
public float SquawkPrefixChance = 0.5f;
|
|
|
|
/// <summary>
|
|
/// Chance that the longest word in the message will be repeated as an
|
|
/// exclamation at the end of the final message.
|
|
/// </summary>
|
|
[DataField]
|
|
public float LongestWordRepeatChance = 0.5f;
|
|
|
|
/// <summary>
|
|
/// The longest word must be at least this many characters long to be
|
|
/// repeated. This prevents repeating short words, which can sound weird.
|
|
/// ex: "How are you? AWWK! How!" - bad
|
|
/// ex: "Look out, it's the captain! RAWWK! Captain!" - good
|
|
/// </summary>
|
|
[DataField]
|
|
public float LongestWordMinLength = 5;
|
|
|
|
/// <summary>
|
|
/// Strings to use as squawking noises.
|
|
/// </summary>
|
|
public readonly string[] Squawks = [
|
|
"accent-parrot-squawk-1",
|
|
"accent-parrot-squawk-2",
|
|
"accent-parrot-squawk-3",
|
|
"accent-parrot-squawk-4",
|
|
"accent-parrot-squawk-5",
|
|
"accent-parrot-squawk-6",
|
|
"accent-parrot-squawk-7",
|
|
"accent-parrot-squawk-8"
|
|
];
|
|
|
|
}
|