示例#1
0
        public override string ToString()
        {
            string temp = Name + " +" + Mod.ToString() + " = +" + Rank.ToString() + " ranks, +" + AbilityMod.ToString() + PathfinderConstants.SPACE + Ability;

            if (ClassSkill > 0)
            {
                temp += ", +" + ClassSkill.ToString() + " class skill";
                if (ExtraSkillUsed)
                {
                    temp += "*";
                }
            }
            if (ExtraMod != 0)
            {
                //  temp += ", +" + ExtraMod.ToString() + " extra mods";
            }
            if (ArmorCheckPenalty != 0)
            {
                temp += ", +" + ArmorCheckPenalty.ToString() + " Armor Check Penalty";
            }

            if (Formula.Length > 0)
            {
                temp += PathfinderConstants.SPACE + Formula;
            }

            temp = temp.Replace("+-", "-");

            return(temp);
        }
示例#2
0
        /// <summary>
        /// Saves the current instance of the armor type object.
        /// </summary>
        /// <returns>ArmorType object</returns>
        public ArmorType SaveArmorType()
        {
            SqlDataReader      result;
            DatabaseConnection dbconn     = new DatabaseConnection();
            SqlCommand         command    = new SqlCommand();
            SqlConnection      connection = new SqlConnection(dbconn.SQLSEVERConnString);

            try
            {
                connection.Open();
                command.Connection  = connection;
                command.CommandType = CommandType.StoredProcedure;
                command.CommandText = "InsertUpdate_ArmorType";
                command.Parameters.Add(dbconn.GenerateParameterObj("@ArmorTypeID", SqlDbType.Int, ArmorTypeID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@ArmorTypeName", SqlDbType.VarChar, ArmorTypeName.ToString(), 1000));
                //command.Parameters.Add(dbconn.GenerateParameterObj("@Speed", SqlDbType.Int, Speed.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@ArmorCheckPenalty", SqlDbType.Int, ArmorCheckPenalty.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@Speed_6", SqlDbType.Int, Speed_6.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@Speed_4", SqlDbType.Int, Speed_4.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@Speed_8", SqlDbType.Int, Speed_8.ToString(), 0));
                result = command.ExecuteReader();

                result.Read();
                SetReaderToObject(ref result);
            }
            catch
            {
                Exception e = new Exception();
                this._insertUpdateOK = false;
                this._insertUpdateMessage.Append(e.Message + "                     Inner Exception= " + e.InnerException);
                throw e;
            }
            finally
            {
                command.Dispose();
                connection.Close();
            }
            return(this);
        }