mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-15 10:17:39 +07:00
Proper interplanetary launch
This commit is contained in:
@ -672,7 +672,7 @@ sector.extractionOutpost.description = A remote outpost, constructed by the enem
|
|||||||
sector.impact0078.description = Here lie remnants of the interstellar transport vessel that first entered this system.\n\nSalvage as much as possible from the wreckage. Research any intact technology.
|
sector.impact0078.description = Here lie remnants of the interstellar transport vessel that first entered this system.\n\nSalvage as much as possible from the wreckage. Research any intact technology.
|
||||||
sector.planetaryTerminal.description = The final target.\n\nThis coastal base contains a structure capable of launching Cores to local planets. It is extremely well guarded.\n\nProduce naval units. Eliminate the enemy as quickly as possible. Research the launch structure.
|
sector.planetaryTerminal.description = The final target.\n\nThis coastal base contains a structure capable of launching Cores to local planets. It is extremely well guarded.\n\nProduce naval units. Eliminate the enemy as quickly as possible. Research the launch structure.
|
||||||
|
|
||||||
sector.onset.name = Onset
|
sector.onset.name = The Onset
|
||||||
|
|
||||||
status.burning.name = Burning
|
status.burning.name = Burning
|
||||||
status.freezing.name = Freezing
|
status.freezing.name = Freezing
|
||||||
|
@ -34,6 +34,11 @@ public class GroundAI extends AIController{
|
|||||||
if(spawner == null && core == null) move = false;
|
if(spawner == null && core == null) move = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//no reason to move if there's nothing there
|
||||||
|
if(core == null && (!state.rules.waves || getClosestSpawner() == null)){
|
||||||
|
move = false;
|
||||||
|
}
|
||||||
|
|
||||||
if(move) pathfind(Pathfinder.fieldCore);
|
if(move) pathfind(Pathfinder.fieldCore);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ public class ErekirTechTree{
|
|||||||
var costMultipliers = new ObjectFloatMap<Item>();
|
var costMultipliers = new ObjectFloatMap<Item>();
|
||||||
costMultipliers.put(Items.silicon, 7);
|
costMultipliers.put(Items.silicon, 7);
|
||||||
costMultipliers.put(Items.surgeAlloy, 4);
|
costMultipliers.put(Items.surgeAlloy, 4);
|
||||||
|
costMultipliers.put(Items.phaseFabric, 4);
|
||||||
costMultipliers.put(Items.thorium, 8);
|
costMultipliers.put(Items.thorium, 8);
|
||||||
costMultipliers.put(Items.graphite, 6);
|
costMultipliers.put(Items.graphite, 6);
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package mindustry.content;
|
package mindustry.content;
|
||||||
|
|
||||||
import arc.graphics.*;
|
import arc.graphics.*;
|
||||||
|
import arc.struct.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
|
|
||||||
public class Items{
|
public class Items{
|
||||||
@ -9,6 +10,9 @@ public class Items{
|
|||||||
phaseFabric, surgeAlloy, sporePod, sand, blastCompound, pyratite, metaglass,
|
phaseFabric, surgeAlloy, sporePod, sand, blastCompound, pyratite, metaglass,
|
||||||
beryllium, tungsten, oxide, carbide, fissileMatter, dormantCyst;
|
beryllium, tungsten, oxide, carbide, fissileMatter, dormantCyst;
|
||||||
|
|
||||||
|
//TODO remove, these are for debugging only
|
||||||
|
public static final Seq<Item> serpuloItems = new Seq<>(), erekirItems = new Seq<>();
|
||||||
|
|
||||||
public static void load(){
|
public static void load(){
|
||||||
copper = new Item("copper", Color.valueOf("d99d73")){{
|
copper = new Item("copper", Color.valueOf("d99d73")){{
|
||||||
hardness = 1;
|
hardness = 1;
|
||||||
@ -124,5 +128,15 @@ public class Items{
|
|||||||
dormantCyst = new Item("dormant-cyst", Color.valueOf("df824d")){{
|
dormantCyst = new Item("dormant-cyst", Color.valueOf("df824d")){{
|
||||||
flammability = 0.1f;
|
flammability = 0.1f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
serpuloItems.addAll(
|
||||||
|
scrap, copper, lead, graphite, coal, titanium, thorium, silicon, plastanium,
|
||||||
|
phaseFabric, surgeAlloy, sporePod, sand, blastCompound, pyratite, metaglass
|
||||||
|
);
|
||||||
|
|
||||||
|
erekirItems.addAll(
|
||||||
|
scrap, graphite, thorium, silicon, phaseFabric, surgeAlloy, sand,
|
||||||
|
beryllium, tungsten, oxide, carbide, fissileMatter, dormantCyst
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package mindustry.content;
|
package mindustry.content;
|
||||||
|
|
||||||
import arc.*;
|
import arc.*;
|
||||||
|
import arc.func.*;
|
||||||
import arc.scene.style.*;
|
import arc.scene.style.*;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
@ -140,6 +141,14 @@ public class TechTree{
|
|||||||
all.add(this);
|
all.add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Recursively iterates through everything that is a child of this node. Includes itself. */
|
||||||
|
public void each(Cons<TechNode> consumer){
|
||||||
|
consumer.get(this);
|
||||||
|
for(var child : children){
|
||||||
|
child.each(consumer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Drawable icon(){
|
public Drawable icon(){
|
||||||
return icon == null ? new TextureRegionDrawable(content.uiIcon) : icon;
|
return icon == null ? new TextureRegionDrawable(content.uiIcon) : icon;
|
||||||
}
|
}
|
||||||
|
@ -76,6 +76,14 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
/** Control building last tapped. */
|
/** Control building last tapped. */
|
||||||
public @Nullable Building buildingTapped;
|
public @Nullable Building buildingTapped;
|
||||||
|
|
||||||
|
{
|
||||||
|
Events.on(UnitDestroyEvent.class, e -> {
|
||||||
|
if(e.unit != null && e.unit.isPlayer() && e.unit.getPlayer().isLocal() && e.unit.type.weapons.contains(w -> w.bullet.killShooter)){
|
||||||
|
manualShooting = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//region utility methods
|
//region utility methods
|
||||||
|
|
||||||
/** Check and assign targets for a specific position. */
|
/** Check and assign targets for a specific position. */
|
||||||
|
@ -247,7 +247,7 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TODO test, different placement
|
//TODO test, different placement
|
||||||
//TODO this biome should have more blocks in gneeral
|
//TODO this biome should have more blocks in general
|
||||||
if(block == Blocks.regolithWall && rand.chance(0.2) && nearAir(x, y) && !near(x, y, 3, Blocks.crystalBlocks)){
|
if(block == Blocks.regolithWall && rand.chance(0.2) && nearAir(x, y) && !near(x, y, 3, Blocks.crystalBlocks)){
|
||||||
block = Blocks.crystalBlocks;
|
block = Blocks.crystalBlocks;
|
||||||
}
|
}
|
||||||
@ -294,7 +294,7 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
|||||||
|
|
||||||
//it is very hot
|
//it is very hot
|
||||||
state.rules.attributes.set(Attribute.heat, 0.8f);
|
state.rules.attributes.set(Attribute.heat, 0.8f);
|
||||||
state.rules.environment = Env.scorching | Env.terrestrial | Env.groundWater;
|
state.rules.environment = Env.scorching | Env.terrestrial;
|
||||||
Schematics.placeLaunchLoadout(spawnX, spawnY);
|
Schematics.placeLaunchLoadout(spawnX, spawnY);
|
||||||
|
|
||||||
state.rules.showSpawns = true;
|
state.rules.showSpawns = true;
|
||||||
|
@ -82,13 +82,13 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{
|
|||||||
any = true;
|
any = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(Structs.contains(tile.tiles, s -> sector.planet.getSector(s).id == sector.planet.startSector)) return;
|
||||||
|
|
||||||
if(noise < 0.16){
|
if(noise < 0.16){
|
||||||
for(Ptile other : tile.tiles){
|
for(Ptile other : tile.tiles){
|
||||||
var osec = sector.planet.getSector(other);
|
var osec = sector.planet.getSector(other);
|
||||||
|
|
||||||
//no sectors near start sector!
|
|
||||||
if(
|
if(
|
||||||
osec.id == sector.planet.startSector || //near starting sector
|
|
||||||
osec.generateEnemyBase && poles < 0.85 || //near other base
|
osec.generateEnemyBase && poles < 0.85 || //near other base
|
||||||
(sector.preset != null && noise < 0.11) //near preset
|
(sector.preset != null && noise < 0.11) //near preset
|
||||||
){
|
){
|
||||||
|
@ -176,6 +176,10 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
settings.put("lastplanet", state.planet.name);
|
settings.put("lastplanet", state.planet.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!selectable(state.planet)){
|
||||||
|
state.planet = Planets.serpulo;
|
||||||
|
}
|
||||||
|
|
||||||
rebuildButtons();
|
rebuildButtons();
|
||||||
mode = look;
|
mode = look;
|
||||||
state.otherCamPos = null;
|
state.otherCamPos = null;
|
||||||
@ -255,7 +259,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
dialog.add("@sectors.captured");
|
dialog.add("@sectors.captured");
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO unimplemented, cutscene needed
|
//TODO not fully implemented, cutscene needed
|
||||||
public void showPlanetLaunch(Sector sector, Cons<Sector> listener){
|
public void showPlanetLaunch(Sector sector, Cons<Sector> listener){
|
||||||
selected = null;
|
selected = null;
|
||||||
hovered = null;
|
hovered = null;
|
||||||
@ -263,11 +267,20 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
this.listener = listener;
|
this.listener = listener;
|
||||||
launchSector = sector;
|
launchSector = sector;
|
||||||
|
|
||||||
//automatically select next planets; TODO pan!
|
//automatically select next planets;
|
||||||
if(sector.planet.launchCandidates.size == 1){
|
if(sector.planet.launchCandidates.size == 1){
|
||||||
state.planet = sector.planet.launchCandidates.first();
|
state.planet = sector.planet.launchCandidates.first();
|
||||||
state.otherCamPos = sector.planet.position;
|
state.otherCamPos = sector.planet.position;
|
||||||
state.otherCamAlpha = 0f;
|
state.otherCamAlpha = 0f;
|
||||||
|
|
||||||
|
//unlock and highlight sector
|
||||||
|
var destSec = state.planet.sectors.get(state.planet.startSector);
|
||||||
|
var preset = destSec.preset;
|
||||||
|
if(preset != null){
|
||||||
|
preset.unlock();
|
||||||
|
}
|
||||||
|
selected = destSec;
|
||||||
|
updateSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO pan over to correct planet
|
//TODO pan over to correct planet
|
||||||
@ -471,7 +484,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
//TODO what if any sector is selectable?
|
//TODO what if any sector is selectable?
|
||||||
//TODO launch criteria - which planets can be launched to? Where should this be defined? Should planets even be selectable?
|
//TODO launch criteria - which planets can be launched to? Where should this be defined? Should planets even be selectable?
|
||||||
if(mode == planetLaunch) return launchSector != null && planet != launchSector.planet && launchSector.planet.launchCandidates.contains(planet);
|
if(mode == planetLaunch) return launchSector != null && planet != launchSector.planet && launchSector.planet.launchCandidates.contains(planet);
|
||||||
return planet == state.planet || (planet.alwaysUnlocked && planet.isLandable()) || planet.sectors.contains(Sector::hasBase);
|
return (planet.alwaysUnlocked && planet.isLandable()) || planet.sectors.contains(Sector::hasBase);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup(){
|
void setup(){
|
||||||
@ -690,6 +703,9 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
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;
|
||||||
|
//announce new sector
|
||||||
|
newPresets.add(state.planet.sectors.get(state.planet.startSector));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,6 +116,7 @@ public class SettingsMenuDialog extends BaseDialog{
|
|||||||
|
|
||||||
t.button("@settings.clearresearch", Icon.trash, style, () -> {
|
t.button("@settings.clearresearch", Icon.trash, style, () -> {
|
||||||
ui.showConfirm("@confirm", "@settings.clearresearch.confirm", () -> {
|
ui.showConfirm("@confirm", "@settings.clearresearch.confirm", () -> {
|
||||||
|
Core.settings.put("lastplanet", "serpulo");
|
||||||
universe.clearLoadoutInfo();
|
universe.clearLoadoutInfo();
|
||||||
for(TechNode node : TechTree.all){
|
for(TechNode node : TechTree.all){
|
||||||
node.reset();
|
node.reset();
|
||||||
|
@ -81,7 +81,10 @@ public class ItemSource extends Block{
|
|||||||
|
|
||||||
while(counter >= limit){
|
while(counter >= limit){
|
||||||
items.set(outputItem, 1);
|
items.set(outputItem, 1);
|
||||||
dump(outputItem);
|
if(dump(outputItem)){
|
||||||
|
//for debugging only
|
||||||
|
produced(outputItem);
|
||||||
|
}
|
||||||
items.set(outputItem, 0);
|
items.set(outputItem, 0);
|
||||||
counter -= limit;
|
counter -= limit;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user