Ejemplo n.º 1
0
 public Equipment(string name, EquipmentTypes type, int id, string meshName) : base(name, id)
 {
     Type = type;
     //Debug.Log($"Equipment/{DefineEquipType(type)}/{meshName}");
     //Mesh = ((GameObject)Resources.Load($"Equipment/{DefineEquipType(type)}/{meshName}")).GetComponent<SkinnedMeshRenderer>();
     MeshName = meshName;
 }
Ejemplo n.º 2
0
 public BaseEquipmentItem(
     string itemName,
     string itemDescription,
     int itemId,
     EquipmentTypes equipmentType,
     ItemTypes itemType,
     int stackSize,
     Sprite spriteNeutral,
     Sprite spriteHighlighted,
     int stamina,
     int strenght,
     int agility,
     int endurance,
     int intelect,
     int resistance,
     int magicResistance
     )
     : base(itemName, itemDescription, itemId, itemType, stackSize, spriteNeutral, spriteHighlighted)
 {
     equipmentType        = this.equipmentType;
     this.stamina         = stamina;
     this.strenght        = strenght;
     this.agility         = agility;
     this.endurance       = endurance;
     this.intelect        = intelect;
     this.resistance      = resistance;
     this.magicResistance = magicResistance;
 }
Ejemplo n.º 3
0
    void Spawn(EquipmentTypes target)
    {
        foreach (Transform child in transform)
        {
            Destroy(child.gameObject);
        }

        List <ItemData> items    = GetComponentInParent <EquipmentMenu>().Items;
        bool            selected = false;

        for (int i = 0; i < items.Count; i++)
        {
            ItemData item = items[i];
            if (item.item.ItemType == ItemTypes.Equapiments)
            {
                if (((Equipment)item.item).EquapimentType == target)
                {
                    GameObject         newButton = Instantiate(Button, transform);
                    SelectScRollButton select    = newButton.GetComponent <SelectScRollButton>();
                    select.num = i;
                    select.GetComponent <Image>().overrideSprite = item.item.IconImage;
                    select.item        = item.item;
                    select.equipButton = EquipButton;
                    select.image       = image;
                    select.text        = text;
                    if (!selected)
                    {
                        select.PassNum();
                        selected = true;
                    }
                }
            }
        }
    }
Ejemplo n.º 4
0
 public ActionResult Create(string Eqmt_Description, string IsActive, string Eqmt_Code)
 {
     try {
         if (!string.IsNullOrEmpty(Eqmt_Description))
         {
             EquipmentTypes EquipmentTypes = new EquipmentTypes();
             EquipmentTypes.Eqmt_Code        = Eqmt_Code;
             EquipmentTypes.Eqmt_Description = Eqmt_Description;
             EquipmentTypes.IsDeleted        = false;
             if (IsActive == "True")
             {
                 EquipmentTypes.IsActive = true;
             }
             if (ModelState.IsValid)
             {
                 objBs.EquipmentTypesBs.Insert(EquipmentTypes);
             }
             return(RedirectToAction("Index", new { sms = "Created Successfully !" }));
         }
         else
         {
             return(RedirectToAction("Index", new { sms = "reason is null or empty !" }));
         }
     }
     catch (Exception ex) {
         return(RedirectToAction("Index", new { sms = "Operation Create failed ! " + ex.InnerException.InnerException.Message.ToString() }));
     }
 }
