]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Adding new Cryogenics Reagent - Opporozidone (Attempt 2) (#24074)
authorGotimanga <127038462+Gotimanga@users.noreply.github.com>
Mon, 29 Apr 2024 04:13:14 +0000 (05:13 +0100)
committerGitHub <noreply@github.com>
Mon, 29 Apr 2024 04:13:14 +0000 (21:13 -0700)
* Fixing mistakes

* How did I make the same mistake twice

---------

Co-authored-by: Kara <lunarautomaton6@gmail.com>
Content.Server/Atmos/Rotting/RottingSystem.cs
Content.Server/Chemistry/ReagentEffects/ReduceRotting.cs [new file with mode: 0644]
Resources/Locale/en-US/guidebook/chemistry/effects.ftl
Resources/Locale/en-US/reagents/meta/medicine.ftl
Resources/Prototypes/Reagents/medicine.yml
Resources/Prototypes/Recipes/Reactions/medicine.yml

index 47bac84e0ca8c0fb1757c53205aafc3964c791ef..dd6387ff4463df1568a3be961f98efa42b2ed7a0 100644 (file)
@@ -149,6 +149,29 @@ public sealed class RottingSystem : SharedRottingSystem
         args.Handled = component.CurrentTemperature < Atmospherics.T0C + 0.85f;
     }
 
+
+    public void ReduceAccumulator(EntityUid uid, TimeSpan time)
+    {
+        if (!TryComp<PerishableComponent>(uid, out var perishable))
+            return;
+
+        if (!TryComp<RottingComponent>(uid, out var rotting))
+        {
+            perishable.RotAccumulator -= time;
+            return;
+        }
+        var total = (rotting.TotalRotTime + perishable.RotAccumulator) - time;
+
+        if (total < perishable.RotAfter)
+        {
+            RemCompDeferred(uid, rotting);
+            perishable.RotAccumulator = total;
+        }
+
+        else
+            rotting.TotalRotTime = total - perishable.RotAfter;
+    }
+    
     /// <summary>
     /// Is anything speeding up the decay?
     /// e.g. buried in a grave
diff --git a/Content.Server/Chemistry/ReagentEffects/ReduceRotting.cs b/Content.Server/Chemistry/ReagentEffects/ReduceRotting.cs
new file mode 100644 (file)
index 0000000..cea4f85
--- /dev/null
@@ -0,0 +1,31 @@
+using Content.Shared.Chemistry.Reagent;
+using JetBrains.Annotations;
+using Robust.Shared.Prototypes;
+using Content.Server.Atmos.Rotting;
+
+namespace Content.Server.Chemistry.ReagentEffects
+{
+    /// <summary>
+    /// Reduces the rotting accumulator on the patient, making them revivable.
+    /// </summary>
+    [UsedImplicitly]
+    public sealed partial class ReduceRotting : ReagentEffect
+    {
+        [DataField("seconds")]
+        public double RottingAmount = 10;
+
+        protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
+            => Loc.GetString("reagent-effect-guidebook-reduce-rotting",
+                ("chance", Probability),
+                ("time", RottingAmount));
+        public override void Effect(ReagentEffectArgs args)
+        {
+            if (args.Scale != 1f)
+                return;
+
+            var rottingSys = args.EntityManager.EntitySysManager.GetEntitySystem<RottingSystem>();
+
+            rottingSys.ReduceAccumulator(args.SolutionEntity, TimeSpan.FromSeconds(RottingAmount));
+        }
+    }
+}
index 94c137608333d8edddf5e96fec606667688c9e22..5b449cd520a67ff0822285c03466917b49c091d3 100644 (file)
@@ -339,6 +339,12 @@ reagent-effect-guidebook-innoculate-zombie-infection =
         *[other] cure
     } an ongoing zombie infection, and provides immunity to future infections
 
+reagent-effect-guidebook-reduce-rotting = 
+    { $chance ->
+        [1] Regenerates
+        *[other] regenerate
+    } {NATURALFIXED($time, 3)} {MANY("second", $time)} of rotting
+
 reagent-effect-guidebook-missing =
     { $chance ->
         [1] Causes
index a0b557e28f7ba15a97e30e18a75ca493c3dcd94c..a84e8315fdad2301ec479cab25685bf3cc7f7e1f 100644 (file)
@@ -127,6 +127,9 @@ reagent-desc-pyrazine = Efficiently heals burns from the hottest of fires. Cause
 reagent-name-insuzine = insuzine
 reagent-desc-insuzine = Rapidly repairs dead tissue caused by electrocution, but cools you slightly. Completely freezes the patient when overdosed.
 
+reagent-name-opporozidone = opporozidone
+reagent-desc-opporozidone= A difficult to synthesize cryogenic drug used to regenerate rotting tissue and brain matter.
+
 reagent-name-necrosol = necrosol
 reagent-desc-necrosol = A necrotic substance that seems to be able to heal frozen corpses. It can treat and rejuvenate plants when applied in small doses.
 
index aae367d9eb9ae362e9f0225f9fc244970d3982cf..ad0d39a134603a501e4bca43c7a3b968ef3b2edf 100644 (file)
         conditions:
         - !type:ReagentThreshold
           min: 12
+          
+- type: reagent
+  id: Opporozidone #Name based of an altered version of the startreck chem "Opporozine"
+  name: reagent-name-opporozidone
+  group: Medicine
+  desc: reagent-desc-opporozidone
+  physicalDesc: reagent-physical-desc-sickly
+  flavor: acid
+  color: "#b5e36d"
+  worksOnTheDead: true
+  metabolisms:
+    Medicine:
+      effects:
+        - !type:ReduceRotting
+          seconds: 20
+          conditions:
+          #Patient must be dead and in a cryo tube (or something cold)
+          - !type:Temperature
+            max: 150.0
+          - !type:MobStateCondition
+            mobstate: Dead
 
 - type: reagent
   id: Necrosol
index 0a36f869b3c52685ca423b9afcf9e126a245285f..2e9b1d4f854fa66218001ab33969558b9eefacfb 100644 (file)
   products:
     Insuzine: 3
 
+- type: reaction
+  id: Opporozidone
+  minTemp: 400 #Maybe if a method of reducing reagent temp exists one day, this could be -50
+  reactants:
+    Cognizine: 
+      amount: 1
+    Plasma:
+      amount: 2
+    Doxarubixadone:
+      amount: 1
+  products:
+    Opporozidone: 3
+
 - type: reaction
   id: Necrosol
   impact: Medium