Exemplo n.º 1
0
        private void Save_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(BrokenItemName.Text) || string.IsNullOrEmpty(BrokenQuantity.Value.ToString()))
            {
                errM.Message = "All Feilds mark with asterisk(*) Are Required";
                errM.Show();
            }
            else
            {
                ItemLogic.AddBrokenItem(BrokenItemName.Text, BrokenQuantity.Value.ToString(), Comment.Text);
                //errM.Message = "New item details saved successfully";
                //errM.Show();

                Hide();
            }
        }
Exemplo n.º 2
0
 private void mNew_Click(object sender, EventArgs e)
 {
     ItemSelectorForm.ResetItems();
     ITEM_NAMES    = DEFAULT_ITEM_NAMES.ToArray();
     nItem.Minimum = 0;
     nItem.Maximum = ITEM_NAMES.Length - 1;
     ItemList      = new List <ItemLogic>();
     for (int i = 0; i < ITEM_NAMES.Length; i++)
     {
         ItemLogic l = new ItemLogic();
         ItemList.Add(l);
     }
     ;
     nItem.Value = 1;
     nItem.Value = 0;
 }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            using (DataContext db = new DataContext())
            {
                List <Items> ilist    = Data.Items.GetItems(-1);
                List <Items> userList = ItemLogic.GetUserInvItems(CurrentUser.Entity(), -1, db);

                ItemLogic.LoadInventory(PartsList, ilist, -1);
                ItemLogic.LoadInventory(ProcessList, ilist, 1);
                ItemLogic.LoadInventory(graphicslist, ilist, 4);
                ItemLogic.LoadInventory(memorylist, ilist, 2);
                ItemLogic.LoadInventory(powersuplist, ilist, 3);
                ItemLogic.LoadInventory(boosterlist, ilist, 0);
                ItemLogic.LoadInventory(UserInvList, userList, -1);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 報酬付与
        /// </summary>
        public static List <LootItemStruct> BattleResult()
        {
            List <LootItemStruct> loots = new List <LootItemStruct>();
            int gold = 0;

            //モンスター固有アイテム抽選
            EnemyDataModel.Instance.Data.ForEach(enemy =>
            {
                loots.AddRange(LootLogic.MonsterLootChoice(enemy.monsterId));
                //ゴールド計算 TODO
                gold += enemy.level * 10;
            });
            //ダンジョン固有アイテム抽選 TODO 確率
            loots.AddRange(LootLogic.DungeonLootChoice(0.1f));

            //アイテム獲得処理
            List <ItemStruct> items = new List <ItemStruct>();

            loots.ForEach(loot =>
            {
                var item = ItemLogic.CreateItemFromLoot(loot);
                items.Add(item);
            });
            StockItemDataModel.GetInstance().AddItems(items);

            //ゴールド獲得処理
            loots.Add(new LootItemStruct()
            {
                Amount = gold,
                ItemId = ItemConsts.GOLD
            });
            StockItemDataModel.GetInstance().AddGold(gold);

            //レベルアップ処理
            //TODO レベルアップの仕様検討
            //一般戦闘の場合は+1 エリート敵の場合は+2
            int levelUpAmount = 1;

            loots.Add(new LootItemStruct()
            {
                Amount = levelUpAmount,
                ItemId = ItemConsts.LEVEL
            });
            BattlerLogic.LevelUp(levelUpAmount);

            return(loots);
        }
Exemplo n.º 5
0
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(Category.Text) || string.IsNullOrEmpty(ItemName.Text) ||
                string.IsNullOrEmpty(UnitPrice.Value.ToString()))
            {
                errM.Message = "All Feilds mark with asterisk(*) Are Required";
                errM.Show();
            }
            else
            {
                ItemLogic.AddNewItem(Category.Text, Vendor.Text, ItemName.Text, ItemDescription.Text, UnitPrice.Value.ToString(), ItemQuantity.Value.ToString());
                //errM.Message = "New item details saved successfully";
                //errM.Show();

                Hide();
            }
        }
Exemplo n.º 6
0
        protected void ViewUserInventory_Command(object sender, CommandEventArgs e)
        {
            int userid = int.Parse(e.CommandArgument.ToString());

            Cache["UserId"] = userid;
            List <Items> usrItemList = new List <Items>();
            Users        u;

            using (DataContext db = new DataContext())
            {
                u           = db.Users.Find(userid);
                usrItemList = ItemLogic.GetUserInvItems(u, -1, db);
            }

            UserInvLbl.Text = u.UserName + "'s Inventory";
            ItemLogic.LoadUserManageInvetory(usrItemList, UserInvView);
        }
Exemplo n.º 7
0
        private async void OnSave(object obj)
        {
            IsBusy = true;

            try
            {
                // Thuc hien cong viec tai day
                var itemLogic = new ItemLogic(_dbContext);
                var item      = new Item
                {
                    Id          = ItemBindProp.Id,
                    ItemName    = ItemBindProp.Name,
                    FkCategory  = CategoryBindProp.Id,
                    Price       = ItemBindProp.Value,
                    IsManaged   = IsManaged == true ? 1 : 0,
                    MinQuantity = MinQuantityBindProp,
                    ItemImage   = ImagePathBindProp
                };
                ItemBindProp.FkCategory = CategoryBindProp.Id;
                ItemBindProp.ItemImage  = ImagePathBindProp;
                if (IsEditing)
                {
                    await itemLogic.UpdateAsync(item);

                    await NavigationService.GoBackAsync();
                }
                else
                {
                    await itemLogic.CreateAsync(item);

                    var param = new NavigationParameters();
                    param.Add(Keys.ITEM, ItemBindProp);

                    await NavigationService.GoBackAsync(param);
                }
            }
            catch (Exception e)
            {
                await ShowError(e);
            }
            finally
            {
                IsBusy = false;
            }
        }
Exemplo n.º 8
0
        private void Save_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            //updating code goes here

            if (string.IsNullOrEmpty(UpdateItemName.Text) || string.IsNullOrEmpty(UpdateUnitPrice.Value.ToString()) || string.IsNullOrEmpty(UpdateItemQuantity.Value.ToString()))
            {
                errM.Message = "All Feilds mark with asterisk(*) Are Required";
                errM.Show();
            }
            else
            {
                ItemLogic.UpdateItem(UpdateItemName.Text, UpdateItemDescription.Text, UpdateUnitPrice.Value, UpdateItemQuantity.Value, ItemListGUI.ItemData.Id.ToString());
                sm.Message = "Item details saved successfully";
                sm.Show();

                Hide();
            }
        }
