Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="batch"></param>
        /// <param name="field"></param>
        /// <param name="position"></param>
        /// <param name="direction"></param>
        public override void Draw(SpriteBatch batch, ViewField field, ViewFieldPosition position, CardinalPoint direction)
        {
            if (Decoration == null || IsHidden)
            {
                return;
            }

            TileDrawing td = DisplayCoordinates.GetPit(position);

            if (td == null)
            {
                return;
            }



            if (IsActivated)
            {
                //batch.FillRectangle(new Rectangle(td.Location, new Size(50, 50)), Color.Red);
                Decoration.Draw(batch, field.Maze.FloorPitDeco, position);
            }
            //TODO
            //if (td != null && !IsHidden)
            //    batch.DrawTile(TileSet, td.ID, td.Location, Color.White, 0.0f, td.Effect, 0.0f);
        }
Beispiel #2
0
        /// <summary>
        /// Default constructor
        /// </summary>
        static DisplayCoordinates()
        {
            int viewcount = Enum.GetValues(typeof(ViewFieldPosition)).Length;

            Doors       = new TileDrawing[viewcount];
            Teleporters = new TileDrawing[viewcount];
            FloorPlates = new TileDrawing[viewcount];

            Ground = new Point[viewcount, 5];
            for (int i = 0; i < viewcount; i++)
            {
                for (int j = 0; j < 5; j++)
                {
                    Ground[i, j] = new Point(-999, -999);
                }
            }

            FlyingItems = new Point[viewcount, 5];

            Pits        = new TileDrawing[viewcount];
            CeilingPits = new TileDrawing[viewcount];
            Stairs      = new List <TileDrawing> [viewcount];
            for (int i = 0; i < viewcount; i++)
            {
                Stairs[i] = new List <TileDrawing>();
            }


            ThrowRight           = new Rectangle(176, 0, 176, 144);
            ThrowLeft            = new Rectangle(0, 0, 176, 144);
            CampButton           = new Rectangle(578, 354, 62, 42);
            FrontSquare          = new Rectangle(48, 14, 256, 192);
            LeftFeetTeam         = new Rectangle(0, 202, 176, 38);
            LeftFrontTeamGround  = new Rectangle(0, 144, 176, 58);
            RightFeetTeam        = new Rectangle(176, 202, 176, 38);
            RightFrontTeamGround = new Rectangle(176, 144, 176, 58);

            ScriptedDialog        = new Rectangle(0, 242, 640, 158);
            ScriptedDialogChoices = new Rectangle[]
            {
                // 1 choice
                new Rectangle(442, 378, 190, 18),
                Rectangle.Empty,
                Rectangle.Empty,

                // 2 choices
                new Rectangle(118, 378, 190, 18),
                new Rectangle(332, 378, 190, 18),
                Rectangle.Empty,

                // 3 choices
                new Rectangle(8, 378, 190, 18),
                new Rectangle(224, 378, 190, 18),
                new Rectangle(440, 378, 190, 18),
            };

            Scroll   = new Rectangle(0, 0, 352, 350);
            ScrollOk = new Rectangle(152, 324, 190, 18);
        }
		/// <summary>
		/// Default constructor 
		/// </summary>
		static DisplayCoordinates()
		{
			int viewcount = Enum.GetValues(typeof(ViewFieldPosition)).Length;

			Doors = new TileDrawing[viewcount];
			Teleporters = new TileDrawing[viewcount];
			FloorPlates = new TileDrawing[viewcount];

			Ground = new Point[viewcount, 5];
			for (int i = 0; i < viewcount; i++)
				for (int j = 0; j < 5; j++)
					Ground[i, j] = new Point(-999, -999);

			FlyingItems = new Point[viewcount, 5];

			Pits = new TileDrawing[viewcount];
			CeilingPits = new TileDrawing[viewcount];
			Stairs = new List<TileDrawing>[viewcount];
			for (int i = 0; i < viewcount; i++)
				Stairs[i] = new List<TileDrawing>();


			ThrowRight = new Rectangle(176, 0, 176, 144);
			ThrowLeft = new Rectangle(0, 0, 176, 144);
			CampButton = new Rectangle(578, 354, 62, 42);
			FrontSquare = new Rectangle(48, 14, 256, 192);
			LeftFeetTeam = new Rectangle(0, 202, 176, 38);
			LeftFrontTeamGround = new Rectangle(0, 144, 176, 58);
			RightFeetTeam = new Rectangle(176, 202, 176, 38);
			RightFrontTeamGround = new Rectangle(176, 144, 176, 58);

			ScriptedDialog = new Rectangle(0, 242, 640, 158);
			ScriptedDialogChoices = new Rectangle[]
			{
				// 1 choice
				new Rectangle(442,	378, 190, 18),
				Rectangle.Empty,
				Rectangle.Empty,

				// 2 choices
				new Rectangle(118,	378, 190, 18),
				new Rectangle(332,	378, 190, 18),
				Rectangle.Empty,

				// 3 choices
				new Rectangle(8,	378, 190, 18),
				new Rectangle(224,	378, 190, 18),
				new Rectangle(440,	378, 190, 18),
			};

			Scroll = new Rectangle(0, 0, 352, 350);
			ScrollOk = new Rectangle(152, 324, 190, 18);
		}
