Fixed tests
This commit is contained in:
@@ -223,16 +223,16 @@ public class SectorPresets{
|
|||||||
|
|
||||||
rules = r -> {
|
rules = r -> {
|
||||||
r.objectives.addAll(
|
r.objectives.addAll(
|
||||||
new CoreItemObjective(Items.tungsten, 100).withMarkers(
|
new CoreItemObjective(Items.tungsten, 100).withMarkers(
|
||||||
new TextMarker("Some blocks can be picked up by the core unit.\nPick up this [accent]container[] and place it onto the [accent]payload loader[].\n(Default keys are [ and ] to pick up and drop)", 347 * 8f, 445f * 8f),
|
new TextMarker("Some blocks can be picked up by the core unit.\nPick up this [accent]container[] and place it onto the [accent]payload loader[].\n(Default keys are [ and ] to pick up and drop)", 347 * 8f, 445f * 8f),
|
||||||
new TextMarker("You must acquire some tungsten to build units.", 293 * 8f, 417 * 8f)
|
new TextMarker("You must acquire some tungsten to build units.", 293 * 8f, 417 * 8f)
|
||||||
),
|
),
|
||||||
new BuildCountObjective(Blocks.payloadMassDriver, 2).withMarkers(
|
new BuildCountObjective(Blocks.payloadMassDriver, 2).withMarkers(
|
||||||
new TextMarker("Units must be transported to the other side of the wall.\nPlace two [accent]Payload Mass Drivers[], one on each side of the wall.\nSet up the link by pressing one of them, then selecting the other.", 293 * 8f, 417 * 8f)
|
new TextMarker("Units must be transported to the other side of the wall.\nPlace two [accent]Payload Mass Drivers[], one on each side of the wall.\nSet up the link by pressing one of them, then selecting the other.", 293 * 8f, 417 * 8f)
|
||||||
),
|
),
|
||||||
new DestroyCoreObjective().withMarkers(
|
new DestroyCoreObjective().withMarkers(
|
||||||
new TextMarker("Similar to the container, units can also be transported using a [accent]Payload Mass Driver[].\nPlace a unit fabricator adjacent to a mass driver to load them, then send them across the wall to attack the enemy base.", 293 * 8f, 417 * 8f)
|
new TextMarker("Similar to the container, units can also be transported using a [accent]Payload Mass Driver[].\nPlace a unit fabricator adjacent to a mass driver to load them, then send them across the wall to attack the enemy base.", 293 * 8f, 417 * 8f)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
if(!(build instanceof CoreBuild) && !build.block.privileged){
|
if(!(build instanceof CoreBuild) && !build.block.privileged){
|
||||||
var ccore = build.closestCore();
|
var ccore = build.closestCore();
|
||||||
|
|
||||||
if(ccore != null && build.within(ccore, buildRadius)){
|
if(ccore != null){
|
||||||
anyBuilds = true;
|
anyBuilds = true;
|
||||||
|
|
||||||
if(!net.active()){
|
if(!net.active()){
|
||||||
|
|||||||
@@ -893,41 +893,43 @@ public class ApplicationTests{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Seq<SpawnGroup> spawns = state.rules.spawns;
|
if(state.rules.waves){
|
||||||
|
Seq<SpawnGroup> spawns = state.rules.spawns;
|
||||||
|
|
||||||
int bossWave = 0;
|
int bossWave = 0;
|
||||||
if(state.rules.winWave > 0){
|
if(state.rules.winWave > 0){
|
||||||
bossWave = state.rules.winWave;
|
bossWave = state.rules.winWave;
|
||||||
}else{
|
}else{
|
||||||
outer:
|
outer:
|
||||||
for(int i = 1; i <= 1000; i++){
|
for(int i = 1; i <= 1000; i++){
|
||||||
for(SpawnGroup spawn : spawns){
|
for(SpawnGroup spawn : spawns){
|
||||||
if(spawn.effect == StatusEffects.boss && spawn.getSpawned(i) > 0){
|
if(spawn.effect == StatusEffects.boss && spawn.getSpawned(i) > 0){
|
||||||
bossWave = i;
|
bossWave = i;
|
||||||
break outer;
|
break outer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(state.rules.attackMode){
|
if(state.rules.attackMode){
|
||||||
bossWave = 100;
|
bossWave = 100;
|
||||||
}else{
|
}else{
|
||||||
assertNotEquals(0, bossWave, "Sector " + zone.name + " doesn't have a boss/end wave.");
|
assertNotEquals(0, bossWave, "Sector " + zone.name + " doesn't have a boss/end wave.");
|
||||||
}
|
|
||||||
|
|
||||||
if(state.rules.winWave > 0) bossWave = state.rules.winWave - 1;
|
|
||||||
|
|
||||||
//TODO check for difficulty?
|
|
||||||
for(int i = 1; i <= bossWave; i++){
|
|
||||||
int total = 0;
|
|
||||||
for(SpawnGroup spawn : spawns){
|
|
||||||
total += spawn.getSpawned(i - 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assertNotEquals(0, total, "Sector " + zone + " has no spawned enemies at wave " + i);
|
if(state.rules.winWave > 0) bossWave = state.rules.winWave - 1;
|
||||||
//TODO this is flawed and needs to be changed later
|
|
||||||
//assertTrue(total < 75, "Sector spawns too many enemies at wave " + i + " (" + total + ")");
|
//TODO check for difficulty?
|
||||||
|
for(int i = 1; i <= bossWave; i++){
|
||||||
|
int total = 0;
|
||||||
|
for(SpawnGroup spawn : spawns){
|
||||||
|
total += spawn.getSpawned(i - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
assertNotEquals(0, total, "Sector " + zone + " has no spawned enemies at wave " + i);
|
||||||
|
//TODO this is flawed and needs to be changed later
|
||||||
|
//assertTrue(total < 75, "Sector spawns too many enemies at wave " + i + " (" + total + ")");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assertEquals(1, Team.sharded.cores().size, "Sector must have one core: " + zone);
|
assertEquals(1, Team.sharded.cores().size, "Sector must have one core: " + zone);
|
||||||
|
|||||||
Reference in New Issue
Block a user