From 9e6bd30aa405d66510038469ba8171bce1afd26e Mon Sep 17 00:00:00 2001
From: LankLTE <135308300+LankLTE@users.noreply.github.com>
Date: Sun, 9 Jul 2023 15:01:35 -0700
Subject: [PATCH] Ambuzol Plus (#17884)
* Added component and functionality.
* Fixed ZombieImmune.
* Zombies now have zombie blood.
* Ambuzol plus.
* Ambuzol plus spawns in bundle.
* Fine CBURN get one too.
* Reworked the reaction
* No more magic blood refilling.
* ok CE i fixed it
* Component change.
---
.../Body/Systems/BloodstreamSystem.cs | 18 ++++++++++++++
.../ReagentEffects/CureZombieInfection.cs | 15 ++++++++++--
.../Zombies/ZombieImmuneComponent.cs | 8 +++++++
Content.Server/Zombies/ZombieSystem.cs | 3 ++-
.../Zombies/ZombifyOnDeathSystem.cs | 4 ++++
Content.Shared/Zombies/ZombieComponent.cs | 12 ++++++++++
.../en-US/guidebook/chemistry/effects.ftl | 6 +++++
.../Locale/en-US/reagents/meta/biological.ftl | 3 +++
.../Locale/en-US/reagents/meta/medicine.ftl | 3 +++
.../Catalog/Fills/Backpacks/duffelbag.yml | 4 +++-
.../Objects/Specific/Medical/healing.yml | 13 ++++++++++
Resources/Prototypes/Reagents/biological.yml | 24 +++++++++++++++++++
Resources/Prototypes/Reagents/medicine.yml | 17 +++++++++++++
.../Prototypes/Recipes/Reactions/medicine.yml | 11 +++++++++
14 files changed, 137 insertions(+), 4 deletions(-)
create mode 100644 Content.Server/Zombies/ZombieImmuneComponent.cs
diff --git a/Content.Server/Body/Systems/BloodstreamSystem.cs b/Content.Server/Body/Systems/BloodstreamSystem.cs
index 0080c9f311..605a46ad7f 100644
--- a/Content.Server/Body/Systems/BloodstreamSystem.cs
+++ b/Content.Server/Body/Systems/BloodstreamSystem.cs
@@ -375,4 +375,22 @@ public sealed class BloodstreamSystem : EntitySystem
}
}
}
+
+ ///
+ /// Change what someone's blood is made of, on the fly.
+ ///
+ public void ChangeBloodReagent(EntityUid uid, string reagent, BloodstreamComponent? component = null)
+ {
+ if (!Resolve(uid, ref component, false))
+ return;
+
+ if(reagent == component.BloodReagent)
+ return;
+
+ var currentVolume = component.BloodSolution.Volume;
+
+ component.BloodReagent = reagent;
+ component.BloodSolution.RemoveAllSolution();
+ _solutionContainerSystem.TryAddReagent(uid, component.BloodSolution, component.BloodReagent, currentVolume, out _);
+ }
}
diff --git a/Content.Server/Chemistry/ReagentEffects/CureZombieInfection.cs b/Content.Server/Chemistry/ReagentEffects/CureZombieInfection.cs
index 31a598b778..dceecaf9bf 100644
--- a/Content.Server/Chemistry/ReagentEffects/CureZombieInfection.cs
+++ b/Content.Server/Chemistry/ReagentEffects/CureZombieInfection.cs
@@ -1,6 +1,5 @@
using Content.Shared.Chemistry.Reagent;
using Robust.Shared.Prototypes;
-
using Robust.Shared.Configuration;
using Content.Server.Zombies;
@@ -9,8 +8,16 @@ namespace Content.Server.Chemistry.ReagentEffects;
public sealed class CureZombieInfection : ReagentEffect
{
+ [DataField("innoculate")]
+ public bool innoculate = false;
+
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
- => Loc.GetString("reagent-effect-guidebook-cure-zombie-infection", ("chance", Probability));
+ {
+ if(innoculate == true)
+ return Loc.GetString("reagent-effect-guidebook-innoculate-zombie-infection", ("chance", Probability));
+
+ return Loc.GetString("reagent-effect-guidebook-cure-zombie-infection", ("chance", Probability));
+ }
// Removes the Zombie Infection Components
public override void Effect(ReagentEffectArgs args)
@@ -18,6 +25,10 @@ public sealed class CureZombieInfection : ReagentEffect
var entityManager = args.EntityManager;
entityManager.RemoveComponent(args.SolutionEntity);
entityManager.RemoveComponent(args.SolutionEntity);
+
+ if (innoculate == true) {
+ entityManager.EnsureComponent(args.SolutionEntity);
+ }
}
}
diff --git a/Content.Server/Zombies/ZombieImmuneComponent.cs b/Content.Server/Zombies/ZombieImmuneComponent.cs
new file mode 100644
index 0000000000..5c2b8b3ce7
--- /dev/null
+++ b/Content.Server/Zombies/ZombieImmuneComponent.cs
@@ -0,0 +1,8 @@
+namespace Content.Server.Zombies
+{
+ [RegisterComponent]
+ public sealed class ZombieImmuneComponent : Component
+ {
+ //still no
+ }
+}
diff --git a/Content.Server/Zombies/ZombieSystem.cs b/Content.Server/Zombies/ZombieSystem.cs
index b051a7f89a..b21892c015 100644
--- a/Content.Server/Zombies/ZombieSystem.cs
+++ b/Content.Server/Zombies/ZombieSystem.cs
@@ -258,7 +258,7 @@ namespace Content.Server.Zombies
}
else
{
- if (_random.Prob(GetZombieInfectionChance(entity, component)))
+ if (!HasComp(entity) && _random.Prob(GetZombieInfectionChance(entity, component)))
{
var pending = EnsureComp(entity);
pending.MaxInfectionLength = _random.NextFloat(0.25f, 1.0f) * component.ZombieInfectionTurnTime;
@@ -301,6 +301,7 @@ namespace Content.Server.Zombies
_humanoidSystem.SetBaseLayerId(target, layer, info.ID);
}
_humanoidSystem.SetSkinColor(target, zombiecomp.BeforeZombifiedSkinColor);
+ _bloodstream.ChangeBloodReagent(target, zombiecomp.BeforeZombifiedBloodReagent);
MetaData(target).EntityName = zombiecomp.BeforeZombifiedEntityName;
return true;
diff --git a/Content.Server/Zombies/ZombifyOnDeathSystem.cs b/Content.Server/Zombies/ZombifyOnDeathSystem.cs
index a846164025..9b5b553808 100644
--- a/Content.Server/Zombies/ZombifyOnDeathSystem.cs
+++ b/Content.Server/Zombies/ZombifyOnDeathSystem.cs
@@ -146,6 +146,8 @@ namespace Content.Server.Zombies
//store some values before changing them in case the humanoid get cloned later
zombiecomp.BeforeZombifiedSkinColor = huApComp.SkinColor;
zombiecomp.BeforeZombifiedCustomBaseLayers = new(huApComp.CustomBaseLayers);
+ if (TryComp(target, out var stream))
+ zombiecomp.BeforeZombifiedBloodReagent = stream.BloodReagent;
_sharedHuApp.SetSkinColor(target, zombiecomp.SkinColor, verify: false, humanoid: huApComp);
_sharedHuApp.SetBaseLayerColor(target, HumanoidVisualLayers.Eyes, zombiecomp.EyeColor, humanoid: huApComp);
@@ -171,6 +173,8 @@ namespace Content.Server.Zombies
//This makes it so the zombie doesn't take bloodloss damage.
//NOTE: they are supposed to bleed, just not take damage
_bloodstream.SetBloodLossThreshold(target, 0f);
+ //Give them zombie blood
+ _bloodstream.ChangeBloodReagent(target, zombiecomp.NewBloodReagent);
//This is specifically here to combat insuls, because frying zombies on grilles is funny as shit.
_serverInventory.TryUnequip(target, "gloves", true, true);
diff --git a/Content.Shared/Zombies/ZombieComponent.cs b/Content.Shared/Zombies/ZombieComponent.cs
index 9feb4c7a13..dd0d8c4115 100644
--- a/Content.Shared/Zombies/ZombieComponent.cs
+++ b/Content.Shared/Zombies/ZombieComponent.cs
@@ -140,5 +140,17 @@ namespace Content.Shared.Zombies
///
[DataField("greetSoundNotification")]
public SoundSpecifier GreetSoundNotification = new SoundPathSpecifier("/Audio/Ambience/Antag/zombie_start.ogg");
+
+ ///
+ /// The blood reagent of the humanoid to restore in case of cloning
+ ///
+ [DataField("beforeZombifiedBloodReagent")]
+ public string BeforeZombifiedBloodReagent = String.Empty;
+
+ ///
+ /// The blood reagent to give the zombie. In case you want zombies that bleed milk, or something.
+ ///
+ [DataField("newBloodReagent")]
+ public string NewBloodReagent = "ZombieBlood";
}
}
diff --git a/Resources/Locale/en-US/guidebook/chemistry/effects.ftl b/Resources/Locale/en-US/guidebook/chemistry/effects.ftl
index 78d0cc25ec..51f783c3d8 100644
--- a/Resources/Locale/en-US/guidebook/chemistry/effects.ftl
+++ b/Resources/Locale/en-US/guidebook/chemistry/effects.ftl
@@ -321,6 +321,12 @@ reagent-effect-guidebook-cause-zombie-infection =
*[other] give
} an individual the zombie infection
+reagent-effect-guidebook-innoculate-zombie-infection =
+ { $chance ->
+ [1] Cures
+ *[other] cure
+ } an ongoing zombie infection, and provides immunity to future infections
+
reagent-effect-guidebook-missing =
{ $chance ->
[1] Causes
diff --git a/Resources/Locale/en-US/reagents/meta/biological.ftl b/Resources/Locale/en-US/reagents/meta/biological.ftl
index 1eee5df990..48f6604ef1 100644
--- a/Resources/Locale/en-US/reagents/meta/biological.ftl
+++ b/Resources/Locale/en-US/reagents/meta/biological.ftl
@@ -7,6 +7,9 @@ reagent-desc-slime = You thought this was gradient blood at first, but you were
reagent-name-spider-blood = blue blood
reagent-desc-spider-blood = Doesn't taste like blueberry juice.
+reagent-name-zombie-blood = zombie blood
+reagent-desc-zombie-blood = Would not advise eating. Can be used to create an inoculation against the infection.
+
reagent-name-ichor = ichor
reagent-desc-ichor = An extremely potent regenerative chemical, perfected by space fauna evolution. Produced in the dragon's digestive system, it is seen as an exotic commodity due to the gargantuan effort of hunting for it.
diff --git a/Resources/Locale/en-US/reagents/meta/medicine.ftl b/Resources/Locale/en-US/reagents/meta/medicine.ftl
index dceaf4cdbb..ba9851ab66 100644
--- a/Resources/Locale/en-US/reagents/meta/medicine.ftl
+++ b/Resources/Locale/en-US/reagents/meta/medicine.ftl
@@ -55,6 +55,9 @@ reagent-desc-phalanximine = Used in the treatment of cancer. Causes moderate rad
reagent-name-ambuzol = ambuzol
reagent-desc-ambuzol = A highly engineered substance able to halt the progression of a zombie infection.
+reagent-name-ambuzol-plus = ambuzol plus
+reagent-desc-ambuzol-plus = Further engineered with the blood of the infected, inoculates the living against the infection.
+
reagent-name-pulped-banana-peel = pulped banana peel
reagent-desc-pulped-banana-peel = Pulped banana peels have some effectiveness against bleeding.
diff --git a/Resources/Prototypes/Catalog/Fills/Backpacks/duffelbag.yml b/Resources/Prototypes/Catalog/Fills/Backpacks/duffelbag.yml
index bf840789c7..3fff9110cf 100644
--- a/Resources/Prototypes/Catalog/Fills/Backpacks/duffelbag.yml
+++ b/Resources/Prototypes/Catalog/Fills/Backpacks/duffelbag.yml
@@ -26,8 +26,9 @@
amount: 2
- id: GrenadeFlashBang
amount: 2
+ - id: PillAmbuzolPlus
- id: PillAmbuzol
- amount: 5
+ amount: 4
- type: entity
parent: ClothingBackpackDuffelSyndicateMedicalBundle
@@ -246,6 +247,7 @@
- id: SyringeRomerol
- id: WeaponRevolverMateba
- id: MagazineBoxMagnumIncendiary
+ - id: PillAmbuzolPlus
- id: PillAmbuzol
amount: 3
diff --git a/Resources/Prototypes/Entities/Objects/Specific/Medical/healing.yml b/Resources/Prototypes/Entities/Objects/Specific/Medical/healing.yml
index 1b5efd5cce..7d6ab12a93 100644
--- a/Resources/Prototypes/Entities/Objects/Specific/Medical/healing.yml
+++ b/Resources/Prototypes/Entities/Objects/Specific/Medical/healing.yml
@@ -325,6 +325,19 @@
- ReagentId: Ambuzol
Quantity: 10
+- type: entity
+ name: ambuzol plus pill
+ parent: Pill
+ id: PillAmbuzolPlus
+ components:
+ - type: SolutionContainerManager
+ solutions:
+ food:
+ maxVol: 20
+ reagents:
+ - ReagentId: AmbuzolPlus
+ Quantity: 5
+
# Syringes
- type: entity
name: ephedrine syringe
diff --git a/Resources/Prototypes/Reagents/biological.yml b/Resources/Prototypes/Reagents/biological.yml
index 568e7bf8aa..d507ddd552 100644
--- a/Resources/Prototypes/Reagents/biological.yml
+++ b/Resources/Prototypes/Reagents/biological.yml
@@ -58,6 +58,30 @@
- !type:PlantAdjustWater
amount: 0.5
+- type: reagent
+ id: ZombieBlood
+ name: reagent-name-zombie-blood
+ group: Biological
+ desc: reagent-desc-zombie-blood
+ physicalDesc: reagent-physical-desc-necrotic
+ flavor: bitter
+ color: "#2b0700"
+ slippery: false
+ metabolisms:
+ Drink:
+ # Disgusting!
+ effects:
+ - !type:SatiateThirst
+ factor: -0.5
+ Poison:
+ effects:
+ - !type:HealthChange
+ damage:
+ types:
+ Poison: 4
+ - !type:ChemVomit
+ probability: 0.25
+
- type: reagent
id: Ichor
name: reagent-name-ichor
diff --git a/Resources/Prototypes/Reagents/medicine.yml b/Resources/Prototypes/Reagents/medicine.yml
index 390e66eca9..18673e7e7e 100644
--- a/Resources/Prototypes/Reagents/medicine.yml
+++ b/Resources/Prototypes/Reagents/medicine.yml
@@ -574,6 +574,23 @@
- !type:ReagentThreshold
min: 10
+- type: reagent
+ id: AmbuzolPlus
+ name: reagent-name-ambuzol-plus
+ group: Medicine
+ desc: reagent-desc-ambuzol-plus
+ physicalDesc: reagent-physical-desc-crisp
+ flavor: medicine
+ color: "#1274b5"
+ metabolisms:
+ Medicine:
+ effects:
+ - !type:CureZombieInfection
+ innoculate: true
+ conditions:
+ - !type:ReagentThreshold
+ min: 5
+
- type: reagent
id: PulpedBananaPeel
name: reagent-name-pulped-banana-peel
diff --git a/Resources/Prototypes/Recipes/Reactions/medicine.yml b/Resources/Prototypes/Recipes/Reactions/medicine.yml
index 2507d1d5d0..30a7cbd931 100644
--- a/Resources/Prototypes/Recipes/Reactions/medicine.yml
+++ b/Resources/Prototypes/Recipes/Reactions/medicine.yml
@@ -222,6 +222,17 @@
products:
Ambuzol: 4
+- type: reaction
+ id: AmbuzolPlus
+ reactants:
+ Ambuzol:
+ amount: 5
+ ZombieBlood:
+ amount: 15
+ products:
+ Blood: 15
+ AmbuzolPlus: 5
+
- type: reaction
id: Synaptizine
reactants: