Carry over other mutations when doing species mutation (#20551)
This commit is contained in:
@@ -3,6 +3,7 @@ using Robust.Shared.Random;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using System.Linq;
|
||||
using Content.Shared.Atmos;
|
||||
using FastAccessors;
|
||||
|
||||
namespace Content.Server.Botany;
|
||||
|
||||
@@ -269,6 +270,7 @@ public sealed class MutationSystem : EntitySystem
|
||||
{
|
||||
seedChemQuantity.Min = 1;
|
||||
seedChemQuantity.Max = 1 + amount;
|
||||
seedChemQuantity.Inherent = false;
|
||||
}
|
||||
int potencyDivisor = (int) Math.Ceiling(100.0f / seedChemQuantity.Max);
|
||||
seedChemQuantity.PotencyDivisor = potencyDivisor;
|
||||
@@ -295,10 +297,7 @@ public sealed class MutationSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
var oldSeed = seed.Clone();
|
||||
seed = protoSeed.Clone();
|
||||
seed.Potency = oldSeed.Potency;
|
||||
seed.Yield = oldSeed.Yield;
|
||||
seed = seed.SpeciesChange(protoSeed);
|
||||
}
|
||||
|
||||
private Color RandomColor(Color color, int bits, int totalbits, float mult)
|
||||
@@ -330,12 +329,14 @@ public sealed class MutationSystem : EntitySystem
|
||||
{
|
||||
val[otherChem.Key] = Random(0.5f) ? otherChem.Value : val[otherChem.Key];
|
||||
}
|
||||
// if target plant doesn't have this chemical, has 50% chance to add it.
|
||||
// if target plant doesn't have this chemical, has 50% chance to add it.
|
||||
else
|
||||
{
|
||||
if (Random(0.5f))
|
||||
{
|
||||
val.Add(otherChem.Key, otherChem.Value);
|
||||
var fixedChem = otherChem.Value;
|
||||
fixedChem.Inherent = false;
|
||||
val.Add(otherChem.Key, fixedChem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user