示例#1
0
        public void Save(int ID)
        {
            using (XmlWriter writer = XmlWriter.Create(Paths.DataPath + "Dex\\" + ID.ToString() + "-" + FormIndex + ".xml", Logger.XmlWriterSettings)) {
                writer.WriteStartDocument();
                writer.WriteStartElement("FormEntry");

                #region Basic data
                writer.WriteStartElement("General");
                writer.WriteElementString("FormName", FormName);
                writer.WriteElementString("Height", Height.ToString());
                writer.WriteElementString("Weight", Weight.ToString());
                writer.WriteElementString("Male", MaleRatio.ToString());
                writer.WriteElementString("Female", FemaleRatio.ToString());
                writer.WriteElementString("RecruitRate", RecruitRate.ToString());
                writer.WriteElementString("BodyStyle", BodyStyle.ToString());
                writer.WriteEndElement();
                #endregion
                #region Stats
                writer.WriteStartElement("BaseStats");
                writer.WriteElementString("HP", BaseHP.ToString());
                writer.WriteElementString("Atk", BaseAtk.ToString());
                writer.WriteElementString("Def", BaseDef.ToString());
                writer.WriteElementString("SpAtk", BaseSpAtk.ToString());
                writer.WriteElementString("SpDef", BaseSpDef.ToString());
                writer.WriteElementString("Speed", BaseSpeed.ToString());
                writer.WriteEndElement();
                #endregion
                #region Pokemon Info
                writer.WriteStartElement("FormInfo");
                writer.WriteElementString("Type1", Type1.ToString());
                writer.WriteElementString("Type2", Type2.ToString());
                writer.WriteElementString("Ability1", Ability1);
                writer.WriteElementString("Ability2", Ability2);
                writer.WriteElementString("Ability3", Ability3);
                writer.WriteElementString("Exp", ExpYield.ToString());
                writer.WriteEndElement();
                #endregion
                #region Moves
                writer.WriteStartElement("Moves");
                #region Level Up Moves
                writer.WriteStartElement("LevelUpMoves");
                for (int i = 0; i < LevelUpMoves.Count; i++)
                {
                    writer.WriteStartElement("LevelUpMove");
                    writer.WriteElementString("Level", LevelUpMoves[i].Level.ToString());
                    writer.WriteElementString("Name", GameData.MoveDex[LevelUpMoves[i].Move].Name);
                    writer.WriteEndElement();
                }
                writer.WriteEndElement();
                #endregion
                #region TM Moves
                writer.WriteStartElement("TMMoves");
                for (int i = 0; i < TMMoves.Count; i++)
                {
                    writer.WriteStartElement("TMMove");
                    writer.WriteElementString("Name", GameData.MoveDex[TMMoves[i]].Name);
                    writer.WriteEndElement();
                }
                writer.WriteEndElement();
                #endregion
                #region Egg Moves
                writer.WriteStartElement("EggMoves");
                for (int i = 0; i < EggMoves.Count; i++)
                {
                    writer.WriteStartElement("EggMove");
                    writer.WriteElementString("Name", GameData.MoveDex[EggMoves[i]].Name);
                    writer.WriteEndElement();
                }
                writer.WriteEndElement();
                #endregion
                #region DW Moves
                writer.WriteStartElement("DWMoves");
                for (int i = 0; i < DWMoves.Count; i++)
                {
                    writer.WriteStartElement("DWMove");
                    writer.WriteElementString("Name", GameData.MoveDex[DWMoves[i]].Name);
                    writer.WriteEndElement();
                }
                writer.WriteEndElement();
                #endregion
                #region Event Moves
                writer.WriteStartElement("EventMoves");
                for (int i = 0; i < EventMoves.Count; i++)
                {
                    writer.WriteStartElement("EventMove");
                    writer.WriteElementString("Name", GameData.MoveDex[EventMoves[i]].Name);
                    writer.WriteEndElement();
                }
                writer.WriteEndElement();
                #endregion
                writer.WriteEndElement();
                #endregion

                writer.WriteEndElement();
                writer.WriteEndDocument();
            }
        }
示例#2
0
        public override string ToString()
        {
            String Moves  = "";
            String Levels = "";

            for (int i = 0; i < MoveLevels.Length; i++)
            {
                Moves  = Moves + MoveList[i].ToString() + "¶";
                Levels = Levels + MoveLevels[i].ToString() + "¶";
            }
            Moves  = Moves + "65535";
            Levels = Levels + "65535" + "¶";
            return(ID + "¶" + Name + "¶" + BaseHP.ToString() + "¶" + BaseAttack.ToString() + "¶" + BaseDefense.ToString() + "¶" + BaseSpecialAttack.ToString() + "¶" + BaseSpecialDefense.ToString() + "¶" + BaseSpeed.ToString() + "¶" + ((int)LevelingType).ToString() + "¶" + FormID.ToString() + "¶" + GenderValue.ToString() + "¶" + ((int)Type1).ToString() + "¶" + ((int)Type2).ToString() + "¶" + CatchRate.ToString() + "¶" + ExpYield.ToString() + "¶" + EffortYield.ToString() + "¶" + Item1.ToString() + "¶" + Item2.ToString() + "¶" + Ability1.ToString() + "¶" + Ability2.ToString() + "¶" + Ability3.ToString() + "¶" + DexEntry + "¶" + Levels + Moves);
        }
示例#3
0
 public override string ToString()
 {
     return($"new PokemonData({PokedexID}, \"{Name}\", PokemonData.Type.{Type1.ToUpper()}, PokemonData.Type.{Type2.ToUpper()}, \"{AbilityCheck(Ability1)}\", {AbilityCheck(Ability2)}, \"{AbilityCheck(HiddenAbility)}\",\n" +
            $"{MaleRatio}f, {CatchRate}, PokemonData.EggGroup.{EggGroup1.ToUpper()}, PokemonData.EggGroup.{EggGroup2.ToUpper()}, {HatchTime}, {Height}f, {Weight}f,\n" +
            $"{EvExp.ToString()}, PokemonData.LevelingRate.{ToUpperRemoveSpace(LevelingRate)}, {EvHP.ToString()}, {EvAttack.ToString()}, {EvDefense.ToString()}, {EvSpecialAttack.ToString()}, {EvSpecialDefense.ToString()}, {EvSpeed.ToString()}, PokemonData.PokedexColor.{ToUpperRemoveSpace(PokedexColor)}, {BaseFriendship.ToString()},\n" +
            $"\"{Species}\", \"{PokedexEntry}\",\n" +
            $"{BaseHP.ToString()}, {BaseAttack.ToString()}, {BaseDefense.ToString()}, {BaseSpecialAttack.ToString()}, {BaseSpecialDefense.ToString()}, {BaseSpeed.ToString()}, {Luminance.ToString()}f, Color.{LightColor.ToLower()}," +
            "new int[] {" + $"{MoveLevels(LevelMoves)}" + "},\n" +
            "new string[]\n" +
            "{\n" +
            $"{MoveNames(LevelMoves)}\n" +
            "},\n" +
            "new string[] { " + HMandTM(hmAndTM) + " },\n" +
            "new int[] {" + EvolutionID + "}, new string[] {" + $"\"Level,{EvolutionLevel}\"" + "}),\n");
 }