Exemplo n.º 9
0
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(CategoryName.Text) || string.IsNullOrEmpty(CategoryDescription.Text))
            {
                errM.Message = "All Feilds mark with asterisk(*) Are Required";
                errM.Show();
            }
            else
            {
                ItemLogic.AddCategory(CategoryName.Text, CategoryDescription.Text);

                sm.Message = "New category details saved successfully";
                sm.Show();

                Hide();
                //ShowInTaskbar = false;
                //new AddCustomer().ShowDialog();
            }
        }
Exemplo n.º 10
0
    public void SetCorrectAnimations(AnimatorOverrideController animator, ItemLogic itemInHandR, ItemLogic itemInHandL, CharacterItemAnimator itemScriptR, CharacterItemAnimator itemScriptL)
    {
        if (m_getOverridesCache == null)
        {
            m_getOverridesCache = new List <KeyValuePair <AnimationClip, AnimationClip> >(animator.overridesCount);
        }
        else
        {
            m_getOverridesCache.Clear();
        }

        //TODO: These two can most likely be cached if we assume that the animator is still the same and overrides aren't modified by anything else
        animator.GetOverrides(m_getOverridesCache);
        PopulateOverrides(m_getOverridesCache);

        if (itemInHandR)
        {
            if (itemInHandR.ItemAnimations)
            {
                ItemAnimationsObject itemAnimations = itemInHandR.ItemAnimations;
                SetRightHandItemAnimations(itemScriptR, itemAnimations, itemInHandR.m_useBothHands);
            }
            else
            {
                ClearAnimations(AnimationKey.Hand.Right);
            }
        }

        if (itemInHandL)
        {
            if (itemInHandL.ItemAnimations)
            {
                ItemAnimationsObject itemAnimations = itemInHandL.ItemAnimations;
                SetLeftHandItemAnimations(itemScriptL, itemAnimations, itemInHandL.m_useBothHands);
            }
            else
            {
                ClearAnimations(AnimationKey.Hand.Left);
            }
        }

        animator.ApplyOverrides(new List <KeyValuePair <AnimationClip, AnimationClip> >(m_overrides.Values));
    }
Exemplo n.º 11
0
    public void SetCorrectAnimations(AnimatorOverrideController animator, ItemLogic itemInHandR, ItemLogic itemInHandL, CharacterItemAnimator itemScriptR, CharacterItemAnimator itemScriptL)
    {
        if (m_getOverridesCache == null)
        {
            m_getOverridesCache = new List <KeyValuePair <AnimationClip, AnimationClip> >(animator.overridesCount);
        }
        else
        {
            m_getOverridesCache.Clear();
        }

        animator.GetOverrides(m_getOverridesCache);
        PopulateOverrides(m_getOverridesCache);

        if (itemInHandR)
        {
            if (itemInHandR.ItemAnimations)
            {
                ItemAnimationsObject itemAnimations = itemInHandR.ItemAnimations;
                SetRightHandItemAnimations(itemScriptR, itemAnimations, itemInHandR.UseBothHands);
            }
            else
            {
                ClearAnimations(AnimationKey.Hand.Right);
            }
        }

        if (itemInHandL)
        {
            if (itemInHandL.ItemAnimations)
            {
                ItemAnimationsObject itemAnimations = itemInHandL.ItemAnimations;
                SetLeftHandItemAnimations(itemScriptL, itemAnimations, itemInHandL.UseBothHands);
            }
            else
            {
                ClearAnimations(AnimationKey.Hand.Left);
            }
        }

        animator.ApplyOverrides(new List <KeyValuePair <AnimationClip, AnimationClip> >(m_overrides.Values));
    }
Exemplo n.º 12
0
 protected void CfmSellBtn_Click(object sender, EventArgs e)
 {
     if (Cache["ItemIDToSell"] is int)
     {
         if (ItemLogic.DeleteItemFromUserInv(CurrentUser.Entity().UserID, (int)Cache["ItemIDToSell"]))
         {
             using (DataContext db = new DataContext())
             {
                 Users u = CurrentUser.Entity(false, db);
                 u.Coins = u.Coins + int.Parse(Cache["PriceToSell"].ToString());
                 db.SaveChanges();
             }
             Response.Redirect("Parts.aspx", true);
         }
         else
         {
             // need to pop up something
         }
     }
 }
Exemplo n.º 13
0
    private static void AttachItem(GameObject character, AccessoryWearLogic accessoryWearLogic, ItemObject itemObject, ItemHoldLogic itemHoldLogic, CharacterItemAnimator.Hand hand, bool keepPrefabConnection)
    {
        if (itemObject != null)
        {
            if (itemObject.Item == null)
            {
                Debug.LogError("Null prefab in " + itemObject);
                return;
            }

            ItemLogic item = Instantiate(itemObject.Item, keepPrefabConnection);
            if (hand == CharacterItemAnimator.Hand.Left)
            {
                itemHoldLogic.m_itemInHandL = item;
            }
            else if (hand == CharacterItemAnimator.Hand.Right)
            {
                itemHoldLogic.m_itemInHandR = item;
            }

            if (itemObject.Item.AccessoryLogic)
            {
                item.transform.parent = character.transform;
                accessoryWearLogic.Attach(item.AccessoryLogic);
            }
            else
            {
                if (hand == CharacterItemAnimator.Hand.Left)
                {
                    item.transform.parent = itemHoldLogic.HandBoneL;
                }
                else if (hand == CharacterItemAnimator.Hand.Right)
                {
                    item.transform.parent = itemHoldLogic.HandBoneR;
                }

                item.transform.localPosition = Vector3.zero;
                item.transform.localRotation = Quaternion.identity;
            }
        }
    }
Exemplo n.º 14
0
        public void Test2()

        {
            var i = new ItemLogic()
            {
                ItemId = 1, ItemName = "Pizza", ItemSize = "Huge"
            };

            var i1 = new ItemLogic()
            {
                ItemId = 2, ItemName = "Pizza", ItemSize = "big"
            };

            var m = ItemLogic.AddItem(i);

            var n = ItemLogic.AddItem(i1);

            var actual = ItemLogic.DeleteSingleItem(m.ItemId);

            Assert.True(actual);
        }
