//spawn pitems and public void SpawnPI(uint difficultylevel) { Random r = RandomGenerator.rnd; r.Next(); //spawn crystals for (int i = 0; i < r.Next(0, (int)difficultylevel) + 1; i++) { dungeon.graph[r.Next(1, dungeon.graph.Count - 1)].items.Add(new Crystal(i.ToString())); Console.WriteLine("CRYSTAL SPAWNED ON NODE {0}!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", dungeon.graph[i].id); //To do: comment out above line. } //spawn health potions uint potionHP = 0; int monsterHP = dungeon.MonsterHP(); while (potionHP < monsterHP + 50) { HealingPotion potion = new HealingPotion(dungeon.totalPotions.Count().ToString()); dungeon.totalPotions.Add(potion); dungeon.graph[r.Next(0, dungeon.graph.Count() - 1)].items.Add(potion); potionHP += dungeon.totalPotions.Last().HPvalue; } }