Skip to content

Commit

Permalink
Синдром туретта (SerbiaStrong-220#427)
Browse files Browse the repository at this point in the history
* А вы видели ту серию Южного Парка про синдром туретта?

Хорошая серия

* Непофикшенное пофикшено

* Update TouretteAccentSystem.cs

* Update TouretteAccentSystem.cs

* Update confusing.yml
  • Loading branch information
CthulhuFhtaghn authored Oct 15, 2023
1 parent 97a9b5b commit 6d112f7
Show file tree
Hide file tree
Showing 14 changed files with 234 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Content.Server/SS220/TouretteSyndrome/TouretteAccentComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// © 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.EntitySystems;
namespace Content.Server.Speech.Components;

[RegisterComponent]
[Access(typeof(TouretteAccentSystem))]
public sealed partial class TouretteAccentComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)] public float SwearChance;
protected internal List<string> TouretteWords;
}
61 changes: 61 additions & 0 deletions Content.Server/SS220/TouretteSyndrome/TouretteAccentSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
using Content.Server.Speech.Components;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using System.Diagnostics;
using System.Text.RegularExpressions;
using System.Linq;
using FastAccessors;

namespace Content.Server.Speech.EntitySystems;

// © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
public sealed class TouretteAccentSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly ReplacementAccentSystem _replacement = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<TouretteAccentComponent, AccentGetEvent>(OnAccentGet);
SubscribeLocalEvent<TouretteAccentComponent, ComponentStartup>(OnTouretteStartup);
}


private void OnTouretteStartup(EntityUid uid, TouretteAccentComponent component, ComponentStartup args)
{
component.SwearChance = _random.NextFloat(0f, 0.7f);

if (component.SwearChance >= 0.6f)
component.SwearChance = 0f;

var en = _proto.EnumeratePrototypes<TouretteCollectionPrototype>();
component.TouretteWords = en.ToArray()[_random.Next(0, en.Count() - 1)].Replics;
}

// converts left word when typed into the right word. For example typing you becomes ye.
private string Accentuate(string message, TouretteAccentComponent component)
{
var msg = message;

if (!_random.Prob(component.SwearChance))
return msg;

if (string.IsNullOrEmpty(msg))
return msg;

var pick = _random.Pick(component.TouretteWords);
msg = msg[0].ToString().ToLower() + msg.Remove(0, 1);
msg = Loc.GetString(pick) + ", " + msg;

return msg;
}

