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.
This commit is contained in:
LankLTE
2023-07-09 15:01:35 -07:00
committed by GitHub
parent af38a22d69
commit 9e6bd30aa4
14 changed files with 137 additions and 4 deletions

View File

@@ -375,4 +375,22 @@ public sealed class BloodstreamSystem : EntitySystem
} }
} }
} }
/// <summary>
/// Change what someone's blood is made of, on the fly.
/// </summary>
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 _);
}
} }

View File

@@ -1,6 +1,5 @@
using Content.Shared.Chemistry.Reagent; using Content.Shared.Chemistry.Reagent;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Configuration; using Robust.Shared.Configuration;
using Content.Server.Zombies; using Content.Server.Zombies;
@@ -9,8 +8,16 @@ namespace Content.Server.Chemistry.ReagentEffects;
public sealed class CureZombieInfection : ReagentEffect public sealed class CureZombieInfection : ReagentEffect
{ {
[DataField("innoculate")]
public bool innoculate = false;
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) 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 // Removes the Zombie Infection Components
public override void Effect(ReagentEffectArgs args) public override void Effect(ReagentEffectArgs args)
@@ -18,6 +25,10 @@ public sealed class CureZombieInfection : ReagentEffect
var entityManager = args.EntityManager; var entityManager = args.EntityManager;
entityManager.RemoveComponent<ZombifyOnDeathComponent>(args.SolutionEntity); entityManager.RemoveComponent<ZombifyOnDeathComponent>(args.SolutionEntity);
entityManager.RemoveComponent<PendingZombieComponent>(args.SolutionEntity); entityManager.RemoveComponent<PendingZombieComponent>(args.SolutionEntity);
if (innoculate == true) {
entityManager.EnsureComponent<ZombieImmuneComponent>(args.SolutionEntity);
}
} }
} }

View File

@@ -0,0 +1,8 @@
namespace Content.Server.Zombies
{
[RegisterComponent]
public sealed class ZombieImmuneComponent : Component
{
//still no
}
}

View File

@@ -258,7 +258,7 @@ namespace Content.Server.Zombies
} }
else else
{ {
if (_random.Prob(GetZombieInfectionChance(entity, component))) if (!HasComp<ZombieImmuneComponent>(entity) && _random.Prob(GetZombieInfectionChance(entity, component)))
{ {
var pending = EnsureComp<PendingZombieComponent>(entity); var pending = EnsureComp<PendingZombieComponent>(entity);
pending.MaxInfectionLength = _random.NextFloat(0.25f, 1.0f) * component.ZombieInfectionTurnTime; 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.SetBaseLayerId(target, layer, info.ID);
} }
_humanoidSystem.SetSkinColor(target, zombiecomp.BeforeZombifiedSkinColor); _humanoidSystem.SetSkinColor(target, zombiecomp.BeforeZombifiedSkinColor);
_bloodstream.ChangeBloodReagent(target, zombiecomp.BeforeZombifiedBloodReagent);
MetaData(target).EntityName = zombiecomp.BeforeZombifiedEntityName; MetaData(target).EntityName = zombiecomp.BeforeZombifiedEntityName;
return true; return true;

View File

@@ -146,6 +146,8 @@ namespace Content.Server.Zombies
//store some values before changing them in case the humanoid get cloned later //store some values before changing them in case the humanoid get cloned later
zombiecomp.BeforeZombifiedSkinColor = huApComp.SkinColor; zombiecomp.BeforeZombifiedSkinColor = huApComp.SkinColor;
zombiecomp.BeforeZombifiedCustomBaseLayers = new(huApComp.CustomBaseLayers); zombiecomp.BeforeZombifiedCustomBaseLayers = new(huApComp.CustomBaseLayers);
if (TryComp<BloodstreamComponent>(target, out var stream))
zombiecomp.BeforeZombifiedBloodReagent = stream.BloodReagent;
_sharedHuApp.SetSkinColor(target, zombiecomp.SkinColor, verify: false, humanoid: huApComp); _sharedHuApp.SetSkinColor(target, zombiecomp.SkinColor, verify: false, humanoid: huApComp);
_sharedHuApp.SetBaseLayerColor(target, HumanoidVisualLayers.Eyes, zombiecomp.EyeColor, 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. //This makes it so the zombie doesn't take bloodloss damage.
//NOTE: they are supposed to bleed, just not take damage //NOTE: they are supposed to bleed, just not take damage
_bloodstream.SetBloodLossThreshold(target, 0f); _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. //This is specifically here to combat insuls, because frying zombies on grilles is funny as shit.
_serverInventory.TryUnequip(target, "gloves", true, true); _serverInventory.TryUnequip(target, "gloves", true, true);

View File

@@ -140,5 +140,17 @@ namespace Content.Shared.Zombies
/// </summary> /// </summary>
[DataField("greetSoundNotification")] [DataField("greetSoundNotification")]
public SoundSpecifier GreetSoundNotification = new SoundPathSpecifier("/Audio/Ambience/Antag/zombie_start.ogg"); public SoundSpecifier GreetSoundNotification = new SoundPathSpecifier("/Audio/Ambience/Antag/zombie_start.ogg");
/// <summary>
/// The blood reagent of the humanoid to restore in case of cloning
/// </summary>
[DataField("beforeZombifiedBloodReagent")]
public string BeforeZombifiedBloodReagent = String.Empty;
/// <summary>
/// The blood reagent to give the zombie. In case you want zombies that bleed milk, or something.
/// </summary>
[DataField("newBloodReagent")]
public string NewBloodReagent = "ZombieBlood";
} }
} }