Exemplo n.º 15
0
        public void OrderIsNotEmpty()
        {
            List <ItemLogic> Items = new List <ItemLogic>();
            var uno = new ItemLogic {
                ItemId = 1, ItemName = "Pepperoni", ItemSize = "Large"
            };
            var dos = new ItemLogic {
                ItemId = 2, ItemName = "Meat Lovers", ItemSize = "Small"
            };
            var tres = new ItemLogic {
                ItemId = 3, ItemName = "Tequila", ItemSize = "XXXXXXXXL"
            };

            Items.Add(uno);
            Items.Add(dos);
            Items.Add(tres);

            var actual = ItemLogic.OrderEmpty(Items);

            Assert.False(actual);
        }
Exemplo n.º 16
0
        public static void TreasureEvent(AsyncSubject <Unit> subject)
        {
            var eventModal = new DungeonEventModal();

            eventModal.EventText("何かを見つけた");
            eventModal.AddChoice("獲得する").Subscribe(_ =>
            {
                subject.OnNext(Unit.Default);
                subject.OnCompleted();
            });
            var loots = LootLogic.DungeonTreasureLootChoice();
            List <ItemStruct> items = new List <ItemStruct>();

            loots.ForEach(loot =>
            {
                var item = ItemLogic.CreateItemFromLoot(loot);
                items.Add(item);
            });
            eventModal.AddLootImages(loots);
            StockItemDataModel.GetInstance().Data.AddRange(items);
        }
Exemplo n.º 17
0
        private async void GetData()
        {
            var historyLogic = new ImportExportHistoryLogic(Helper.GetDataContext());
            var itemLogic    = new ItemLogic(Helper.GetDataContext());

            var listHistory = await historyLogic.GetAllAsync();

            var listItem = await itemLogic.GetAllAsync();

            var listVisualItem       = Mapper.Map <List <VisualItemModel> >(listItem.Where(h => h.IsManaged == 1 && h.CurrentQuantity > h.MinQuantity));
            var listVisualRunOutItem = Mapper.Map <List <VisualItemModel> >(listItem.Where(h => h.IsManaged == 1 && h.CurrentQuantity <= h.MinQuantity));
            var listVisualHistory    = Mapper.Map <List <VisualHistoryModel> >(listHistory);

            foreach (var history in listVisualHistory)
            {
                history.Item = listItem.FirstOrDefault(h => h.Id == history.FkItemOrMaterial).ItemName;
            }

            ListItemBindProp       = new ObservableCollection <VisualItemModel>(listVisualItem);
            ListRunOutItemBindProp = new ObservableCollection <VisualItemModel>(listVisualRunOutItem);
            ListHistoryBindProp    = new ObservableCollection <VisualHistoryModel>(listVisualHistory);
        }
Exemplo n.º 18
0
        public void FindItem()
        {
            var search             = "Pepperoni";
            List <ItemLogic> Items = new List <ItemLogic>();
            var uno = new ItemLogic {
                ItemId = 1, ItemName = "Pepperoni", ItemSize = "Large"
            };
            var dos = new ItemLogic {
                ItemId = 2, ItemName = "Meat Lovers", ItemSize = "Small"
            };
            var tres = new ItemLogic {
                ItemId = 3, ItemName = "Tequila", ItemSize = "XXXXXXXXL"
            };

            Items.Add(uno);
            Items.Add(dos);
            Items.Add(tres);

            var actual = ItemLogic.FindItem(Items, search);

            Assert.Equal(uno.ItemName, search);
        }
Exemplo n.º 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "HelpBtn", "showTutorial();", true);
            using (DataContext db = new DataContext())
            {
                // Machines.DefaultMachine(CurrentUser.Entity(), db);
                Machines m = Machines.GetUserMachine(CurrentUser.Entity().UserID, db);
                Session["Machines"] = m;
                List <Items> InvItmList = ItemLogic.GetUserInvItems(CurrentUser.Entity(), -1, db);

                // Store into Encrypted Viewstate
                ViewState["InvetoryList"] = InvItmList;

                // Text Labels
                WorkstationNameLbl.Text = m.MachineName;
                ProcessorLbl.Text       = m.MachineProcessor;
                GraphicLbl.Text         = m.MachineGraphicCard;
                MemoryLbl.Text          = m.MachineMemory;
                PwsupLbl.Text           = m.MachinePowerSupply;

                // Attribute Labels
                HpattrLabel.Text    = m.Health.ToString();
                AtkattrLabel.Text   = m.Attack.ToString();
                DefattrLabel.Text   = m.Defence.ToString();
                SpeedattrLabel.Text = m.Speed.ToString();

                // Upgrade Panel
                WorkStnUpgradeName.Text = m.MachineName;
                MachineLogic.LoadItemIntoList(ProcessList, InvItmList, 1);
                MachineLogic.LoadItemIntoList(GraphicList, InvItmList, 4);
                MachineLogic.LoadItemIntoList(MemoryList, InvItmList, 2);
                MachineLogic.LoadItemIntoList(PowerSupList, InvItmList, 3);

                CurrentProcessStatLbl.Text = m.Health.ToString();
                CurrentGPUStatLbl.Text     = m.Speed.ToString();
                CurrentMemStatLbl.Text     = m.Attack.ToString();
                CurrentPowStatLbl.Text     = m.Defence.ToString();
            }
        }
Exemplo n.º 20
0
 public void Drop(CharacterItemAnimator.Hand hand)
 {
     if (hand == CharacterItemAnimator.Hand.Right)
     {
         ItemLogic itemLogic = m_itemInHandR.GetComponent <ItemLogic>();
         m_itemInHandR.transform.parent = null;
         m_itemInHandR = null;
         if (itemLogic)
         {
             itemLogic.OnDrop();
         }
     }
     else if (hand == CharacterItemAnimator.Hand.Left)
     {
         ItemLogic itemLogic = m_itemInHandL.GetComponent <ItemLogic>();
         m_itemInHandL.transform.parent = null;
         m_itemInHandL = null;
         if (itemLogic)
         {
             itemLogic.OnDrop();
         }
     }
 }
Exemplo n.º 21
0
        protected void AddItemToUserInv_Click(object sender, EventArgs e)
        {
            int           userid = int.Parse(Cache["UserId"].ToString());
            InventoryItem invItem;

            using (DataContext db = new DataContext())
            {
                if (ItemLogic.CheckInventoryItem(db, userid, int.Parse(AllItemsList.SelectedValue), out invItem))
                {
                    invItem.Quantity = invItem.Quantity + 1;
                    db.SaveChanges();
                }
                else
                {
                    invItem          = new InventoryItem();
                    invItem.UserId   = userid;
                    invItem.Quantity = 1;
                    db.InventoryItem.Add(invItem);
                    db.SaveChanges();
                }
                Response.Redirect("UserInventory.aspx", true);
            }
        }
