Dwarf minor content (#15082)
* alcohol & body stuff * vocal changes * accent * dumb
This commit is contained in:
9
Content.Server/Speech/Components/DwarfAccentComponent.cs
Normal file
9
Content.Server/Speech/Components/DwarfAccentComponent.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
namespace Content.Server.Speech.Components;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Used for replacing words for dwarves (pseudo-scottish)
|
||||||
|
/// </summary>
|
||||||
|
[RegisterComponent]
|
||||||
|
public sealed class DwarfAccentComponent : Component
|
||||||
|
{
|
||||||
|
}
|
||||||
83
Content.Server/Speech/EntitySystems/DwarfAccentSystem.cs
Normal file
83
Content.Server/Speech/EntitySystems/DwarfAccentSystem.cs
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Content.Server.Speech.Components;
|
||||||
|
|
||||||
|
namespace Content.Server.Speech.EntitySystems;
|
||||||
|
|
||||||
|
public sealed class DwarfAccentSystem : EntitySystem
|
||||||
|
{
|
||||||
|
// TODO:
|
||||||
|
// these are pretty bad to have as static dicts in systems, ideally these all get moved to prototypes
|
||||||
|
// these can honestly stay unlocalized in prototypes? -- most of these word-replacers make zero sense to localize into other languages
|
||||||
|
// since they're so english-specific
|
||||||
|
// all of the 'word-replacers' should also probably respect capitalization when transformed, so all caps -> all caps
|
||||||
|
// and first letter capitalized -> first letter capitalized, at the very least
|
||||||
|
|
||||||
|
// these specifically mostly come from examples of specific scottish-english (not necessarily scots) verbiage
|
||||||
|
// https://en.wikipedia.org/wiki/Scotticism
|
||||||
|
// https://en.wikipedia.org/wiki/Scottish_English
|
||||||
|
// https://www.cs.stir.ac.uk/~kjt/general/scots.html
|
||||||
|
private static readonly Dictionary<string, string> DirectReplacements = new()
|
||||||
|
{
|
||||||
|
{ "girl", "lassie" },
|
||||||
|
{ "boy", "laddie" },
|
||||||
|
{ "man", "lad" },
|
||||||
|
{ "woman", "lass" },
|
||||||
|
{ "do", "dae" },
|
||||||
|
{ "don't", "dinnae" },
|
||||||
|
{ "dont", "dinnae" },
|
||||||
|
{ "i'm", "A'm" },
|
||||||
|
{ "im", "am"},
|
||||||
|
{ "going", "gaun" },
|
||||||
|
{ "know", "ken"},
|
||||||
|
{ "i", "Ah" },
|
||||||
|
{ "you're", "ye're"},
|
||||||
|
{ "youre", "yere"},
|
||||||
|
{ "you", "ye" },
|
||||||
|
{ "i'll", "A'll" },
|
||||||
|
{ "ill", "all"},
|
||||||
|
{ "of", "ae" },
|
||||||
|
{ "was", "wis" },
|
||||||
|
{ "can't", "cannae" },
|
||||||
|
{ "cant", "cannae" },
|
||||||
|
{ "yourself", "yersel" },
|
||||||
|
{ "where", "whaur" },
|
||||||
|
{ "oh", "ach" },
|
||||||
|
{ "little", "wee" },
|
||||||
|
{ "small", "wee" },
|
||||||
|
{ "shit", "shite" },
|
||||||
|
{ "yeah", "aye" },
|
||||||
|
{ "yea", "aye"},
|
||||||
|
{ "yes", "aye" },
|
||||||
|
{ "too", "tae" },
|
||||||
|
{ "my", "ma" },
|
||||||
|
{ "not", "nae" },
|
||||||
|
{ "dad", "da" },
|
||||||
|
{ "mom", "maw" },
|
||||||
|
};
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
SubscribeLocalEvent<DwarfAccentComponent, AccentGetEvent>(OnAccentGet);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Accentuate(string message)
|
||||||
|
{
|
||||||
|
// this is just word replacements right now,
|
||||||
|
// but leaving it open to more intelligent phonotactic manipulations at some point which are probably possible
|
||||||
|
var msg = message;
|
||||||
|
|
||||||
|
foreach (var (first, replace) in DirectReplacements)
|
||||||
|
{
|
||||||
|
msg = Regex.Replace(msg, $@"(?<!\w){first}(?!\w)", replace, RegexOptions.IgnoreCase);
|
||||||
|
}
|
||||||
|
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnAccentGet(EntityUid uid, DwarfAccentComponent component, AccentGetEvent args)
|
||||||
|
{
|
||||||
|
args.Message = Accentuate(args.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
33
Resources/Prototypes/Body/Organs/dwarf.yml
Normal file
33
Resources/Prototypes/Body/Organs/dwarf.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
- type: entity
|
||||||
|
id: OrganDwarfHeart
|
||||||
|
parent: OrganHumanHeart
|
||||||
|
name: dwarf heart
|
||||||
|
components:
|
||||||
|
- type: Metabolizer
|
||||||
|
metabolizerTypes: [Dwarf]
|
||||||
|
|
||||||
|
- type: entity
|
||||||
|
id: OrganDwarfLiver
|
||||||
|
parent: OrganHumanLiver
|
||||||
|
name: dwarf liver
|
||||||
|
components:
|
||||||
|
- type: Metabolizer
|
||||||
|
metabolizerTypes: [Dwarf]
|
||||||
|
|
||||||
|
- type: entity
|
||||||
|
id: OrganDwarfStomach
|
||||||
|
parent: OrganHumanStomach
|
||||||
|
name: dwarf stomach
|
||||||
|
components:
|
||||||
|
- type: Sprite
|
||||||
|
state: stomach
|
||||||
|
- type: Organ
|
||||||
|
- type: SolutionContainerManager
|
||||||
|
solutions:
|
||||||
|
stomach:
|
||||||
|
maxVol: 75
|
||||||
|
- type: Stomach
|
||||||
|
- type: Metabolizer
|
||||||
|
# mm very yummy
|
||||||
|
maxReagents: 5
|
||||||
|
metabolizerTypes: [Dwarf]
|
||||||
49
Resources/Prototypes/Body/Prototypes/dwarf.yml
Normal file
49
Resources/Prototypes/Body/Prototypes/dwarf.yml
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
- type: body
|
||||||
|
id: Dwarf
|
||||||
|
name: "dwarf"
|
||||||
|
root: torso
|
||||||
|
slots:
|
||||||
|
head:
|
||||||
|
part: HeadHuman
|
||||||
|
connections:
|
||||||
|
- torso
|
||||||
|
organs:
|
||||||
|
brain: OrganHumanBrain
|
||||||
|
eyes: OrganHumanEyes
|
||||||
|
torso:
|
||||||
|
part: TorsoHuman
|
||||||
|
connections:
|
||||||
|
- left arm
|
||||||
|
- right arm
|
||||||
|
- left leg
|
||||||
|
- right leg
|
||||||
|
organs:
|
||||||
|
heart: OrganDwarfHeart
|
||||||
|
lungs: OrganHumanLungs
|
||||||
|
stomach: OrganDwarfStomach
|
||||||
|
liver: OrganDwarfLiver
|
||||||
|
kidneys: OrganHumanKidneys
|
||||||
|
right arm:
|
||||||
|
part: RightArmHuman
|
||||||
|
connections:
|
||||||
|
- right hand
|
||||||
|
left arm:
|
||||||
|
part: LeftArmHuman
|
||||||
|
connections:
|
||||||
|
- left hand
|
||||||
|
right hand:
|
||||||
|
part: RightHandHuman
|
||||||
|
left hand:
|
||||||
|
part: LeftHandHuman
|
||||||
|
right leg:
|
||||||
|
part: RightLegHuman
|
||||||
|
connections:
|
||||||
|
- right foot
|
||||||
|
left leg:
|
||||||
|
part: LeftLegHuman
|
||||||
|
connections:
|
||||||
|
- left foot
|
||||||
|
right foot:
|
||||||
|
part: RightFootHuman
|
||||||
|
left foot:
|
||||||
|
part: LeftFootHuman
|
||||||
@@ -21,3 +21,6 @@
|
|||||||
|
|
||||||
- type: metabolizerType
|
- type: metabolizerType
|
||||||
id: Plant
|
id: Plant
|
||||||
|
|
||||||
|
- type: metabolizerType
|
||||||
|
id: Dwarf
|
||||||
|
|||||||
@@ -23,8 +23,28 @@
|
|||||||
drawdepth: Mobs
|
drawdepth: Mobs
|
||||||
scale: 1, 0.8
|
scale: 1, 0.8
|
||||||
- type: Body
|
- type: Body
|
||||||
prototype: Human
|
prototype: Dwarf
|
||||||
requiredLegs: 2
|
requiredLegs: 2
|
||||||
|
- type: Fixtures
|
||||||
|
fixtures: # TODO: This needs a second fixture just for mob collisions.
|
||||||
|
- shape:
|
||||||
|
!type:PhysShapeCircle
|
||||||
|
radius: 0.35
|
||||||
|
# they r smaller
|
||||||
|
density: 120
|
||||||
|
restitution: 0.0
|
||||||
|
mask:
|
||||||
|
- MobMask
|
||||||
|
layer:
|
||||||
|
- MobLayer
|
||||||
|
- type: Vocal
|
||||||
|
sounds:
|
||||||
|
Male: UnisexDwarf
|
||||||
|
Female: UnisexDwarf
|
||||||
|
Unsexed: UnisexDwarf
|
||||||
|
- type: DwarfAccent
|
||||||
|
- type: Speech
|
||||||
|
speechSounds: Bass
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
save: false
|
save: false
|
||||||
|
|||||||
@@ -125,12 +125,35 @@
|
|||||||
damage:
|
damage:
|
||||||
types:
|
types:
|
||||||
Caustic: 1
|
Caustic: 1
|
||||||
|
# dwarves take less toxin damage and heal a marginal amount of brute
|
||||||
|
- !type:HealthChange
|
||||||
|
conditions:
|
||||||
|
- !type:ReagentThreshold
|
||||||
|
min: 5
|
||||||
|
- !type:OrganType
|
||||||
|
type: Dwarf
|
||||||
|
damage:
|
||||||
|
types:
|
||||||
|
Caustic: 0.5
|
||||||
|
- !type:HealthChange
|
||||||
|
conditions:
|
||||||
|
- !type:ReagentThreshold
|
||||||
|
min: 5
|
||||||
|
- !type:OrganType
|
||||||
|
type: Dwarf
|
||||||
|
damage:
|
||||||
|
groups:
|
||||||
|
Brute: -1
|
||||||
- !type:ChemVomit
|
- !type:ChemVomit
|
||||||
probability: 0.04
|
probability: 0.04
|
||||||
conditions:
|
conditions:
|
||||||
- !type:ReagentThreshold
|
- !type:ReagentThreshold
|
||||||
reagent: Ethanol
|
reagent: Ethanol
|
||||||
min: 3
|
min: 3
|
||||||
|
# dwarves immune to vomiting from alcohol
|
||||||
|
- !type:OrganType
|
||||||
|
type: Dwarf
|
||||||
|
shouldHave: false
|
||||||
Alcohol:
|
Alcohol:
|
||||||
effects:
|
effects:
|
||||||
- !type:Drunk
|
- !type:Drunk
|
||||||
|
|||||||
@@ -46,6 +46,17 @@
|
|||||||
params:
|
params:
|
||||||
variation: 0.125
|
variation: 0.125
|
||||||
|
|
||||||
|
- type: emoteSounds
|
||||||
|
id: UnisexDwarf
|
||||||
|
sounds:
|
||||||
|
Scream:
|
||||||
|
collection: MaleScreams
|
||||||
|
Laugh:
|
||||||
|
collection: MaleLaugh
|
||||||
|
params:
|
||||||
|
variation: 0.125
|
||||||
|
pitchscale: 0.75
|
||||||
|
|
||||||
# body emotes
|
# body emotes
|
||||||
- type: emoteSounds
|
- type: emoteSounds
|
||||||
id: GeneralBodyEmotes
|
id: GeneralBodyEmotes
|
||||||
|
|||||||
Reference in New Issue
Block a user