mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-12 19:09:34 +07:00
Bugfixes / Default capture waves
This commit is contained in:
parent
658079fab6
commit
2510b09201
@ -112,7 +112,7 @@ public class TechTree implements ContentList{
|
||||
});
|
||||
|
||||
node(Items.coal, with(Items.lead, 3000), () -> {
|
||||
node(Items.graphite, with(Items.coal, 3000), () -> {
|
||||
node(Items.graphite, with(Items.coal, 1000), () -> {
|
||||
node(graphitePress, () -> {
|
||||
node(Items.titanium, with(Items.graphite, 6000, Items.copper, 10000, Items.lead, 10000), () -> {
|
||||
node(pneumaticDrill, () -> {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package mindustry.entities.abilities;
|
||||
|
||||
import arc.*;
|
||||
import arc.func.*;
|
||||
import arc.graphics.*;
|
||||
import arc.graphics.g2d.*;
|
||||
@ -70,8 +71,18 @@ public class ForceFieldAbility implements Ability{
|
||||
|
||||
if(unit.shield > 0){
|
||||
Draw.z(Layer.shields);
|
||||
|
||||
Draw.color(unit.team.color, Color.white, Mathf.clamp(unit.shieldAlpha));
|
||||
Fill.poly(unit.x, unit.y, 6, realRad);
|
||||
|
||||
if(Core.settings.getBool("animatedshields")){
|
||||
Fill.poly(unit.x, unit.y, 6, realRad);
|
||||
}else{
|
||||
Lines.stroke(1.5f);
|
||||
Draw.alpha(0.09f);
|
||||
Fill.poly(unit.x, unit.y, 6, radius);
|
||||
Draw.alpha(1f);
|
||||
Lines.poly(unit.x, unit.y, 6, radius);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -281,16 +281,18 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{
|
||||
|
||||
Schematics.placeLaunchLoadout(spawn.x, spawn.y);
|
||||
|
||||
float difficulty = sector.baseCoverage;
|
||||
|
||||
if(sector.hasEnemyBase()){
|
||||
basegen.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;
|
||||
}else{
|
||||
state.rules.winWave = 15 * (int)Math.max(difficulty, 1);
|
||||
}
|
||||
|
||||
state.rules.waves = true;
|
||||
|
||||
float difficulty = sector.baseCoverage;
|
||||
|
||||
//scale up the spawning base on difficulty (this is just for testing)
|
||||
for(SpawnGroup group : state.rules.spawns){
|
||||
group.unitAmount *= difficulty;
|
||||
|
@ -89,7 +89,7 @@ public class Sector{
|
||||
* Only sectors adjacent to non-wave sectors can be landed on.
|
||||
* TODO also preset sectors*/
|
||||
public boolean unlocked(){
|
||||
return hasBase() || Structs.contains(tile.tiles, p -> planet.getSector(p).isCaptured()) || (preset != null && preset.unlocked());
|
||||
return hasBase();
|
||||
}
|
||||
|
||||
/** @return whether the player has a base here. */
|
||||
|
@ -36,7 +36,8 @@ public class PausedDialog extends BaseDialog{
|
||||
if(!mobile){
|
||||
//TODO localize
|
||||
cont.label(() -> state.getSector() == null ? "" :
|
||||
"[lightgray]Next turn in [accent]" + state.getSector().displayTimeRemaining())
|
||||
("[lightgray]Next turn in [accent]" + state.getSector().displayTimeRemaining() +
|
||||
(state.rules.winWave > 0 && !state.getSector().isCaptured() ? "\n[lightgray]Reach wave[accent] " + state.rules.winWave + "[] to capture" : "")))
|
||||
.visible(() -> state.getSector() != null).colspan(2);
|
||||
cont.row();
|
||||
|
||||
|
@ -120,8 +120,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
boolean canLaunch(Sector sector){
|
||||
return mode == launch &&
|
||||
(sector.tile.v.within(launchSector.tile.v, (launchRange + 0.5f) * planets.planet.sectorApproxRadius*2) //within range
|
||||
//TODO completely untested
|
||||
|| (sector.preset != null && sector.preset.unlocked() && TechTree.get(sector.preset) != null && TechTree.get(sector.preset).objectives.contains(r -> r.zone() != null && r.zone() == sector.preset))); //is an unlocked preset
|
||||
|| (sector.preset != null && sector.preset.unlocked() && TechTree.get(sector.preset) != null && TechTree.get(sector.preset).objectives.contains(r -> r.zone() != null && r.zone() == launchSector.preset))); //is an unlocked preset
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -31,17 +31,21 @@ public class ConsumeItemDynamic extends Consume{
|
||||
public void build(Building tile, Table table){
|
||||
ItemStack[][] current = {items.get(tile)};
|
||||
|
||||
table.update(() -> {
|
||||
if(current[0] != items.get(tile)){
|
||||
rebuild(tile, table);
|
||||
current[0] = items.get(tile);
|
||||
}
|
||||
});
|
||||
table.table(cont -> {
|
||||
table.update(() -> {
|
||||
if(current[0] != items.get(tile)){
|
||||
rebuild(tile, cont);
|
||||
current[0] = items.get(tile);
|
||||
}
|
||||
});
|
||||
|
||||
rebuild(tile, table);
|
||||
rebuild(tile, cont);
|
||||
});
|
||||
}
|
||||
|
||||
private void rebuild(Building tile, Table table){
|
||||
table.clear();
|
||||
|
||||
for(ItemStack stack : items.get(tile)){
|
||||
table.add(new ReqImage(new ItemImage(stack.item.icon(Cicon.medium), stack.amount),
|
||||
() -> tile.items != null && tile.items.has(stack.item, stack.amount))).size(8 * 4).padRight(6 * Mathf.digits(stack.amount));
|
||||
|
Loading…
Reference in New Issue
Block a user