Elin
EnsureMinimumSeedDrop
Farming code
This part controls the chance for crops to level up :

int num3 = 220 / (Mathf.Clamp(<Player Farming Level> - <Crop Seed Level>, 0, 50) * 2 + 10 + <1 if watered> * 2 + ((<1 if fertilized> > 0) ? 20 : 0) + (<Player worships Kumiromi> ? 25 : 0)); if (EClass.player.isAutoFarming) { num3 = 2 + num3 * 2; } if (EClass.rnd(num3) == 0) // Enter leveling block

Basically, the chances to level up a crop whenever it is harvested is based on your farming skill - crop level, maxing at 50. Then you have modifiers like watering, fertilizer, etc.

There is also an auto farming penalty. At the end, it does a random roll and if num3 = 0, it will level up.

So the simple way to make it always level up is to just replace all the code before the random with num3 = 0.

int num3 = 0 if (EClass.rnd(num3) == 0) // Enter leveling block

Look for
public static Thing MakeSeed(SourceObj.Row obj, PlantData plant = null)
starting at line 73 in TraitSeed.cs.

Then this is the part that determines how many levels a seed can gain when it levels up :

if (EClass.rnd(num3) == 0) { int num4 = Mathf.Max(5, EClass.pc.Evalue(286)) - thing2.encLV; if (num4 <= 0) { if (!EClass.player.isAutoFarming) { Msg.Say("seedLvLimit", thing2); } } else { int num5 = Mathf.Clamp(EClass.rnd(num4) - 5, 1, EClass.player.isAutoFarming ? 3 : 10); LevelSeed(thing2, obj, num5); EClass.pc.PlaySound("seed_level"); } } Rand.SetSeed();

This starts at line 102 of TraitSeed.cs.

Basically do the same thing you already did in your mod, set num5 = player's farming skill (Evalue 286), followed by Rand.Seteed() and it should work. Specifically this aprt here :

int num5 = Mathf.Clamp(EClass.rnd(num4) - 5, 1, EClass.player.isAutoFarming ? 3 : 10);

Instead of doing the clamp and random, set it to the player's farming skill so it levels to the max instantly.
< >
Showing 1-2 of 2 comments
Beinded  [developer] 25 Feb @ 2:07pm 
I tried and for now I couldn't get a result
Question 27 Feb @ 11:21am 
Originally posted by Beinded:
I tried and for now I couldn't get a result

Hmm, have you tried asking in the modding channel in the official Elin discord? I might have gotten it wrong.
< >
Showing 1-2 of 2 comments
Per page: 1530 50