Ejemplo n.º 5
0
        public void Update(RawMasterInfo rpInfo)
        {
            Ships.UpdateRawData(rpInfo.Ships, r => new ShipInfo(r), (rpData, rpRawData) => rpData.Update(rpRawData));
            ShipTypes.UpdateRawData(rpInfo.ShipTypes, r => new ShipTypeInfo(r), (rpData, rpRawData) => rpData.Update(rpRawData));

            Equipment.UpdateRawData(rpInfo.Equipment, r => new EquipmentInfo(r), (rpData, rpRawData) => rpData.Update(rpRawData));
            EquipmentTypes.UpdateRawData(rpInfo.EquipmentTypes, r => new EquipmentTypeInfo(r), (rpData, rpRawData) => rpData.Update(rpRawData));

            Items.UpdateRawData(rpInfo.Items, r => new ItemInfo(r), (rpData, rpRawData) => rpData.Update(rpRawData));

            MapAreas.UpdateRawData(rpInfo.MapAreas, r => new MapAreaInfo(r), (rpData, rpRawData) => rpData.Update(rpRawData));
            Maps.UpdateRawData(rpInfo.Maps, r => new MapMasterInfo(r), (rpData, rpRawData) => rpData.Update(rpRawData));

            Expeditions.UpdateRawData(rpInfo.Expeditions, r => new ExpeditionInfo(r), (rpData, rpRawData) => rpData.Update(rpRawData));

            EventMapCount = (from rArea in MapAreas.Values
                             where rArea.IsEventArea
                             join rMap in Maps.Values on rArea.ID equals rMap.AreaID
                             select rMap).Count();

            if (r_InitializationLock != null)
            {
                r_InitializationLock.Set();
                r_InitializationLock.Dispose();
                r_InitializationLock = null;
            }
        }
        public ActionResult DeleteConfirmed(int id)
        {
            EquipmentTypes equipmentTypes = db.EquipmentTypes.Find(id);

            db.EquipmentTypes.Remove(equipmentTypes);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 7
0
 public MenuEquipment(string Name, EquipmentTypes EquipmentType, int Price, Texture2D sprIcon, Texture2D sprFull)
 {
     this.Name          = Name;
     this.EquipmentType = EquipmentType;
     this.Price         = Price;
     this.sprIcon       = sprIcon;
     this.sprFull       = sprFull;
 }
Ejemplo n.º 8
0
    //public string MoveSetType;

    public Weapon(string name, EquipmentTypes type, int id, WeaponProps _props, string meshName, string hitboxType, string movesetType) : base(name, type, id, meshName)
    {
        Hitbox = ((GameObject)Resources.Load($"Equipment/Hitboxes/{hitboxType}")).GetComponent <Hitbox>();
        //Mesh = ((GameObject)Resources.Load($"Equipment/Weapons/Meshes/{meshName}")).GetComponent<SkinnedMeshRenderer>();
        MoveSet = new MoveSet();
        //MoveSet.AnimatorOverride = (AnimatorOverrideController)Resources.Load($"Equipment/MoveSets/Female/{movesetType}");
        MoveSet.MovesetType = movesetType;
        props = _props;
    }
Ejemplo n.º 9
0
 public Equipment(int strength, int intellect, int agility, int stamina, EquipmentTypes equipmentType, int id, string name, ItemTypes itemType, QualityTypes quality, string description, int capacity, int buyprice, int sellprice, string spritepath)
     : base(id, name, itemType, quality, description, capacity, buyprice, sellprice, spritepath)
 {
     this.Strength      = strength;
     this.Intellect     = intellect;
     this.Agility       = agility;
     this.Stamina       = stamina;
     this.EquipmentType = equipmentType;
 }
Ejemplo n.º 10
0
        public List <string> GetNames(EquipmentTypes type)
        {
            List <string> names = new List <string>();

            foreach (Equipment Equipment in GetEquipmentList(type))
            {
                names.Add(Equipment.Name);
            }
            return(names);
        }
 public ActionResult Edit([Bind(Include = "typeId,typeName,maxUsers")] EquipmentTypes equipmentTypes)
 {
     if (ModelState.IsValid)
     {
         db.Entry(equipmentTypes).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(equipmentTypes));
 }
Ejemplo n.º 12
0
        public static List <cEquipment> RetrieveEquipment(EquipmentTypes Category)
        {
            List <ParamStruct> paramiters = new List <ParamStruct>();

            paramiters.Add(new ParamStruct("@retriveType", 5, DbType.Int32, 4, ParameterDirection.Input));
            paramiters.Add(new ParamStruct("@category", Category, DbType.Int32, 4, ParameterDirection.Input));
            DbDataReader reader = DAL.DAL.ReadData("retrieveEqipmentData", paramiters);

            return(Repackager(reader, retrieveEquipmentData.getEquipmentByCategory));
        }
        public ActionResult Create([Bind(Include = "typeId,typeName,maxUsers")] EquipmentTypes equipmentTypes)
        {
            if (ModelState.IsValid)
            {
                db.EquipmentTypes.Add(equipmentTypes);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(equipmentTypes));
        }
Ejemplo n.º 14
0
    public static void EquipDefaultItem(Inventory inventory, EquipmentTypes type)
    {
        if ((int)type > 4)
        {
            return;
        }

        Equipment equipment = Data.GetDefaultItem(type);

        Equipment.EquipItem(inventory, equipment);
    }
Ejemplo n.º 15
0
 /// <summary>
 /// Clear the database
 /// </summary>
 public void Clear()
 {
     MasterShips.Clear();
     ShipTypes.Clear();
     MasterEquipments.Clear();
     EquipmentTypes.Clear();
     MasterUseItems.Clear();
     MapArea.Clear();
     MapInfo.Clear();
     Mission.Clear();
 }
Ejemplo n.º 16
0
 public EquipmentManager(string Name, string id, string Desc, int agility, int strength, int wisdom, int defence, EquipmentTypes type, int spellEffectID)
 {
     name          = Name;
     description   = Desc;
     itemid        = "item.equipment." + type.ToString().ToLower() + "." + id.ToLower();
     Agility       = agility;
     Strength      = strength;
     Wisdom        = wisdom;
     Defence       = defence;
     EquipmentType = type;
     SpellEffectID = spellEffectID;
 }
Ejemplo n.º 17
0
    public static void UnequipItem(Inventory inventory, EquipmentTypes type)
    {
        if (inventory.GetEquipmentSlot(type) is Armor)
        {
            inventory.ResetArmor((Armor)inventory.GetEquipmentSlot(type));
        }

        /*Debug.Log(inventory.Character.Player.gameObject.transform.Find("Eyes").gameObject.name);
         * Debug.Log(type);
         * Debug.Log(Helper.FindEquipmentOfType<SkinnedMeshRenderer>(inventory.Character.Player.gameObject.transform.Find("Eyes").gameObject, type).gameObject.name);*/
        //GameObject.Destroy(Helper.FindEquipmentOfType<SkinnedMeshRenderer>(inventory.Character.Player.gameObject.transform.Find("Eyes").gameObject, type).gameObject);
        GameObject.Destroy(Helper.FindComponentInChildWithTag <SkinnedMeshRenderer>(inventory.Character.Player.gameObject.transform.Find("Eyes").gameObject, Equipment.DefineEquipType(type)).gameObject);
    }
Ejemplo n.º 18
0
    /*public static void Disarm(Inventory inventory)
     * {
     *
     * }*/

    public static string DefineEquipType(EquipmentTypes _type)
    {
        string type = "";

        switch (_type)
        {
        case EquipmentTypes.Head:
        {
            type = "Head";
            break;
        }

        case EquipmentTypes.Body:
        {
            type = "Body";
            break;
        }

        case EquipmentTypes.Hands:
        {
            type = "Hands";
            break;
        }

        case EquipmentTypes.Legs:
        {
            type = "Legs";
            break;
        }

        case EquipmentTypes.Feet:
        {
            type = "Feet";
            break;
        }

        case EquipmentTypes.Weapon:
        {
            type = "Weapon";
            break;
        }

        case EquipmentTypes.Offhand:
        {
            type = "Offhand";
            break;
        }
        }

        return(type);
    }
        // GET: EquipmentTypes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EquipmentTypes equipmentTypes = db.EquipmentTypes.Find(id);

            if (equipmentTypes == null)
            {
                return(HttpNotFound());
            }
            return(View(equipmentTypes));
        }
    public void Unequip(EquipmentTypes type)
    {
        Items.Add(GetEquipmentSlot(type));

        /*EquipmentTypes _type = equipment.Type;
         *
         * Equipment slot = GetEquipmentSlot(_type);*/

        Equipment.UnequipItem(this, type);

        Equipment.EquipDefaultItem(Character.Inventory, type);

        ResetEquipment(type);
    }
