private bool CanOwnerEquip()
        {
            EquipmentDescription desc = Equipment.GetDescriptions()[EquipmentName];

            if (!String.IsNullOrEmpty(desc.requiredSkillName))
            {
                return(OldOwner.professionManager.HasSkill(desc.requiredSkillName));
            }

            return(true);
        }
Ejemplo n.º 2
0
    public void Describe(OnUIItemDescribeEventData e)
    {
        EquipmentDescription n = Instantiate(DescriptionPrefab);

        n.GetComponent <RectTransform>().SetParent(e.DescriptionParent, false);
        n.TopDescription.text    = TopDescription;
        n.BottomDescription.text = BottomDescription;
        foreach (PlayerUIStatModifier stat in StatBonuses)
        {
            EquipmentDescriptionStatChange s = Instantiate(StatLinePrefab);
            s.Image.sprite = stat.Icon;
            s.Text.text    = stat.Description;
            n.AddStatChange(s);
        }
    }
Ejemplo n.º 3
0
        public EquipmentData(EquipmentDescription description)
        {
            EquipmentName = description.EquipmentName;
            EquipmentId   = description.EquipmentId;
            Type          = description.Type;
            MaxHp         = description.MaxHp;

            Attack  = description.Attack;
            Defense = description.Defense;
            Speed   = description.Speed;

            Fire  = description.Fire;
            Water = description.Water;
            Earth = description.Earth;
            Air   = description.Air;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Saves the equipment.
        /// </summary>
        /// <returns>Equipment Object</returns>
        public Equipment SaveEquipment()
        {
            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_Equipment";
                command.Parameters.Add(dbconn.GenerateParameterObj("@EquipmentID", SqlDbType.Int, EquipmentID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@EquipmentName", SqlDbType.VarChar, EquipmentName.ToString(), 50));
                command.Parameters.Add(dbconn.GenerateParameterObj("@EquipmentDescription", SqlDbType.VarChar, EquipmentDescription.ToString(), 400));
                command.Parameters.Add(dbconn.GenerateParameterObj("@EquipmentTypeID", SqlDbType.Int, EquipmentTypeID.ToString(), 0));

                command.Parameters.Add(dbconn.GenerateParameterObj("@EquipmentWeight", SqlDbType.Decimal, EquipmentWeight.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@EquipmentCost", SqlDbType.Int, EquipmentCost.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@BookID", SqlDbType.Int, BookID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@Upgradable", SqlDbType.Bit, Upgradable.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);
        }
Ejemplo n.º 5
0
 public WeaponEquipmentData(EquipmentDescription description) : base(description)
 {
     BaseCD = description.BaseCD;
 }