Exemplo n.º 22
0
        private async void OnSave(object obj)
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                // Thuc hien cong viec tai day
                var dataContext  = Helper.GetDataContext();
                var itemLogic    = new ItemLogic(dataContext);
                var historyLogic = new ImportExportHistoryLogic(dataContext);

                var param = new NavigationParameters();
                //Update Số lượng Item và Material

                if (QuantityBindProp > 0)
                {
                    await itemLogic.ModifyQuantityAsync(Item.Id, QuantityBindProp, false);

                    var history = new ImportExportHistory
                    {
                        FkItemOrMaterial = Item.Id,
                        IsImported       = 1,
                        Quantity         = QuantityBindProp,
                        Reason           = IsSelectingOtherReason == true ? OtherReasonBindProp : _reason
                    };

                    var his = await historyLogic.CreateAsync(history, false);

                    var visualHistory = new VisualHistoryModel
                    {
                        Quantity     = history.Quantity,
                        Reason       = history.Reason,
                        CreationDate = his.CreationDate,
                        Item         = Item.ItemName
                    };
                    await dataContext.SaveChangesAsync();

                    Item.CurrentQuantity += QuantityBindProp;

                    param.Add(Keys.HISTORY, visualHistory);
                    await NavigationService.GoBackAsync(param);
                }
                else
                {
                    await PageDialogService.DisplayAlertAsync("Cảnh báo", "Bạn chưa nhập số lượng giảm!", "OK");
                }
            }
            catch (Exception e)
            {
                await ShowError(e);
            }
            finally
            {
                IsBusy = false;
            }
        }
Exemplo n.º 23
0
    public void AttachItem(ItemLogic item, CharacterItemAnimator.Hand handToAttach)
    {
        if (item.PreferredHand == ItemLogic.HandPreference.Left)
        {
            handToAttach = CharacterItemAnimator.Hand.Left;
        }
        else if (item.PreferredHand == ItemLogic.HandPreference.Right)
        {
            handToAttach = CharacterItemAnimator.Hand.Right;
        }

        if (m_itemUsesBothHands || item.UseBothHands)
        {
            if (m_itemInHandL && m_itemInHandL != item)
            {
                Drop(CharacterItemAnimator.Hand.Left);
            }
            if (m_itemInHandR && m_itemInHandR != item)
            {
                Drop(CharacterItemAnimator.Hand.Right);
            }
        }

        if (item == m_itemInHandL && handToAttach == CharacterItemAnimator.Hand.Left)
        {
            m_itemInHandL = item;
        }
        else if (item == m_itemInHandR && handToAttach == CharacterItemAnimator.Hand.Right)
        {
            m_itemInHandR = item;
        }
        else if (m_itemInHandL == null && handToAttach == CharacterItemAnimator.Hand.Left)
        {
            m_itemInHandL = item;
        }
        else if (m_itemInHandR == null && handToAttach == CharacterItemAnimator.Hand.Right)
        {
            m_itemInHandR = item;
        }
        else if (item.PreferredHand == ItemLogic.HandPreference.Right)
        {
            if (m_itemInHandR)
            {
                Drop(CharacterItemAnimator.Hand.Right);
            }
            m_itemInHandR = item;
        }
        else if (item.PreferredHand == ItemLogic.HandPreference.Left ||
                 item.PreferredHand == ItemLogic.HandPreference.Either)
        {
            if (m_itemInHandL)
            {
                Drop(CharacterItemAnimator.Hand.Left);
            }
            m_itemInHandL = item;
        }
        CheckHands();

        bool isWeapon = false;

        if (item.ItemAnimations)
        {
            isWeapon = item.ItemAnimations.IsWeapon;
        }

        m_itemUsesBothHands = item.UseBothHands;
        if (m_itemScriptR != null && item == m_itemInHandR)
        {
            m_itemScriptR.UseBothHands = m_itemUsesBothHands;
        }
        else if (m_itemScriptL != null && item == m_itemInHandL)
        {
            m_itemScriptL.UseBothHands = m_itemUsesBothHands;
        }

        if (item == m_itemInHandR)
        {
            Attach(item, m_handBoneR);
        }
        else if (item == m_itemInHandL)
        {
            Attach(item, m_handBoneL);
        }

        if (m_aimScript)
        {
            if (item.ItemTypeID <= 2)
            {
                m_aimScript.SetGunInHand(true, item.ItemTypeID);
            }
            else
            {
                m_aimScript.SetGunInHand(false, -1);
            }
        }

        if (m_itemScriptL || m_itemScriptR)
        {
            m_animatorOverridesApplier.SetCorrectAnimations(m_animator, m_itemInHandR, m_itemInHandL, m_itemScriptR, m_itemScriptL);
        }
    }
Exemplo n.º 24
0
    private void CheckHands()
    {
        ItemLogic right  = m_itemInHandR;
        ItemLogic left   = m_itemInHandL;
        ItemLogic either = null;

        if (right)
        {
            if (right.UseBothHands && m_itemInHandL)
            {
                Drop(CharacterItemAnimator.Hand.Left);
                left = null;
            }

            if (right.PreferredHand == ItemLogic.HandPreference.Right)
            {
                m_itemInHandR = right;
            }
            else if (right.PreferredHand == ItemLogic.HandPreference.Left)
            {
                m_itemInHandL = right;
                m_itemInHandR = null;
            }
            else if (right.PreferredHand == ItemLogic.HandPreference.Either)
            {
                m_itemInHandR = right;
                either        = right;
            }
        }

        if (left)
        {
            if (left.UseBothHands)
            {
                if (m_itemInHandR)
                {
                    Drop(CharacterItemAnimator.Hand.Right);
                }
                if (m_itemInHandL)
                {
                    Drop(CharacterItemAnimator.Hand.Left);
                }
                either = null;
            }

            if (left.PreferredHand == ItemLogic.HandPreference.Left)
            {
                m_itemInHandL = left;
            }
            else if (left.PreferredHand == ItemLogic.HandPreference.Right)
            {
                if (m_itemInHandR == null)
                {
                    m_itemInHandR = left;
                }
                else
                {
                    Drop(CharacterItemAnimator.Hand.Left);
                }

                if (either != null)
                {
                    m_itemInHandR = left;
                    m_itemInHandL = either;
                }
            }
            else if (left.PreferredHand == ItemLogic.HandPreference.Either)
            {
                if (m_itemInHandL != null && m_itemInHandL != left)
                {
                    m_itemInHandR = left;
                }
                else
                {
                    m_itemInHandL = left;
                }
            }
        }
    }
