Added final campaign map (WIP, untested)

This commit is contained in:
Anuken
2020-11-18 18:58:54 -05:00
parent 63d4428527
commit 1ef264d560
37 changed files with 9240 additions and 8906 deletions
+9 -2
View File
@@ -89,7 +89,7 @@ public class Blocks implements ContentList{
message, switchBlock, microProcessor, logicProcessor, hyperProcessor, largeLogicDisplay, logicDisplay, memoryCell, memoryBank,
//campaign
launchPad, launchPadLarge,
launchPad, launchPadLarge, interplanetaryAccelerator,
//misc experimental
blockForge, blockLoader, blockUnloader;
@@ -2046,7 +2046,6 @@ public class Blocks implements ContentList{
//TODO remove
launchPadLarge = new LaunchPad("launch-pad-large"){{
//requirements(Category.effect, BuildVisibility.campaignOnly, with(Items.titanium, 200, Items.silicon, 150, Items.lead, 250, Items.plastanium, 75));
size = 4;
itemCapacity = 300;
launchTime = 60f * 35;
@@ -2054,6 +2053,14 @@ public class Blocks implements ContentList{
consumes.power(6f);
}};
interplanetaryAccelerator = new Accelerator("interplanetary-accelerator"){{
requirements(Category.effect, BuildVisibility.campaignOnly, with(Items.copper, 9000, Items.silicon, 9000, Items.thorium, 9000, Items.titanium, 9000, Items.surgeAlloy, 5000, Items.phaseFabric, 4000));
researchCostMultiplier = 0.1f;
size = 7;
hasPower = true;
consumes.power(10f);
}};
//endregion campaign
//region logic
@@ -10,7 +10,7 @@ public class SectorPresets implements ContentList{
groundZero,
craters, biomassFacility, frozenForest, ruinousShores, windsweptIslands, stainedMountains, tarFields,
fungalPass, extractionOutpost, saltFlats, overgrowth,
impact0078, desolateRift, nuclearComplex;
impact0078, desolateRift, nuclearComplex, planetaryTerminal;
@Override
public void load(){
@@ -68,6 +68,7 @@ public class SectorPresets implements ContentList{
overgrowth = new SectorPreset("overgrowth", serpulo, 134){{
difficulty = 5;
useAI = false;
}};
tarFields = new SectorPreset("tarFields", serpulo, 23){{
@@ -89,5 +90,9 @@ public class SectorPresets implements ContentList{
captureWave = 50;
difficulty = 7;
}};
planetaryTerminal = new SectorPreset("planetaryTerminal", serpulo, 93){{
difficulty = 10;
}};
}
}
+22 -7
View File
@@ -30,6 +30,8 @@ public class TechTree implements ContentList{
node(junction, () -> {
node(router, () -> {
node(launchPad, Seq.with(new SectorComplete(extractionOutpost)), () -> {
node(interplanetaryAccelerator, Seq.with(new SectorComplete(planetaryTerminal)), () -> {
});
});
node(distributor);
@@ -47,7 +49,7 @@ public class TechTree implements ContentList{
});
node(itemBridge, () -> {
node(titaniumConveyor, () -> {
node(titaniumConveyor, Seq.with(new SectorComplete(craters)), () -> {
node(phaseConveyor, () -> {
node(massDriver, () -> {
@@ -108,7 +110,7 @@ public class TechTree implements ContentList{
});
node(graphitePress, () -> {
node(pneumaticDrill, () -> {
node(pneumaticDrill, Seq.with(new SectorComplete(frozenForest)), () -> {
node(cultivator, Seq.with(new SectorComplete(biomassFacility)), () -> {
});
@@ -234,7 +236,7 @@ public class TechTree implements ContentList{
});
});
node(steamGenerator, () -> {
node(steamGenerator, Seq.with(new SectorComplete(craters)), () -> {
node(thermalGenerator, () -> {
node(differentialGenerator, () -> {
node(thoriumReactor, Seq.with(new Research(Liquids.cryofluid)), () -> {
@@ -291,7 +293,7 @@ public class TechTree implements ContentList{
node(salvo, () -> {
node(swarmer, () -> {
node(cyclone, () -> {
node(spectre, () -> {
node(spectre, Seq.with(new SectorComplete(nuclearComplex)), () -> {
});
});
@@ -321,8 +323,8 @@ public class TechTree implements ContentList{
});
node(lancer, () -> {
node(foreshadow, () -> {
node(meltdown, () -> {
node(meltdown, () -> {
node(foreshadow, () -> {
});
});
@@ -417,7 +419,7 @@ public class TechTree implements ContentList{
});
node(additiveReconstructor, Seq.with(new SectorComplete(biomassFacility)), () -> {
node(multiplicativeReconstructor, () -> {
node(multiplicativeReconstructor, Seq.with(new SectorComplete(overgrowth)), () -> {
node(exponentialReconstructor, () -> {
node(tetrativeReconstructor, () -> {
});
@@ -468,7 +470,20 @@ public class TechTree implements ContentList{
new Research(thermalGenerator),
new Research(thoriumReactor)
), () -> {
node(planetaryTerminal, Seq.with(
new SectorComplete(desolateRift),
new SectorComplete(nuclearComplex),
new SectorComplete(overgrowth),
new SectorComplete(extractionOutpost),
new SectorComplete(saltFlats),
new Research(spectre),
new Research(launchPad),
new Research(impactReactor),
new Research(additiveReconstructor),
new Research(exponentialReconstructor)
), () -> {
});
});
});
});
+1 -1
View File
@@ -453,7 +453,7 @@ public class UnitTypes implements ContentList{
shootEffect = Fx.greenLaserChargeSmall;
incendChance = 0.05f;
incendChance = 0.075f;
incendSpread = 5f;
incendAmount = 1;
+1 -1
View File
@@ -124,7 +124,7 @@ public class Damage{
//try to heal the tile
if(collide && hitter.type.collides(hitter, tile)){
hitter.type.hitTile(hitter, tile, 0f);
hitter.type.hitTile(hitter, tile, 0f, false);
}
};
@@ -161,7 +161,9 @@ public abstract class BulletType extends Content{
return healPercent <= 0.001f || tile.team != bullet.team || tile.healthf() < 1f;
}
public void hitTile(Bullet b, Building build, float initialHealth){
/** If direct is false, this is an indirect hit and the tile was already damaged.
* TODO this is a mess. */
public void hitTile(Bullet b, Building build, float initialHealth, boolean direct){
if(makeFire && build.team != b.team){
Fires.create(build.tile);
}
@@ -169,8 +171,8 @@ public abstract class BulletType extends Content{
if(healPercent > 0f && build.team == b.team && !(build.block instanceof ConstructBlock)){
Fx.healBlockFull.at(build.x, build.y, build.block.size, Pal.heal);
build.heal(healPercent / 100f * build.maxHealth());
}else if(build.team != b.team){
hit(b, build.x, build.y);
}else if(build.team != b.team && direct){
hit(b);
}
}
@@ -54,7 +54,7 @@ public class RailBulletType extends BulletType{
}
@Override
public void hitTile(Bullet b, Building build, float initialHealth){
public void hitTile(Bullet b, Building build, float initialHealth, boolean direct){
handle(b, build, initialHealth);
}
}
@@ -142,7 +142,7 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
}
}
type.hitTile(self(), tile, health);
type.hitTile(self(), tile, health, true);
return !type.pierceBuilding;
}
+7 -3
View File
@@ -31,9 +31,13 @@ public class Bar extends Element{
this.fraction = fraction;
lastValue = value = Mathf.clamp(fraction.get());
update(() -> {
this.name = name.get();
this.blinkColor.set(color.get());
setColor(color.get());
try{
this.name = name.get();
this.blinkColor.set(color.get());
setColor(color.get());
}catch(Exception e){ //getting the fraction may involve referring to invalid data
this.name = "";
}
});
}
@@ -679,7 +679,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
if(sector.info.wavesSurvived >= 0 && sector.info.wavesSurvived - sector.info.wavesPassed >= 0 && !sector.isBeingPlayed()){
int toCapture = sector.info.attack || sector.info.winWave <= 1 ? -1 : sector.info.winWave - (sector.info.wave + sector.info.wavesPassed);
boolean plus = (sector.info.wavesSurvived - sector.info.wavesPassed) >= SectorDamage.maxRetWave - 1;
stable.add("[accent]Survives " + Math.min(sector.info.wavesSurvived - sector.info.wavesPassed, toCapture) +
stable.add("[accent]Survives " + Math.min(sector.info.wavesSurvived - sector.info.wavesPassed, toCapture <= 0 ? 200 : 0) +
(plus ? "+" : "") + (toCapture < 0 ? "" : "/" + toCapture) + " waves");
stable.row();
}
@@ -0,0 +1,104 @@
package mindustry.world.blocks.campaign;
import arc.Graphics.*;
import arc.Graphics.Cursor.*;
import arc.graphics.g2d.*;
import arc.math.*;
import arc.scene.ui.layout.*;
import arc.util.*;
import mindustry.annotations.Annotations.*;
import mindustry.content.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.type.*;
import mindustry.world.*;
import static mindustry.Vars.*;
public class Accelerator extends Block{
public @Load("launch-arrow") TextureRegion arrowRegion;
public Block launching = Blocks.coreNucleus;
public int[] capacities = new int[content.items().size];
public Accelerator(String name){
super(name);
update = true;
solid = true;
hasItems = true;
itemCapacity = 8000;
configurable = true;
}
@Override
public void init(){
for(ItemStack stack : launching.requirements){
capacities[stack.item.id] = stack.amount;
}
consumes.items(launching.requirements);
super.init();
}
public class AcceleratorBuild extends Building{
@Override
public void draw(){
super.draw();
for(int l = 0; l < 4; l++){
float length = 7f + l * 5f;
Draw.color(team.color, Pal.darkMetal, Mathf.absin(Time.time() + l*50f, 10f, 1f));
for(int i = 0; i < 4; i++){
float rot = i*90f + 45f;
Draw.rect(arrowRegion, x + Angles.trnsx(rot, length), y + Angles.trnsy(rot, length), rot + 180f);
}
}
float rad = size * tilesize / 2f * 0.74f;
float scl = 2f;
Draw.z(Layer.bullet - 0.0001f);
Lines.stroke(1.75f, Pal.accent);
Lines.square(x, y, rad * 1.22f, 45f);
Lines.stroke(3f, Pal.accent);
Lines.square(x, y, rad, Time.time() / scl);
Lines.square(x, y, rad, -Time.time() / scl);
Draw.color(team.color);
for(int i = 0; i < 4; i++){
float rot = i*90f + 45f + (-Time.time()/3f)%360f;
float length = 26f;
Draw.rect(arrowRegion, x + Angles.trnsx(rot, length), y + Angles.trnsy(rot, length), rot + 180f);
}
Draw.reset();
}
@Override
public Cursor getCursor(){
return !state.isCampaign() || !consValid() ? SystemCursor.arrow : super.getCursor();
}
@Override
public void buildConfiguration(Table table){
deselect();
if(!state.isCampaign() || !consValid()) return;
ui.showInfo("@indev.campaign");
}
@Override
public int getMaximumAccepted(Item item){
return capacities[item.id];
}
@Override
public boolean acceptItem(Building source, Item item){
return items.get(item) < getMaximumAccepted(item);
}
}
}
@@ -1,6 +1,8 @@
package mindustry.world.blocks.campaign;
import arc.*;
import arc.Graphics.*;
import arc.Graphics.Cursor.*;
import arc.graphics.*;
import arc.graphics.g2d.*;
import arc.math.*;
@@ -54,6 +56,11 @@ public class LaunchPad extends Block{
public class LaunchPadBuild extends Building{
@Override
public Cursor getCursor(){
return !state.isCampaign() ? SystemCursor.arrow : super.getCursor();
}
@Override
public void draw(){
super.draw();
@@ -63,6 +63,8 @@ public class CoreBlock extends StorageBlock{
CoreBlock block = (CoreBlock)tile.block();
Fx.spawn.at(entity);
player.set(entity);
if(!net.client()){
Unit unit = block.unitType.create(tile.team());
unit.set(entity);