Exemple #1
0
    private static IEnumerable <string> GetHeader(PKM pk, GameStrings s)
    {
        string filename = pk.Nickname;

        if ((uint)pk.Species < s.Species.Count)
        {
            var name = s.Species[pk.Species];
            if (pk.Nickname != name)
            {
                filename += $" ({name})";
            }
        }
        yield return(filename);

        if (pk.Format >= 3 && (uint)pk.Ability < s.Ability.Count)
        {
            yield return($"[{s.Ability[pk.Ability]}]");
        }

        var level = pk.Stat_Level;

        if (level == 0)
        {
            level = pk.CurrentLevel;
        }
        yield return($"lv{level}");

        if (pk.HeldItem > 0)
        {
            var items = s.GetItemStrings(pk.Format);
            if ((uint)pk.HeldItem < items.Length)
            {
                yield return($" @ {items[pk.HeldItem]}");
            }
        }

        if (pk.Format >= 3 && (uint)pk.Nature < s.Natures.Count)
        {
            yield return(s.natures[pk.Nature]);
        }
    }