Exemplo n.º 25
0
        private void LoadLogic(string logicString)
        {
            logicString = Migrator.ApplyMigrations(logicString);
            ItemList    = new List <ItemLogic>();
            string[] lines = logicString.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
            ItemSelectorForm.ResetItems();
            ITEM_NAMES = DEFAULT_ITEM_NAMES.ToArray();
            int i = 0;

            while (true)
            {
                if (i == lines.Length)
                {
                    break;
                }
                if (lines[i].StartsWith("#"))
                {
                    i++;
                    continue;
                }
                if (lines[i].Contains("-"))
                {
                    var itemName = lines[i].Substring(2);
                    if (ItemList.Count >= ITEM_NAMES.Length)
                    {
                        var newList = ITEM_NAMES.ToList();
                        newList.Add(itemName);
                        ItemSelectorForm.AddItem(itemName);
                        ITEM_NAMES = newList.ToArray();
                    }
                    i++;
                    continue;
                }
                else
                {
                    ItemLogic l = new ItemLogic();
                    l.Dependence = new List <int>();
                    if (lines[i] != "")
                    {
                        foreach (string j in lines[i].Split(','))
                        {
                            l.Dependence.Add(Convert.ToInt32(j));
                        }
                        ;
                    }
                    ;
                    l.Conditional = new List <List <int> >();
                    if (lines[i + 1] != "")
                    {
                        foreach (string j in lines[i + 1].Split(';'))
                        {
                            List <int> c = new List <int>();
                            foreach (string k in j.Split(','))
                            {
                                c.Add(Convert.ToInt32(k));
                            }
                            ;
                            l.Conditional.Add(c);
                        }
                        ;
                    }
                    ;
                    l.Time_Needed    = Convert.ToInt32(lines[i + 2]);
                    l.Time_Available = Convert.ToInt32(lines[i + 3]);
                    var trickInfo = lines[i + 4].Split(new char[] { ';' }, 2);
                    l.IsTrick      = trickInfo.Length > 1;
                    l.TrickTooltip = l.IsTrick ? trickInfo[1] : null;
                    if (string.IsNullOrWhiteSpace(l.TrickTooltip))
                    {
                        l.TrickTooltip = null;
                    }
                    ItemList.Add(l);
                    i += 5;
                };
            }
            ;

            nItem.Maximum = ITEM_NAMES.Length - 1;
            SetIndex((int)nItem.Value);
        }
Exemplo n.º 26
0
 private void mImport_Click(object sender, EventArgs e)
 {
     if (openLogic.ShowDialog() == DialogResult.OK)
     {
         StreamReader LogicFile = new StreamReader(File.Open(openLogic.FileName, FileMode.Open));
         ItemList = new List <ItemLogic>();
         var logicString = LogicFile.ReadToEnd();
         logicString = Migrator.ApplyMigrations(logicString);
         string[] lines = logicString.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
         ItemSelectorForm.ResetItems();
         ITEM_NAMES = DEFAULT_ITEM_NAMES.ToArray();
         int i = 0;
         while (true)
         {
             if (i == lines.Length)
             {
                 break;
             }
             ;
             if (lines[i].Contains("-"))
             {
                 var itemName = lines[i].Substring(2);
                 if (ItemList.Count >= ITEM_NAMES.Length)
                 {
                     var newList = ITEM_NAMES.ToList();
                     newList.Add(itemName);
                     ItemSelectorForm.AddItem(itemName);
                     ITEM_NAMES = newList.ToArray();
                 }
                 i++;
                 continue;
             }
             else
             {
                 ItemLogic l = new ItemLogic();
                 l.Dependence = new List <int>();
                 if (lines[i] != "")
                 {
                     foreach (string j in lines[i].Split(','))
                     {
                         l.Dependence.Add(Convert.ToInt32(j));
                     }
                     ;
                 }
                 ;
                 l.Conditional = new List <List <int> >();
                 if (lines[i + 1] != "")
                 {
                     foreach (string j in lines[i + 1].Split(';'))
                     {
                         List <int> c = new List <int>();
                         foreach (string k in j.Split(','))
                         {
                             c.Add(Convert.ToInt32(k));
                         }
                         ;
                         l.Conditional.Add(c);
                     }
                     ;
                 }
                 ;
                 l.Time_Needed    = Convert.ToInt32(lines[i + 2]);
                 l.Time_Available = Convert.ToInt32(lines[i + 3]);
                 ItemList.Add(l);
                 i += 4;
             };
         }
         ;
         LogicFile.Close();
         nItem.Value   = 1;
         nItem.Value   = 0;
         nItem.Maximum = ITEM_NAMES.Length - 1;
     }
     ;
 }
