Various campaign-related tweaks
This commit is contained in:
20
core/src/mindustry/maps/generators/BaseGenerator.java
Normal file
20
core/src/mindustry/maps/generators/BaseGenerator.java
Normal 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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user