diff --git a/Content.Server/Body/Components/MetabolizerComponent.cs b/Content.Server/Body/Components/MetabolizerComponent.cs index 7fe7d23cf34..cf3433e7059 100644 --- a/Content.Server/Body/Components/MetabolizerComponent.cs +++ b/Content.Server/Body/Components/MetabolizerComponent.cs @@ -1,4 +1,5 @@ using Content.Server.Body.Systems; +using Content.Server.Floofstation.Traits; using Content.Server.Traits.Assorted; using Content.Shared.Body.Prototypes; using Content.Shared.FixedPoint; @@ -45,7 +46,7 @@ public sealed partial class MetabolizerComponent : Component /// List of metabolizer types that this organ is. ex. Human, Slime, Felinid, w/e. /// [DataField] - [Access(typeof(MetabolizerSystem), typeof(LiquorLifelineSystem), Other = AccessPermissions.ReadExecute)] // FIXME Friends + [Access(typeof(MetabolizerSystem), typeof(LiquorLifelineSystem), typeof(VampirismSystem), Other = AccessPermissions.ReadExecute)] // Floofstation public HashSet>? MetabolizerTypes = null; /// diff --git a/Content.Server/Body/Components/StomachComponent.cs b/Content.Server/Body/Components/StomachComponent.cs index d541ca4d7c4..6d0a55400a1 100644 --- a/Content.Server/Body/Components/StomachComponent.cs +++ b/Content.Server/Body/Components/StomachComponent.cs @@ -1,4 +1,5 @@ using Content.Server.Body.Systems; +using Content.Server.Floofstation.Traits; using Content.Server.Nutrition.EntitySystems; using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Reagent; @@ -45,6 +46,7 @@ public sealed partial class StomachComponent : Component /// A whitelist for what special-digestible-required foods this stomach is capable of eating. /// [DataField] + [Access(Other = AccessPermissions.ReadWriteExecute)] // Floofstation public EntityWhitelist? SpecialDigestible = null; /// diff --git a/Content.Server/FloofStation/Traits/Components/VampirismComponent.cs b/Content.Server/FloofStation/Traits/Components/VampirismComponent.cs new file mode 100644 index 00000000000..b54c65ef420 --- /dev/null +++ b/Content.Server/FloofStation/Traits/Components/VampirismComponent.cs @@ -0,0 +1,29 @@ +using Content.Server.Body.Components; +using Content.Shared.Body.Prototypes; +using Content.Shared.Whitelist; +using Robust.Shared.Prototypes; + +namespace Content.Server.Floofstation.Traits.Components; + +/// +/// Enables the mob to suck blood from other mobs to replenish its own saturation. +/// Must be fully initialized before being added to a mob. +/// +[RegisterComponent] +public sealed partial class VampirismComponent : Component +{ + [DataField] + public HashSet> MetabolizerPrototypes = new() { "Vampiric", "Animal" }; + + /// + /// A whitelist for what special-digestible-required foods the vampire's stomach is capable of eating. + /// + [DataField] + public EntityWhitelist? SpecialDigestible = null; + + [DataField] + public TimeSpan SuccDelay = TimeSpan.FromSeconds(1); + + [DataField] + public float UnitsToSucc = 10; +} diff --git a/Content.Server/FloofStation/Traits/VampirismSystem.cs b/Content.Server/FloofStation/Traits/VampirismSystem.cs new file mode 100644 index 00000000000..17c9ea9abe3 --- /dev/null +++ b/Content.Server/FloofStation/Traits/VampirismSystem.cs @@ -0,0 +1,51 @@ +using Content.Server.Body.Components; +using Content.Server.Floofstation.Traits.Components; +using Content.Server.Vampiric; +using Content.Shared.Body.Components; +using Content.Shared.Body.Systems; + +namespace Content.Server.Floofstation.Traits; + +public sealed class VampirismSystem : EntitySystem +{ + [Dependency] private readonly SharedBodySystem _body = default!; + + public override void Initialize() + { + SubscribeLocalEvent(OnInitVampire); + } + + private void OnInitVampire(Entity ent, ref MapInitEvent args) + { + EnsureBloodSucker(ent); + + if (!TryComp(ent, out var body) + || !_body.TryGetBodyOrganComponents(ent, out var comps, body)) + return; + + foreach (var (metabolizer, organ) in comps) + { + if (!TryComp(organ.Owner, out var stomach)) + continue; + + metabolizer.MetabolizerTypes = ent.Comp.MetabolizerPrototypes; + + if (ent.Comp.SpecialDigestible is {} whitelist) + stomach.SpecialDigestible = whitelist; + } + } + + private void EnsureBloodSucker(Entity uid) + { + if (HasComp(uid)) + return; + + AddComp(uid, new BloodSuckerComponent + { + Delay = uid.Comp.SuccDelay, + InjectWhenSucc = false, // The code for it is deprecated, might wanna make it inject something when (if?) it gets reworked + UnitsToSucc = uid.Comp.UnitsToSucc, + WebRequired = false + }); + } +} diff --git a/Resources/Locale/en-US/Floof/traits/traits.ftl b/Resources/Locale/en-US/Floof/traits/traits.ftl index fbc4f8fecb2..b21e405010e 100644 --- a/Resources/Locale/en-US/Floof/traits/traits.ftl +++ b/Resources/Locale/en-US/Floof/traits/traits.ftl @@ -1,5 +1,11 @@ trait-name-Vampirism = Vampirism -trait-description-Vampirism = Whether through implantation, genetic modification, or evolution, you have a pair of hollow, sharp fangs used to drink iron-based blood from the beings that contain it. +trait-description-Vampirism = + Your body has evolved to be able to suck blood from beings that contain it and metabolize it into useful compounds. + You cannot eat normal food, but drinking blood satiates your hunger and thirst, and also improves your health. + +trait-name-HollowFangs = Hollow fangs +trait-description-HollowFangs = + Whether through implantation, genetic modification, or evolution, you have a pair of hollow, sharp fangs used to drink iron-based blood from the beings that contain it. trait-name-CumProducer = Cock trait-description-CumProducer = You have a schlong between your legs. diff --git a/Resources/Prototypes/Floof/Traits/physical.yml b/Resources/Prototypes/Floof/Traits/physical.yml index 835b2dea254..b10e8b5a7f7 100644 --- a/Resources/Prototypes/Floof/Traits/physical.yml +++ b/Resources/Prototypes/Floof/Traits/physical.yml @@ -1,27 +1,54 @@ - type: trait id: Vampirism # You may port this to EE, you have my permission! category: Physical - points: -1 + points: 3 requirements: - !type:CharacterJobRequirement inverted: true jobs: - Borg - MedicalBorg - - !type:CharacterSpeciesRequirement # This will be removed once you can edit organs with traits + - !type:CharacterSpeciesRequirement inverted: true species: - - Moth - - Oni - - Diona - - SlimePerson - - Human - IPC + - !type:CharacterTraitRequirement + inverted: true + traits: + - HollowFangs + components: + - type: Vampirism + succDelay: 3 + specialDigestible: # Vampires cannot eat food chat is that real + tags: + - IceCream + - Pill + - Crayon + - Paper + +- type: trait + id: HollowFangs + category: Physical + points: -2 + requirements: + - !type:CharacterJobRequirement + inverted: true + jobs: + - Borg + - MedicalBorg + - !type:CharacterSpeciesRequirement + inverted: true + species: + - IPC + - !type:CharacterTraitRequirement + inverted: true + traits: + - Vampirism components: - - type: BloodSucker - unitsToSucc: 10 - injectWhenSucc: false - webRequired: false + - type: Vampirism + succDelay: 5 + metabolizerPrototypes: + - Animal - type: trait id: Weakness diff --git a/Resources/Prototypes/Reagents/biological.yml b/Resources/Prototypes/Reagents/biological.yml index 5c0cef314ca..e50fb966f1f 100644 --- a/Resources/Prototypes/Reagents/biological.yml +++ b/Resources/Prototypes/Reagents/biological.yml @@ -51,6 +51,11 @@ - !type:AdjustReagent reagent: UncookedAnimalProteins amount: 0.5 + # Floofstation - prevent vampires from getting sick by drinking blood + conditions: + - !type:OrganType + type: Vampiric + shouldHave: false Medicine: effects: - !type:HealthChange