View File

@@ -321,6 +321,12 @@ reagent-effect-guidebook-cause-zombie-infection =
*[other] give *[other] give
} an individual the zombie infection } 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 = reagent-effect-guidebook-missing =
{ $chance -> { $chance ->
[1] Causes [1] Causes

View File

@@ -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-name-spider-blood = blue blood
reagent-desc-spider-blood = Doesn't taste like blueberry juice. 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-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. 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.

View File

@@ -55,6 +55,9 @@ reagent-desc-phalanximine = Used in the treatment of cancer. Causes moderate rad
reagent-name-ambuzol = ambuzol reagent-name-ambuzol = ambuzol
reagent-desc-ambuzol = A highly engineered substance able to halt the progression of a zombie infection. 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-name-pulped-banana-peel = pulped banana peel
reagent-desc-pulped-banana-peel = Pulped banana peels have some effectiveness against bleeding. reagent-desc-pulped-banana-peel = Pulped banana peels have some effectiveness against bleeding.

View File

@@ -26,8 +26,9 @@
amount: 2 amount: 2
- id: GrenadeFlashBang - id: GrenadeFlashBang
amount: 2 amount: 2
- id: PillAmbuzolPlus
- id: PillAmbuzol - id: PillAmbuzol
amount: 5 amount: 4
- type: entity - type: entity
parent: ClothingBackpackDuffelSyndicateMedicalBundle parent: ClothingBackpackDuffelSyndicateMedicalBundle
@@ -246,6 +247,7 @@
- id: SyringeRomerol - id: SyringeRomerol
- id: WeaponRevolverMateba - id: WeaponRevolverMateba
- id: MagazineBoxMagnumIncendiary - id: MagazineBoxMagnumIncendiary
- id: PillAmbuzolPlus
- id: PillAmbuzol - id: PillAmbuzol
amount: 3 amount: 3

View File

@@ -325,6 +325,19 @@
- ReagentId: Ambuzol - ReagentId: Ambuzol
Quantity: 10 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 # Syringes
- type: entity - type: entity
name: ephedrine syringe name: ephedrine syringe

View File

@@ -58,6 +58,30 @@
- !type:PlantAdjustWater - !type:PlantAdjustWater
amount: 0.5 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 - type: reagent
id: Ichor id: Ichor
name: reagent-name-ichor name: reagent-name-ichor

View File

@@ -574,6 +574,23 @@
- !type:ReagentThreshold - !type:ReagentThreshold
min: 10 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 - type: reagent
id: PulpedBananaPeel id: PulpedBananaPeel
name: reagent-name-pulped-banana-peel name: reagent-name-pulped-banana-peel

View File

@@ -222,6 +222,17 @@
products: products:
Ambuzol: 4 Ambuzol: 4
- type: reaction
id: AmbuzolPlus
reactants:
Ambuzol:
amount: 5
ZombieBlood:
amount: 15
products:
Blood: 15
AmbuzolPlus: 5
- type: reaction - type: reaction
id: Synaptizine id: Synaptizine
reactants: reactants: