public override void Execute(TileManager tileManager, Tile tile, TilePosition center) { for (int d = 1; d <= radius; d++) { int rDamage = damage * (radius - d + 1) / radius; TilePosition[] tiles = Manhattan.GetTilesAtDistance(d); for(int i = 0; i < tiles.Length; i++) { TilePosition p = center + tiles[i]; if (tileManager.IsValidTile(p)) if (tileManager.DamageTile(p, rDamage) == false) if (setOnFire && tileManager.GetTileDefinition(tileManager.GetTileType(p)).burns) tileManager.SetTileOnFire(p, true); } } if (setOnFire) { TilePosition[] tiles = Manhattan.GetTilesAtDistance(radius + 1); for(int i = 0; i < tiles.Length; i++) { TilePosition p = center + tiles[i]; if (tileManager.IsValidTile(p)) if (setOnFire && tileManager.GetTileDefinition(tileManager.GetTileType(p)).burns) tileManager.SetTileOnFire(p, true); } } }
public override void Execute(TileManager tileManager, Tile tile, TilePosition pos) { pos += delta; if (tileManager.IsValidTile(pos)) tileManager.SetTileOnFire(pos, value); }