コード例 #1
0
        internal static void ToJson(this IPBEPokemon pkmn, JsonTextWriter w)
        {
            w.WriteStartObject();
            w.WritePropertyName(nameof(IPBEPokemon.Species));
            PBESpecies species = pkmn.Species;

            w.WriteValue(species.ToString());
            if (PBEDataUtils.HasForms(species, true))
            {
                w.WritePropertyName(nameof(IPBEPokemon.Form));
                w.WriteValue(PBEDataUtils.GetNameOfForm(species, pkmn.Form));
            }
            w.WritePropertyName(nameof(IPBEPokemon.Nickname));
            w.WriteValue(pkmn.Nickname);
            w.WritePropertyName(nameof(IPBEPokemon.Level));
            w.WriteValue(pkmn.Level);
            w.WritePropertyName(nameof(IPBEPokemon.EXP));
            w.WriteValue(pkmn.EXP);
            w.WritePropertyName(nameof(IPBEPokemon.Friendship));
            w.WriteValue(pkmn.Friendship);
            w.WritePropertyName(nameof(IPBEPokemon.Shiny));
            w.WriteValue(pkmn.Shiny);
            w.WritePropertyName(nameof(IPBEPokemon.Pokerus));
            w.WriteValue(pkmn.Pokerus);
            w.WritePropertyName(nameof(IPBEPokemon.Ability));
            w.WriteValue(pkmn.Ability.ToString());
            w.WritePropertyName(nameof(IPBEPokemon.Nature));
            w.WriteValue(pkmn.Nature.ToString());
            w.WritePropertyName(nameof(IPBEPokemon.CaughtBall));
            w.WriteValue(pkmn.CaughtBall.ToString());
            w.WritePropertyName(nameof(IPBEPokemon.Gender));
            w.WriteValue(pkmn.Gender.ToString());
            w.WritePropertyName(nameof(IPBEPokemon.Item));
            w.WriteValue(pkmn.Item.ToString());
            w.WritePropertyName(nameof(IPBEPokemon.EffortValues));
            pkmn.EffortValues.ToJson(w);
            w.WritePropertyName(nameof(IPBEPokemon.IndividualValues));
            pkmn.IndividualValues.ToJson(w);
            w.WritePropertyName(nameof(IPBEPokemon.Moveset));
            pkmn.Moveset.ToJson(w);
            w.WriteEndObject();
        }
コード例 #2
0
 public static PBEType GetHiddenPowerType(this IPBEReadOnlyStatCollection stats)
 {
     return(PBEDataUtils.GetHiddenPowerType(stats.HP, stats.Attack, stats.Defense, stats.SpAttack, stats.SpDefense, stats.Speed));
 }
コード例 #3
0
 public static byte GetHiddenPowerBasePower(this IPBEReadOnlyStatCollection stats, PBESettings settings)
 {
     return(PBEDataUtils.GetHiddenPowerBasePower(stats.HP, stats.Attack, stats.Defense, stats.SpAttack, stats.SpDefense, stats.Speed, settings));
 }
コード例 #4
0
 /// <summary>Temporary check to see if a move is usable, can be removed once all moves are added</summary>
 public static bool IsMoveUsable(this IPBEMoveData mData)
 {
     return(PBEDataUtils.IsMoveUsable(mData.Effect));
 }
コード例 #5
0
 public static bool IsWeatherMove(this IPBEMoveData mData)
 {
     return(PBEDataUtils.IsWeatherMove(mData.Effect));
 }
コード例 #6
0
 public static bool IsSpreadMove(this IPBEMoveData mData)
 {
     return(PBEDataUtils.IsSpreadMove(mData.Targets));
 }
コード例 #7
0
 public static bool IsSetDamageMove(this IPBEMoveData mData)
 {
     return(PBEDataUtils.IsSetDamageMove(mData.Effect));
 }
コード例 #8
0
 public static bool IsMultiHitMove(this IPBEMoveData mData)
 {
     return(PBEDataUtils.IsMultiHitMove(mData.Effect));
 }
コード例 #9
0
 public static bool IsHPRestoreMove(this IPBEMoveData mData)
 {
     return(PBEDataUtils.IsHPRestoreMove(mData.Effect));
 }
コード例 #10
0
 public static bool HasSecondaryEffects(this IPBEMoveData mData, PBESettings settings)
 {
     return(PBEDataUtils.HasSecondaryEffects(mData.Effect, settings));
 }
コード例 #11
0
 internal PBEReadOnlyPartyMovesetSlot(PBESettings settings, PBEMove move, byte ppUps)
 {
     Move  = move;
     PP    = PBEDataUtils.CalcMaxPP(move, ppUps, settings);
     PPUps = ppUps;
 }