From 3985a5a8b717aef15c63ef4767675ccbf22ae319 Mon Sep 17 00:00:00 2001 From: fox Date: Wed, 28 Aug 2024 12:46:16 +0300 Subject: [PATCH 1/4] done --- .../Components/FixtureDensityModifier.cs | 14 ++++++ .../Traits/TraitStatModifierSystem.cs | 35 ++++++++++++++ .../Locale/en-US/Floof/traits/traits.ftl | 8 ++++ .../Prototypes/Floof/Traits/physical.yml | 46 ++++++++++++++++++- Resources/Prototypes/Traits/physical.yml | 2 + 5 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 Content.Shared/Floofstation/Traits/Components/FixtureDensityModifier.cs create mode 100644 Content.Shared/Floofstation/Traits/TraitStatModifierSystem.cs diff --git a/Content.Shared/Floofstation/Traits/Components/FixtureDensityModifier.cs b/Content.Shared/Floofstation/Traits/Components/FixtureDensityModifier.cs new file mode 100644 index 00000000000..7b24f406b41 --- /dev/null +++ b/Content.Shared/Floofstation/Traits/Components/FixtureDensityModifier.cs @@ -0,0 +1,14 @@ +namespace Content.Shared.Floofstation.Traits.Components; + +[RegisterComponent] +public sealed partial class FixtureDensityModifierComponent : Component +{ + /// + /// The minimum and maximum density that may be used as input for and achieved as a result of application of this component. + /// + [DataField] + public float Min = float.Epsilon, Max = float.PositiveInfinity; + + [DataField] + public float Factor = 1f; +} diff --git a/Content.Shared/Floofstation/Traits/TraitStatModifierSystem.cs b/Content.Shared/Floofstation/Traits/TraitStatModifierSystem.cs new file mode 100644 index 00000000000..42cbbae9295 --- /dev/null +++ b/Content.Shared/Floofstation/Traits/TraitStatModifierSystem.cs @@ -0,0 +1,35 @@ +using Content.Shared.Contests; +using Content.Shared.Floofstation.Traits.Components; +using Robust.Shared.Physics; +using Robust.Shared.Physics.Systems; + +namespace Content.Shared.Floofstation.Traits; + +public sealed partial class TraitStatModifierSystem : EntitySystem +{ + [Dependency] private readonly ContestsSystem _contests = default!; + [Dependency] private readonly FixtureSystem _fixtures = default!; + [Dependency] private readonly SharedPhysicsSystem _physics = default!; + + public override void Initialize() + { + SubscribeLocalEvent(OnInitDensity); // Traits are added after CharacterSpawnedEvent so it's fineā„¢ + } + + private void OnInitDensity(Entity ent, ref MapInitEvent args) + { + if (!TryComp(ent.Owner, out var fixtures)) + return; + + foreach (var (id, fix) in fixtures.Fixtures) + { + if (!fix.Hard || fix.Density < ent.Comp.Min || fix.Density > ent.Comp.Max) + continue; + + var result = Math.Clamp(fix.Density * ent.Comp.Factor, ent.Comp.Min, ent.Comp.Max); + _physics.SetDensity(ent, id, fix, result, update: false, fixtures); + } + + _fixtures.FixtureUpdate(ent, true, true, fixtures); + } +} diff --git a/Resources/Locale/en-US/Floof/traits/traits.ftl b/Resources/Locale/en-US/Floof/traits/traits.ftl index 17c725791f1..fbc4f8fecb2 100644 --- a/Resources/Locale/en-US/Floof/traits/traits.ftl +++ b/Resources/Locale/en-US/Floof/traits/traits.ftl @@ -9,3 +9,11 @@ trait-description-MilkProducer = You have a pair of large mammaries. trait-name-SquirtProducer = Pussy trait-description-SquirtProducer = You have a slit between your legs. + +trait-name-Weakness = Weakness +trait-description-Weakness = You are naturally more vulnerable to fatigue. Your stamina pool is halved, making you greately vulnerable to shoving and stunning attacks. + +trait-name-Lightweight = Lightweight +trait-description-Lightweight = + You are naturally lighter than other representatives of your species. Your body density is reduced to 2/3 of normal. + Note: [color=red]this will not display in the character creation menu, and will only have effect in-game.[/color] diff --git a/Resources/Prototypes/Floof/Traits/physical.yml b/Resources/Prototypes/Floof/Traits/physical.yml index 3929563253f..80a76763cbb 100644 --- a/Resources/Prototypes/Floof/Traits/physical.yml +++ b/Resources/Prototypes/Floof/Traits/physical.yml @@ -21,4 +21,48 @@ unitsToSucc: 10 injectWhenSucc: false webRequired: false - + +- type: trait + id: Weakness + category: Physical + points: 5 + requirements: + - !type:CharacterJobRequirement + inverted: true + jobs: + - Borg + - MedicalBorg + - !type:CharacterSpeciesRequirement + inverted: true + species: + - Oni + - IPC + - !type:CharacterTraitRequirement + inverted: true + traits: + - Lethargy + - Vigor + components: + - type: StaminaCritModifier + critThresholdModifier: -50 + +- type: trait + id: Lightweight + category: Physical + points: -2 # Has pros and cons, not sure + requirements: + - !type:CharacterJobRequirement + inverted: true + jobs: + - Borg + - MedicalBorg + - !type:CharacterSpeciesRequirement # TODO if lamia gets merged, ensure it is added too + inverted: true + species: + - Felinid # They don't need to be lighter + - IPC + components: + - type: FixtureDensityModifier + min: 100 + factor: 0.66 # still not as light as felinids due to different fixture size + diff --git a/Resources/Prototypes/Traits/physical.yml b/Resources/Prototypes/Traits/physical.yml index fa0033588b1..f571ad52c7d 100644 --- a/Resources/Prototypes/Traits/physical.yml +++ b/Resources/Prototypes/Traits/physical.yml @@ -100,6 +100,7 @@ inverted: true traits: - Lethargy + - Weakness # Floofstation - !type:CharacterSpeciesRequirement inverted: true species: @@ -123,6 +124,7 @@ inverted: true traits: - Vigor + - Weakness # Floofstation - !type:CharacterSpeciesRequirement inverted: true species: From 4014d80b16bf7d27d4c853e053a6c5c0246a4bd9 Mon Sep 17 00:00:00 2001 From: FloofStation Changelogs <175611579+Floof-Station-Bot@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:52:06 +0000 Subject: [PATCH 2/4] Automatic Changelog Update (#157) --- Resources/Changelog/Floof.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Resources/Changelog/Floof.yml b/Resources/Changelog/Floof.yml index 3115fb121c3..8e68d86e318 100644 --- a/Resources/Changelog/Floof.yml +++ b/Resources/Changelog/Floof.yml @@ -729,3 +729,9 @@ Entries: changes: [] id: 99 time: '2024-08-27T20:07:59.0000000+00:00' +- author: Mnemotechnician + changes: + - type: Add + message: Added two new physical traits - weakness and lightweight + id: 100 + time: '2024-08-29T14:51:40.0000000+00:00' From 71be789d658633127e3ddc6646c92e1895b35df3 Mon Sep 17 00:00:00 2001 From: cynical Date: Thu, 29 Aug 2024 18:22:59 -0400 Subject: [PATCH 3/4] the fix --- Content.Server/Devour/DevourSystem.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Content.Server/Devour/DevourSystem.cs b/Content.Server/Devour/DevourSystem.cs index febbd093a6c..16def72d44e 100644 --- a/Content.Server/Devour/DevourSystem.cs +++ b/Content.Server/Devour/DevourSystem.cs @@ -1,3 +1,4 @@ +using Content.Server.Body.Components; using Content.Server.Body.Systems; using Content.Shared.Chemistry.Components; using Content.Shared.Devour; @@ -15,6 +16,7 @@ public override void Initialize() base.Initialize(); SubscribeLocalEvent(OnDoAfter); + SubscribeLocalEvent(OnGibContents); } private void OnDoAfter(EntityUid uid, DevourerComponent component, DevourDoAfterEvent args) @@ -45,5 +47,15 @@ private void OnDoAfter(EntityUid uid, DevourerComponent component, DevourDoAfter _audioSystem.PlayPvs(component.SoundDevour, uid); } + + private void OnGibContents(EntityUid uid, DevourerComponent component, ref BeingGibbedEvent args) + { + if (!component.ShouldStoreDevoured) + return; + + // For some reason we have two different systems that should handle gibbing, + // and for some another reason GibbingSystem, which should empty all containers, doesn't get involved in this process + ContainerSystem.EmptyContainer(component.Stomach); + } } From ef6331b43dfc3cc05f373039027478e52dc5e673 Mon Sep 17 00:00:00 2001 From: FloofStation Changelogs <175611579+Floof-Station-Bot@users.noreply.github.com> Date: Fri, 30 Aug 2024 05:07:33 +0000 Subject: [PATCH 4/4] Automatic Changelog Update (#158) --- Resources/Changelog/Floof.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Resources/Changelog/Floof.yml b/Resources/Changelog/Floof.yml index 8e68d86e318..1efbaf4f8d6 100644 --- a/Resources/Changelog/Floof.yml +++ b/Resources/Changelog/Floof.yml @@ -735,3 +735,9 @@ Entries: message: Added two new physical traits - weakness and lightweight id: 100 time: '2024-08-29T14:51:40.0000000+00:00' +- author: cynical24 + changes: + - type: Fix + message: space dragons will now drop bodies upon being butchered :3 + id: 101 + time: '2024-08-30T05:07:01.0000000+00:00'