From 7d90c47726aff4e8fa3b0338a429ec49e5c25432 Mon Sep 17 00:00:00 2001 From: fox Date: Sun, 1 Sep 2024 01:09:13 +0300 Subject: [PATCH 1/9] chat it works --- .../Body/Components/MetabolizerComponent.cs | 3 +- .../Body/Components/StomachComponent.cs | 2 + .../Traits/Components/VampirismComponent.cs | 32 +++++++++++ .../FloofStation/Traits/VampirismSystem.cs | 53 +++++++++++++++++++ .../Prototypes/Body/Organs/Animal/animal.yml | 2 +- .../Prototypes/Floof/Traits/physical.yml | 19 ++++--- Resources/Prototypes/Reagents/biological.yml | 5 ++ 7 files changed, 104 insertions(+), 12 deletions(-) create mode 100644 Content.Server/FloofStation/Traits/Components/VampirismComponent.cs create mode 100644 Content.Server/FloofStation/Traits/VampirismSystem.cs 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..dd2193becab --- /dev/null +++ b/Content.Server/FloofStation/Traits/Components/VampirismComponent.cs @@ -0,0 +1,32 @@ +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" }; + + [DataField] + public List AddedMetabolismGroups = new(), RemovedMetabolismGroups = new(); + + /// + /// 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..7c2919a4eec --- /dev/null +++ b/Content.Server/FloofStation/Traits/VampirismSystem.cs @@ -0,0 +1,53 @@ +using Content.Server.Body.Components; +using Content.Server.Floofstation.Traits.Components; +using Content.Server.Vampiric; +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); + + Log.Info($"Init vampire: {ent.Owner}"); + + if (!_body.TryGetBodyOrganComponents(ent, out var comps)) + return; + + Log.Info($"Init vampire: {ent.Owner}"); + + 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/Prototypes/Body/Organs/Animal/animal.yml b/Resources/Prototypes/Body/Organs/Animal/animal.yml index 2f50821df35..29e8b214a71 100644 --- a/Resources/Prototypes/Body/Organs/Animal/animal.yml +++ b/Resources/Prototypes/Body/Organs/Animal/animal.yml @@ -82,7 +82,7 @@ - type: Stomach - type: Metabolizer maxReagents: 3 - metabolizerTypes: [ Animal ] + metabolizerPrototypes: [ Animal ] groups: - id: Food - id: Drink diff --git a/Resources/Prototypes/Floof/Traits/physical.yml b/Resources/Prototypes/Floof/Traits/physical.yml index 835b2dea254..fff0639128d 100644 --- a/Resources/Prototypes/Floof/Traits/physical.yml +++ b/Resources/Prototypes/Floof/Traits/physical.yml @@ -8,20 +8,19 @@ 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 components: - - type: BloodSucker - unitsToSucc: 10 - injectWhenSucc: false - webRequired: false + - type: Vampirism + succDelay: 3 + specialDigestible: # Vampires cannot eat food chat is that real + tags: + - IceCream + - Pill + - Crayon + - Paper - 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 From 09dc326dad87384bbb321a5b6456c148305b22b4 Mon Sep 17 00:00:00 2001 From: fox Date: Sun, 1 Sep 2024 01:12:11 +0300 Subject: [PATCH 2/9] also make it restore blood --- Resources/Prototypes/Reagents/biological.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Resources/Prototypes/Reagents/biological.yml b/Resources/Prototypes/Reagents/biological.yml index e50fb966f1f..b9b9f3d7a2d 100644 --- a/Resources/Prototypes/Reagents/biological.yml +++ b/Resources/Prototypes/Reagents/biological.yml @@ -46,6 +46,12 @@ type: Vampiric reagent: Omnizine amount: 0.2 + # Floofstation - make vampires replenish their own blood by drinking blood + - !type:ModifyBloodLevel + amount: 0.3 # +0.6 units of blood for each unit drunk + conditions: + - !type:OrganType + type: Vampiric Food: effects: - !type:AdjustReagent From 888a3c6e8220b077a65ff10ea8d60f9bc03f2f99 Mon Sep 17 00:00:00 2001 From: fox Date: Sun, 1 Sep 2024 01:19:23 +0300 Subject: [PATCH 3/9] Make a negative trait --- Resources/Prototypes/Floof/Traits/physical.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Prototypes/Floof/Traits/physical.yml b/Resources/Prototypes/Floof/Traits/physical.yml index fff0639128d..ac30b5549a5 100644 --- a/Resources/Prototypes/Floof/Traits/physical.yml +++ b/Resources/Prototypes/Floof/Traits/physical.yml @@ -1,7 +1,7 @@ - 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 From f38a0720cde340b6b038b94ece1622465448ea98 Mon Sep 17 00:00:00 2001 From: fox Date: Sun, 1 Sep 2024 01:28:34 +0300 Subject: [PATCH 4/9] Update trait description --- Resources/Locale/en-US/Floof/traits/traits.ftl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Resources/Locale/en-US/Floof/traits/traits.ftl b/Resources/Locale/en-US/Floof/traits/traits.ftl index fbc4f8fecb2..080a03c1bab 100644 --- a/Resources/Locale/en-US/Floof/traits/traits.ftl +++ b/Resources/Locale/en-US/Floof/traits/traits.ftl @@ -1,5 +1,7 @@ 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 = + 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. + You cannot eat normal food, but drinking blood satiates your hunger and thirst, and also improves your health. trait-name-CumProducer = Cock trait-description-CumProducer = You have a schlong between your legs. From d086884688b5c9695cb94f30ca3a0bd7d4872c45 Mon Sep 17 00:00:00 2001 From: fox Date: Sun, 1 Sep 2024 01:30:19 +0300 Subject: [PATCH 5/9] Didn't mean to change this guh --- Resources/Prototypes/Body/Organs/Animal/animal.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Prototypes/Body/Organs/Animal/animal.yml b/Resources/Prototypes/Body/Organs/Animal/animal.yml index 29e8b214a71..2f50821df35 100644 --- a/Resources/Prototypes/Body/Organs/Animal/animal.yml +++ b/Resources/Prototypes/Body/Organs/Animal/animal.yml @@ -82,7 +82,7 @@ - type: Stomach - type: Metabolizer maxReagents: 3 - metabolizerPrototypes: [ Animal ] + metabolizerTypes: [ Animal ] groups: - id: Food - id: Drink From 945b22972f3e86618af114586739f1c1cfac0228 Mon Sep 17 00:00:00 2001 From: fox Date: Sun, 1 Sep 2024 01:38:32 +0300 Subject: [PATCH 6/9] Revert "also make it restore blood" This reverts commit 09dc326dad87384bbb321a5b6456c148305b22b4. --- Resources/Prototypes/Reagents/biological.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Resources/Prototypes/Reagents/biological.yml b/Resources/Prototypes/Reagents/biological.yml index b9b9f3d7a2d..e50fb966f1f 100644 --- a/Resources/Prototypes/Reagents/biological.yml +++ b/Resources/Prototypes/Reagents/biological.yml @@ -46,12 +46,6 @@ type: Vampiric reagent: Omnizine amount: 0.2 - # Floofstation - make vampires replenish their own blood by drinking blood - - !type:ModifyBloodLevel - amount: 0.3 # +0.6 units of blood for each unit drunk - conditions: - - !type:OrganType - type: Vampiric Food: effects: - !type:AdjustReagent From 17c836f53b34d7986adddb05238c14b8b872bc9f Mon Sep 17 00:00:00 2001 From: fox Date: Sun, 1 Sep 2024 01:38:42 +0300 Subject: [PATCH 7/9] cleanup --- .../FloofStation/Traits/Components/VampirismComponent.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/Content.Server/FloofStation/Traits/Components/VampirismComponent.cs b/Content.Server/FloofStation/Traits/Components/VampirismComponent.cs index dd2193becab..b54c65ef420 100644 --- a/Content.Server/FloofStation/Traits/Components/VampirismComponent.cs +++ b/Content.Server/FloofStation/Traits/Components/VampirismComponent.cs @@ -15,9 +15,6 @@ public sealed partial class VampirismComponent : Component [DataField] public HashSet> MetabolizerPrototypes = new() { "Vampiric", "Animal" }; - [DataField] - public List AddedMetabolismGroups = new(), RemovedMetabolismGroups = new(); - /// /// A whitelist for what special-digestible-required foods the vampire's stomach is capable of eating. /// From f2bc2e4b56876b109e0f4d117c8d2186ff5c55f8 Mon Sep 17 00:00:00 2001 From: fox Date: Sun, 1 Sep 2024 01:56:42 +0300 Subject: [PATCH 8/9] Oops --- Content.Server/FloofStation/Traits/VampirismSystem.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Content.Server/FloofStation/Traits/VampirismSystem.cs b/Content.Server/FloofStation/Traits/VampirismSystem.cs index 7c2919a4eec..17c9ea9abe3 100644 --- a/Content.Server/FloofStation/Traits/VampirismSystem.cs +++ b/Content.Server/FloofStation/Traits/VampirismSystem.cs @@ -1,6 +1,7 @@ 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; @@ -18,13 +19,10 @@ private void OnInitVampire(Entity ent, ref MapInitEvent args { EnsureBloodSucker(ent); - Log.Info($"Init vampire: {ent.Owner}"); - - if (!_body.TryGetBodyOrganComponents(ent, out var comps)) + if (!TryComp(ent, out var body) + || !_body.TryGetBodyOrganComponents(ent, out var comps, body)) return; - Log.Info($"Init vampire: {ent.Owner}"); - foreach (var (metabolizer, organ) in comps) { if (!TryComp(organ.Owner, out var stomach)) From d5dbe736ba905cfd35cf7d22b98b6c6ba4e121f3 Mon Sep 17 00:00:00 2001 From: fox Date: Sun, 1 Sep 2024 14:29:28 +0300 Subject: [PATCH 9/9] Splt into 2 traits --- .../Locale/en-US/Floof/traits/traits.ftl | 6 +++- .../Prototypes/Floof/Traits/physical.yml | 28 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/Resources/Locale/en-US/Floof/traits/traits.ftl b/Resources/Locale/en-US/Floof/traits/traits.ftl index 080a03c1bab..b21e405010e 100644 --- a/Resources/Locale/en-US/Floof/traits/traits.ftl +++ b/Resources/Locale/en-US/Floof/traits/traits.ftl @@ -1,8 +1,12 @@ 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. + 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 ac30b5549a5..b10e8b5a7f7 100644 --- a/Resources/Prototypes/Floof/Traits/physical.yml +++ b/Resources/Prototypes/Floof/Traits/physical.yml @@ -12,6 +12,10 @@ inverted: true species: - IPC + - !type:CharacterTraitRequirement + inverted: true + traits: + - HollowFangs components: - type: Vampirism succDelay: 3 @@ -22,6 +26,30 @@ - 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: Vampirism + succDelay: 5 + metabolizerPrototypes: + - Animal + - type: trait id: Weakness category: Physical