private void OnAccentGet(EntityUid uid, TouretteAccentComponent component, AccentGetEvent args)
{
args.Message = Accentuate(args.Message, component);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// © 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;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
using System.Collections.Generic;

namespace Robust.Shared.Audio;

[Prototype("touretteCollection")]
public sealed class TouretteCollectionPrototype : IPrototype
{
[ViewVariables, IdDataField] public string ID { get; private set; } = default!;
[DataField("replics")]
public List<string> Replics { get; private set; } = new();
}
49 changes: 49 additions & 0 deletions Resources/Locale/ru-RU/ss220/accent/TouretteAccent.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
accent-tourette-prefix-1-1 = Скуик
accent-tourette-prefix-1-2 = Пиип
accent-tourette-prefix-1-3 = Тц-тц
accent-tourette-prefix-1-4 = Мяу
accent-tourette-prefix-1-5 = Скуик скуик
accent-tourette-prefix-1-6 = Скуик-скуик
accent-tourette-prefix-2-1 = Эй
accent-tourette-prefix-2-2 = Пупупу
accent-tourette-prefix-2-3 = Да
accent-tourette-prefix-2-4 = Нет
accent-tourette-prefix-2-5 = А
accent-tourette-prefix-2-6 = Бе
accent-tourette-prefix-2-7 = Буэ
accent-tourette-prefix-2-8 = Брррр
accent-tourette-prefix-3-1 = Блять
accent-tourette-prefix-3-2 = Сука
accent-tourette-prefix-3-3 = Иду нахуй
accent-tourette-prefix-3-4 = Буэ
accent-tourette-prefix-3-5 = Срань
accent-tourette-prefix-3-6 = Нахуй
accent-tourette-prefix-3-7 = Хуй
accent-tourette-prefix-4-1 = Пошел ты
accent-tourette-prefix-4-2 = Чертила
accent-tourette-prefix-4-3 = Блять
accent-tourette-prefix-4-4 = Еблан
accent-tourette-prefix-4-5 = Блядь
accent-tourette-prefix-4-6 = Срань
accent-tourette-prefix-4-7 = Сука
accent-tourette-prefix-5-1 = Скуик
accent-tourette-prefix-5-2 = Мррр
accent-tourette-prefix-5-3 = Мур
accent-tourette-prefix-5-4 = Мяу
accent-tourette-prefix-5-5 = Пхихи
accent-tourette-prefix-5-6 = Скуик скуик
accent-tourette-prefix-5-7 = Хихик
accent-tourette-prefix-5-8 = Кхихи
accent-tourette-prefix-6-1 = Да
accent-tourette-prefix-6-2 = Нет
accent-tourette-prefix-6-3 = Хуй
accent-tourette-prefix-6-4 = Да-да
accent-tourette-prefix-6-5 = Нет-нет
accent-tourette-prefix-6-6 = Угу
accent-tourette-prefix-6-7 = Ага
accent-tourette-prefix-6-8 = Эй
2 changes: 2 additions & 0 deletions Resources/Locale/ru-RU/ss220/traits.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
trait-tourette-name = Синдром Туретта
trait-tourette-desc = Иногда вы непроизвольно издаете какие-то звуки или нецензурную брань. Иногда. И не факт, что вы будете именно ругаться.
1 change: 1 addition & 0 deletions Resources/PhotocopierForms/FormIndex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
- /PhotocopierForms/nanotrasen_station/medical/med_rcp.xml
- /PhotocopierForms/nanotrasen_station/medical/med_rep_death.xml
- /PhotocopierForms/nanotrasen_station/medical/med_rep_psych.xml
- /PhotocopierForms/nanotrasen_station/medical/med_rep_psych_tourette.xml
- /PhotocopierForms/nanotrasen_station/medical/med_sitrep.xml
- Id: engineering
Name: Инженерный отдел
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form>
<FormId>med_rep_psych_tourette</FormId>
<PrototypeId>PaperNtFormMed</PrototypeId>
<EntityName>форма НТ-МЕД-ТРТТ</EntityName>
<PhotocopierTitle>Справка о синдроме Туретта</PhotocopierTitle>
<Content><![CDATA[[bold]Форма НТ-МЕД-ТРТТ[/bold]
[head=2]Справка о синдроме Туретта[/head]
[italic]Дата: ДЕНЬ/МЕСЯЦ/ГОД[/italic]
[bold]Психолог:[/bold] (ПОЛНОЕ ИМЯ ПСИХОЛОГА)
[bold]Полное имя и должность пациента:[/bold]
[bold]Состояние синдрома:[/bold]
(Стадия развития, степень выраженности, навязчивость)
[bold]Проявляющиеся тики:[/bold]
(Описание тиков)
[italic]Место для печатей - Психолог[/italic]]]></Content>
</Form>
11 changes: 11 additions & 0 deletions Resources/Prototypes/SS220/TouretteCollection/aggressive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
- type: touretteCollection
id: aggressive
replics:
- accent-tourette-prefix-4-1
- accent-tourette-prefix-4-2
- accent-tourette-prefix-4-3
- accent-tourette-prefix-4-4
- accent-tourette-prefix-4-5
- accent-tourette-prefix-4-6
- accent-tourette-prefix-4-7
12 changes: 12 additions & 0 deletions Resources/Prototypes/SS220/TouretteCollection/confusing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
- type: touretteCollection
id: confusing
replics:
- accent-tourette-prefix-6-1
- accent-tourette-prefix-6-2
- accent-tourette-prefix-6-3
- accent-tourette-prefix-6-4
- accent-tourette-prefix-6-5
- accent-tourette-prefix-6-6
- accent-tourette-prefix-6-7
- accent-tourette-prefix-6-8
12 changes: 12 additions & 0 deletions Resources/Prototypes/SS220/TouretteCollection/cute.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
- type: touretteCollection
id: cute
replics:
- accent-tourette-prefix-5-1
- accent-tourette-prefix-5-2
- accent-tourette-prefix-5-3
- accent-tourette-prefix-5-4
- accent-tourette-prefix-5-5
- accent-tourette-prefix-5-6
- accent-tourette-prefix-5-7
- accent-tourette-prefix-5-8
12 changes: 12 additions & 0 deletions Resources/Prototypes/SS220/TouretteCollection/second.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
- type: touretteCollection
id: Second
replics:
- accent-tourette-prefix-2-1
- accent-tourette-prefix-2-2
- accent-tourette-prefix-2-3
- accent-tourette-prefix-2-4
- accent-tourette-prefix-2-5
- accent-tourette-prefix-2-6
- accent-tourette-prefix-2-7
- accent-tourette-prefix-2-8
10 changes: 10 additions & 0 deletions Resources/Prototypes/SS220/TouretteCollection/squeaks.yml
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
- type: touretteCollection
id: Squeaks
replics:
- accent-tourette-prefix-1-1
- accent-tourette-prefix-1-2
- accent-tourette-prefix-1-3
- accent-tourette-prefix-1-4
- accent-tourette-prefix-1-5
- accent-tourette-prefix-1-6
11 changes: 11 additions & 0 deletions Resources/Prototypes/SS220/TouretteCollection/swearing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# © SS220, An EULA/CLA with a hosting restriction, full text: https://raw.githubusercontent.com/SerbiaStrong-220/space-station-14/master/CLA.txt
- type: touretteCollection
id: Swearing
replics:
- accent-tourette-prefix-3-1
- accent-tourette-prefix-3-2
- accent-tourette-prefix-3-3
- accent-tourette-prefix-3-4
- accent-tourette-prefix-3-5
- accent-tourette-prefix-3-6
- accent-tourette-prefix-3-7
6 changes: 6 additions & 0 deletions Resources/Prototypes/SS220/tourette_trait.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- type: trait
id: TouretteSyndrome
name: trait-tourette-name
description: trait-tourette-desc
components:
- type: TouretteAccent

0 comments on commit 6d112f7

Please sign in to comment.