Beispiel #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="batch"></param>
        /// <param name="field"></param>
        /// <param name="position"></param>
        /// <param name="direction"></param>
        public override void Draw(SpriteBatch batch, ViewField field, ViewFieldPosition position, CardinalPoint direction)
        {
            if (Decoration == null || IsHidden)
            {
                return;
            }

            TileDrawing td = DisplayCoordinates.GetFloorPlate(position);

            if (td == null)
            {
                return;
            }

            Decoration.Draw(batch, DecorationPrimary, position);
        }
Beispiel #5
0
        /// <summary>
        /// Draw the door
        /// </summary>
        /// <param name="batch">Spritebatch to use</param>
        /// <param name="field">View field</param>
        /// <param name="position">Position in the view filed</param>
        /// <param name="view">Looking direction of the team</param>
        public override void Draw(SpriteBatch batch, ViewField field, ViewFieldPosition position, CardinalPoint direction)
        {
            if (!IsVisible)
            {
                return;
            }

            TileDrawing td = DisplayCoordinates.GetTeleporter(position);

            if (td == null)
            {
                return;
            }

            Anim.Draw(batch, td.Location, 0.0f, SpriteEffects.None,
                      DisplayCoordinates.GetDistantColor(position),
                      DisplayCoordinates.GetMonsterScaleFactor(position));
        }
Beispiel #6
0
        /// <summary>
        /// Draw the door
        /// </summary>
        /// <param name="batch">Spritebatch to use</param>
        /// <param name="field">View field</param>
        /// <param name="position">Position in the view filed</param>
        /// <param name="view">Looking direction of the team</param>
        public override void Draw(SpriteBatch batch, ViewField field, ViewFieldPosition position, CardinalPoint view)
        {
            if (TileSet == null)
            {
                return;
            }

            TileDrawing td   = null;
            TileSet     wall = Square.Maze.WallTileset;


            // TODO: Under the door, draw sides
            if (field.GetBlock(ViewFieldPosition.L).IsWall&& position == ViewFieldPosition.Team)
            {
                //		td = DisplayCoordinates.GetDoor(ViewFieldPosition.Team);
                //		if (td != null)
                //			batch.DrawTile(overlay, td.ID, td.Location, Color.White, 0.0f, td.Effect, 0.0f);
                if (field.Maze.Decoration != null)
                {
                    field.Maze.Decoration.Draw(batch, field.Maze.DoorDeco, position);
                }
            }

            // Draw the door
            else if (((field.Maze.IsDoorNorthSouth(Square.Location) && (view == CardinalPoint.North || view == CardinalPoint.South)) ||
                      (!field.Maze.IsDoorNorthSouth(Square.Location) && (view == CardinalPoint.East || view == CardinalPoint.West))) &&
                     position != ViewFieldPosition.Team)
            {
                td = DisplayCoordinates.GetDoor(position);
                if (td != null)
                {
                    batch.DrawTile(wall, td.ID, td.Location, Color.White, 0.0f, td.Effect, 0.0f);
                    //block.Door.Draw(batch, td.Location, position, view);


                    switch (Type)
                    {
                    case DoorType.Grid:
                        DrawSimpleDoor(batch, 1, td.Location, position);
                        break;

                    case DoorType.Forest:
                        DrawSimpleDoor(batch, 6, td.Location, position);
                        break;

                    case DoorType.Iron:
                        DrawSimpleDoor(batch, 0, td.Location, position);
                        break;

                    case DoorType.Monster:
                        DrawUpDownDoor(batch, 2, td.Location, position);
                        break;

                    case DoorType.Azure:
                        DrawSimpleDoor(batch, 8, td.Location, position);
                        break;

                    case DoorType.Crimson:
                        DrawSimpleDoor(batch, 9, td.Location, position);
                        break;

                    case DoorType.Temple:
                        DrawSimpleDoor(batch, 10, td.Location, position);
                        break;

                    case DoorType.Silver:
                        DrawSimpleDoor(batch, 11, td.Location, position);
                        break;

                    case DoorType.Mantis:
                        DrawSimpleDoor(batch, 12, td.Location, position);
                        break;
                    }
                }
            }
        }