Ejemplo n.º 21
0
 public ActionResult Edit([Bind(Include = "ID,Type")] EquipmentTypes equipmentTypes)
 {
     if (ModelState.IsValid)
     {
         var exists = db.EquipmentTypes.Any(e => e.Type == equipmentTypes.Type);
         if (exists)
         {
             ViewBag.Exists = "Type already exists in the database.";
             return(View(equipmentTypes));
         }
         db.Entry(equipmentTypes).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(equipmentTypes));
 }
Ejemplo n.º 22
0
        public EquipmentCreateViewModel(EquipmentListViewModel viewModel, Entities database)
        {
            _database  = database;
            _viewModel = viewModel;

            Equipment      = new Data.Equipment();
            EquipmentTypes = database.Categories.ToList();

            SaveCommand        = new RelayCommand(Save);
            CancelCommand      = new RelayCommand(Cancel);
            SelectImageCommand = new RelayCommand(SelectImage);

            Equipment.Name     = "New Item";
            Equipment.Category = EquipmentTypes.First();
            Equipment.Value    = 1;
        }
    public static T FindEquipmentOfType <T>(this GameObject parent, EquipmentTypes type) where T : Component
    {
        Transform t = parent.transform;

        foreach (Transform tr in t)
        {
            if (tr.TryGetComponent <EquipmentModel>(out EquipmentModel equip))
            {
                if (equip.type == type)
                {
                    return(tr.GetComponent <T>());
                }
            }
        }
        return(null);
    }
    void ResetEquipment(EquipmentTypes type)
    {
        switch (type)
        {
        case EquipmentTypes.Head:
        {
            Head = null;
            return;
        }

        case EquipmentTypes.Body:
        {
            Body = null;
            return;
        }

        case EquipmentTypes.Hands:
        {
            Hands = null;
            return;
        }

        case EquipmentTypes.Legs:
        {
            Legs = null;
            return;
        }

        case EquipmentTypes.Feet:
        {
            Feet = null;
            return;
        }

        case EquipmentTypes.Weapon:
        {
            Weapon = null;
            return;
        }

        case EquipmentTypes.Offhand:
        {
            Offhand = null;
            return;
        }
        }
    }
