Botany balancing fixes and QoL ('No romerol ambrosia' edition) (#21756)
* Chem 1984 phase 1 * Chem 1984 phase 2 * Notification on species mutation * Plant yml balancing * Better localization * First version of reagent list * Revert "Better localization" nvm This reverts commit bab87cb1bd58523164d306dccaefc1ac5c6b64ad. * cooler reagents and no more popups * :trollface: * I’m blind
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
|
using Content.Shared.Random;
|
||||||
|
using Content.Shared.Random.Helpers;
|
||||||
using Content.Shared.Chemistry.Reagent;
|
using Content.Shared.Chemistry.Reagent;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Shared.Atmos;
|
using Content.Shared.Atmos;
|
||||||
@@ -11,11 +13,12 @@ public sealed class MutationSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
||||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||||
private List<ReagentPrototype> _allChemicals = default!;
|
private WeightedRandomFillSolutionPrototype _randomChems = default!;
|
||||||
|
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
_allChemicals = _prototypeManager.EnumeratePrototypes<ReagentPrototype>().ToList();
|
_randomChems = _prototypeManager.Index<WeightedRandomFillSolutionPrototype>("RandomPickBotanyReagent");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -37,7 +40,7 @@ public sealed class MutationSystem : EntitySystem
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add up everything in the bits column and put the number here.
|
// Add up everything in the bits column and put the number here.
|
||||||
const int totalbits = 270;
|
const int totalbits = 275;
|
||||||
|
|
||||||
// Tolerances (55)
|
// Tolerances (55)
|
||||||
MutateFloat(ref seed.NutrientConsumption , 0.05f, 1.2f, 5, totalbits, severity);
|
MutateFloat(ref seed.NutrientConsumption , 0.05f, 1.2f, 5, totalbits, severity);
|
||||||
@@ -81,10 +84,10 @@ public sealed class MutationSystem : EntitySystem
|
|||||||
MutateGasses(ref seed.ConsumeGasses, 0.01f, 0.5f, 1, totalbits, severity);
|
MutateGasses(ref seed.ConsumeGasses, 0.01f, 0.5f, 1, totalbits, severity);
|
||||||
|
|
||||||
// Chems (20)
|
// Chems (20)
|
||||||
MutateChemicals(ref seed.Chemicals, 5, 20, totalbits, severity);
|
MutateChemicals(ref seed.Chemicals, 20, totalbits, severity);
|
||||||
|
|
||||||
// Species (5)
|
// Species (10)
|
||||||
MutateSpecies(ref seed, 5, totalbits, severity);
|
MutateSpecies(ref seed, 10, totalbits, severity);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SeedData Cross(SeedData a, SeedData b)
|
public SeedData Cross(SeedData a, SeedData b)
|
||||||
@@ -246,7 +249,7 @@ public sealed class MutationSystem : EntitySystem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MutateChemicals(ref Dictionary<string, SeedChemQuantity> chemicals, int max, int bits, int totalbits, float mult)
|
private void MutateChemicals(ref Dictionary<string, SeedChemQuantity> chemicals, int bits, int totalbits, float mult)
|
||||||
{
|
{
|
||||||
float probModify = mult * bits / totalbits;
|
float probModify = mult * bits / totalbits;
|
||||||
probModify = Math.Clamp(probModify, 0, 1);
|
probModify = Math.Clamp(probModify, 0, 1);
|
||||||
@@ -254,11 +257,11 @@ public sealed class MutationSystem : EntitySystem
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Add a random amount of a random chemical to this set of chemicals
|
// Add a random amount of a random chemical to this set of chemicals
|
||||||
ReagentPrototype selectedChemical = _robustRandom.Pick(_allChemicals);
|
if (_randomChems != null)
|
||||||
if (selectedChemical != null)
|
|
||||||
{
|
{
|
||||||
string chemicalId = selectedChemical.ID;
|
var pick = _randomChems.Pick(_robustRandom);
|
||||||
int amount = _robustRandom.Next(1, max);
|
string chemicalId = pick.reagent;
|
||||||
|
int amount = _robustRandom.Next(1, ((int)pick.quantity));
|
||||||
SeedChemQuantity seedChemQuantity = new SeedChemQuantity();
|
SeedChemQuantity seedChemQuantity = new SeedChemQuantity();
|
||||||
if (chemicals.ContainsKey(chemicalId))
|
if (chemicals.ContainsKey(chemicalId))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -172,8 +172,8 @@
|
|||||||
- type: MeleeWeapon
|
- type: MeleeWeapon
|
||||||
damage:
|
damage:
|
||||||
types:
|
types:
|
||||||
Heat: 6
|
Heat: 7.5
|
||||||
Caustic: 6
|
Caustic: 7.5
|
||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
food:
|
food:
|
||||||
@@ -677,12 +677,12 @@
|
|||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
food:
|
food:
|
||||||
maxVol: 19
|
maxVol: 24
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: Nutriment
|
- ReagentId: Nutriment
|
||||||
Quantity: 5
|
Quantity: 5
|
||||||
- ReagentId: SpaceLube
|
- ReagentId: SpaceLube
|
||||||
Quantity: 10
|
Quantity: 15
|
||||||
- ReagentId: Vitamin
|
- ReagentId: Vitamin
|
||||||
Quantity: 4
|
Quantity: 4
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
@@ -1242,10 +1242,10 @@
|
|||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
food:
|
food:
|
||||||
maxVol: 22
|
maxVol: 20
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: Omnizine
|
- ReagentId: Omnizine
|
||||||
Quantity: 5
|
Quantity: 3
|
||||||
- ReagentId: SpaceDrugs
|
- ReagentId: SpaceDrugs
|
||||||
Quantity: 5
|
Quantity: 5
|
||||||
- ReagentId: Nutriment
|
- ReagentId: Nutriment
|
||||||
@@ -1398,19 +1398,19 @@
|
|||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
food:
|
food:
|
||||||
maxVol: 9
|
maxVol: 7
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: Nutriment
|
- ReagentId: Nutriment
|
||||||
Quantity: 5
|
Quantity: 5
|
||||||
- ReagentId: CarpoToxin
|
- ReagentId: CarpoToxin
|
||||||
Quantity: 4
|
Quantity: 2
|
||||||
- type: Produce
|
- type: Produce
|
||||||
seedId: koibean
|
seedId: koibean
|
||||||
- type: Extractable
|
- type: Extractable
|
||||||
juiceSolution:
|
juiceSolution:
|
||||||
reagents:
|
reagents:
|
||||||
- ReagentId: CarpoToxin
|
- ReagentId: CarpoToxin
|
||||||
Quantity: 4
|
Quantity: 2
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: watermelon
|
name: watermelon
|
||||||
|
|||||||
114
Resources/Prototypes/Hydroponics/mutations.yml
Normal file
114
Resources/Prototypes/Hydroponics/mutations.yml
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
- type: weightedRandomFillSolution
|
||||||
|
id: RandomPickBotanyReagent
|
||||||
|
fills:
|
||||||
|
- quantity: 5
|
||||||
|
weight: 0.5
|
||||||
|
reagents:
|
||||||
|
- Omnizine
|
||||||
|
- Nocturine
|
||||||
|
- Barozine
|
||||||
|
- Lexorin
|
||||||
|
- Honk
|
||||||
|
- BuzzochloricBees
|
||||||
|
- Stimulants
|
||||||
|
- quantity: 5
|
||||||
|
weight: 1
|
||||||
|
reagents:
|
||||||
|
- Cognizine
|
||||||
|
- Toxin
|
||||||
|
- Leporazine
|
||||||
|
- Epinephrine
|
||||||
|
- CarpoToxin
|
||||||
|
- SulfuricAcid
|
||||||
|
- Licoxide
|
||||||
|
- Napalm
|
||||||
|
- ChlorineTrifluoride
|
||||||
|
- Radium
|
||||||
|
- Gold
|
||||||
|
- Uranium
|
||||||
|
- Phosphorus
|
||||||
|
- AtomicBomb
|
||||||
|
- Neurotoxin
|
||||||
|
- ChangelingSting
|
||||||
|
- CogChamp
|
||||||
|
- quantity: 5
|
||||||
|
weight: 2
|
||||||
|
reagents:
|
||||||
|
- Desoxyephedrine
|
||||||
|
- ChloralHydrate
|
||||||
|
- Ipecac
|
||||||
|
- Hyronalin
|
||||||
|
- Pax
|
||||||
|
- Cryoxadone
|
||||||
|
- Ethylredoxrazine
|
||||||
|
- Dylovene
|
||||||
|
- Histamine
|
||||||
|
- Blood
|
||||||
|
- WeldingFuel
|
||||||
|
- Mercury
|
||||||
|
- Silver
|
||||||
|
- Phenol
|
||||||
|
- Ultravasculine
|
||||||
|
- Carbon
|
||||||
|
- THC
|
||||||
|
- Nicotine
|
||||||
|
- DoctorsDelight
|
||||||
|
- IceCream
|
||||||
|
- Cola
|
||||||
|
- Diphenhydramine
|
||||||
|
- Iron
|
||||||
|
- quantity: 10
|
||||||
|
weight: 3
|
||||||
|
reagents:
|
||||||
|
- Bicaridine
|
||||||
|
- Dermaline
|
||||||
|
- Ephedrine
|
||||||
|
- NorepinephricAcid
|
||||||
|
- Tricordrazine
|
||||||
|
- Saline
|
||||||
|
- PulpedBananaPeel
|
||||||
|
- Cryptobiolin
|
||||||
|
- EZNutrient
|
||||||
|
- Ammonia
|
||||||
|
- RobustHarvest
|
||||||
|
- SpaceLube
|
||||||
|
- Theobromine
|
||||||
|
- Allicin
|
||||||
|
- Acetone
|
||||||
|
- Ash
|
||||||
|
- SodiumCarbonate
|
||||||
|
- SpaceDrugs
|
||||||
|
- MuteToxin
|
||||||
|
- JuiceBerryPoison
|
||||||
|
- Pilk
|
||||||
|
- Posca
|
||||||
|
- Ethanol
|
||||||
|
- FourteenLoko
|
||||||
|
- LemonLime
|
||||||
|
- Enzyme
|
||||||
|
- Vinegar
|
||||||
|
- Potassium
|
||||||
|
- Fluorine
|
||||||
|
- Aluminium
|
||||||
|
- quantity: 10
|
||||||
|
weight: 3.5
|
||||||
|
reagents:
|
||||||
|
- Vitamin
|
||||||
|
- Kelotane
|
||||||
|
- Inaprovaline
|
||||||
|
- Oil
|
||||||
|
- Slime
|
||||||
|
- Fiber
|
||||||
|
- Water
|
||||||
|
- Sugar
|
||||||
|
- Cream
|
||||||
|
- SodaWater
|
||||||
|
- Ice
|
||||||
|
- JuiceCarrot
|
||||||
|
- JuicePotato
|
||||||
|
- Protein
|
||||||
|
- Flour
|
||||||
|
- Soysauce
|
||||||
|
- TableSalt
|
||||||
|
- Chlorine
|
||||||
|
- Mercury
|
||||||
@@ -427,8 +427,8 @@
|
|||||||
Max: 5
|
Max: 5
|
||||||
PotencyDivisor: 20
|
PotencyDivisor: 20
|
||||||
SpaceLube:
|
SpaceLube:
|
||||||
Min: 1
|
Min: 5
|
||||||
Max: 10
|
Max: 15
|
||||||
PotencyDivisor: 10
|
PotencyDivisor: 10
|
||||||
Vitamin:
|
Vitamin:
|
||||||
Min: 1
|
Min: 1
|
||||||
@@ -1028,8 +1028,8 @@
|
|||||||
PotencyDivisor: 10
|
PotencyDivisor: 10
|
||||||
Omnizine: # Don't kill me
|
Omnizine: # Don't kill me
|
||||||
Min: 1
|
Min: 1
|
||||||
Max: 5
|
Max: 3
|
||||||
PotencyDivisor: 20
|
PotencyDivisor: 35
|
||||||
SpaceDrugs:
|
SpaceDrugs:
|
||||||
Min: 1
|
Min: 1
|
||||||
Max: 5
|
Max: 5
|
||||||
@@ -1164,8 +1164,8 @@
|
|||||||
chemicals:
|
chemicals:
|
||||||
Nutriment:
|
Nutriment:
|
||||||
Min: 1
|
Min: 1
|
||||||
Max: 3
|
Max: 2
|
||||||
PotencyDivisor: 25
|
PotencyDivisor: 50
|
||||||
|
|
||||||
- type: seed
|
- type: seed
|
||||||
id: koibean
|
id: koibean
|
||||||
|
|||||||
Reference in New Issue
Block a user