Skip to content

Commit

Permalink
Merge branch 'master' into Nikko--Toybox
Browse files Browse the repository at this point in the history
  • Loading branch information
Memeji committed Aug 30, 2024
2 parents cd8ca0a + ef6331b commit 8acadd6
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Content.Server/Devour/DevourSystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Server.Body.Components;
using Content.Server.Body.Systems;
using Content.Shared.Chemistry.Components;
using Content.Shared.Devour;
Expand All @@ -15,6 +16,7 @@ public override void Initialize()
base.Initialize();

SubscribeLocalEvent<DevourerComponent, DevourDoAfterEvent>(OnDoAfter);
SubscribeLocalEvent<DevourerComponent, BeingGibbedEvent>(OnGibContents);
}

private void OnDoAfter(EntityUid uid, DevourerComponent component, DevourDoAfterEvent args)
Expand Down Expand Up @@ -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);
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Content.Shared.Floofstation.Traits.Components;

[RegisterComponent]
public sealed partial class FixtureDensityModifierComponent : Component
{
/// <summary>
/// The minimum and maximum density that may be used as input for and achieved as a result of application of this component.
/// </summary>
[DataField]
public float Min = float.Epsilon, Max = float.PositiveInfinity;

[DataField]
public float Factor = 1f;
}
35 changes: 35 additions & 0 deletions Content.Shared/Floofstation/Traits/TraitStatModifierSystem.cs
Original file line number Diff line number Diff line change
@@ -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<FixtureDensityModifierComponent, MapInitEvent>(OnInitDensity); // Traits are added after CharacterSpawnedEvent so it's fine™
}

private void OnInitDensity(Entity<FixtureDensityModifierComponent> ent, ref MapInitEvent args)
{
if (!TryComp<FixturesComponent>(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);
}
}
12 changes: 12 additions & 0 deletions Resources/Changelog/Floof.yml
Original file line number Diff line number Diff line change
Expand Up @@ -729,3 +729,15 @@ 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'
- 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'
8 changes: 8 additions & 0 deletions Resources/Locale/en-US/Floof/traits/traits.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
46 changes: 45 additions & 1 deletion Resources/Prototypes/Floof/Traits/physical.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,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

2 changes: 2 additions & 0 deletions Resources/Prototypes/Traits/physical.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
inverted: true
traits:
- Lethargy
- Weakness # Floofstation
- !type:CharacterSpeciesRequirement
inverted: true
species:
Expand All @@ -123,6 +124,7 @@
inverted: true
traits:
- Vigor
- Weakness # Floofstation
- !type:CharacterSpeciesRequirement
inverted: true
species:
Expand Down

0 comments on commit 8acadd6

Please sign in to comment.