mirror of
https://github.com/kwsch/pkNX.git
synced 2026-09-11 12:05:25 -05:00
Add every level evolution randomizer
Every new level up grants an evolution to the Pokémon. Makes for an incredibly varied playthrough!
This commit is contained in:
@@ -27,6 +27,8 @@ public override void Execute()
|
||||
for (var i = 0; i < Evolutions.Length; i++)
|
||||
{
|
||||
var evo = Evolutions[i];
|
||||
if (Personal[i].HP == 0)
|
||||
continue;
|
||||
Randomize(evo, i);
|
||||
}
|
||||
}
|
||||
@@ -40,6 +42,17 @@ public void ExecuteTrade()
|
||||
}
|
||||
}
|
||||
|
||||
public void ExecuteEvolveEveryLevel()
|
||||
{
|
||||
for (var i = 0; i < Evolutions.Length; i++)
|
||||
{
|
||||
var evo = Evolutions[i];
|
||||
if (Personal[i].HP == 0)
|
||||
continue;
|
||||
MakeEvolveEveryLevel(evo, i);
|
||||
}
|
||||
}
|
||||
|
||||
private void Randomize(EvolutionSet evos, int species)
|
||||
{
|
||||
foreach (var evo in evos.PossibleEvolutions)
|
||||
@@ -98,5 +111,26 @@ private void ReplaceTradeMethod(EvolutionMethod evo, int species, int evoIndex)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void MakeEvolveEveryLevel(EvolutionSet evos, int species)
|
||||
{
|
||||
var evoSet = evos.PossibleEvolutions;
|
||||
var evoNew = new EvolutionMethod()
|
||||
{
|
||||
Argument = 0, // clear
|
||||
Form = 0, // randomized later
|
||||
Level = 1,
|
||||
Method = EvolutionType.LevelUp,
|
||||
Species = species, // randomized later
|
||||
};
|
||||
|
||||
evoSet[0] = evoNew;
|
||||
|
||||
if (evoSet[1].HasData) // has other branched evolutions; remove them
|
||||
{
|
||||
for (int i = 1; i < evoSet.Length; i++)
|
||||
evoSet[i] = new EvolutionMethod();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user