Disabled spawner radius/warning when waves off
This commit is contained in:
@@ -48,7 +48,7 @@ public class WaveSpawner{
|
|||||||
|
|
||||||
/** @return true if the player is near a ground spawn point. */
|
/** @return true if the player is near a ground spawn point. */
|
||||||
public boolean playerNear(){
|
public boolean playerNear(){
|
||||||
return !player.dead() && spawns.contains(g -> Mathf.dst(g.x * tilesize, g.y * tilesize, player.x, player.y) < state.rules.dropZoneRadius && player.team() != state.rules.waveTeam);
|
return state.rules.waves && !player.dead() && spawns.contains(g -> Mathf.dst(g.x * tilesize, g.y * tilesize, player.x, player.y) < state.rules.dropZoneRadius && player.team() != state.rules.waveTeam);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void spawnEnemies(){
|
public void spawnEnemies(){
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
drag = type.drag * (isGrounded() ? (floorOn().dragMultiplier) : 1f);
|
drag = type.drag * (isGrounded() ? (floorOn().dragMultiplier) : 1f);
|
||||||
|
|
||||||
//apply knockback based on spawns
|
//apply knockback based on spawns
|
||||||
if(team != state.rules.waveTeam){
|
if(team != state.rules.waveTeam && state.rules.waves){
|
||||||
float relativeSize = state.rules.dropZoneRadius + hitSize/2f + 1f;
|
float relativeSize = state.rules.dropZoneRadius + hitSize/2f + 1f;
|
||||||
for(Tile spawn : spawner.getSpawns()){
|
for(Tile spawn : spawner.getSpawns()){
|
||||||
if(within(spawn.worldx(), spawn.worldy(), relativeSize)){
|
if(within(spawn.worldx(), spawn.worldy(), relativeSize)){
|
||||||
|
|||||||
@@ -121,10 +121,12 @@ public class OverlayRenderer{
|
|||||||
Lines.stroke(2f);
|
Lines.stroke(2f);
|
||||||
Draw.color(Color.gray, Color.lightGray, Mathf.absin(Time.time(), 8f, 1f));
|
Draw.color(Color.gray, Color.lightGray, Mathf.absin(Time.time(), 8f, 1f));
|
||||||
|
|
||||||
for(Tile tile : spawner.getSpawns()){
|
if(state.rules.waves){
|
||||||
if(tile.within(player.x, player.y, state.rules.dropZoneRadius + spawnerMargin)){
|
for(Tile tile : spawner.getSpawns()){
|
||||||
Draw.alpha(Mathf.clamp(1f - (player.dst(tile) - state.rules.dropZoneRadius) / spawnerMargin));
|
if(tile.within(player.x, player.y, state.rules.dropZoneRadius + spawnerMargin)){
|
||||||
Lines.dashCircle(tile.worldx(), tile.worldy(), state.rules.dropZoneRadius);
|
Draw.alpha(Mathf.clamp(1f - (player.dst(tile) - state.rules.dropZoneRadius) / spawnerMargin));
|
||||||
|
Lines.dashCircle(tile.worldx(), tile.worldy(), state.rules.dropZoneRadius);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -196,6 +196,21 @@ public class CoreBlock extends StorageBlock{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroyed(){
|
||||||
|
super.onDestroyed();
|
||||||
|
|
||||||
|
//add a spawn to the map for future reference - waves should be disabled, so it shouldn't matter
|
||||||
|
if(state.isCampaign() && team == state.rules.waveTeam){
|
||||||
|
//do not recache
|
||||||
|
tile.setOverlayQuiet(Blocks.spawn);
|
||||||
|
|
||||||
|
if(!spawner.getSpawns().contains(tile)){
|
||||||
|
spawner.getSpawns().add(tile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawLight(){
|
public void drawLight(){
|
||||||
Drawf.light(team, x, y, 30f * size, Pal.accent, 0.5f + Mathf.absin(20f, 0.1f));
|
Drawf.light(team, x, y, 30f * size, Pal.accent, 0.5f + Mathf.absin(20f, 0.1f));
|
||||||
|
|||||||
Reference in New Issue
Block a user