Ejemplo n.º 25
0
 public Equipment(DataRow item)
 {
     ItemID        = int.Parse(item["item_id"].ToString());
     Name          = item["item_name"].ToString();
     ItemQuality   = (ItemQualitys)Enum.Parse(typeof(ItemQualitys), item["item_quality"].ToString());
     ItemType      = (ItemTypes)Enum.Parse(typeof(ItemTypes), item["item_type"].ToString());
     PlayerType    = (PlayerTypes)Enum.Parse(typeof(PlayerTypes), item["player_type"].ToString());
     Des           = item["item_description"].ToString();
     Capacity      = int.Parse(item["item_capacity"].ToString());
     BuyPrice      = int.Parse(item["item_buyprice"].ToString());
     SellPrice     = int.Parse(item["item_sellprice"].ToString());
     Sprite        = item["item_sprite"].ToString();
     EquipmentType = (EquipmentTypes)Enum.Parse(typeof(EquipmentTypes), item["equipment_type"].ToString());
     Attack        = int.Parse(item["item_attack"].ToString());
     Defence       = int.Parse(item["item_defence"].ToString());
     Speed         = int.Parse(item["item_speed"].ToString());
 }
Ejemplo n.º 26
0
        public ResponseWrapper <object> UpdateEquipmentType(int typeId, string typeName)
        {
            try
            {
                var newEquipment = new EquipmentTypes
                {
                    typeId   = typeId,
                    typeName = typeName
                };

                equipmentTypeRepository.Update(newEquipment);
                equipmentTypeRepository.Save();
                return(new ResponseWrapper <object>("OK", true));
            }
            catch (Exception e)
            {
                return(new ResponseWrapper <object>(e.Message, false));
            }
        }
