Exemplo n.º 1
0
        private void ShowMap()
        {
            selectedPortal = Definition.WorldMapPortals[(int)UIPortalNumber.Value];

            switch (selectedPortal.TypeOfPortal)
            {
            case WorldMapPortal.PortalType.NotUsed:
                UIDestination.Text = "Not in use";
                break;

            case WorldMapPortal.PortalType.RoomDestination:
                if (Definition.Regions[selectedPortal.DestinationRegion - 1] != null)
                {
                    UIDestination.Text = string.Format("Region {0}, Room {1}, {2},{3}", Definition.Regions[selectedPortal.DestinationRegion - 1]
                                                       , Definition.Regions[selectedPortal.DestinationRegion - 1].Rooms[selectedPortal.DestinationRoom]
                                                       , selectedPortal.RoomDestinationX, selectedPortal.RoomDestinationY);
                }
                break;

            case WorldMapPortal.PortalType.WorldMapDestination:
                UIDestination.Text = string.Format("World Map {0},{1}", selectedPortal.MapDestinationX, selectedPortal.MapDestinationY);
                break;

            case WorldMapPortal.PortalType.Destination:
                UIDestination.Text = "Room portal destination";
                break;
            }

            var      players = new List <WorldMapCreature>();
            Creature cr      = new Creature
            {
                InUse = false
            };
            WorldMapCreature player = new WorldMapCreature
            {
                Creature = cr
            };

            players.Add(player);
            players.AddRange(Definition.WorldMapPlayers);
            UIPlayers.DataSource = players;

            UpdateMap();
        }
Exemplo n.º 2
0
        private void UIResidentCreatures_DoubleClick(object sender, System.EventArgs e)
        {
            if (selectedX == -1)
            {
                return;
            }
            var creature = (Creature)UIResidentCreatures.SelectedItem;
            var form     = new CreatureViewer();

            form.Definition = definition;
            WorldMapCreature MapCreature = new WorldMapCreature();

            MapCreature.Creature        = creature;
            MapCreature.AppearingIn     = room.Name;
            MapCreature.ChanceAppearing = (byte)100;
            //form.Creature = creature;
            form.MapCreature = MapCreature;
            form.Show();
        }
Exemplo n.º 3
0
        private void UIRandomCreature_DoubleClick(object sender, System.EventArgs e)
        {
            if (UIRandomCreature.TextLength == 0)
            {
                return;
            }
            var form = new CreatureViewer();

            form.Definition = definition;
            WorldMapCreature MapCreature = new WorldMapCreature();

            MapCreature.Creature        = region.RandomCreatures[room.RandomCreatureNumber];
            MapCreature.AppearingIn     = room.Name;
            MapCreature.ChanceAppearing = room.RandomCreatureChance;
            //form.Creature = region.RandomCreatures[room.RandomCreatureNumber];
            form.MapCreature = MapCreature;

            form.MdiParent = this.MdiParent;
            form.Show();
        }
Exemplo n.º 4
0
        public void ShowRoom()
        {
            DrawRoom(room);
            var items = new List <RoomItem>();

            items.Add(new RoomItem());
            items.AddRange(room.RoomItems);
            UIItems.DataSource = items;

            var creatures = new List <Creature>();
            var creature  = new Creature();

            creature.InUse = false;
            creatures.Add(creature);
            creatures.AddRange(room.RoomCreatures);
            UIResidentCreatures.DataSource = creatures;

            var      players = new List <WorldMapCreature>();
            Creature cr      = new Creature
            {
                InUse = false
            };
            WorldMapCreature player = new WorldMapCreature
            {
                Creature = cr
            };

            players.Add(player);
            players.AddRange(room.RoomPlayers);
            UIPlayers.DataSource = players;

            if (room.RandomCreatureChance > 0)
            {
                UIRandomCreature.Text = region.RandomCreatures[room.RandomCreatureNumber].Name;
                UIAppearChance.Text   = room.RandomCreatureChance.ToString() + "%";
            }
        }