mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-11 03:08:38 +07:00
Updated discord URL
This commit is contained in:
parent
0db7a78889
commit
522e19d4bf
@ -38,7 +38,7 @@ public class Vars{
|
||||
public static final Team waveTeam = Team.red;
|
||||
|
||||
//discord group URL
|
||||
public static final String discordURL = "https://discord.gg/BKADYds";
|
||||
public static final String discordURL = "https://discord.gg/mindustry";
|
||||
public static final String releasesURL = "https://api.github.com/repos/Anuken/Mindustry/releases";
|
||||
public static final String crashReportURL = "http://mindustry.us.to/report";
|
||||
public static final int maxTextLength = 150;
|
||||
|
@ -1,27 +1,26 @@
|
||||
package io.anuke.mindustry.maps.generation;
|
||||
|
||||
import com.badlogic.gdx.math.GridPoint2;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import com.badlogic.gdx.utils.Predicate;
|
||||
import io.anuke.mindustry.content.Items;
|
||||
import io.anuke.mindustry.content.blocks.DistributionBlocks;
|
||||
import io.anuke.mindustry.content.blocks.StorageBlocks;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.maps.generation.pathfinding.FlowPathFinder;
|
||||
import io.anuke.mindustry.maps.generation.pathfinding.TilePathfinder;
|
||||
import io.anuke.mindustry.type.AmmoType;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.mindustry.type.Recipe;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.Edges;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.defense.Door;
|
||||
import io.anuke.mindustry.world.blocks.defense.Wall;
|
||||
import io.anuke.mindustry.world.blocks.defense.turrets.ItemTurret;
|
||||
import io.anuke.mindustry.world.blocks.defense.turrets.PowerTurret;
|
||||
import io.anuke.mindustry.world.blocks.defense.turrets.Turret;
|
||||
import io.anuke.mindustry.world.blocks.power.PowerGenerator;
|
||||
import io.anuke.mindustry.world.blocks.power.SolarGenerator;
|
||||
import io.anuke.mindustry.world.blocks.production.Drill;
|
||||
import io.anuke.mindustry.world.consumers.ConsumePower;
|
||||
import io.anuke.ucore.util.Log;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class FortressGenerator{
|
||||
@ -55,6 +54,18 @@ public class FortressGenerator{
|
||||
Block wall = walls.get((int)(difficultyScl * walls.size));
|
||||
Drill drill = (Drill) drills.get((int)(difficultyScl * drills.size));
|
||||
|
||||
TilePathfinder finder = new FlowPathFinder(gen.tiles);
|
||||
Array<Tile> out = new Array<>();
|
||||
finder.search(gen.tile(enemyX, enemyY - 1), t -> t.block().dropsItem(Items.copper), out);
|
||||
for (int i = 0; i < out.size - 1; i++) {
|
||||
Tile current = out.get(i);
|
||||
Tile next = out.get(i + 1);
|
||||
byte rotation = next.relativeTo(current.x, current.y);
|
||||
current.setBlock(DistributionBlocks.conveyor, team);
|
||||
current.setRotation(rotation);
|
||||
}
|
||||
/*
|
||||
|
||||
//place down drills
|
||||
for(int x = 0; x < gen.width; x++){
|
||||
for(int y = 0; y < gen.height; y++){
|
||||
@ -132,7 +143,7 @@ public class FortressGenerator{
|
||||
gen.setBlock(x, y, wall, team);
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
boolean accepts(AmmoType[] types, Item item){
|
||||
|
@ -22,7 +22,7 @@ public class FlowPathFinder extends TilePathfinder{
|
||||
for(int i = 0; i < weights.length; i++){
|
||||
for(int j = 0; j < weights[0].length; j++){
|
||||
if(result.test(tiles[i][j])){
|
||||
weights[i][j] = Float.MAX_VALUE;
|
||||
weights[i][j] = 100000;
|
||||
queue.addLast(tiles[i][j]);
|
||||
}else{
|
||||
weights[i][j] = 0f;
|
||||
@ -37,6 +37,9 @@ public class FlowPathFinder extends TilePathfinder{
|
||||
if(inBounds(nx, ny) && weights[nx][ny] < weights[tile.x][tile.y] && tiles[nx][ny].passable()){
|
||||
weights[nx][ny] = weights[tile.x][tile.y] - 1;
|
||||
queue.addLast(tiles[nx][ny]);
|
||||
if(result.test(tiles[nx][ny])){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -46,14 +49,14 @@ public class FlowPathFinder extends TilePathfinder{
|
||||
Tile tile = out.peek();
|
||||
|
||||
Tile max = null;
|
||||
float maxf = 0f;
|
||||
float maxf = weights[tile.x][tile.y];
|
||||
for(GridPoint2 point : Geometry.d4){
|
||||
int nx = tile.x + point.x, ny = tile.y + point.y;
|
||||
if(inBounds(nx, ny) && (weights[nx][ny] > maxf || max == null)){
|
||||
if(inBounds(nx, ny) && (weights[nx][ny] > maxf)){
|
||||
max = tiles[nx][ny];
|
||||
maxf = weights[nx][ny];
|
||||
|
||||
if(MathUtils.isEqual(maxf, Float.MAX_VALUE)){
|
||||
if(MathUtils.isEqual(maxf, 100000)){
|
||||
out.add(max);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user