Preset capture waves / More tooltips
This commit is contained in:
@@ -9,7 +9,7 @@ public class SectorPresets implements ContentList{
|
||||
public static SectorPreset
|
||||
groundZero,
|
||||
craters, frozenForest, ruinousShores, stainedMountains, tarFields, fungalPass,
|
||||
saltFlats, overgrowth, impact0078, crags,
|
||||
saltFlats, overgrowth,
|
||||
desolateRift, nuclearComplex;
|
||||
|
||||
@Override
|
||||
@@ -17,34 +17,27 @@ public class SectorPresets implements ContentList{
|
||||
|
||||
groundZero = new SectorPreset("groundZero", serpulo, 15){{
|
||||
alwaysUnlocked = true;
|
||||
conditionWave = 5;
|
||||
launchPeriod = 5;
|
||||
rules = r -> {
|
||||
r.winWave = 10;
|
||||
};
|
||||
captureWave = 10;
|
||||
}};
|
||||
|
||||
saltFlats = new SectorPreset("saltFlats", serpulo, 101){{
|
||||
conditionWave = 10;
|
||||
launchPeriod = 5;
|
||||
|
||||
}};
|
||||
|
||||
frozenForest = new SectorPreset("frozenForest", serpulo, 86){{
|
||||
conditionWave = 10;
|
||||
captureWave = 40;
|
||||
}};
|
||||
|
||||
craters = new SectorPreset("craters", serpulo, 18){{
|
||||
conditionWave = 10;
|
||||
captureWave = 40;
|
||||
}};
|
||||
|
||||
ruinousShores = new SectorPreset("ruinousShores", serpulo, 19){{
|
||||
conditionWave = 20;
|
||||
launchPeriod = 20;
|
||||
captureWave = 40;
|
||||
}};
|
||||
|
||||
stainedMountains = new SectorPreset("stainedMountains", serpulo, 20){{
|
||||
conditionWave = 10;
|
||||
launchPeriod = 10;
|
||||
captureWave = 30;
|
||||
}};
|
||||
|
||||
fungalPass = new SectorPreset("fungalPass", serpulo, 21){{
|
||||
@@ -52,49 +45,20 @@ public class SectorPresets implements ContentList{
|
||||
}};
|
||||
|
||||
overgrowth = new SectorPreset("overgrowth", serpulo, 22){{
|
||||
conditionWave = 12;
|
||||
launchPeriod = 4;
|
||||
|
||||
}};
|
||||
|
||||
tarFields = new SectorPreset("tarFields", serpulo, 23){{
|
||||
conditionWave = 15;
|
||||
launchPeriod = 10;
|
||||
captureWave = 40;
|
||||
}};
|
||||
|
||||
desolateRift = new SectorPreset("desolateRift", serpulo, 123){{
|
||||
conditionWave = 3;
|
||||
launchPeriod = 2;
|
||||
captureWave = 40;
|
||||
}};
|
||||
|
||||
|
||||
nuclearComplex = new SectorPreset("nuclearComplex", serpulo, 130){{
|
||||
conditionWave = 30;
|
||||
launchPeriod = 15;
|
||||
captureWave = 60;
|
||||
}};
|
||||
|
||||
|
||||
/*
|
||||
crags = new Zone("crags", new MapGenerator("crags").dist(2f)){{
|
||||
loadout = Loadouts.basicFoundation;
|
||||
baseLaunchCost = ItemStack.with();
|
||||
startingItems = ItemStack.list(Items.copper, 2000, Items.lead, 2000, Items.graphite, 500, Items.titanium, 500, Items.silicon, 500);
|
||||
conditionWave = 3;
|
||||
launchPeriod = 2;
|
||||
requirements = with(stainedMountains, 40);
|
||||
blockRequirements = new Block[]{Blocks.thermalGenerator};
|
||||
resources = Array.with(Items.copper, Items.scrap, Items.lead, Items.coal, Items.sand};
|
||||
}};
|
||||
|
||||
|
||||
impact0078 = new SectorPreset("impact0078"){{
|
||||
loadout = Loadouts.basicNucleus;
|
||||
baseLaunchCost = ItemStack.list();
|
||||
startingItems = ItemStack.list(Items.copper, 2000, Items.lead, 2000, Items.graphite, 500, Items.titanium, 500, Items.silicon, 500);
|
||||
conditionWave = 3;
|
||||
launchPeriod = 2;
|
||||
//requirements = with(nuclearComplex, 40);
|
||||
//blockRequirements = new Block[]{Blocks.thermalGenerator};
|
||||
//resources = Array.with(Items.copper, Items.scrap, Items.lead, Items.coal, Items.titanium, Items.thorium};
|
||||
}};*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,6 +99,7 @@ public class UI implements ApplicationListener, Loadable{
|
||||
Dialog.setHideAction(() -> sequence(fadeOut(0.1f)));
|
||||
|
||||
Tooltips.getInstance().animations = false;
|
||||
Tooltips.getInstance().textProvider = text -> new Tooltip(t -> t.background(Styles.black5).margin(4f).add(text));
|
||||
|
||||
Core.settings.setErrorHandler(e -> {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -29,27 +29,6 @@ public class Objectives{
|
||||
}
|
||||
}
|
||||
|
||||
public static class SectorWave extends SectorObjective{
|
||||
public int wave;
|
||||
|
||||
public SectorWave(SectorPreset zone, int wave){
|
||||
this.preset = zone;
|
||||
this.wave = wave;
|
||||
}
|
||||
|
||||
protected SectorWave(){}
|
||||
|
||||
@Override
|
||||
public boolean complete(){
|
||||
return preset.bestWave() >= wave;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String display(){
|
||||
return Core.bundle.format("requirement.wave", wave, preset.localizedName);
|
||||
}
|
||||
}
|
||||
|
||||
public static class SectorComplete extends SectorObjective{
|
||||
|
||||
public SectorComplete(SectorPreset zone){
|
||||
@@ -65,29 +44,11 @@ public class Objectives{
|
||||
|
||||
@Override
|
||||
public String display(){
|
||||
return Core.bundle.format("requirement.capture",preset.localizedName);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Launched extends SectorObjective{
|
||||
|
||||
public Launched(SectorPreset zone){
|
||||
this.preset = zone;
|
||||
}
|
||||
|
||||
protected Launched(){}
|
||||
|
||||
@Override
|
||||
public boolean complete(){
|
||||
return preset.hasLaunched();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String display(){
|
||||
return Core.bundle.format("requirement.core", preset.localizedName);
|
||||
return Core.bundle.format("requirement.capture", preset.localizedName);
|
||||
}
|
||||
}
|
||||
|
||||
//TODO merge
|
||||
public abstract static class SectorObjective implements Objective{
|
||||
public @NonNull SectorPreset preset;
|
||||
}
|
||||
|
||||
@@ -330,20 +330,20 @@ public class DesktopInput extends InputHandler{
|
||||
|
||||
table.button(Icon.paste, Styles.clearPartiali, () -> {
|
||||
ui.schematics.show();
|
||||
});
|
||||
}).tooltip("Schematics");
|
||||
|
||||
table.button(Icon.tree, Styles.clearPartiali, () -> {
|
||||
ui.research.show();
|
||||
}).visible(() -> state.isCampaign());
|
||||
}).visible(() -> state.isCampaign()).tooltip("Research");
|
||||
|
||||
table.button(Icon.map, Styles.clearPartiali, () -> {
|
||||
ui.planet.show();
|
||||
}).visible(() -> state.isCampaign());
|
||||
}).visible(() -> state.isCampaign()).tooltip("Planet Map");
|
||||
|
||||
table.button(Icon.up, Styles.clearPartiali, () -> {
|
||||
ui.planet.show(state.getSector(), player.team().core());
|
||||
}).visible(() -> state.isCampaign())
|
||||
.disabled(b -> player.team().core() == null || !player.team().core().items.has(player.team().core().block.requirements));
|
||||
.disabled(b -> player.team().core() == null || !player.team().core().items.has(player.team().core().block.requirements)).tooltip("Launch Core");
|
||||
}
|
||||
|
||||
void pollInput(){
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package mindustry.type;
|
||||
|
||||
import arc.*;
|
||||
import arc.func.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.scene.ui.layout.*;
|
||||
@@ -11,16 +10,15 @@ import mindustry.gen.*;
|
||||
import mindustry.maps.generators.*;
|
||||
import mindustry.ui.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class SectorPreset extends UnlockableContent{
|
||||
public @NonNull FileMapGenerator generator;
|
||||
public @NonNull Planet planet;
|
||||
public @NonNull Sector sector;
|
||||
|
||||
public Cons<Rules> rules = rules -> {};
|
||||
public int conditionWave = Integer.MAX_VALUE;
|
||||
public int launchPeriod = 10;
|
||||
public int captureWave = 0;
|
||||
public Cons<Rules> rules = rules -> {
|
||||
rules.winWave = captureWave;
|
||||
};
|
||||
|
||||
public SectorPreset(String name, Planet planet, int sector){
|
||||
super(name);
|
||||
@@ -31,39 +29,6 @@ public class SectorPreset extends UnlockableContent{
|
||||
planet.preset(sector, this);
|
||||
}
|
||||
|
||||
public Rules getRules(){
|
||||
return generator.map.rules();
|
||||
}
|
||||
|
||||
public boolean isLaunchWave(int wave){
|
||||
return metCondition() && wave % launchPeriod == 0;
|
||||
}
|
||||
|
||||
public boolean hasLaunched(){
|
||||
//TODO implement
|
||||
return Core.settings.getBool(name + "-launched", false);
|
||||
}
|
||||
|
||||
public int bestWave(){
|
||||
//TODO implement
|
||||
return Core.settings.getInt(name + "-wave", 0);
|
||||
}
|
||||
|
||||
/** @return whether initial conditions to launch are met. */
|
||||
public boolean isLaunchMet(){
|
||||
return bestWave() >= conditionWave;
|
||||
}
|
||||
|
||||
/** Whether this zone has met its condition; if true, the player can leave. */
|
||||
public boolean metCondition(){
|
||||
//players can't leave in attack mode.
|
||||
return state.wave >= conditionWave && !state.rules.attackMode;
|
||||
}
|
||||
|
||||
public boolean canConfigure(){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureRegion icon(Cicon c){
|
||||
return Icon.terrain.getRegion();
|
||||
|
||||
Reference in New Issue
Block a user