namespace pkNX.Structures;
///
/// Criteria for evolving to this branch in the Evolution Tree
///
public class EvolutionMethod
{
public EvolutionMethod Copy(int species = -1)
{
if (species < 0)
species = Species;
return new EvolutionMethod
{
Method = Method,
Species = (ushort)species,
Form = Form,
Argument = Argument,
Level = Level,
};
}
public bool HasData => Species != 0;
/// Evolve to Species
public ushort Species { get; set; }
/// Conditional Argument (different from )
public ushort Argument { get; set; }
/// Evolution Method
public EvolutionType Method { get; set; }
/// Destination Form
public byte Form { get; set; }
/// Conditional Argument (different from )
public byte Level { get; set; }
public override string ToString() => $"{(Species)Species}-{Form} [{Argument}] @ {Level}{(RequiresLevelUp ? "X" : "")}";
/// Is if the evolved form isn't modified. Special consideration for , which forces 1.
private const byte AnyForm = byte.MaxValue;
public bool RequiresLevelUp => Method.IsLevelUpRequired();
///
/// Returns the form that the Pokémon will have after evolution.
///
/// Un-evolved Form ID
public byte GetDestinationForm(byte form)
{
if (Method == EvolutionType.LevelUpFormFemale1)
return 1;
if (Form == AnyForm)
return form;
return Form;
}
}