Exemplo n.º 27
0
        public void Input(List <Character> CharacterList, MouseState oldState) //resstructure this aea to account for going backwards in the menu
        {
            if (SelectedChracterIndex == -1)
            {
                foreach (Character c in CharacterList) //looks for a character that has been clicked on (if none exist nothing happens, otherwise that character is selected)
                {
                    if (IsVisibleLvl1 != true && InputMethods.checkIfMouseClickInBounds(oldState, new Vector2(c.Location.X * Constants.MapSquareSize, c.Location.Y * Constants.MapSquareSize), new Vector2(Constants.MapSquareSize, Constants.MapSquareSize), (int)Constants.MouseButtons.Left))
                    {
                        SelectedChracterIndex = CharacterList.IndexOf(c);
                        IsVisibleLvl1         = true;
                        FilteredMenuItems     = filterList(c);
                        break;
                    }
                }
            }
            else
            {
                if (IsVisibleLvl1 && !IsVisibleLvl2 && InputMethods.checkIfMouseClicked(oldState, (int)Constants.MouseButtons.Left)) //attack, items, abilities
                {
                    if (InputMethods.checkIfMouseClickInBounds(oldState, new Vector2((CharacterList[SelectedChracterIndex].Location.X + 1) * Constants.MapSquareSize, CharacterList[SelectedChracterIndex].Location.Y * Constants.MapSquareSize), new Vector2(Constants.CharacterMenuWidth, Constants.CharacterMenuHeight * (FilteredMenuItems.Count)), (int)Constants.MouseButtons.Left))
                    {
                        IsVisibleLvl2 = true;

                        /*string
                         * for (int x = 0; x  < FilteredMenuItems.Count; x++)
                         * {
                         *
                         * }*/
                        menuIndexLvl2 = (int)(Mouse.GetState().Y - (CharacterList[SelectedChracterIndex].Location.Y * Constants.MapSquareSize)) / Constants.CharacterMenuHeight;
                        Console.Write(menuIndexLvl2);

                        //display appropriat sub menu
                        //enum switch if item menu selected display items
                    }
                    else
                    {
                        IsVisibleLvl1         = false;
                        SelectedChracterIndex = -1;
                    }



                    //if (FilteredMenuItems)
                }
                else if (IsVisibleLvl1 && IsVisibleLvl2 && InputMethods.checkIfMouseClicked(oldState, (int)Constants.MouseButtons.Left))
                {
                    switch (FilteredMenuItems[menuIndexLvl2])
                    {
                    case "Items":
                    {
                        Vector2     characterDisplacement = new Vector2((CharacterList[SelectedChracterIndex].Location.X + 1) * (Constants.MapSquareSize), CharacterList[SelectedChracterIndex].Location.Y * Constants.MapSquareSize);
                        List <Item> EquippedItems         = new List <Item>();
                        EquippedItems = CharacterList[SelectedChracterIndex].getEquipedItems();
                        bool forLoopHasWorked = false;
                        for (int j = 0; j < EquippedItems.Count; j++)
                        {
                            if (InputMethods.checkIfMouseClickInBounds(oldState, new Vector2(Constants.CharacterMenuWidth + characterDisplacement.X, 32 * j + characterDisplacement.Y), new Vector2(Constants.CharacterMenuWidth, Constants.CharacterMenuHeight), (int)Constants.MouseButtons.Left))
                            {
                                forLoopHasWorked = true;
                                ItemLogic.useItem(CharacterList[SelectedChracterIndex], EquippedItems[j]);
                                Console.WriteLine(CharacterList[SelectedChracterIndex].CurrentHealth);
                            }
                        }

                        if (!forLoopHasWorked)
                        {
                            IsVisibleLvl1         = false;
                            IsVisibleLvl2         = false;
                            SelectedChracterIndex = -1;
                        }
                        else
                        {
                            CharacterList[SelectedChracterIndex].HasAction = false;
                            IsVisibleLvl1         = false;
                            IsVisibleLvl2         = false;
                            SelectedChracterIndex = -1;
                        }

                        /*if ()
                         * {
                         * }
                         * else
                         * {
                         * IsVisibleLvl1 = false;
                         * SelectedChracterIndex = -1;
                         * }*/
                    }
                    break;

                    case "Wait":
                    {
                        CharacterList[SelectedChracterIndex].HasMove   = false;
                        CharacterList[SelectedChracterIndex].HasAction = false;
                        IsVisibleLvl1         = false;
                        IsVisibleLvl2         = false;
                        SelectedChracterIndex = -1;
                    }
                    break;

                    default:
                        break;
                    }
                }

                /*else if (IsVisibleLvl2 && InputMethods.chechIfMouseClicked(oldState, (int)Constants.MouseButtons.Left)) //no support for sub menues yet so hold off for testing //attack menue, item menu, abilities menu
                 * {
                 *  if (InputMethods.checkIfMouseClickInBounds(oldState, new Vector2((CharacterList[SelectedChracterIndex].Location.X + 1) * Constants.MapSquareSize, CharacterList[SelectedChracterIndex].Location.Y * Constants.MapSquareSize), new Vector2(Constants.CharacterMenuWidth, Constants.CharacterMenuHeight * (FilteredMenuItems.Count - 1)), (int)Constants.MouseButtons.Left))
                 *  {
                 *      //perform appropriate action
                 *      //enum switch if item in inverntory pressed use item
                 *  }
                 *  else
                 *  {
                 *      IsVisibleLvl1 = false;
                 *      IsVisibleLvl2 = false;
                 *      SelectedChracterIndex = -1;
                 *  }
                 * }*/
            }
        }
Exemplo n.º 28
0
        protected void StealLinkBtn_Command(object sender, CommandEventArgs e)
        {
            MissionData mis = (MissionData)Session["MissionData"];

            string stolenFile = e.CommandArgument.ToString();

            if (mis.MissionType == 0)
            {
                if (MissionLogic.CheckStolenFile(stolenFile))
                {
                    // Title
                    SummaryTitle.Text      = "Congratulations, Mission Completed!";
                    SummaryTitle.ForeColor = System.Drawing.Color.Green;
                    // Summary
                    MisNameLbl.Text    = mis.MissionName;
                    MisIPLbl.Text      = mis.MissionIP;
                    MisSumLbl.Text     = "Some perpetrators uses these methods to gain access to companies to actually steal theri client information. As such, this could be prevented if firewall rules and other configurations were set up correctly.";
                    MisExpLbl.Text     = mis.MissionExp.ToString();
                    MisCoinLbl.Text    = mis.MissionCoin.ToString();
                    Step5Lbl.ForeColor = System.Drawing.Color.Green;


                    using (DataContext db = new DataContext())
                    {
                        Users u = CurrentUser.Entity(false, db);
                        u.TotalExp = u.TotalExp + mis.MissionExp;

                        Items i = ItemLogic.GetRewardForMis(mis.RecommendLevel, Machines.GetUserMachine(CurrentUser.Entity().UserID, db));
                        ItemNameLbl.Text   = i.ItemName;
                        ItemBonusLbl.Text  = i.ItemBonus.ToString();
                        ItemImage.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(i.ItemPic, 0, i.ItemPic.Length);

                        InventoryItem invItem;
                        if (ItemLogic.CheckInventoryItem(db, u.UserID, i.ItemId, out invItem))
                        {
                            invItem.Quantity += 1;
                            db.SaveChanges();
                        }
                        else
                        {
                            invItem          = new InventoryItem();
                            invItem.UserId   = u.UserID;
                            invItem.ItemId   = i.ItemId;
                            invItem.Quantity = 1;
                            db.InventoryItem.Add(invItem);
                        }
                        List <string> RewardList = new List <string>();
                        RewardList.Add("Mission Exp: " + mis.MissionExp.ToString());
                        RewardList.Add("Mission Coin: " + mis.MissionCoin.ToString());
                        RewardList.Add("Item: " + i.ItemName);

                        MissionLogLogic.Store(CurrentUser.Entity().UserID, mis.MissionName, true, RewardList);
                    }

                    ScriptManager.RegisterStartupScript(this, this.GetType(), "missionSumModel", "showFinishPrompt();", true);
                }
                else
                {
                    // Title
                    SummaryTitle.Text      = "Mission Failed!";
                    SummaryTitle.ForeColor = System.Drawing.Color.Red;
                    MisNameLbl.Text        = mis.MissionName;
                    MisIPLbl.Text          = mis.MissionIP;
                    MisSumLbl.Text         = "Mission Failed due to incorrect file choosen.";
                    MisExpLbl.Text         = "0";
                    MisCoinLbl.Text        = "0";
                    Step5Lbl.ForeColor     = System.Drawing.Color.Red;
                    ItemImage.Visible      = false;
                    List <string> rewardList = new List <string>();
                    rewardList.Add("Failed Mission no reward");
                    MissionLogLogic.Store(CurrentUser.Entity().UserID, mis.MissionName, false, rewardList);

                    ScriptManager.RegisterStartupScript(this, this.GetType(), "missionSumModel", "showFinishPrompt();", true);
                }
            }
            else
            {
                // Title
                SummaryTitle.Text      = "Mission Failed!";
                SummaryTitle.ForeColor = System.Drawing.Color.Red;
                MisNameLbl.Text        = mis.MissionName;
                MisIPLbl.Text          = mis.MissionIP;
                MisSumLbl.Text         = "Mission Failed due to incorrect type of attack choosen";
                MisExpLbl.Text         = "0";
                MisCoinLbl.Text        = "0";
                Step5Lbl.ForeColor     = System.Drawing.Color.Red;
                ItemImage.Visible      = false;
                List <string> rewardList = new List <string>();
                rewardList.Add("Failed Mission no reward");
                MissionLogLogic.Store(CurrentUser.Entity().UserID, mis.MissionName, false, rewardList);


                ScriptManager.RegisterStartupScript(this, this.GetType(), "missionSumModel", "showFinishPrompt();", true);
            }
        }