Ejemplo n.º 27
0
 public void AddEquipment(int itemID, EquipmentTypes equipmentType)
 {
     for (int i = 0; i < equipmentList.Count; i++)
     {
         if (equipmentList[i].EquipmentType == equipmentType)
         {
             if (equipmentList[i].ItemID == -1)
             {
                 equipmentList[i].ItemID = itemID;
             }
             else
             {
                 RemoveEquipment(i);
                 equipmentList[i].ItemID = itemID;
             }
         }
         StartEvent();
     }
 }
    public Equipment GetEquipmentSlot(EquipmentTypes type)
    {
        switch (type)
        {
        case EquipmentTypes.Head:
        {
            return(this.Head);
        }

        case EquipmentTypes.Body:
        {
            return(this.Body);
        }

        case EquipmentTypes.Hands:
        {
            return(this.Hands);
        }

        case EquipmentTypes.Legs:
        {
            return(this.Legs);
        }

        case EquipmentTypes.Feet:
        {
            return(this.Feet);
        }

        case EquipmentTypes.Weapon:
        {
            return(this.Weapon);
        }

        case EquipmentTypes.Offhand:
        {
            return(this.Offhand);
        }
        }

        return(null);
    }
    public void ChangeArmor(Equipment equipment)
    {
        if (GetEquipmentSlot(equipment.Type) != null)
        {
            Items.Add(GetEquipmentSlot(equipment.Type));
        }

        Items.Remove(equipment);

        EquipmentTypes _type = equipment.Type;

        //string type = Equipment.DefineEquipType(_type);

        Equipment slot = GetEquipmentSlot(_type);

        Equipment.UnequipItem(this, _type);
        Equipment.EquipItem(this, equipment);

        SetEquipment(equipment);
    }
Ejemplo n.º 30
0
        public ResponseWrapper <object> AddEquipmentType(string equipmentName)
        {
            try
            {
                var freeId       = GetEquipmentTypeFreeId();
                var newEquipment = new EquipmentTypes
                {
                    typeId   = freeId,
                    typeName = equipmentName
                };

                equipmentTypeRepository.AddEquipmentType(newEquipment);
                equipmentTypeRepository.Save();
                return(new ResponseWrapper <object>("OK", true));
            }
            catch (Exception e)
            {
                return(new ResponseWrapper <object>(e.Message, false));
            }
        }
Ejemplo n.º 31
0
 public static EquipmentSilhouette GetSilhouette(EquipmentTypes slot)
 {
     string name = string.Empty;
     switch (slot)
     {
         case EquipmentTypes.Armor:
             name = "SilhouetteArmor";
             break;
         case EquipmentTypes.Backpack:
             name = "SilhouetteBackpack";
             break;
         case EquipmentTypes.Boots:
             name = "SilhouetteBoots";
             break;
         case EquipmentTypes.Gloves:
             name = "SilhouetteGloves";
             break;
         case EquipmentTypes.Helmet:
             name = "SilhouetteHelmet";
             break;
         case EquipmentTypes.Shield:
             name = "SilhouetteShield";
             break;
         case EquipmentTypes.Talisman:
             name = "SilhouetteTalisman";
             break;
         case EquipmentTypes.Weapon:
             name = "SilhouetteWeapon";
             break;
     }
     if (name != string.Empty)
     {
         return Resources.Load<EquipmentSilhouette>("Prefabs/Other/EqCaps/" + name);
     }
     return null;
 }
Ejemplo n.º 32
0
 public Equipment(EquipmentTypes type)
 {
     EquipmentType = type;
     Type = ItemTypes.Equipment;
 }
Ejemplo n.º 33
0
 public static Vector3 GetEquipmentPosition(EquipmentTypes slot)
 {
     switch (slot)
     {
         case EquipmentTypes.Armor:
             return new Vector3(7.09f, 1.02f, 0);
         case EquipmentTypes.Backpack:
             return new Vector3(8.19f, 1.07f, 0);
         case EquipmentTypes.Boots:
             return new Vector3(7.64f, 0.77f, 0);
         case EquipmentTypes.Gloves:
             return new Vector3(6.54f, 0.77f, 0);
         case EquipmentTypes.Helmet:
             return new Vector3(7.09f, 1.57f, 0);
         case EquipmentTypes.Shield:
             return new Vector3(7.64f, 1.32f, 0);
         case EquipmentTypes.Talisman:
             return new Vector3(5.99f, 1.02f, 0);
         case EquipmentTypes.Weapon:
             return new Vector3(6.54f, 1.32f, 0);
         default:
             return new Vector3(5.99f, 1.62f, 0);
     }
 }
Ejemplo n.º 34
0
 public void SetIntoSlot(EquipmentTypes type)
 {
     this.transform.position = Constants.GetEquipmentPosition(type);
 }