Merged alpha and dart mech pads / Differential gen / Fixed optional display
After Width: | Height: | Size: 195 B |
After Width: | Height: | Size: 578 B |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |
Before Width: | Height: | Size: 208 B |
@ -580,8 +580,7 @@ block.pneumatic-drill.name = Pneumatic Drill
|
||||
block.laser-drill.name = Laser Drill
|
||||
block.water-extractor.name = Water Extractor
|
||||
block.cultivator.name = Cultivator
|
||||
block.alpha-mech-pad.name = Alpha Mech Pad
|
||||
block.dart-ship-pad.name = Dart Ship Pad
|
||||
block.alpha-dart-mech-pad.name = Alpha-Dart Mech Pad
|
||||
block.delta-mech-pad.name = Delta Mech Pad
|
||||
block.javelin-ship-pad.name = Javelin Ship Pad
|
||||
block.trident-ship-pad.name = Trident Ship Pad
|
||||
|
Before Width: | Height: | Size: 507 B After Width: | Height: | Size: 507 B |
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
@ -25,6 +25,8 @@ import io.anuke.mindustry.world.blocks.storage.Vault;
|
||||
import io.anuke.mindustry.world.blocks.units.MechPad;
|
||||
import io.anuke.mindustry.world.blocks.units.RepairPoint;
|
||||
import io.anuke.mindustry.world.blocks.units.UnitFactory;
|
||||
import io.anuke.mindustry.world.consumers.ConsumeItemFilter;
|
||||
import io.anuke.mindustry.world.consumers.ConsumeLiquidFilter;
|
||||
|
||||
import static io.anuke.mindustry.Vars.content;
|
||||
import static io.anuke.mindustry.Vars.state;
|
||||
@ -57,7 +59,7 @@ public class Blocks implements ContentList{
|
||||
mechanicalPump, rotaryPump, thermalPump, conduit, pulseConduit, liquidRouter, liquidTank, liquidJunction, bridgeConduit, phaseConduit,
|
||||
|
||||
//power
|
||||
combustionGenerator, thermalGenerator, turbineGenerator, rtgGenerator, solarPanel, largeSolarPanel, thoriumReactor,
|
||||
combustionGenerator, thermalGenerator, turbineGenerator, differentialGenerator, rtgGenerator, solarPanel, largeSolarPanel, thoriumReactor,
|
||||
fusionReactor, battery, batteryLarge, powerNode, powerNodeLarge, surgeTower,
|
||||
|
||||
//production
|
||||
@ -74,7 +76,7 @@ public class Blocks implements ContentList{
|
||||
fortressFactory, repairPoint,
|
||||
|
||||
//upgrades
|
||||
alphaPad, deltaPad, tauPad, omegaPad, dartPad, javelinPad, tridentPad, glaivePad;
|
||||
alphaDartPad, deltaPad, tauPad, omegaPad, javelinPad, tridentPad, glaivePad;
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
@ -639,13 +641,13 @@ public class Blocks implements ContentList{
|
||||
requirements(Category.effect, ItemStack.with(Items.lead, 200, Items.titanium, 150, Items.titanium, 150, Items.silicon, 250));
|
||||
consumes.power(3.50f);
|
||||
size = 2;
|
||||
consumes.item(Items.phasefabric).optional(true);
|
||||
consumes.item(Items.phasefabric).optional(true).boost(true);
|
||||
}};
|
||||
|
||||
forceProjector = new ForceProjector("force-projector"){{
|
||||
requirements(Category.effect, ItemStack.with(Items.lead, 200, Items.titanium, 150, Items.titanium, 150, Items.silicon, 250));
|
||||
size = 3;
|
||||
consumes.item(Items.phasefabric).optional(true);
|
||||
consumes.item(Items.phasefabric).optional(true).boost(true);
|
||||
}};
|
||||
|
||||
shockMine = new ShockMine("shock-mine"){{
|
||||
@ -845,6 +847,17 @@ public class Blocks implements ContentList{
|
||||
size = 2;
|
||||
}};
|
||||
|
||||
differentialGenerator = new TurbineGenerator("differential-generator"){{
|
||||
requirements(Category.power, ItemStack.with(Items.copper, 140, Items.titanium, 100, Items.lead, 200, Items.silicon, 130, Items.metaglass, 100));
|
||||
powerProduction = 12f;
|
||||
itemDuration = 30f;
|
||||
consumes.remove(ConsumeItemFilter.class);
|
||||
consumes.remove(ConsumeLiquidFilter.class);
|
||||
consumes.item(Items.pyratite);
|
||||
consumes.liquid(Liquids.cryofluid, 0.06f);
|
||||
size = 3;
|
||||
}};
|
||||
|
||||
rtgGenerator = new DecayGenerator("rtg-generator"){{
|
||||
requirements(Category.power, ItemStack.with(Items.lead, 200, Items.silicon, 150, Items.phasefabric, 50, Items.plastanium, 150, Items.thorium, 100));
|
||||
size = 2;
|
||||
@ -1346,7 +1359,7 @@ public class Blocks implements ContentList{
|
||||
//endregion
|
||||
//region upgrades
|
||||
|
||||
alphaPad = new MechPad("alpha-mech-pad"){{
|
||||
alphaDartPad = new MechPad("alpha-dart-mech-pad"){{
|
||||
requirements(Category.upgrade, ItemStack.with(Items.lead, 200, Items.graphite, 100, Items.copper, 150));
|
||||
mech = Mechs.alpha;
|
||||
size = 2;
|
||||
@ -1374,13 +1387,6 @@ public class Blocks implements ContentList{
|
||||
consumes.powerBuffered(120f);
|
||||
}};
|
||||
|
||||
dartPad = new MechPad("dart-ship-pad"){{
|
||||
requirements(Category.upgrade, ItemStack.with(Items.lead, 150, Items.copper, 150, Items.silicon, 200, Items.titanium, 240));
|
||||
mech = Mechs.dart;
|
||||
size = 2;
|
||||
consumes.powerBuffered(50f);
|
||||
}};
|
||||
|
||||
javelinPad = new MechPad("javelin-ship-pad"){{
|
||||
requirements(Category.upgrade, ItemStack.with(Items.lead, 350, Items.silicon, 450, Items.titanium, 500, Items.plastanium, 400, Items.phasefabric, 200));
|
||||
mech = Mechs.javelin;
|
||||
|
@ -228,8 +228,7 @@ public class TechTree implements ContentList{
|
||||
});
|
||||
});
|
||||
|
||||
node(alphaPad, () -> {
|
||||
node(dartPad);
|
||||
node(alphaDartPad, () -> {
|
||||
node(deltaPad, () -> {
|
||||
node(javelinPad);
|
||||
node(tauPad, () -> {
|
||||
|
@ -36,7 +36,6 @@ import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.Block.Icon;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.Floor;
|
||||
import io.anuke.mindustry.world.blocks.storage.CoreBlock.CoreEntity;
|
||||
|
||||
import java.io.DataInput;
|
||||
import java.io.DataOutput;
|
||||
@ -255,15 +254,6 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{
|
||||
return "Player{" + id + ", mech=" + mech.name + ", local=" + isLocal + ", " + x + ", " + y + "}";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removed(){
|
||||
|
||||
TileEntity core = getClosestCore();
|
||||
if(core != null && ((CoreEntity) core).currentUnit == this){
|
||||
((CoreEntity) core).currentUnit = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityGroup targetGroup(){
|
||||
return playerGroup;
|
||||
|
@ -9,8 +9,6 @@ public abstract class NetConnection{
|
||||
public boolean modclient;
|
||||
public boolean mobile;
|
||||
|
||||
public int lastSentSnapshotID = -1;
|
||||
|
||||
/**ID of last recieved client snapshot.*/
|
||||
public int lastRecievedClientSnapshot = -1;
|
||||
/**Timestamp of last recieved snapshot.*/
|
||||
|
@ -54,7 +54,7 @@ public class ForceProjector extends Block {
|
||||
canOverdrive = false;
|
||||
hasLiquids = true;
|
||||
hasItems = true;
|
||||
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.1f)).optional(true).update(false);
|
||||
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.1f)).optional(true).boost(true).update(false);
|
||||
consumePower = new ConsumeForceProjectorPower(60f, 60f);
|
||||
consumes.add(consumePower);
|
||||
}
|
||||
|
@ -59,7 +59,6 @@ public class ItemLiquidGenerator extends PowerGenerator{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void update(Tile tile){
|
||||
ItemLiquidGeneratorEntity entity = tile.entity();
|
||||
|
@ -144,10 +144,11 @@ public class CoreBlock extends StorageBlock{
|
||||
CoreEntity entity = tile.entity();
|
||||
|
||||
if(entity.currentUnit != null){
|
||||
if(!entity.currentUnit.isDead()){
|
||||
if(!entity.currentUnit.isDead() || !entity.currentUnit.isAdded()){
|
||||
entity.currentUnit = null;
|
||||
return;
|
||||
}
|
||||
|
||||
entity.heat = Mathf.lerpDelta(entity.heat, 1f, 0.1f);
|
||||
entity.time += entity.delta();
|
||||
entity.progress += 1f / state.rules.respawnTime * entity.delta();
|
||||
|
@ -81,7 +81,12 @@ public class MechPad extends Block{
|
||||
Mech result = ((MechPad) tile.block()).mech;
|
||||
|
||||
if(entity.player.mech == result){
|
||||
entity.player.mech = (entity.player.isMobile ? Mechs.starterMobile : Mechs.starterDesktop);
|
||||
Mech target = (entity.player.isMobile ? Mechs.starterMobile : Mechs.starterDesktop);
|
||||
if(entity.player.mech == target){
|
||||
entity.player.mech = (entity.player.isMobile ? Mechs.starterDesktop : Mechs.starterMobile);
|
||||
}else{
|
||||
entity.player.mech = target;
|
||||
}
|
||||
}else{
|
||||
entity.player.mech = result;
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ import static io.anuke.mindustry.Vars.mobile;
|
||||
/**An abstract class that defines a type of resource that a block can consume.*/
|
||||
public abstract class Consume{
|
||||
protected boolean optional;
|
||||
protected boolean update = true;
|
||||
protected boolean update = true, boost = false;
|
||||
|
||||
public Consume optional(boolean optional){
|
||||
this.optional = optional;
|
||||
@ -25,6 +25,11 @@ public abstract class Consume{
|
||||
return this;
|
||||
}
|
||||
|
||||
public Consume boost(boolean boost){
|
||||
this.boost = boost;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isOptional(){
|
||||
return optional;
|
||||
}
|
||||
|
@ -53,6 +53,6 @@ public class ConsumeItem extends Consume{
|
||||
|
||||
@Override
|
||||
public void display(BlockStats stats){
|
||||
stats.add(optional ? BlockStat.boostItem : BlockStat.inputItem, item);
|
||||
stats.add(boost ? BlockStat.boostItem : BlockStat.inputItem, item);
|
||||
}
|
||||
}
|
||||
|
@ -58,6 +58,6 @@ public class ConsumeItemFilter extends Consume{
|
||||
|
||||
@Override
|
||||
public void display(BlockStats stats){
|
||||
stats.add(optional ? BlockStat.boostItem : BlockStat.inputItem, new ItemFilterValue(filter));
|
||||
stats.add(boost ? BlockStat.boostItem : BlockStat.inputItem, new ItemFilterValue(filter));
|
||||
}
|
||||
}
|
||||
|
@ -44,6 +44,6 @@ public class ConsumeItems extends Consume{
|
||||
|
||||
@Override
|
||||
public void display(BlockStats stats){
|
||||
stats.add(optional ? BlockStat.boostItem : BlockStat.inputItems, new ItemListValue(items));
|
||||
stats.add(boost ? BlockStat.boostItem : BlockStat.inputItems, new ItemListValue(items));
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public class ConsumeLiquid extends Consume{
|
||||
|
||||
@Override
|
||||
public void display(BlockStats stats){
|
||||
if(!optional){
|
||||
if(!boost){
|
||||
stats.add(BlockStat.liquidUse, use * 60f, StatUnit.liquidSecond);
|
||||
stats.add(BlockStat.inputLiquid, liquid);
|
||||
}else{
|
||||
|
@ -62,7 +62,7 @@ public class ConsumeLiquidFilter extends Consume{
|
||||
|
||||
@Override
|
||||
public void display(BlockStats stats){
|
||||
if(optional){
|
||||
if(boost){
|
||||
stats.add(BlockStat.boostLiquid, new LiquidFilterValue(filter));
|
||||
}else if(isFuel){
|
||||
stats.add(BlockStat.inputLiquidFuel, new LiquidFilterValue(filter));
|
||||
|