mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-22 06:57:42 -05:00
Add more party related properties/methods
This commit is contained in:
@@ -782,12 +782,32 @@ public void SetStats(ushort[] stats)
|
||||
Stat_SPD = stats[5];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if Party Stats are present. False if not initialized (from stored format).
|
||||
/// </summary>
|
||||
public bool PartyStatsPresent => Stat_HPMax != 0;
|
||||
|
||||
/// <summary>
|
||||
/// Clears any status condition and refreshes the stats.
|
||||
/// </summary>
|
||||
public void Heal()
|
||||
{
|
||||
SetStats(GetStats(PersonalInfo));
|
||||
Status_Condition = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enforces that Party Stat values are present.
|
||||
/// </summary>
|
||||
/// <returns>True if stats were refreshed, false if stats were already present.</returns>
|
||||
public bool ForcePartyData()
|
||||
{
|
||||
if (PartyStatsPresent)
|
||||
return false;
|
||||
Heal();
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the <see cref="PKM"/> can hold its <see cref="HeldItem"/>.
|
||||
/// </summary>
|
||||
|
||||
@@ -253,7 +253,7 @@ private void LoadFieldsFromPKM(PKM pk, bool focus = true, bool skipConversionChe
|
||||
MT_Level.Text = (pk.Stat_HPMax != 0 ? pk.Stat_Level : Experience.GetLevel(pk.EXP, pk.Species, pk.AltForm)).ToString();
|
||||
TB_EXP.Text = pk.EXP.ToString();
|
||||
MT_Form.Text = pk.AltForm.ToString();
|
||||
if (pk.Stat_HPMax != 0) // stats present
|
||||
if (pk.PartyStatsPresent) // stats present
|
||||
Stats.LoadPartyStats(pk);
|
||||
}
|
||||
FieldsLoaded = true;
|
||||
|
||||
Reference in New Issue
Block a user