Exemplo n.º 29
0
        private void LoadLogic(string logicString)
        {
            ItemList = new List <ItemLogic>();
            string[] lines = logicString.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
            ItemSelectorForm.ResetItems();
            ITEM_NAMES = DEFAULT_ITEM_NAMES.ToArray();
            int i = 0;

            while (true)
            {
                if (i == lines.Length)
                {
                    break;
                }
                ;
                if (lines[i].Contains("-"))
                {
                    var itemName = lines[i].Substring(2);
                    if (ItemList.Count >= ITEM_NAMES.Length)
                    {
                        var newList = ITEM_NAMES.ToList();
                        newList.Add(itemName);
                        ItemSelectorForm.AddItem(itemName);
                        ITEM_NAMES = newList.ToArray();
                    }
                    i++;
                    continue;
                }
                else
                {
                    ItemLogic l = new ItemLogic();
                    l.Dependence = new List <int>();
                    if (lines[i] != "")
                    {
                        foreach (string j in lines[i].Split(','))
                        {
                            l.Dependence.Add(Convert.ToInt32(j));
                        }
                        ;
                    }
                    ;
                    l.Conditional = new List <List <int> >();
                    if (lines[i + 1] != "")
                    {
                        foreach (string j in lines[i + 1].Split(';'))
                        {
                            List <int> c = new List <int>();
                            foreach (string k in j.Split(','))
                            {
                                c.Add(Convert.ToInt32(k));
                            }
                            ;
                            l.Conditional.Add(c);
                        }
                        ;
                    }
                    ;
                    l.Time_Needed    = Convert.ToInt32(lines[i + 2]);
                    l.Time_Available = Convert.ToInt32(lines[i + 3]);
                    ItemList.Add(l);
                    i += 4;
                };
            }
            ;

            nItem.Maximum = ITEM_NAMES.Length - 1;
            SetIndex((int)nItem.Value);
        }
