Various campaign-related tweaks

This commit is contained in:
Anuken
2020-05-13 17:04:59 -04:00
parent c432639dfa
commit 04dc701c25
15 changed files with 77 additions and 36 deletions

View File

@@ -0,0 +1,20 @@
package mindustry.maps.generators;
import arc.struct.*;
import mindustry.content.*;
import mindustry.game.*;
import mindustry.type.*;
import mindustry.world.*;
public class BaseGenerator{
public void generate(Tiles tiles, Array<Tile> cores, Tile spawn, Team team, Sector sector){
for(Tile tile : cores){
tile.clearOverlay();
tile.setBlock(Blocks.coreShard, team);
}
}
}

View File

@@ -123,7 +123,7 @@ public class TODOPlanetGenerator extends PlanetGenerator{
float constraint = 1.3f;
float radius = width / 2f / Mathf.sqrt3;
int rooms = rand.random(2, 5) - 1;
int rooms = rand.random(2, 5);
Array<Room> array = new Array<>();
for(int i = 0; i < rooms; i++){
@@ -262,6 +262,12 @@ public class TODOPlanetGenerator extends PlanetGenerator{
Schematics.placeLoadout(Loadouts.advancedShard, spawn.x, spawn.y);
if(sector.hostility > 0.02f){
new BaseGenerator().generate(tiles, enemies.map(r -> tiles.getn(r.x, r.y)), tiles.get(spawn.x, spawn.y), state.rules.waveTeam, sector);
state.rules.attackMode = true;
}
state.rules.waves = true;
}