New launch pad / Tech tree tweaks

This commit is contained in:
Anuken
2019-03-27 22:13:40 -04:00
parent 20a681a71f
commit 50959317e9
13 changed files with 3825 additions and 3696 deletions

View File

@@ -69,7 +69,7 @@ public class Blocks implements ContentList{
mechanicalDrill, pneumaticDrill, laserDrill, blastDrill, waterExtractor, oilExtractor, cultivator,
//storage
coreShard, coreFoundation, coreNucleus, vault, container, unloader, launchPad,
coreShard, coreFoundation, coreNucleus, vault, container, unloader, launchPad, launchPadLarge,
//turrets
duo, scatter, scorch, hail, arc, wave, lancer, swarmer, salvo, fuse, ripple, cyclone, spectre, meltdown,
@@ -754,7 +754,7 @@ public class Blocks implements ContentList{
titaniumConveyor = new Conveyor("titanium-conveyor"){{
requirements(Category.distribution, ItemStack.with(Items.copper, 2, Items.lead, 1, Items.titanium, 1));
health = 65;
speed = 0.07f;
speed = 0.08f;
}};
junction = new Junction("junction"){{
@@ -1101,7 +1101,7 @@ public class Blocks implements ContentList{
}};
launchPad = new LaunchPad("launch-pad"){{
requirements(Category.effect, () -> world.isZone(), ItemStack.with(Items.copper, 500, Items.titanium, 200, Items.silicon, 200, Items.lead, 200));
requirements(Category.effect, () -> world.isZone(), ItemStack.with(Items.copper, 500, Items.silicon, 150, Items.lead, 200));
size = 3;
itemCapacity = 100;
launchTime = 60f * 8;
@@ -1109,6 +1109,16 @@ public class Blocks implements ContentList{
consumes.power(1f);
}};
launchPadLarge = new LaunchPad("launch-pad-large"){{
requirements(Category.effect, () -> world.isZone(), ItemStack.with(Items.titanium, 400, Items.silicon, 300, Items.lead, 500, Items.plastanium, 150));
size = 4;
itemCapacity = 250;
launchTime = 60f * 7;
hasPower = true;
consumes.power(2f);
}};
//endregion
//region turrets

View File

@@ -34,7 +34,7 @@ public class Fx implements ContentList{
bigShockwave, nuclearShockwave, explosion, blockExplosion, blockExplosionSmoke, shootSmall, shootHeal, shootSmallSmoke, shootBig, shootBig2, shootBigSmoke,
shootBigSmoke2, shootSmallFlame, shootPyraFlame, shootLiquid, shellEjectSmall, shellEjectMedium,
shellEjectBig, lancerLaserShoot, lancerLaserShootSmoke, lancerLaserCharge, lancerLaserChargeBegin, lightningCharge, lightningShoot,
unitSpawn, spawnShockwave, magmasmoke, impactShockwave, impactcloud, impactsmoke, dynamicExplosion;
unitSpawn, spawnShockwave, magmasmoke, impactShockwave, impactcloud, impactsmoke, dynamicExplosion, padlaunch;
@Override
public void load(){
@@ -106,6 +106,13 @@ public class Fx implements ContentList{
Lines.poly(e.x, e.y, 4, 5f + e.fin() * 12f);
Draw.reset();
});
padlaunch = new Effect(10, e -> {
Lines.stroke(4f * e.fout());
Draw.color(Pal.accent);
Lines.poly(e.x, e.y, 4, 5f + e.fin() * 60f);
Draw.reset();
});
vtolHover = new Effect(40f, e -> {
float len = e.finpow() * 10f;

View File

@@ -19,15 +19,20 @@ public class TechTree implements ContentList{
node(junction, () -> {
node(itemBridge);
node(router, () -> {
node(launchPad, () -> {
node(launchPadLarge, () -> {
});
});
node(distributor);
node(overflowGate);
node(sorter);
node(sorter, () -> {
node(overflowGate);
});
node(container, () -> {
node(unloader);
node(vault, () -> {
node(launchPad, () -> {
});
});
});

View File

@@ -1,12 +1,18 @@
package io.anuke.mindustry.world.blocks.storage;
import io.anuke.mindustry.entities.Effects;
import io.anuke.arc.graphics.g2d.Draw;
import io.anuke.arc.graphics.g2d.Lines;
import io.anuke.arc.util.Time;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.entities.Effects;
import io.anuke.mindustry.entities.type.TileEntity;
import io.anuke.mindustry.graphics.Pal;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.ItemType;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.meta.BlockStat;
import io.anuke.mindustry.world.meta.StatUnit;
import static io.anuke.mindustry.Vars.data;
import static io.anuke.mindustry.Vars.world;
@@ -23,23 +29,52 @@ public class LaunchPad extends StorageBlock{
solid = true;
}
@Override
public void setStats(){
super.setStats();
stats.add(BlockStat.launchTime, launchTime / 60f, StatUnit.seconds);
}
@Override
public boolean acceptItem(Item item, Tile tile, Tile source){
return item.type == ItemType.material && super.acceptItem(item, tile, source);
return item.type == ItemType.material && tile.entity.items.total() < itemCapacity;
}
@Override
public void draw(Tile tile){
super.draw(tile);
float progress = (tile.entity.items.total() / (float)itemCapacity) * ((tile.entity.timer.getTime(timerLaunch) / (launchTime / tile.entity.timeScale)));
float scale = size/3f;
Lines.stroke(2f);
Draw.color(Pal.accentBack);
Lines.poly(tile.drawx(), tile.drawy(), 4, scale * 10f * (1f - progress), 45 + 360f*progress);
Draw.color(Pal.accent);
if(tile.entity.cons.valid()){
for(int i = 0; i < 3; i++){
float f = (Time.time() / 100f + i * 0.5f) % 1f;
Lines.stroke(((2f * (2f - Math.abs(0.5f - f) * 2f)) - 2f + 0.2f));
Lines.poly(tile.drawx(), tile.drawy(), 4, (1f - f) * 10f * scale);
}
}
Draw.reset();
}
@Override
public void update(Tile tile){
TileEntity entity = tile.entity;
if(entity.cons.valid() && world.isZone()){
if(entity.cons.valid() && world.isZone() && entity.items.total() >= itemCapacity && entity.timer.get(timerLaunch, launchTime / entity.timeScale)){
for(Item item : Vars.content.items()){
if(entity.items.get(item) >= itemCapacity && entity.timer.get(timerLaunch, launchTime / entity.timeScale)){
//TODO play animation of some sort
Effects.effect(Fx.dooropenlarge, tile);
data.addItem(item, entity.items.get(item));
entity.items.set(item, 0);
}
Effects.effect(Fx.padlaunch, tile);
data.addItem(item, entity.items.get(item));
entity.items.set(item, 0);
}
}
}

View File

@@ -13,6 +13,7 @@ public enum BlockStat{
inputItemCapacity(StatCategory.items),
outputItemCapacity(StatCategory.items),
itemsMoved(StatCategory.items),
launchTime(StatCategory.items),
liquidCapacity(StatCategory.liquids),
liquidOutput(StatCategory.liquids),