コード例 #1
0
ファイル: Pokemon.cs プロジェクト: LennonM1932511/VGP232
 public override string ToString()
 {
     // construct a string to return with the following format
     // Nat,Pokemon,HP,Atk,Def,SpA,SpD,Spe,Total
     return(string.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10}", Index, Name, HP, Attack, Defense,
                          SpecialAttack, SpecialDefense, Speed, Total, Type1.ToString(), Type2 == PokemonType.None ? "" : Type2.ToString()));
 }
コード例 #2
0
    internal void CalculateWeight(Vector3 finOrC, Vector3 final, Vector3 curr)
    {
        Distance = Mathf.Abs(Vector3.Distance(U2D.FromV2ToV3(_position), final));
        var furtherWeight = CheckIfFurtherThanCurr(curr, final);

        //can't be further than C
        furtherWeight += CheckIfFurtherThanCurr(curr, finOrC);

        //we are going to substract then
        if (Type1.ToString().Contains("Way"))
        {
            Distance = Mathf.Abs(Vector3.Distance(U2D.FromV2ToV3(_position), curr));
        }

        _calcWeight = _baseWeight + Distance + furtherWeight;
    }
コード例 #3
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();
            }
        }
コード例 #4
0
ファイル: CremaTables.cs プロジェクト: teize001/Crema
 public Table1Row Find(string StringKey, int IntKey, Type1 TypeKey, float FloatKey)
 {
     return(base.FindRow(CremaUtility.GenerateHashCode(StringKey.ToString(), IntKey.ToString(), TypeKey.ToString(), FloatKey.ToString())));
 }