public void DestorySIde(BaseDimension dimension, int xDoor, int yDoor) { for (var i = 0; i <= 3; i++) { dimension.Reset(xDoor, yDoor - i); } }
public override void Update(int x, int y, BaseDimension dimension, bool isView) { switch (Id) { case 27: if (isView) { return; } if (dimension.Rand.Next(0, 3) != 0) { return; } var direction = dimension.Rand.Next(0, 2); switch (direction) { case 0: AddTexture(x + 1, y, dimension); break; case 1: AddTexture(x + 1, y, dimension); break; } break; case 32 when dimension.MapTile[x, y].IdSubTexture < 3: if (dimension.MapTile[x, y].TimeCount % 120 != 110) { return; } dimension.MapTile[x, y].IdSubTexture++; break; } }
public override List <Item> Destory(int x, int y, BaseDimension dimension, DynamicEntity entity) { List <Item> itemDrop = new List <Item>(); var procent = Program.Game.Player.Carma / 100.0f; switch (Id) { case 27: if (Program.Game.Rand.Next(100) < (int)(80 * procent)) { itemDrop.Add(new Item(1, 50)); } else if (Program.Game.Rand.Next(100) < (int)(90 * procent)) { itemDrop.Add(new Item(1, 19)); } break; case 32 when dimension.MapTile[x, y].IdSubTexture == 3: var minValue = 2 + (int)(4 * procent); itemDrop.Add(new Item(dimension.Rand.Next(minValue, minValue + minValue / 2), 51)); itemDrop.Add(new Item(dimension.Rand.Next(minValue, minValue + minValue * 2), 50)); break; } return(itemDrop); }
public override List <Item> Destory(int x, int y, BaseDimension dimension, DynamicEntity entity) { var yDoor = y; yDoor -= dimension.MapTile[x, y].IdSubTexture; DestorySIde(dimension, x, yDoor); return(base.Destory(x, y, dimension, entity)); }
public override bool BlockAdded(BaseDimension dimension, int x, int y) { if (dimension.MapTile[x, y - 1].Active) { return(false); } dimension.SetTexture(x, y - 1, Id, 1); return(true); }
public override void Update(int x, int y, BaseDimension dimension, DynamicEntity entity) { if (dimension.MapTile[x, y + 1].Active) { return; } dimension.MapTile[x, y].Destory(x, y, entity); }
public override void Spawn(BaseDimension dimension) { for (var i = 0; i < 2; i++) { for (var j = 0; j < 2; j++) { dimension.SetTexture(X + i, j + Y, 35); } } }
public void Destory(BaseDimension dimension) { Program.Game.AddExplosion(Position); if (TypeBullet == 1) { dimension.SetTexture(( int)Math.Floor(OldPosition.X / Tile.TILE_MAX_SIZE), (int)Math.Floor(OldPosition.Y / Tile.TILE_MAX_SIZE), 1); } }
/// <summary> /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>. /// </summary> /// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>.</param> /// <returns> /// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false. /// </returns> /// <exception cref="T:System.NullReferenceException"> /// The <paramref name="obj"/> parameter is null. /// </exception> public override bool Equals(object obj) { QualifiedDimension asQualifiedDimension; if ((asQualifiedDimension = obj as QualifiedDimension) == null) { return(false); } return(BaseDimension.Equals(asQualifiedDimension.BaseDimension) && Path.SequenceEqual(asQualifiedDimension.Path)); }
public override void Update(int x, int y, BaseDimension dimension, DynamicEntity entity) { if (dimension.MapTile[x, y + 1].Active) { return; } if (entity is Player player) { player.GetDrop(x, y); } }
public static bool GetActive(BaseDimension dimension, int x, int y) { if (x < 0 || x >= SizeGeneratior.WorldWidth) { return(false); } if (y < 0 || y >= SizeGeneratior.WorldHeight) { return(false); } return(dimension.MapTile[x, y].Active); }
public override bool UseBlock(int x, int y, BaseDimension dimension, DynamicEntity entity) { var xDoor = x; var yDoor = y + (2 - dimension.MapTile[x, y].IdSubTexture); int idDoor = dimension.MapTile[xDoor, yDoor].IdTexture; for (var j = 0; j < 3; j++) { dimension.Reset(xDoor, yDoor - j); } dimension.AddDoor(idDoor, xDoor, yDoor, true); return(true); }
public override void Spawn(BaseDimension dimension) { for (var i = 0; i < SIZEX; i++) { if (X + i + 1 >= SizeGeneratior.WorldWidth) { continue; } for (var j = 0; j < SIZEY; j++) { if (j != 0 || Math.Abs(Y - j - dimension.MapHeight[X + i + 1]) < 1) { dimension.Reset(X + i, Y - j); } } } for (var i = -5; i < 5; i++) { for (var j = -5; j < 5; j++) { if (Tools.InRadious(X + 5 + i, Y + 5 + j, X + 5, Y + 5, 5 - 1, true)) { dimension.SetTexture(X + 5 + i, Y - 5 + j, 12); } } } dimension.MapTile[X + SIZEX / 2, Y - SIZEY / 2].IdPoster = 0; for (var i = 0; i < SIZEX - 1; i++) { for (var j = 1; j < SIZEY - 1; j++) { dimension.MapTile[X + i, Y - j].IdWall = 9; } } for (var i = 0; i < SIZEX; i++) { dimension.SetTexture(X + i, Y, 9); dimension.SetTexture(X + i, Y - (SIZEY - 1), 9); } for (var j = 4; j < SIZEY; j++) { dimension.SetTexture(X, Y - j, 9); dimension.SetTexture(X + (SIZEX - 1), Y - j, 9); } if (!Isplaying) { dimension.Zombies.Add(new Boss(new Vector2((X + 2) * Tile.TILE_MAX_SIZE, (Y - 10) * Tile.TILE_MAX_SIZE))); } dimension.SetTexture(X + 1, Y - (SIZEY - 2), 6); dimension.SetTexture(X + (SIZEX - 2), Y - (SIZEY - 2), 6); }
public override List <Item> Destory(int x, int y, BaseDimension dimension, DynamicEntity entity) { if (Id == 19) { dimension.Reset(x - 1, y); } else { dimension.Reset(x + 1, y); } List <Item> drop = new List <Item> { new Item(1, 26) }; return(drop); }
public Tile(BaseDimension dimension) { _dimension = dimension; IdWall = -1; IdPoster = -1; Blockheight = 1; WaterType = 0; Frame = 0; IdSubTexture = 0; Active = false; Light = 0; IdTexture = 0; Hp = 0; TileDate = null; TimeCount = 0; }
public override List <Item> Destory(int x, int y, BaseDimension dimension, DynamicEntity entity) { if (dimension.MapTile[x, y].IdSubTexture == 0) { dimension.Reset(x, y - 1); } else { dimension.Reset(x, y + 1); } List <Item> drop = new List <Item> { new Item(1, 27) }; return(drop); }
public void AddTexture(int newX, int newY, BaseDimension dimension) { if (newX < 0 || newX >= SizeGeneratior.WorldWidth) { return; } if (dimension.MapTile[newX, newY].Active) { return; } if (!dimension.MapTile[newX, newY + 1].IsSolid()) { return; } dimension.SetTexture(newX, newY, Id); }
public override bool UseBlock(int x, int y, BaseDimension dimension, DynamicEntity entity) { var xDoor = x; var yDoor = y + (2 - dimension.MapTile[x, y].IdSubTexture); int iddoor = dimension.MapTile[xDoor, yDoor].IdTexture; if (dimension.MapTile[xDoor, yDoor].IdTexture == dimension.MapTile[xDoor - 1, yDoor].IdTexture) { xDoor -= 1; } for (var i = 0; i < 2; i++) { for (var j = 0; j < 3; j++) { dimension.Reset(xDoor + i, yDoor - j); } } dimension.AddDoor(iddoor - 1, xDoor, yDoor, false); return(true); }
public virtual List <Item> Destory(int x, int y, BaseDimension dimension, DynamicEntity entity) => new List <Item> { new Item(1, Id) };
public virtual bool UseBlock(int x, int y, BaseDimension dimension, DynamicEntity entity) => false;
public virtual void Update(int x, int y, BaseDimension dimension, bool isView) { }
public virtual void Update(int x, int y, BaseDimension dimension, DynamicEntity entity) { }
public override bool UseBlock(int x, int y, BaseDimension dimension, DynamicEntity entity) { ((Player)entity).TeleportToShowMap(); return(true); }
/// <summary> /// /// </summary> /// <param name="other"></param> protected BaseDimension(BaseDimension other) : base(other) { }
public override void Render(ITileDatecs tileDate, Render render, Texture2D texture, BaseDimension dimension, Vector2 pos, int x, int y, int frame, int subTexture, ColorScheme color) { if (dimension.MapTile[x, y].IdTexture == dimension.MapTile[x - 1, y].IdTexture) { frame += 1; } base.Render(tileDate, render, texture, dimension, pos, x, y, frame, subTexture, color); }
public virtual void Render(ITileDatecs tileDate, Render render, Texture2D texture, BaseDimension dimension, Vector2 pos, int x, int y, int frame, int subTexture, ColorScheme color) { lock (Locked) { render.Draw(texture, new Rectangle((int)pos.X, (int)pos.Y, 16, 16), new Rectangle(16 * frame, 16 * subTexture, 16, 16), color); } }
public virtual void Spawn(BaseDimension dimension) { }
public virtual bool BlockAdded(BaseDimension dimension, int x, int y) => true;
public override void Render(ITileDatecs tileDate, Render render, Texture2D texture, BaseDimension dimension, Vector2 pos, int x, int y, int frame, int subTexture, ColorScheme color) { TreeDate treeDate = (TreeDate)tileDate; if (dimension.MapTile[x, y].IdTexture == 16) { render.Draw(texture, new Rectangle((int)pos.X - 25, (int)pos.Y - 42, 64, 64), new Rectangle(64 * frame, 64 * treeDate.TypeTree, 64, 64), color); } else if (dimension.MapTile[x, y].IdTexture == 38) { render.Draw(texture, new Rectangle((int)pos.X, (int)pos.Y, 16, 16), new Rectangle(16 * subTexture, 16 * treeDate.TypeTree, 16, 16), color); } else { base.Render(tileDate, render, texture, dimension, pos, x, y, frame, subTexture, color); } }
/// <summary> /// /// </summary> /// <param name="other"></param> protected BaseDimension(BaseDimension other) : base(other) { }
public override bool UseBlock(int x, int y, BaseDimension dimension, DynamicEntity entity) => true;