コード例 #1
0
        private void clearPart(ItemInventory inventory, ISkillArgs args, FreeData fd)
        {
            if (inventory.name == "w1" || inventory.name == "w2" || inventory.name == "w3")
            {
                ShowPartAction show = new ShowPartAction();
                show.show = false;
                show.SetPlayer("current");
                show.SetScope(1);

                if (inventory.name == "w1")
                {
                    show.weaponKey = "1";
                    ClearPart(args, fd, 1);
                }
                else if (inventory.name == "w2")
                {
                    show.weaponKey = "2";
                    ClearPart(args, fd, 2);
                }
                else if (inventory.name == "w3")
                {
                    show.weaponKey = "3";
                    ClearPart(args, fd, 3);
                }
                show.parts = "1,2,3,4,5";
                show.Act(args);
            }
        }
コード例 #2
0
        private void clearPart(ItemInventory inventory, ISkillArgs args, FreeData fd)
        {
            if (inventory.name == ChickenConstant.BagPrimeWeapon || inventory.name == ChickenConstant.BagSecondaryWeapon || inventory.name == ChickenConstant.BagPistolWeapon)
            {
                ShowPartAction show = new ShowPartAction();
                show.show = false;
                show.SetPlayer("current");
                show.SetScope(1);

                if (inventory.name == ChickenConstant.BagPrimeWeapon)
                {
                    show.weaponKey = "1";
                    ClearPart(args, fd, 1);
                }
                else if (inventory.name == ChickenConstant.BagSecondaryWeapon)
                {
                    show.weaponKey = "2";
                    ClearPart(args, fd, 2);
                }
                else if (inventory.name == ChickenConstant.BagPistolWeapon)
                {
                    show.weaponKey = "3";
                    ClearPart(args, fd, 3);
                }
                show.parts = "1,2,3,4,5";
                show.Act(args);
            }
        }
コード例 #3
0
        private void redrawPart(ItemInventory inventory, ISkillArgs args, ItemPosition ip, FreeData fd)
        {
            if (inventory.name == "w1" || inventory.name == "w2" || inventory.name == "w3")
            {
                int id = (int)((IntPara)ip.GetParameters().Get("itemId")).GetValue();

                WeaponResConfigItem config = SingletonManager.Get <WeaponResourceConfigManager>().GetConfigById(id);
                if (config != null)
                {
                    HashSet <int> list = new HashSet <int>();

                    foreach (XmlConfig.EWeaponPartType part in SingletonManager.Get <WeaponPartsConfigManager>().GetAvaliablePartTypes(id))
                    {
                        list.Add(FreeWeaponUtil.GetWeaponPart(part));
                    }

                    List <string> showP = new List <string>();
                    List <string> hideP = new List <string>();

                    for (int i = 1; i <= 5; i++)
                    {
                        if (list.Contains(i))
                        {
                            showP.Add(i.ToString());
                        }
                        else
                        {
                            hideP.Add(i.ToString());
                        }
                    }

                    ShowPartAction show = new ShowPartAction();
                    show.show = true;
                    show.SetPlayer("current");
                    show.SetScope(1);
                    if (inventory.name == "w1")
                    {
                        show.weaponKey = "1";
                    }
                    else if (inventory.name == "w2")
                    {
                        show.weaponKey = "2";
                    }
                    else
                    {
                        show.weaponKey = "3";
                    }

                    show.parts = StringUtil.GetStringFromStrings(showP, ",");
                    show.Act(args);

                    show.show  = false;
                    show.parts = StringUtil.GetStringFromStrings(hideP, ",");
                    show.Act(args);
                }
                else
                {
                    Debug.LogError(ip.key.GetName() + " 没有定义配件.");
                }
            }
        }
コード例 #4
0
        private void redrawPart(ItemInventory inventory, ISkillArgs args, ItemPosition ip, FreeData fd)
        {
            if (inventory.name == ChickenConstant.BagPrimeWeapon || inventory.name == ChickenConstant.BagSecondaryWeapon || inventory.name == ChickenConstant.BagPistolWeapon)
            {
                int id = (int)((IntPara)ip.GetParameters().Get("itemId")).GetValue();

                WeaponAllConfigs configs = SingletonManager.Get <WeaponConfigManagement>().FindConfigById(id);
                if (configs != null)
                {
                    HashSet <int> list = new HashSet <int>();

                    foreach (XmlConfig.EWeaponPartType part in configs.ApplyPartsSlot)
                    {
                        list.Add(FreeWeaponUtil.GetWeaponPart(part));
                    }

                    List <string> showP = new List <string>();
                    List <string> hideP = new List <string>();

                    for (int i = 1; i <= 5; i++)
                    {
                        if (list.Contains(i))
                        {
                            showP.Add(i.ToString());
                        }
                        else
                        {
                            hideP.Add(i.ToString());
                        }
                    }

                    ShowPartAction show = new ShowPartAction();
                    show.show = true;
                    show.SetPlayer("current");
                    show.SetScope(1);
                    if (inventory.name == ChickenConstant.BagPrimeWeapon)
                    {
                        show.weaponKey = "1";
                    }
                    else if (inventory.name == ChickenConstant.BagSecondaryWeapon)
                    {
                        show.weaponKey = "2";
                    }
                    else
                    {
                        show.weaponKey = "3";
                    }

                    show.parts = StringUtil.GetStringFromStrings(showP, ",");
                    show.Act(args);

                    show.show  = false;
                    show.parts = StringUtil.GetStringFromStrings(hideP, ",");
                    show.Act(args);
                }
                else
                {
                    Debug.LogError(ip.key.GetName() + " 没有定义配件.");
                }
            }
        }