Exemplo n.º 1
0
        private void addRandomMiscItems(long seed)
        {
            JavaRng rng = new JavaRng(seed);

            foreach (var miscItem in miscBools.ToArray())
            {
                int nextRandom = rng.NextInt(4);
                if (nextRandom == 1)
                {
                    miscBools[miscItem.Key] = true;
                    updateMiscItem(miscItem.Key);
                }
            }
        }
Exemplo n.º 2
0
        private void addRandomItem(long seed, Slot slot)
        {
            JavaRng   rng       = new JavaRng(seed);
            ArrayList slotItems = new ArrayList();

            foreach (Item item in allItems)
            {
                if (item.Slot == slot && !item.Name.Contains("none_"))
                {
                    slotItems.Add(item);
                }
            }
            int  rndIndex = rng.NextInt(slotItems.Count);
            Item rndItem  = (Item)slotItems[rndIndex];

            XmlElement   newItem = xml.CreateElement("item");
            XmlAttribute newType = xml.CreateAttribute("type");

            newType.Value = rndItem.Name;
            newItem.SetAttributeNode(newType);
            cadence.AppendChild(newItem);
        }