// Will only be accurate for the host public override string ToString() { var sb = new StringBuilder(); sb.AppendLine($"{Nickname}/{Species} {GenderSymbol} Lv.{Level}"); sb.AppendLine($"HP: {HP}/{MaxHP} ({HPPercentage:P2})"); sb.Append($"Types: {PBELocalizedString.GetTypeName(Type1).English}"); if (Type2 != PBEType.None) { sb.Append($"/{PBELocalizedString.GetTypeName(Type2).English}"); } sb.AppendLine(); sb.Append($"Known types: {PBELocalizedString.GetTypeName(KnownType1).English}"); if (KnownType2 != PBEType.None) { sb.Append($"/{PBELocalizedString.GetTypeName(KnownType2).English}"); } sb.AppendLine(); sb.AppendLine($"Position: {Team.TrainerName}'s {FieldPosition}"); sb.AppendLine($"Status1: {Status1}"); if (Status1 == PBEStatus1.Asleep) { sb.AppendLine($"Sleep turns: {Status1Counter}/{SleepTurns}"); } else if (Status1 == PBEStatus1.BadlyPoisoned) { sb.AppendLine($"Toxic Counter: {Status1Counter}"); } sb.AppendLine($"Status2: {Status2}"); if (Status2.HasFlag(PBEStatus2.Confused)) { sb.AppendLine($"Confusion turns: {ConfusionCounter}/{ConfusionTurns}"); } if (Status2.HasFlag(PBEStatus2.Disguised)) { sb.AppendLine($"Disguised as: {DisguisedAsPokemon.Nickname}"); } if (Status2.HasFlag(PBEStatus2.Infatuated)) { sb.AppendLine($"Infatuated with: {InfatuatedWithPokemon.Nickname}"); } if (Status2.HasFlag(PBEStatus2.LeechSeed)) { sb.AppendLine($"Seeded position: {SeededTeam.TrainerName}'s {SeededPosition}"); } if (Status2.HasFlag(PBEStatus2.Substitute)) { sb.AppendLine($"Substitute HP: {SubstituteHP}"); } sb.AppendLine($"Stats: [A] {Attack}, [D] {Defense}, [SA] {SpAttack}, [SD] {SpDefense}, [S] {Speed}, [W] {Weight:0.0}"); PBEStat[] statChanges = GetChangedStats(); if (statChanges.Length > 0) { var statStrs = new List <string>(7); if (Array.IndexOf(statChanges, PBEStat.Attack) != -1) { statStrs.Add($"[A] x{PBEBattle.GetStatChangeModifier(AttackChange, false):0.00}"); } if (Array.IndexOf(statChanges, PBEStat.Defense) != -1) { statStrs.Add($"[D] x{PBEBattle.GetStatChangeModifier(DefenseChange, false):0.00}"); } if (Array.IndexOf(statChanges, PBEStat.SpAttack) != -1) { statStrs.Add($"[SA] x{PBEBattle.GetStatChangeModifier(SpAttackChange, false):0.00}"); } if (Array.IndexOf(statChanges, PBEStat.SpDefense) != -1) { statStrs.Add($"[SD] x{PBEBattle.GetStatChangeModifier(SpDefenseChange, false):0.00}"); } if (Array.IndexOf(statChanges, PBEStat.Speed) != -1) { statStrs.Add($"[S] x{PBEBattle.GetStatChangeModifier(SpeedChange, false):0.00}"); } if (Array.IndexOf(statChanges, PBEStat.Accuracy) != -1) { statStrs.Add($"[AC] x{PBEBattle.GetStatChangeModifier(AccuracyChange, true):0.00}"); } if (Array.IndexOf(statChanges, PBEStat.Evasion) != -1) { statStrs.Add($"[E] x{PBEBattle.GetStatChangeModifier(EvasionChange, true):0.00}"); } sb.AppendLine($"Stat changes: {string.Join(", ", statStrs)}"); } sb.AppendLine($"Ability: {PBELocalizedString.GetAbilityName(Ability).English}"); sb.AppendLine($"Known ability: {(KnownAbility == PBEAbility.MAX ? "???" : PBELocalizedString.GetAbilityName(KnownAbility).English)}"); sb.AppendLine($"Item: {PBELocalizedString.GetItemName(Item).English}"); sb.AppendLine($"Known item: {(KnownItem == (PBEItem)ushort.MaxValue ? "???" : PBELocalizedString.GetItemName(KnownItem).English)}"); if (Moves.Contains(PBEMove.Frustration) || Moves.Contains(PBEMove.Return)) { sb.AppendLine($"Friendship: {Friendship} ({Friendship / byte.MaxValue:P2})"); } if (Moves.Contains(PBEMove.HiddenPower)) { sb.AppendLine($"{PBELocalizedString.GetMoveName(PBEMove.HiddenPower).English}: {PBELocalizedString.GetTypeName(IndividualValues.HiddenPowerType).English}:{IndividualValues.HiddenPowerBasePower}"); } sb.Append("Moves: "); for (int i = 0; i < Team.Battle.Settings.NumMoves; i++) { PBEBattleMoveset.PBEBattleMovesetSlot slot = Moves[i]; PBEMove move = slot.Move; if (i > 0) { sb.Append(", "); } sb.Append(PBELocalizedString.GetMoveName(slot.Move).English); if (move != PBEMove.None) { sb.Append($" ({slot.PP}/{slot.MaxPP})"); } } sb.AppendLine(); sb.Append("Known moves: "); for (int i = 0; i < Team.Battle.Settings.NumMoves; i++) { PBEBattleMoveset.PBEBattleMovesetSlot slot = KnownMoves[i]; PBEMove move = slot.Move; int pp = slot.PP; int maxPP = slot.MaxPP; if (i > 0) { sb.Append(", "); } sb.Append(move == PBEMove.MAX ? "???" : PBELocalizedString.GetMoveName(move).English); if (move != PBEMove.None && move != PBEMove.MAX) { sb.Append($" ({pp}{(maxPP == 0 ? ")" : $"/{maxPP})")}"); } }
// Will only be accurate for the host public override string ToString() { var sb = new StringBuilder(); sb.AppendLine($"{Nickname}/{Species} {GenderSymbol} Lv.{Level}"); sb.AppendLine($"HP: {HP}/{MaxHP} ({HPPercentage:P2})"); sb.AppendLine($"Types: {PBELocalizedString.GetTypeName(Type1).English}/{PBELocalizedString.GetTypeName(Type2).English}"); sb.AppendLine($"Position: {Team.TrainerName}'s {FieldPosition}"); sb.AppendLine($"Status1: {Status1}"); if (Status1 == PBEStatus1.Asleep) { sb.AppendLine($"Sleep turns: {Status1Counter}/{SleepTurns}"); } else if (Status1 == PBEStatus1.BadlyPoisoned) { sb.AppendLine($"Toxic Counter: {Status1Counter}"); } sb.AppendLine($"Status2: {Status2}"); if (Status2.HasFlag(PBEStatus2.Confused)) { sb.AppendLine($"Confusion turns: {ConfusionCounter}/{ConfusionTurns}"); } if (Status2.HasFlag(PBEStatus2.Disguised)) { sb.AppendLine($"Disguised as: {DisguisedAsPokemon.Nickname}"); } if (Status2.HasFlag(PBEStatus2.Infatuated)) { sb.AppendLine($"Infatuated with: {InfatuatedWithPokemon.Nickname}"); } if (Status2.HasFlag(PBEStatus2.LeechSeed)) { sb.AppendLine($"Seeded position: {SeededTeam.TrainerName}'s {SeededPosition}"); } if (Status2.HasFlag(PBEStatus2.Substitute)) { sb.AppendLine($"Substitute HP: {SubstituteHP}"); } sb.AppendLine($"Stats: [A] {Attack}, [D] {Defense}, [SA] {SpAttack}, [SD] {SpDefense}, [S] {Speed}, [W] {Weight:0.0}"); PBEStat[] statChanges = GetChangedStats(); if (statChanges.Length > 0) { var statStrs = new List <string>(7); if (Array.IndexOf(statChanges, PBEStat.Attack) != -1) { statStrs.Add($"[A] x{PBEBattle.GetStatChangeModifier(AttackChange, false):0.00}"); } if (Array.IndexOf(statChanges, PBEStat.Defense) != -1) { statStrs.Add($"[D] x{PBEBattle.GetStatChangeModifier(DefenseChange, false):0.00}"); } if (Array.IndexOf(statChanges, PBEStat.SpAttack) != -1) { statStrs.Add($"[SA] x{PBEBattle.GetStatChangeModifier(SpAttackChange, false):0.00}"); } if (Array.IndexOf(statChanges, PBEStat.SpDefense) != -1) { statStrs.Add($"[SD] x{PBEBattle.GetStatChangeModifier(SpDefenseChange, false):0.00}"); } if (Array.IndexOf(statChanges, PBEStat.Speed) != -1) { statStrs.Add($"[S] x{PBEBattle.GetStatChangeModifier(SpeedChange, false):0.00}"); } if (Array.IndexOf(statChanges, PBEStat.Accuracy) != -1) { statStrs.Add($"[AC] x{PBEBattle.GetStatChangeModifier(AccuracyChange, true):0.00}"); } if (Array.IndexOf(statChanges, PBEStat.Evasion) != -1) { statStrs.Add($"[E] x{PBEBattle.GetStatChangeModifier(EvasionChange, true):0.00}"); } sb.AppendLine($"Stat changes: {string.Join(", ", statStrs)}"); } sb.AppendLine($"Ability: {PBELocalizedString.GetAbilityName(Ability).English}"); sb.AppendLine($"Known ability: {(KnownAbility == PBEAbility.MAX ? "???" : PBELocalizedString.GetAbilityName(KnownAbility).English)}"); sb.AppendLine($"Item: {PBELocalizedString.GetItemName(Item).English}"); sb.AppendLine($"Known item: {(KnownItem == (PBEItem)ushort.MaxValue ? "???" : PBELocalizedString.GetItemName(KnownItem).English)}"); if (Array.IndexOf(Moves, PBEMove.Frustration) != -1 || Array.IndexOf(Moves, PBEMove.Return) != -1) { sb.AppendLine($"Friendship: {Friendship} ({Friendship / (double)byte.MaxValue:P2})"); } if (Array.IndexOf(Moves, PBEMove.HiddenPower) != -1) { sb.AppendLine($"{PBELocalizedString.GetMoveName(PBEMove.HiddenPower).English}: {PBELocalizedString.GetTypeName(IndividualValues.HiddenPowerType).English}/{IndividualValues.HiddenPowerBasePower}"); } string[] moveStrs = new string[Moves.Length]; for (int i = 0; i < moveStrs.Length; i++) { moveStrs[i] = $"{PBELocalizedString.GetMoveName(Moves[i]).English} {PP[i]}/{MaxPP[i]}"; } sb.AppendLine($"Moves: {string.Join(", ", moveStrs)}"); sb.AppendLine($"Usable moves: {string.Join(", ", GetUsableMoves().Select(m => PBELocalizedString.GetMoveName(m).English))}"); sb.Append($"Known moves: {string.Join(", ", KnownMoves.Select(m => m == PBEMove.MAX ? "???" : PBELocalizedString.GetMoveName(m).English))}"); return(sb.ToString()); }