mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-11 11:17:11 +07:00
Per-mode no-build radius
This commit is contained in:
parent
2e958d8d8f
commit
914fa3079d
@ -39,7 +39,6 @@ public class Vars{
|
||||
//team of the enemy in waves
|
||||
public static final Team waveTeam = Team.red;
|
||||
|
||||
public static final float enemyCoreBuildRange = 400f;
|
||||
//discord group URL
|
||||
public static final String discordURL = "https://discord.gg/BKADYds";
|
||||
public static final String releasesURL = "https://api.github.com/repos/Anuken/Mindustry/releases";
|
||||
|
@ -20,9 +20,11 @@ public enum GameMode{
|
||||
disableWaves = true;
|
||||
isPvp = true;
|
||||
hidden = true;
|
||||
enemyCoreBuildRadius = 600f;
|
||||
}};
|
||||
|
||||
public boolean infiniteResources, disableWaveTimer, disableWaves, hidden, autoSpawn, isPvp;
|
||||
public float enemyCoreBuildRadius = 400f;
|
||||
|
||||
public String description(){
|
||||
return Bundles.get("mode." + name() + ".description");
|
||||
|
@ -66,11 +66,11 @@ public class OverlayRenderer{
|
||||
for(Team enemy : state.teams.enemiesOf(player.getTeam())){
|
||||
for(Tile core : state.teams.get(enemy).cores){
|
||||
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);
|
||||
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));
|
||||
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
|
||||
for(Team enemy : state.teams.enemiesOf(team)){
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user