Esempio n. 1
0
        private void OnWorldMonster(object sender, GameEventArgs e)
        {
            WorldEvent worldEvent = e.Get <WorldEvent>();
            Monster    monster;

            // Create specific monster(s)
            if (worldEvent.Name != "Wandering Monster")
            {
                foreach (string name in worldEvent.EventData)
                {
                    monster = monsterFactory.Create(name, worldEvent.Hero);
                    RaiseGameEvent(GameEvents.SetMonster, this, monster);
                }
            }
            // Create monster using monster table
            else
            {
                // Select random number of monsters
                int groupSize = random.Next(minMonsterGroupSize, maxMonsterGroupSize + 1);
                for (int i = 0; i < groupSize; ++i)
                {
                    monster = CurrentZone.MonsterTable.GenerateObject(
                        worldEvent.Hero, monsterFactory);
                    RaiseGameEvent(GameEvents.SetMonster, this, monster);
                }
            }
        }
Esempio n. 2
0
        //------------------------------------------------------------------------------
        // Private Functions:
        //------------------------------------------------------------------------------

        private void AddZoneArchetypes()
        {
            // TRISTRAM
            WorldZone zone = new WorldZone("New Tristram", WorldZoneType.Town,
                                           "You are in the town of New Tristram, a place of relative safety.");

            zone.ConnectedZones.Add("Old Tristram Road");

            // Discover next zone
            WorldEvent worldEvent = new WorldEvent("Old Tristram Road", GameEvents.WorldZoneDiscovery,
                                                   "Exiting the town's eastern gate, you find a weathered road leading north.");

            zone.EventTable.Events[EventRarity.Common].Add(worldEvent);

            AddArchetype(zone);

            // OLD TRISTRAM ROAD
            zone = new WorldZone("Old Tristram Road", WorldZoneType.Outdoors,
                                 "You are in Old Tristram Road, just outside of the town of Tristram. An eerie fog blankets" +
                                 " the area, making it difficult to see more than about 30 feet in front of you.");
            zone.ConnectedZones.Add("Tristram");
            zone.MonsterTable.Monsters[MonsterRarity.Common].Add("Fallen Imp");
            zone.MonsterTable.Monsters[MonsterRarity.Uncommon].Add("Fallen Shaman");

            worldEvent = new WorldEvent("Wandering Monster", GameEvents.WorldMonster,
                                        "As you wander, you stumble into the territory of a monster.");
            zone.EventTable.Events[EventRarity.Common].Add(worldEvent);

            AddArchetype(zone);

            SaveArchetypesToFile();
        }
Esempio n. 3
0
        private void OnPlayerExplore(object sender, GameEventArgs e)
        {
            WorldEvent worldEvent = CurrentZone.EventTable.GenerateObject(e.Get <Hero>());

            RaiseGameEvent(worldEvent.EventType, this, worldEvent);
        }
Esempio n. 4
0
        private void OnWorldZoneDiscovery(object sender, GameEventArgs e)
        {
            WorldEvent worldEvent = e.Get <WorldEvent>();

            NextZoneName = worldEvent.Name;
        }