Skip to content

Commit

Permalink
Cross repeatable (#1528)
Browse files Browse the repository at this point in the history
  • Loading branch information
in1ef authored Aug 6, 2024
1 parent fe844c6 commit d1ed4b5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Content.Server/Botany/Systems/MutationSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ public SeedData Cross(SeedData a, SeedData b)
CrossBool(ref result.TurnIntoKudzu, a.TurnIntoKudzu);
CrossBool(ref result.CanScream, a.CanScream);

CrossRepeatable(ref result.HarvestRepeat, ref a.HarvestRepeat); //SS220 CrossRepeatable

CrossGasses(ref result.ExudeGasses, a.ExudeGasses);
CrossGasses(ref result.ConsumeGasses, a.ConsumeGasses);

Expand Down Expand Up @@ -407,6 +409,13 @@ private void CrossBool(ref bool val, bool other)
val = Random(0.5f) ? val : other;
}

//SS220 CrossRepeatable start
private void CrossRepeatable(ref HarvestType val, ref HarvestType other)
{
val = Random(0.15f) ? val : other;
}
//SS220 CrossRepeatable end

private bool Random(float p)
{
return _robustRandom.Prob(p);
Expand Down

0 comments on commit d1ed4b5

Please sign in to comment.