Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anuken
2022-09-02 08:35:00 -04:00
42 changed files with 98 additions and 78 deletions

View File

@@ -1228,6 +1228,8 @@ public class Blocks{
heatRequirement = 6f;
outputLiquid = new LiquidStack(Liquids.nitrogen, 4f / 60f);
researchCost = with(Items.silicon, 2000, Items.oxide, 900, Items.beryllium, 2400);
}};
oxidationChamber = new HeatProducer("oxidation-chamber"){{
@@ -1280,6 +1282,8 @@ public class Blocks{
ambientSound = Sounds.hum;
consumeLiquid(Liquids.slag, 40f / 60f);
heatOutput = 8f;
researchCost = with(Items.tungsten, 1200, Items.oxide, 900, Items.beryllium, 2400);
}};
phaseHeater = new HeatProducer("phase-heater"){{
@@ -2794,6 +2798,8 @@ public class Blocks{
consumeLiquid(Liquids.hydrogen, 0.5f / 60f);
consumeLiquid(Liquids.nitrogen, 3f / 60f).boost();
researchCost = with(Items.silicon, 1500, Items.oxide, 200, Items.beryllium, 3000, Items.tungsten, 1200);
}};
impactDrill = new BurstDrill("impact-drill"){{

View File

@@ -135,8 +135,8 @@ public class ErekirTechTree{
//TODO move into turbine condenser?
node(plasmaBore, () -> {
node(impactDrill, Seq.with(new OnSector(aegis)), () -> {
node(largePlasmaBore, Seq.with(tmpNever), () -> {
node(eruptionDrill, () -> {
node(largePlasmaBore, Seq.with(new OnSector(caldera)), () -> {
node(eruptionDrill, Seq.with(tmpNever), () -> {
});
});

View File

@@ -80,6 +80,14 @@ public class Sector{
return hasBase() || (preset != null && preset.alwaysUnlocked);
}
public boolean allowLaunchSchematics(){
return (preset != null && preset.overrideLaunchDefaults) ? preset.allowLaunchSchematics : planet.allowLaunchSchematics;
}
public boolean allowLaunchLoadout(){
return (preset != null && preset.overrideLaunchDefaults) ? preset.allowLaunchLoadout : planet.allowLaunchLoadout;
}
public void saveInfo(){
Core.settings.putJson(planet.name + "-s-" + id + "-info", info);
}

View File

@@ -18,6 +18,12 @@ public class SectorPreset extends UnlockableContent{
public float startWaveTimeMultiplier = 2f;
public boolean addStartingItems = false;
public boolean showSectorLandInfo = true;
/** If true, uses this sector's launch fields instead */
public boolean overrideLaunchDefaults = false;
/** Whether to allow users to specify a custom launch schematic for this map. */
public boolean allowLaunchSchematics = false;
/** Whether to allow users to specify the resources they take to this map. */
public boolean allowLaunchLoadout = false;
/** If true, switches to attack mode after waves end. */
public boolean attackAfterWaves = false;

View File

@@ -55,7 +55,7 @@ public class LaunchLoadoutDialog extends BaseDialog{
int capacity = lastCapacity;
if(!sector.planet.allowLaunchLoadout){
if(!destination.allowLaunchLoadout()){
resources.clear();
//TODO this should be set to a proper loadout based on sector.
if(destination.preset != null){
@@ -95,7 +95,7 @@ public class LaunchLoadoutDialog extends BaseDialog{
table.image(s.item.uiIcon).left().size(iconSmall);
String amountStr = (al + as) + (sector.planet.allowLaunchLoadout ? "[gray] (" + (al + " + " + as + ")") : "");
String amountStr = (al + as) + (destination.allowLaunchLoadout() ? "[gray] (" + (al + " + " + as + ")") : "");
table.add(
sitems.has(s.item, s.amount) ? amountStr :
@@ -111,7 +111,7 @@ public class LaunchLoadoutDialog extends BaseDialog{
Runnable rebuildItems = () -> rebuild.get(items);
if(sector.planet.allowLaunchLoadout){
if(destination.allowLaunchLoadout()){
buttons.button("@resources.max", Icon.add, Styles.togglet, () -> {
setMax(!getMax());
update.run();
@@ -154,7 +154,7 @@ public class LaunchLoadoutDialog extends BaseDialog{
cont.add(Core.bundle.format("launch.from", sector.name())).row();
if(sector.planet.allowLaunchSchematics){
if(destination.allowLaunchSchematics()){
cont.pane(t -> {
int[] i = {0};
@@ -176,7 +176,7 @@ public class LaunchLoadoutDialog extends BaseDialog{
}
};
if(sector.planet.allowLaunchSchematics || schematics.getDefaultLoadout(core) == null){
if(destination.allowLaunchSchematics() || schematics.getDefaultLoadout(core) == null){
for(var entry : schematics.getLoadouts()){
if(entry.key.size <= core.size){
for(Schematic s : entry.value){

View File

@@ -1160,7 +1160,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
//free launch.
control.playSector(sector);
}else{
CoreBlock block = from.planet.allowLaunchSchematics ? (from.info.bestCoreType instanceof CoreBlock b ? b : (CoreBlock)from.planet.defaultCore) : (CoreBlock)from.planet.defaultCore;
CoreBlock block = sector.allowLaunchSchematics() ? (from.info.bestCoreType instanceof CoreBlock b ? b : (CoreBlock)from.planet.defaultCore) : (CoreBlock)from.planet.defaultCore;
loadouts.show(block, from, sector, () -> {
var schemCore = universe.getLastLoadout().findCore();