Asteroid/space improvements
This commit is contained in:
@@ -832,6 +832,7 @@ public class Blocks{
|
|||||||
size = 2;
|
size = 2;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
drawer = new DrawWeave();
|
drawer = new DrawWeave();
|
||||||
|
envEnabled |= Env.space;
|
||||||
|
|
||||||
ambientSound = Sounds.techloop;
|
ambientSound = Sounds.techloop;
|
||||||
ambientSoundVolume = 0.02f;
|
ambientSoundVolume = 0.02f;
|
||||||
@@ -994,6 +995,7 @@ public class Blocks{
|
|||||||
incinerator = new Incinerator("incinerator"){{
|
incinerator = new Incinerator("incinerator"){{
|
||||||
requirements(Category.crafting, with(Items.graphite, 5, Items.lead, 15));
|
requirements(Category.crafting, with(Items.graphite, 5, Items.lead, 15));
|
||||||
health = 90;
|
health = 90;
|
||||||
|
envEnabled |= Env.space;
|
||||||
consumes.power(0.50f);
|
consumes.power(0.50f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -2146,6 +2148,8 @@ public class Blocks{
|
|||||||
tier = 2;
|
tier = 2;
|
||||||
drillTime = 600;
|
drillTime = 600;
|
||||||
size = 2;
|
size = 2;
|
||||||
|
//mechanical drill doesn't work in space
|
||||||
|
envEnabled ^= Env.space;
|
||||||
|
|
||||||
consumes.liquid(Liquids.water, 0.05f).boost();
|
consumes.liquid(Liquids.water, 0.05f).boost();
|
||||||
}};
|
}};
|
||||||
@@ -2167,7 +2171,6 @@ public class Blocks{
|
|||||||
tier = 4;
|
tier = 4;
|
||||||
updateEffect = Fx.pulverizeMedium;
|
updateEffect = Fx.pulverizeMedium;
|
||||||
drillEffect = Fx.mineBig;
|
drillEffect = Fx.mineBig;
|
||||||
envEnabled |= Env.space;
|
|
||||||
|
|
||||||
consumes.power(1.10f);
|
consumes.power(1.10f);
|
||||||
consumes.liquid(Liquids.water, 0.08f).boost();
|
consumes.liquid(Liquids.water, 0.08f).boost();
|
||||||
@@ -2570,6 +2573,7 @@ public class Blocks{
|
|||||||
flags = EnumSet.of(BlockFlag.turret, BlockFlag.extinguisher);
|
flags = EnumSet.of(BlockFlag.turret, BlockFlag.extinguisher);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
//TODO these may work in space, but what's the point?
|
||||||
lancer = new PowerTurret("lancer"){{
|
lancer = new PowerTurret("lancer"){{
|
||||||
requirements(Category.turret, with(Items.copper, 60, Items.lead, 70, Items.silicon, 50));
|
requirements(Category.turret, with(Items.copper, 60, Items.lead, 70, Items.silicon, 50));
|
||||||
range = 165f;
|
range = 165f;
|
||||||
@@ -2656,6 +2660,7 @@ public class Blocks{
|
|||||||
size = 2;
|
size = 2;
|
||||||
scaledHealth = 300;
|
scaledHealth = 300;
|
||||||
shootSound = Sounds.missile;
|
shootSound = Sounds.missile;
|
||||||
|
envEnabled |= Env.space;
|
||||||
|
|
||||||
limitRange(5f);
|
limitRange(5f);
|
||||||
}};
|
}};
|
||||||
@@ -2699,6 +2704,7 @@ public class Blocks{
|
|||||||
shootLength = 5f;
|
shootLength = 5f;
|
||||||
bulletDamage = 30f;
|
bulletDamage = 30f;
|
||||||
reloadTime = 8f;
|
reloadTime = 8f;
|
||||||
|
envEnabled |= Env.space;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
tsunami = new LiquidTurret("tsunami"){{
|
tsunami = new LiquidTurret("tsunami"){{
|
||||||
@@ -2736,6 +2742,7 @@ public class Blocks{
|
|||||||
restitution = 0.1f;
|
restitution = 0.1f;
|
||||||
shootCone = 30;
|
shootCone = 30;
|
||||||
size = 3;
|
size = 3;
|
||||||
|
envEnabled |= Env.space;
|
||||||
|
|
||||||
scaledHealth = 220;
|
scaledHealth = 220;
|
||||||
shootSound = Sounds.shotgun;
|
shootSound = Sounds.shotgun;
|
||||||
@@ -2846,6 +2853,7 @@ public class Blocks{
|
|||||||
shootCone = 2f;
|
shootCone = 2f;
|
||||||
shootSound = Sounds.railgun;
|
shootSound = Sounds.railgun;
|
||||||
unitSort = UnitSorts.strongest;
|
unitSort = UnitSorts.strongest;
|
||||||
|
envEnabled |= Env.space;
|
||||||
|
|
||||||
coolantMultiplier = 0.4f;
|
coolantMultiplier = 0.4f;
|
||||||
|
|
||||||
@@ -2898,6 +2906,7 @@ public class Blocks{
|
|||||||
shootSound = Sounds.laserbig;
|
shootSound = Sounds.laserbig;
|
||||||
loopSound = Sounds.beam;
|
loopSound = Sounds.beam;
|
||||||
loopSoundVolume = 2f;
|
loopSoundVolume = 2f;
|
||||||
|
envEnabled |= Env.space;
|
||||||
|
|
||||||
shootType = new ContinuousLaserBulletType(78){{
|
shootType = new ContinuousLaserBulletType(78){{
|
||||||
length = 200f;
|
length = 200f;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package mindustry.content;
|
package mindustry.content;
|
||||||
|
|
||||||
import mindustry.ctype.*;
|
|
||||||
import mindustry.game.*;
|
import mindustry.game.*;
|
||||||
|
|
||||||
public class Loadouts{
|
public class Loadouts{
|
||||||
@@ -8,6 +7,7 @@ public class Loadouts{
|
|||||||
basicShard,
|
basicShard,
|
||||||
basicFoundation,
|
basicFoundation,
|
||||||
basicNucleus,
|
basicNucleus,
|
||||||
|
spaceNucleus,
|
||||||
basicBastion;
|
basicBastion;
|
||||||
|
|
||||||
public static void load(){
|
public static void load(){
|
||||||
@@ -15,5 +15,6 @@ public class Loadouts{
|
|||||||
basicFoundation = Schematics.readBase64("bXNjaAB4nD1OSQ6DMBBzFhVu8BG+0X8MQyoiJTNSukj8nlCi2Adbtg/GA4OBF8oB00rvyE/9ykafqOIw58A7SWRKy1ZiShhZ5RcOLZhYS1hefQ1gRIeptH9jq/qW2lvc1d2tgWsOfVX/tOwE86AYBA==");
|
basicFoundation = Schematics.readBase64("bXNjaAB4nD1OSQ6DMBBzFhVu8BG+0X8MQyoiJTNSukj8nlCi2Adbtg/GA4OBF8oB00rvyE/9ykafqOIw58A7SWRKy1ZiShhZ5RcOLZhYS1hefQ1gRIeptH9jq/qW2lvc1d2tgWsOfVX/tOwE86AYBA==");
|
||||||
basicNucleus = Schematics.readBase64("bXNjaAB4nD2MUQqAIBBEJy0s6qOLdJXuYNtCgikYBd2+LNmdj308hkGHtkId7M4YFns4mk/yfB4a48602eDI+mlNznu0FMPFd0wYKCaewl8F0EOueqM+yKSLVfJrNKWnSw/FZGzEGXFG9sy/px4gEBW1");
|
basicNucleus = Schematics.readBase64("bXNjaAB4nD2MUQqAIBBEJy0s6qOLdJXuYNtCgikYBd2+LNmdj308hkGHtkId7M4YFns4mk/yfB4a48602eDI+mlNznu0FMPFd0wYKCaewl8F0EOueqM+yKSLVfJrNKWnSw/FZGzEGXFG9sy/px4gEBW1");
|
||||||
basicBastion = Schematics.readBase64("bXNjaAF4nGNgYWBhZmDJS8xNZWBNzMsEUtwpqcXJRZkFJZn5eQyClfmlCin5Cnn5JQqpFZnFJVwMbDmJSak5xQxM0bGMDDzJ+UWpukmJxWDVDAyMIAQkACMdFqE=");
|
basicBastion = Schematics.readBase64("bXNjaAF4nGNgYWBhZmDJS8xNZWBNzMsEUtwpqcXJRZkFJZn5eQyClfmlCin5Cnn5JQqpFZnFJVwMbDmJSak5xQxM0bGMDDzJ+UWpukmJxWDVDAyMIAQkACMdFqE=");
|
||||||
|
spaceNucleus = Schematics.readBase64("bXNjaAF4nDXKuwrCQBRF0WMStVDwQyQJAStBrCxEKxsLsZjcXJiBeTEPB/9eQdzlYmOOZY3GCsPYypR83Pd9KaV7u5zyyB050xeRSB5fh+F2ulz9neTujNXEkYLySTkLYKHFyDqiejwrbLzlbERS1E5BaY01ucCtzaQ5x+9d49cMFRr84QNbTSRJ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,42 +183,53 @@ public class SectorDamage{
|
|||||||
|
|
||||||
if(core == null || spawns.isEmpty()) return;
|
if(core == null || spawns.isEmpty()) return;
|
||||||
|
|
||||||
|
boolean airOnly = !state.rules.spawns.contains(g -> !g.type.flying);
|
||||||
|
|
||||||
Tile start = spawns.first();
|
Tile start = spawns.first();
|
||||||
|
|
||||||
var field = pathfinder.getField(state.rules.waveTeam, Pathfinder.costGround, Pathfinder.fieldCore);
|
|
||||||
Seq<Tile> path = new Seq<>();
|
Seq<Tile> path = new Seq<>();
|
||||||
boolean found = false;
|
|
||||||
|
|
||||||
if(field != null && field.weights != null){
|
//TODO would be nice if this worked in a more generic way, with two different calculations and paths
|
||||||
int[][] weights = field.weights;
|
if(airOnly){
|
||||||
int count = 0;
|
world.raycastEach(start.x, start.y, core.tileX(), core.tileY(), (x, y) -> {
|
||||||
Tile current = start;
|
path.add(world.rawTile(x, y));
|
||||||
while(count < world.width() * world.height()){
|
return false;
|
||||||
int minCost = Integer.MAX_VALUE;
|
});
|
||||||
int cx = current.x, cy = current.y;
|
}else{
|
||||||
for(Point2 p : Geometry.d4){
|
var field = pathfinder.getField(state.rules.waveTeam, Pathfinder.costGround, Pathfinder.fieldCore);
|
||||||
int nx = cx + p.x, ny = cy + p.y;
|
boolean found = false;
|
||||||
|
|
||||||
Tile other = world.tile(nx, ny);
|
if(field != null && field.weights != null){
|
||||||
if(other != null && weights[nx][ny] < minCost && weights[nx][ny] != -1){
|
int[][] weights = field.weights;
|
||||||
minCost = weights[nx][ny];
|
int count = 0;
|
||||||
current = other;
|
Tile current = start;
|
||||||
|
while(count < world.width() * world.height()){
|
||||||
|
int minCost = Integer.MAX_VALUE;
|
||||||
|
int cx = current.x, cy = current.y;
|
||||||
|
for(Point2 p : Geometry.d4){
|
||||||
|
int nx = cx + p.x, ny = cy + p.y;
|
||||||
|
|
||||||
|
Tile other = world.tile(nx, ny);
|
||||||
|
if(other != null && weights[nx][ny] < minCost && weights[nx][ny] != -1){
|
||||||
|
minCost = weights[nx][ny];
|
||||||
|
current = other;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
path.add(current);
|
||||||
|
|
||||||
|
if(current.build == core){
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
count ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
path.add(current);
|
|
||||||
|
|
||||||
if(current.build == core){
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
count ++;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(!found){
|
if(!found){
|
||||||
path = Astar.pathfind(start, core.tile, SectorDamage::cost, t -> !(t.block().isStatic() && t.solid()));
|
path.clear();
|
||||||
|
path.addAll(Astar.pathfind(start, core.tile, SectorDamage::cost, t -> !(t.block().isStatic() && t.solid())));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//create sparse tile array for fast range query
|
//create sparse tile array for fast range query
|
||||||
|
|||||||
@@ -118,8 +118,8 @@ public class AsteroidGenerator extends BlankPlanetGenerator{
|
|||||||
wallOre(Blocks.beryllicStoneWall, Blocks.wallOreBeryl, 50f, 0.62f * berylliumScale);
|
wallOre(Blocks.beryllicStoneWall, Blocks.wallOreBeryl, 50f, 0.62f * berylliumScale);
|
||||||
|
|
||||||
//TODO:
|
//TODO:
|
||||||
//- copper maybe should not exist
|
//- enemy wave spawns
|
||||||
//- consider replacing certain ores with something else
|
//- never ending
|
||||||
|
|
||||||
//titanium
|
//titanium
|
||||||
pass((x, y) -> {
|
pass((x, y) -> {
|
||||||
@@ -131,6 +131,10 @@ public class AsteroidGenerator extends BlankPlanetGenerator{
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
int spawnSide = rand.random(3);
|
||||||
|
int sizeOffset = width / 2 - 1;
|
||||||
|
tiles.getn(sizeOffset * Geometry.d8edge[spawnSide].x + width/2, sizeOffset * Geometry.d8edge[spawnSide].y + height/2).setOverlay(Blocks.spawn);
|
||||||
|
|
||||||
Schematics.placeLaunchLoadout(sx, sy);
|
Schematics.placeLaunchLoadout(sx, sy);
|
||||||
|
|
||||||
state.rules.planetBackground = new PlanetParams(){{
|
state.rules.planetBackground = new PlanetParams(){{
|
||||||
@@ -139,9 +143,19 @@ public class AsteroidGenerator extends BlankPlanetGenerator{
|
|||||||
camPos = new Vec3(1.2388899f, 1.6047299f, 2.4758825f);
|
camPos = new Vec3(1.2388899f, 1.6047299f, 2.4758825f);
|
||||||
}};
|
}};
|
||||||
//state.rules.backgroundTexture = "sprites/space.png";
|
//state.rules.backgroundTexture = "sprites/space.png";
|
||||||
state.rules.dragMultiplier = 0.7f; //yes, yes space has 0 drag but 0% drag is very annoying
|
state.rules.dragMultiplier = 0.7f; //yes, space actually has 0 drag but true 0% drag is very annoying
|
||||||
state.rules.borderDarkness = false;
|
state.rules.borderDarkness = false;
|
||||||
state.rules.environment = Env.space;
|
state.rules.environment = Env.space;
|
||||||
|
state.rules.waves = true;
|
||||||
|
//TODO maybe make this on by default everywhere
|
||||||
|
state.rules.showSpawns = true;
|
||||||
|
//TODO better wavegen, do it by hand even
|
||||||
|
state.rules.spawns = Waves.generate(0.5f, rand, false, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Schematic getDefaultLoadout(){
|
||||||
|
return Loadouts.spaceNucleus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -679,7 +679,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
state.camPos.set(0f, camLength, 0.1f);
|
state.camPos.set(0f, camLength, 0.1f);
|
||||||
|
|
||||||
if(Mathf.equal(state.otherCamAlpha, 1f, 0.01f)){
|
if(Mathf.equal(state.otherCamAlpha, 1f, 0.01f)){
|
||||||
//cam.position.set(params.otherCamPos).lerp(params.planet.position, params.otherCamAlpha).add(params.camPos);
|
//TODO change zoom too
|
||||||
state.camPos.set(Tmp.v31.set(state.otherCamPos).lerp(state.planet.position, state.otherCamAlpha).add(state.camPos).sub(state.planet.position));
|
state.camPos.set(Tmp.v31.set(state.otherCamPos).lerp(state.planet.position, state.otherCamAlpha).add(state.camPos).sub(state.planet.position));
|
||||||
|
|
||||||
state.otherCamPos = null;
|
state.otherCamPos = null;
|
||||||
@@ -1031,29 +1031,6 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
stable.pack();
|
stable.pack();
|
||||||
stable.setPosition(x, y, Align.center);
|
stable.setPosition(x, y, Align.center);
|
||||||
|
|
||||||
//do not fade out for now, TODO remove?
|
|
||||||
/*
|
|
||||||
stable.update(() -> {
|
|
||||||
if(selected != null){
|
|
||||||
if(launching){
|
|
||||||
stable.color.sub(0, 0, 0, 0.05f * Time.delta);
|
|
||||||
}else{
|
|
||||||
if(!state.planet.hasGrid()){
|
|
||||||
stable.color.a = 1f;
|
|
||||||
}else{
|
|
||||||
//fade out UI when not facing selected sector
|
|
||||||
Tmp.v31.set(selected.tile.v).rotate(Vec3.Y, -state.planet.getRotation()).scl(-1f).nor();
|
|
||||||
float dot = planets.cam.direction.dot(Tmp.v31);
|
|
||||||
stable.color.a = Math.max(dot, 0f)*2f;
|
|
||||||
if(dot*2f <= -0.1f){
|
|
||||||
selected = null;
|
|
||||||
updateSelected();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});*/
|
|
||||||
|
|
||||||
stable.act(0f);
|
stable.act(0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1087,12 +1064,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
if(mode == look && !sector.hasBase()){
|
if(mode == look && !sector.hasBase()){
|
||||||
shouldHide = false;
|
shouldHide = false;
|
||||||
Sector from = findLauncher(sector);
|
Sector from = findLauncher(sector);
|
||||||
if(from == null || mode == planetLaunch){
|
if(from == null){
|
||||||
//TODO use the standard nucleus core schematic.
|
|
||||||
if(mode == planetLaunch){
|
|
||||||
listener.get(sector);
|
|
||||||
}
|
|
||||||
|
|
||||||
//clear loadout information, so only the basic loadout gets used
|
//clear loadout information, so only the basic loadout gets used
|
||||||
universe.clearLoadoutInfo();
|
universe.clearLoadoutInfo();
|
||||||
//free launch.
|
//free launch.
|
||||||
@@ -1136,7 +1108,14 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
}
|
}
|
||||||
}else if(mode == select){
|
}else if(mode == select){
|
||||||
listener.get(sector);
|
listener.get(sector);
|
||||||
|
}else if(mode == planetLaunch){ //TODO make sure it doesn't have a base already.
|
||||||
|
|
||||||
|
//TODO animation
|
||||||
|
//schematic selection and cost handled by listener
|
||||||
|
listener.get(sector);
|
||||||
|
control.playSector(sector);
|
||||||
}else{
|
}else{
|
||||||
|
//sector should have base here
|
||||||
control.playSector(sector);
|
control.playSector(sector);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import static mindustry.Vars.*;
|
|||||||
public class Accelerator extends Block{
|
public class Accelerator extends Block{
|
||||||
public @Load("launch-arrow") TextureRegion arrowRegion;
|
public @Load("launch-arrow") TextureRegion arrowRegion;
|
||||||
|
|
||||||
|
//TODO dynamic
|
||||||
public Block launching = Blocks.coreNucleus;
|
public Block launching = Blocks.coreNucleus;
|
||||||
public int[] capacities = {};
|
public int[] capacities = {};
|
||||||
|
|
||||||
@@ -111,7 +112,12 @@ public class Accelerator extends Block{
|
|||||||
|
|
||||||
ui.planet.showPlanetLaunch(state.rules.sector, sector -> {
|
ui.planet.showPlanetLaunch(state.rules.sector, sector -> {
|
||||||
//TODO cutscene, etc...
|
//TODO cutscene, etc...
|
||||||
|
|
||||||
|
//TODO should consume resources based on destination schem
|
||||||
consume();
|
consume();
|
||||||
|
|
||||||
|
universe.clearLoadoutInfo();
|
||||||
|
universe.updateLoadout(sector.planet.generator.getDefaultLoadout().findCore(), sector.planet.generator.getDefaultLoadout());
|
||||||
});
|
});
|
||||||
|
|
||||||
Events.fire(Trigger.acceleratorUse);
|
Events.fire(Trigger.acceleratorUse);
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ public class PowerTurret extends Turret{
|
|||||||
public PowerTurret(String name){
|
public PowerTurret(String name){
|
||||||
super(name);
|
super(name);
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
envEnabled |= Env.space;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ public class Drill extends Block{
|
|||||||
hasItems = true;
|
hasItems = true;
|
||||||
ambientSound = Sounds.drill;
|
ambientSound = Sounds.drill;
|
||||||
ambientSoundVolume = 0.018f;
|
ambientSoundVolume = 0.018f;
|
||||||
|
//drills work in space I guess
|
||||||
|
envEnabled |= Env.space;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user