This commit is contained in:
Anuken
2020-10-09 10:02:08 -04:00
parent e2b58528d0
commit 22f1c3b2d1
8 changed files with 49 additions and 30 deletions

View File

@@ -1,6 +1,6 @@
#define HIGHP #define HIGHP
#define NSCALE 2700.0 #define NSCALE 2700.0
#define CAMSCALE (NSCALE*5) #define CAMSCALE (NSCALE*5.0)
uniform sampler2D u_texture; uniform sampler2D u_texture;
uniform sampler2D u_stars; uniform sampler2D u_stars;

View File

@@ -96,7 +96,14 @@ public class EditorTile extends Tile{
super.recache(); super.recache();
} }
} }
@Override
protected void changed(){
if(state.isGame()){
super.changed();
}
}
@Override @Override
protected void changeEntity(Team team, Prov<Building> entityprov, int rotation){ protected void changeEntity(Team team, Prov<Building> entityprov, int rotation){
if(skip()){ if(skip()){

View File

@@ -127,7 +127,7 @@ public class EntityCollisions{
public static boolean legsSolid(int x, int y){ public static boolean legsSolid(int x, int y){
Tile tile = world.tile(x, y); Tile tile = world.tile(x, y);
return tile == null || tile.staticDarkness() >= 2; return tile == null || tile.staticDarkness() >= 2 || tile.floor().solid;
} }
public static boolean waterSolid(int x, int y){ public static boolean waterSolid(int x, int y){

View File

@@ -1165,10 +1165,6 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
proximity.add(tile); proximity.add(tile);
} }
for(Building other : tmpTiles){
other.onProximityUpdate();
}
onProximityAdded(); onProximityAdded();
onProximityUpdate(); onProximityUpdate();

View File

@@ -70,10 +70,12 @@ public class DefaultWaves{
shieldScaling = 20f; shieldScaling = 20f;
}}, }},
new SpawnGroup(mace){{ new SpawnGroup(spiroct){{
begin = 45; begin = 45;
spacing = 3; spacing = 3;
unitScaling = 2; unitScaling = 1;
max = 10;
shieldScaling = 10f;
effect = StatusEffects.overdrive; effect = StatusEffects.overdrive;
}}, }},
@@ -92,15 +94,16 @@ public class DefaultWaves{
shieldScaling = 20f; shieldScaling = 20f;
}}, }},
new SpawnGroup(dagger){{ new SpawnGroup(quasar){{
begin = 82; begin = 82;
spacing = 3; spacing = 3;
unitAmount = 4; unitAmount = 4;
unitScaling = 3; unitScaling = 3;
shieldScaling = 30f;
effect = StatusEffects.overdrive; effect = StatusEffects.overdrive;
}}, }},
new SpawnGroup(dagger){{ new SpawnGroup(pulsar){{
begin = 41; begin = 41;
spacing = 5; spacing = 5;
unitAmount = 1; unitAmount = 1;
@@ -146,6 +149,8 @@ public class DefaultWaves{
unitAmount = 4; unitAmount = 4;
unitScaling = 3; unitScaling = 3;
spacing = 5; spacing = 5;
shields = 100f;
shieldScaling = 10f;
effect = StatusEffects.overdrive; effect = StatusEffects.overdrive;
}}, }},
@@ -157,7 +162,7 @@ public class DefaultWaves{
max = 16; max = 16;
}}, }},
new SpawnGroup(horizon){{ new SpawnGroup(nova){{
begin = 53; begin = 53;
unitAmount = 2; unitAmount = 2;
unitScaling = 3; unitScaling = 3;
@@ -176,6 +181,7 @@ public class DefaultWaves{
unitAmount = 1; unitAmount = 1;
unitScaling = 1; unitScaling = 1;
spacing = 30; spacing = 30;
shieldScaling = 10f;
}}, }},
new SpawnGroup(reign){{ new SpawnGroup(reign){{
@@ -183,6 +189,7 @@ public class DefaultWaves{
unitAmount = 1; unitAmount = 1;
unitScaling = 1; unitScaling = 1;
spacing = 40; spacing = 40;
shieldScaling = 10f;
}}, }},
new SpawnGroup(antumbra){{ new SpawnGroup(antumbra){{
@@ -190,6 +197,15 @@ public class DefaultWaves{
unitAmount = 1; unitAmount = 1;
unitScaling = 1; unitScaling = 1;
spacing = 40; spacing = 40;
shieldScaling = 10f;
}},
new SpawnGroup(vela){{
begin = 100;
unitAmount = 1;
unitScaling = 1;
spacing = 30;
shieldScaling = 20f;
}}, }},
new SpawnGroup(horizon){{ new SpawnGroup(horizon){{
@@ -197,6 +213,18 @@ public class DefaultWaves{
unitAmount = 2; unitAmount = 2;
unitScaling = 3; unitScaling = 3;
spacing = 4; spacing = 4;
shields = 40f;
shieldScaling = 20f;
}},
new SpawnGroup(atrax){{
begin = 210;
unitAmount = 1;
unitScaling = 1;
spacing = 35;
shields = 1000;
shieldScaling = 35f;
}} }}
); );
} }
@@ -234,6 +262,7 @@ public class DefaultWaves{
int next = Mathf.random(8, 16); int next = Mathf.random(8, 16);
float shieldAmount = Math.max((i - shieldStart) * shieldsPerWave, 0); float shieldAmount = Math.max((i - shieldStart) * shieldsPerWave, 0);
int space = start == 0 ? 1 : Mathf.random(1, 2);
//main progression //main progression
out.add(new SpawnGroup(curSpecies[Math.min(curTier, curSpecies.length - 1)]){{ out.add(new SpawnGroup(curSpecies[Math.min(curTier, curSpecies.length - 1)]){{
@@ -244,6 +273,7 @@ public class DefaultWaves{
unitScaling = Mathf.random(1f, 2f); unitScaling = Mathf.random(1f, 2f);
shields = shieldAmount; shields = shieldAmount;
shieldScaling = shieldsPerWave; shieldScaling = shieldsPerWave;
spacing = space;
}}); }});
//extra progression that tails out, blends in //extra progression that tails out, blends in

View File

@@ -51,6 +51,7 @@ public class SpawnGroup implements Serializable{
/** Returns the amount of units spawned on a specific wave. */ /** Returns the amount of units spawned on a specific wave. */
public int getUnitsSpawned(int wave){ public int getUnitsSpawned(int wave){
if(spacing == 0) spacing = 1;
if(wave < begin || wave > end || (wave - begin) % spacing != 0){ if(wave < begin || wave > end || (wave - begin) % spacing != 0){
return 0; return 0;
} }

View File

@@ -496,24 +496,8 @@ public class Tile implements Position, QuadTreeObject, Displayable{
protected void changeEntity(Team team, Prov<Building> entityprov, int rotation){ protected void changeEntity(Team team, Prov<Building> entityprov, int rotation){
if(build != null){ if(build != null){
int size = build.block.size;
build.remove(); build.remove();
build = null; build = null;
//update edge entities
tileSet.clear();
for(Point2 edge : Edges.getEdges(size)){
Building other = world.build(x + edge.x, y + edge.y);
if(other != null){
tileSet.add(other);
}
}
//update proximity, since multiblock was just removed
for(Building t : tileSet){
t.updateProximity();
}
} }
if(block.hasBuilding()){ if(block.hasBuilding()){

View File

@@ -351,8 +351,9 @@ public abstract class Turret extends Block{
AmmoEntry entry = ammo.peek(); AmmoEntry entry = ammo.peek();
entry.amount -= ammoPerShot; entry.amount -= ammoPerShot;
if(entry.amount == 0) ammo.pop(); if(entry.amount <= 0) ammo.pop();
totalAmmo -= ammoPerShot; totalAmmo -= ammoPerShot;
totalAmmo = Math.max(totalAmmo, 0);
Time.run(reloadTime / 2f, this::ejectEffects); Time.run(reloadTime / 2f, this::ejectEffects);
return entry.type(); return entry.type();
} }
@@ -364,7 +365,7 @@ public abstract class Turret extends Block{
/** @return whether the turret has ammo. */ /** @return whether the turret has ammo. */
public boolean hasAmmo(){ public boolean hasAmmo(){
return ammo.size > 0 && ammo.peek().amount >= ammoPerShot; return ammo.size > 0 && ammo.peek().amount >= 1;
} }
protected void updateShooting(){ protected void updateShooting(){