コード例 #1
0
        private void PopulateDrop(TypeDrop actualDrop)
        {
            switch (actualDrop)
            {
            case TypeDrop.Gold:
            {
                StatsManager.Instance.AddGold(CostDrop());
                break;
            }

            case TypeDrop.Weapon:
            {
                InfoWeapon iw = new InfoWeapon();
                iw.SetValues("Weapon", (float)RarityStats(), false, WeaponType.SimpleSword, WeaponEffect(), actualRarityDrop, 1f, CostDrop(), "/Weapons/" + IconNameWeapon());
                if (InventoryManager.Instance.AvailableWeaponSpace > 0)
                {
                    InventoryManager.Instance.AddToInventory(iw);
                }
                else
                {
                    StatsManager.Instance.AddGold(iw.SellValue);
                }

                break;
            }

            case TypeDrop.Armor:
            {
                InfoArmor      ia    = new InfoArmor();
                EquippedInSlot slot  = SlotArmor();
                Stats          stats = ArmorStats();
                ia.SetValues("Armadura", false, slot, CostDrop(), "Some description randomly to be implemented", stats, "/Armors/" + slot.ToString() + "/" + IconNameArmor(slot));
                if (InventoryManager.Instance.AvailableArmorSpace > 0)
                {
                    InventoryManager.Instance.AddToInventory(ia);
                }
                else
                {
                    StatsManager.Instance.AddGold(ia.SellValue);
                }
                break;
            }

            case TypeDrop.Item:
            {
                InfoItem ii = new InfoItem();
                ii.SetValues("Item", TypeItem.Other, "Some description randomly generated", ConsumeEffect.None, CostDrop(), 1, "/Items/" + IconNameItem());
                if (InventoryManager.Instance.AvailableItemSpace > 0)
                {
                    InventoryManager.Instance.AddToInventory(ii);
                }
                else
                {
                    StatsManager.Instance.AddGold(ii.SellValue);
                }
                break;
            }
            }
        }
コード例 #2
0
 public void GiveRewards(int levelPlayer, int levelDungeon)
 {
     EstablishPercentsForItems(levelDungeon, levelPlayer);
     for (int i = 0; i < GetQuantityItems(); i++)
     {
         SetQualityItem();
         TypeDrop drop_i = TypeItemToGive();
         PopulateDrop(drop_i);
     }
 }
コード例 #3
0
    public void Create()
    {
        string name = NameInput.GetComponent <InputField> ().text;
        List <Dropdown.OptionData> types = TypeDrop.GetComponent <Dropdown> ().options;
        string type = types [TypeDrop.GetComponent <Dropdown> ().value].text;
        List <Dropdown.OptionData> races = RaceDrop.GetComponent <Dropdown> ().options;
        string race = races [RaceDrop.GetComponent <Dropdown> ().value].text;

        GameObject tp_player = GameObject.FindGameObjectWithTag("Player");
        int        id        = tp_player.GetComponent <Player> ().PlayerID;

        string[] content = new string[] { "('" + id + "','" + name + "','3','" + race + "','" + type + "','" + Att_HP + "','" + Att_HP + "','16','1/1/1/1','0','" + Str + "','" + Con + "','" + Dex + "','" + Int + "','" + Luck + "','0/0/0/0/0/0/0/0/0/0','0/0/0/0/0/0/0/0')" };
        print(content [0]);
        RaiseEventOptions opt = new RaiseEventOptions();

        opt.Receivers = ReceiverGroup.MasterClient;
        PhotonNetwork.RaiseEvent(16, content, false, opt);
    }
コード例 #4
0
 //Used on the slotmachine this is why the drop is predefined.
 public void DropItemDirectly(int levelPlayer, TypeDrop drop)
 {
     SetQualityItem();
     _levelPlayer = levelPlayer;
     PopulateDrop(drop);
 }
コード例 #5
0
 public DragAndDropWindow(TypeDrop typeDrop)
 {
     _typeDrop = typeDrop;
 }