Exemplo n.º 30
0
    private void SetCorrectAnimations()
    {
        List <KeyValuePair <AnimationClip, AnimationClip> > overrides;

        overrides = new List <KeyValuePair <AnimationClip, AnimationClip> >(m_animator.overridesCount);
        m_animator.GetOverrides(overrides);

        m_overrides = overrides;

        if (m_itemInHandR)
        {
            ItemLogic item = m_itemInHandR.GetComponent <ItemLogic>();
            if (item.ItemAnimations)
            {
                if (item.ItemAnimations.InteractionRightLoop != null)
                {
                    m_itemScriptR.LoopingAnimationStanding = true;
                    if (item.ItemAnimations.InteractionRightStart != null)
                    {
                        m_itemScriptR.InteractionStandingStartDuration = item.ItemAnimations.InteractionRightStart.length;
                        m_itemScriptR.LoopingDuration = item.ItemAnimations.InteractionRightLoopTime;
                    }
                }
                else
                {
                    m_itemScriptR.LoopingAnimationStanding = false;
                }

                if (item.ItemAnimations.CrouchingInteractionRightLoop != null)
                {
                    m_itemScriptR.LoopingAnimationCrouching = true;
                    if (item.ItemAnimations.CrouchingInteractionRightStart != null)
                    {
                        m_itemScriptR.InteractionCrouchingStartDuration = item.ItemAnimations.CrouchingInteractionRightStart.length;
                        m_itemScriptR.LoopingDuration = item.ItemAnimations.CrouchingInteractionRightLoopTime;
                    }
                }
                else
                {
                    m_itemScriptR.LoopingAnimationCrouching = false;
                }

                ReplaceAnimation("_ItemInteractionRStart", item.ItemAnimations.InteractionRightStart);
                ReplaceAnimation("_ItemInteractionRLoop", item.ItemAnimations.InteractionRightLoop);
                ReplaceAnimation("_ItemInteractionREnd", item.ItemAnimations.InteractionRightEnd);

                ReplaceAnimation("_ItemInteractionCrouchingRStart", item.ItemAnimations.CrouchingInteractionRightStart);
                ReplaceAnimation("_ItemInteractionCrouchingRLoop", item.ItemAnimations.CrouchingInteractionRightLoop);
                ReplaceAnimation("_ItemInteractionCrouchingREnd", item.ItemAnimations.CrouchingInteractionRightEnd);

                ReplaceAnimation("_ItemHoldR", item.ItemAnimations.HoldingRight);
                ReplaceAnimation("_ItemHoldCrouchingR", item.ItemAnimations.CrouchingHoldingRight);
                ReplaceAnimation("_ItemEquipR", item.ItemAnimations.EquipRight);
                ReplaceAnimation("_ItemUnEquipR", item.ItemAnimations.UnEquipRight);

                if (item.m_useBothHands)
                {
                    ReplaceAnimation("_ItemInteractionLStart", item.ItemAnimations.InteractionRightStart);
                    ReplaceAnimation("_ItemInteractionLLoop", item.ItemAnimations.InteractionRightLoop);
                    ReplaceAnimation("_ItemInteractionLEnd", item.ItemAnimations.InteractionRightEnd);

                    ReplaceAnimation("_ItemInteractionCrouchingLStart", item.ItemAnimations.CrouchingInteractionRightStart);
                    ReplaceAnimation("_ItemInteractionCrouchingLLoop", item.ItemAnimations.CrouchingInteractionRightLoop);
                    ReplaceAnimation("_ItemInteractionCrouchingLEnd", item.ItemAnimations.CrouchingInteractionRightEnd);

                    ReplaceAnimation("_ItemHoldB", item.ItemAnimations.HoldingRight);
                    ReplaceAnimation("_ItemHoldCrouchingB", item.ItemAnimations.CrouchingHoldingRight);
                    ReplaceAnimation("_ItemEquipB", item.ItemAnimations.EquipRight);
                    ReplaceAnimation("_ItemUnEquipB", item.ItemAnimations.UnEquipRight);
                }
            }
            else
            {
                ReplaceAnimation("_ItemInteractionRStart", null);
                ReplaceAnimation("_ItemInteractionRLoop", null);
                ReplaceAnimation("_ItemInteractionREnd", null);

                ReplaceAnimation("_ItemInteractionCrouchingRStart", null);
                ReplaceAnimation("_ItemInteractionCrouchingRLoop", null);
                ReplaceAnimation("_ItemInteractionCrouchingREnd", null);

                ReplaceAnimation("_ItemHoldR", null);
                ReplaceAnimation("_ItemHoldCrouchingR", null);
                ReplaceAnimation("_ItemEquipR", null);
                ReplaceAnimation("_ItemUnEquipR", null);
            }
        }

        if (m_itemInHandL)
        {
            ItemLogic item = m_itemInHandL.GetComponent <ItemLogic>();
            if (item.ItemAnimations)
            {
                if (item.ItemAnimations.InteractionLeftLoop != null)
                {
                    m_itemScriptL.LoopingAnimationStanding = true;
                    if (item.ItemAnimations.InteractionLeftStart != null)
                    {
                        m_itemScriptL.InteractionStandingStartDuration = item.ItemAnimations.InteractionLeftStart.length;
                        m_itemScriptL.LoopingDuration = item.ItemAnimations.InteractionLeftLoopTime;
                    }
                }
                else
                {
                    m_itemScriptL.LoopingAnimationStanding = false;
                }

                if (item.ItemAnimations.CrouchingInteractionLeftLoop != null)
                {
                    m_itemScriptL.LoopingAnimationCrouching = true;
                    if (item.ItemAnimations.CrouchingInteractionLeftStart != null)
                    {
                        m_itemScriptL.InteractionCrouchingStartDuration = item.ItemAnimations.CrouchingInteractionLeftStart.length;
                        m_itemScriptL.LoopingDuration = item.ItemAnimations.CrouchingInteractionLeftLoopTime;
                    }
                }
                else
                {
                    m_itemScriptL.LoopingAnimationCrouching = false;
                }

                ReplaceAnimation("_ItemInteractionLStart", item.ItemAnimations.InteractionLeftStart);
                ReplaceAnimation("_ItemInteractionLLoop", item.ItemAnimations.InteractionLeftLoop);
                ReplaceAnimation("_ItemInteractionLEnd", item.ItemAnimations.InteractionLeftEnd);

                ReplaceAnimation("_ItemInteractionCrouchingLStart", item.ItemAnimations.CrouchingInteractionLeftStart);
                ReplaceAnimation("_ItemInteractionCrouchingLLoop", item.ItemAnimations.CrouchingInteractionLeftLoop);
                ReplaceAnimation("_ItemInteractionCrouchingLEnd", item.ItemAnimations.CrouchingInteractionLeftEnd);

                ReplaceAnimation("_ItemHoldL", item.ItemAnimations.HoldingLeft);
                ReplaceAnimation("_ItemHoldCrouchingL", item.ItemAnimations.CrouchingHoldingLeft);
                ReplaceAnimation("_ItemEquipL", item.ItemAnimations.EquipLeft);
                ReplaceAnimation("_ItemUnEquipL", item.ItemAnimations.UnEquipLeft);

                if (item.m_useBothHands)
                {
                    ReplaceAnimation("_ItemInteractionRStart", item.ItemAnimations.InteractionLeftStart);
                    ReplaceAnimation("_ItemInteractionRLoop", item.ItemAnimations.InteractionLeftLoop);
                    ReplaceAnimation("_ItemInteractionREnd", item.ItemAnimations.InteractionLeftEnd);

                    ReplaceAnimation("_ItemInteractionCrouchingRStart", item.ItemAnimations.CrouchingInteractionLeftStart);
                    ReplaceAnimation("_ItemInteractionCrouchingRLoop", item.ItemAnimations.CrouchingInteractionLeftLoop);
                    ReplaceAnimation("_ItemInteractionCrouchingREnd", item.ItemAnimations.CrouchingInteractionLeftEnd);

                    ReplaceAnimation("_ItemHoldB", item.ItemAnimations.HoldingLeft);
                    ReplaceAnimation("_ItemHoldCrouchingB", item.ItemAnimations.CrouchingHoldingLeft);
                    ReplaceAnimation("_ItemEquipB", item.ItemAnimations.EquipLeft);
                    ReplaceAnimation("_ItemUnEquipB", item.ItemAnimations.UnEquipLeft);
                }
            }
            else
            {
                ReplaceAnimation("_ItemInteractionLStart", null);
                ReplaceAnimation("_ItemInteractionLLoop", null);
                ReplaceAnimation("_ItemInteractionLEnd", null);

                ReplaceAnimation("_ItemInteractionCrouchingLStart", null);
                ReplaceAnimation("_ItemInteractionCrouchingLLoop", null);
                ReplaceAnimation("_ItemInteractionCrouchingLEnd", null);

                ReplaceAnimation("_ItemHoldL", null);
                ReplaceAnimation("_ItemHoldCrouchingL", null);
                ReplaceAnimation("_ItemEquipR", null);
                ReplaceAnimation("_ItemUnEquipR", null);
            }
        }

        List <KeyValuePair <AnimationClip, AnimationClip> > newOverrides = new List <KeyValuePair <AnimationClip, AnimationClip> >();

        for (int i = 0; i < m_overrides.Count; i++)
        {
            if (m_overrides[i].Value == overrides[i].Value)
            {
                newOverrides.Add(m_overrides[i]);
            }
        }
        m_animator.ApplyOverrides(newOverrides);
    }