Botany tweaks vol. 2 (#18888)

* Even more consumption

* Revert "Even more consumption"

This reverts commit 94ae0eca0ba1b4a55913f92519e1354b77e70734.

Oops forgot a file

* Believe it or not, more nutrient consumption

* Buff ez nutrient and l4z

* Add left 4 zed to emagged nutrimax just because

* Change some thresholds
This commit is contained in:
Doru991
2023-08-10 04:43:06 +03:00
committed by GitHub
parent e4bfb27a3b
commit 30f0ad2134
7 changed files with 36 additions and 14 deletions

View File

@@ -119,6 +119,7 @@ public sealed class MutationSystem : EntitySystem
{
// Probability that a bit flip happens for this value.
float p = mult*bits/totalbits;
p = Math.Clamp(p, 0, 1);
if (!Random(p))
{
return;
@@ -150,6 +151,7 @@ public sealed class MutationSystem : EntitySystem
{
// Probability that a bit flip happens for this value.
float p = mult*bits/totalbits;
p = Math.Clamp(p, 0, 1);
if (!Random(p))
{
return;
@@ -174,7 +176,8 @@ public sealed class MutationSystem : EntitySystem
private void MutateBool(ref bool val, bool polarity, int bits, int totalbits, float mult)
{
// Probability that a bit flip happens for this value.
float p = mult*bits/totalbits;
float p = mult * bits / totalbits;
p = Math.Clamp(p, 0, 1);
if (!Random(p))
{
return;
@@ -186,6 +189,7 @@ public sealed class MutationSystem : EntitySystem
private void MutateHarvestType(ref HarvestType val, int bits, int totalbits, float mult)
{
float p = mult * bits/totalbits;
p = Math.Clamp(p, 0, 1);
if (!Random(p))
return;