Per-mode no-build radius
This commit is contained in:
@@ -39,7 +39,6 @@ public class Vars{
|
|||||||
//team of the enemy in waves
|
//team of the enemy in waves
|
||||||
public static final Team waveTeam = Team.red;
|
public static final Team waveTeam = Team.red;
|
||||||
|
|
||||||
public static final float enemyCoreBuildRange = 400f;
|
|
||||||
//discord group URL
|
//discord group URL
|
||||||
public static final String discordURL = "https://discord.gg/BKADYds";
|
public static final String discordURL = "https://discord.gg/BKADYds";
|
||||||
public static final String releasesURL = "https://api.github.com/repos/Anuken/Mindustry/releases";
|
public static final String releasesURL = "https://api.github.com/repos/Anuken/Mindustry/releases";
|
||||||
|
|||||||
@@ -20,9 +20,11 @@ public enum GameMode{
|
|||||||
disableWaves = true;
|
disableWaves = true;
|
||||||
isPvp = true;
|
isPvp = true;
|
||||||
hidden = true;
|
hidden = true;
|
||||||
|
enemyCoreBuildRadius = 600f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
public boolean infiniteResources, disableWaveTimer, disableWaves, hidden, autoSpawn, isPvp;
|
public boolean infiniteResources, disableWaveTimer, disableWaves, hidden, autoSpawn, isPvp;
|
||||||
|
public float enemyCoreBuildRadius = 400f;
|
||||||
|
|
||||||
public String description(){
|
public String description(){
|
||||||
return Bundles.get("mode." + name() + ".description");
|
return Bundles.get("mode." + name() + ".description");
|
||||||
|
|||||||
@@ -66,11 +66,11 @@ public class OverlayRenderer{
|
|||||||
for(Team enemy : state.teams.enemiesOf(player.getTeam())){
|
for(Team enemy : state.teams.enemiesOf(player.getTeam())){
|
||||||
for(Tile core : state.teams.get(enemy).cores){
|
for(Tile core : state.teams.get(enemy).cores){
|
||||||
float dst = Vector2.dst(player.x, player.y, core.drawx(), core.drawy());
|
float dst = Vector2.dst(player.x, player.y, core.drawx(), core.drawy());
|
||||||
if(dst < enemyCoreBuildRange * 1.5f){
|
if(dst < state.mode.enemyCoreBuildRadius * 1.5f){
|
||||||
Draw.color(Color.DARK_GRAY);
|
Draw.color(Color.DARK_GRAY);
|
||||||
Lines.poly(core.drawx(), core.drawy() - 2, 200, enemyCoreBuildRange);
|
Lines.poly(core.drawx(), core.drawy() - 2, 200, state.mode.enemyCoreBuildRadius);
|
||||||
Draw.color(Palette.accent, enemy.color, 0.5f + Mathf.absin(Timers.time(), 10f, 0.5f));
|
Draw.color(Palette.accent, enemy.color, 0.5f + Mathf.absin(Timers.time(), 10f, 0.5f));
|
||||||
Lines.poly(core.drawx(), core.drawy(), 200, enemyCoreBuildRange);
|
Lines.poly(core.drawx(), core.drawy(), 200, state.mode.enemyCoreBuildRadius);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ public class Build{
|
|||||||
//check for enemy cores
|
//check for enemy cores
|
||||||
for(Team enemy : state.teams.enemiesOf(team)){
|
for(Team enemy : state.teams.enemiesOf(team)){
|
||||||
for(Tile core : state.teams.get(enemy).cores){
|
for(Tile core : state.teams.get(enemy).cores){
|
||||||
if(Vector2.dst(x*tilesize + type.offset(), y*tilesize + type.offset(), core.drawx(), core.drawy()) < enemyCoreBuildRange + type.size*tilesize/2f){
|
if(Vector2.dst(x*tilesize + type.offset(), y*tilesize + type.offset(), core.drawx(), core.drawy()) < state.mode.enemyCoreBuildRadius + type.size*tilesize/2f){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user