Merged alpha and dart mech pads / Differential gen / Fixed optional display

This commit is contained in:
Anuken
2019-02-02 17:39:46 -05:00
parent 696e6cb84b
commit 8e8e95cd2d
22 changed files with 1430 additions and 1442 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 B

View File

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

View File

@@ -580,8 +580,7 @@ block.pneumatic-drill.name = Pneumatic Drill
block.laser-drill.name = Laser Drill block.laser-drill.name = Laser Drill
block.water-extractor.name = Water Extractor block.water-extractor.name = Water Extractor
block.cultivator.name = Cultivator block.cultivator.name = Cultivator
block.alpha-mech-pad.name = Alpha Mech Pad block.alpha-dart-mech-pad.name = Alpha-Dart Mech Pad
block.dart-ship-pad.name = Dart Ship Pad
block.delta-mech-pad.name = Delta Mech Pad block.delta-mech-pad.name = Delta Mech Pad
block.javelin-ship-pad.name = Javelin Ship Pad block.javelin-ship-pad.name = Javelin Ship Pad
block.trident-ship-pad.name = Trident Ship Pad block.trident-ship-pad.name = Trident Ship Pad

Binary file not shown.

Before

Width:  |  Height:  |  Size: 507 B

After

Width:  |  Height:  |  Size: 507 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@@ -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.MechPad;
import io.anuke.mindustry.world.blocks.units.RepairPoint; import io.anuke.mindustry.world.blocks.units.RepairPoint;
import io.anuke.mindustry.world.blocks.units.UnitFactory; 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.content;
import static io.anuke.mindustry.Vars.state; 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, mechanicalPump, rotaryPump, thermalPump, conduit, pulseConduit, liquidRouter, liquidTank, liquidJunction, bridgeConduit, phaseConduit,
//power //power
combustionGenerator, thermalGenerator, turbineGenerator, rtgGenerator, solarPanel, largeSolarPanel, thoriumReactor, combustionGenerator, thermalGenerator, turbineGenerator, differentialGenerator, rtgGenerator, solarPanel, largeSolarPanel, thoriumReactor,
fusionReactor, battery, batteryLarge, powerNode, powerNodeLarge, surgeTower, fusionReactor, battery, batteryLarge, powerNode, powerNodeLarge, surgeTower,
//production //production
@@ -74,7 +76,7 @@ public class Blocks implements ContentList{
fortressFactory, repairPoint, fortressFactory, repairPoint,
//upgrades //upgrades
alphaPad, deltaPad, tauPad, omegaPad, dartPad, javelinPad, tridentPad, glaivePad; alphaDartPad, deltaPad, tauPad, omegaPad, javelinPad, tridentPad, glaivePad;
@Override @Override
public void load(){ 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)); requirements(Category.effect, ItemStack.with(Items.lead, 200, Items.titanium, 150, Items.titanium, 150, Items.silicon, 250));
consumes.power(3.50f); consumes.power(3.50f);
size = 2; size = 2;
consumes.item(Items.phasefabric).optional(true); consumes.item(Items.phasefabric).optional(true).boost(true);
}}; }};
forceProjector = new ForceProjector("force-projector"){{ forceProjector = new ForceProjector("force-projector"){{
requirements(Category.effect, ItemStack.with(Items.lead, 200, Items.titanium, 150, Items.titanium, 150, Items.silicon, 250)); requirements(Category.effect, ItemStack.with(Items.lead, 200, Items.titanium, 150, Items.titanium, 150, Items.silicon, 250));
size = 3; size = 3;
consumes.item(Items.phasefabric).optional(true); consumes.item(Items.phasefabric).optional(true).boost(true);
}}; }};
shockMine = new ShockMine("shock-mine"){{ shockMine = new ShockMine("shock-mine"){{
@@ -845,6 +847,17 @@ public class Blocks implements ContentList{
size = 2; 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"){{ 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)); requirements(Category.power, ItemStack.with(Items.lead, 200, Items.silicon, 150, Items.phasefabric, 50, Items.plastanium, 150, Items.thorium, 100));
size = 2; size = 2;
@@ -1346,7 +1359,7 @@ public class Blocks implements ContentList{
//endregion //endregion
//region upgrades //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)); requirements(Category.upgrade, ItemStack.with(Items.lead, 200, Items.graphite, 100, Items.copper, 150));
mech = Mechs.alpha; mech = Mechs.alpha;
size = 2; size = 2;
@@ -1374,13 +1387,6 @@ public class Blocks implements ContentList{
consumes.powerBuffered(120f); 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"){{ 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)); requirements(Category.upgrade, ItemStack.with(Items.lead, 350, Items.silicon, 450, Items.titanium, 500, Items.plastanium, 400, Items.phasefabric, 200));
mech = Mechs.javelin; mech = Mechs.javelin;

View File

@@ -228,8 +228,7 @@ public class TechTree implements ContentList{
}); });
}); });
node(alphaPad, () -> { node(alphaDartPad, () -> {
node(dartPad);
node(deltaPad, () -> { node(deltaPad, () -> {
node(javelinPad); node(javelinPad);
node(tauPad, () -> { node(tauPad, () -> {

View File

@@ -36,7 +36,6 @@ import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Block.Icon; import io.anuke.mindustry.world.Block.Icon;
import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.Floor; import io.anuke.mindustry.world.blocks.Floor;
import io.anuke.mindustry.world.blocks.storage.CoreBlock.CoreEntity;
import java.io.DataInput; import java.io.DataInput;
import java.io.DataOutput; 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 + "}"; 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 @Override
public EntityGroup targetGroup(){ public EntityGroup targetGroup(){
return playerGroup; return playerGroup;

View File

@@ -9,8 +9,6 @@ public abstract class NetConnection{
public boolean modclient; public boolean modclient;
public boolean mobile; public boolean mobile;
public int lastSentSnapshotID = -1;
/**ID of last recieved client snapshot.*/ /**ID of last recieved client snapshot.*/
public int lastRecievedClientSnapshot = -1; public int lastRecievedClientSnapshot = -1;
/**Timestamp of last recieved snapshot.*/ /**Timestamp of last recieved snapshot.*/

View File

@@ -54,7 +54,7 @@ public class ForceProjector extends Block {
canOverdrive = false; canOverdrive = false;
hasLiquids = true; hasLiquids = true;
hasItems = 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); consumePower = new ConsumeForceProjectorPower(60f, 60f);
consumes.add(consumePower); consumes.add(consumePower);
} }

View File

@@ -59,7 +59,6 @@ public class ItemLiquidGenerator extends PowerGenerator{
} }
} }
@Override @Override
public void update(Tile tile){ public void update(Tile tile){
ItemLiquidGeneratorEntity entity = tile.entity(); ItemLiquidGeneratorEntity entity = tile.entity();

View File

@@ -144,10 +144,11 @@ public class CoreBlock extends StorageBlock{
CoreEntity entity = tile.entity(); CoreEntity entity = tile.entity();
if(entity.currentUnit != null){ if(entity.currentUnit != null){
if(!entity.currentUnit.isDead()){ if(!entity.currentUnit.isDead() || !entity.currentUnit.isAdded()){
entity.currentUnit = null; entity.currentUnit = null;
return; return;
} }
entity.heat = Mathf.lerpDelta(entity.heat, 1f, 0.1f); entity.heat = Mathf.lerpDelta(entity.heat, 1f, 0.1f);
entity.time += entity.delta(); entity.time += entity.delta();
entity.progress += 1f / state.rules.respawnTime * entity.delta(); entity.progress += 1f / state.rules.respawnTime * entity.delta();

View File

@@ -81,7 +81,12 @@ public class MechPad extends Block{
Mech result = ((MechPad) tile.block()).mech; Mech result = ((MechPad) tile.block()).mech;
if(entity.player.mech == result){ 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{ }else{
entity.player.mech = result; entity.player.mech = result;
} }

View File

@@ -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.*/ /**An abstract class that defines a type of resource that a block can consume.*/
public abstract class Consume{ public abstract class Consume{
protected boolean optional; protected boolean optional;
protected boolean update = true; protected boolean update = true, boost = false;
public Consume optional(boolean optional){ public Consume optional(boolean optional){
this.optional = optional; this.optional = optional;
@@ -25,6 +25,11 @@ public abstract class Consume{
return this; return this;
} }
public Consume boost(boolean boost){
this.boost = boost;
return this;
}
public boolean isOptional(){ public boolean isOptional(){
return optional; return optional;
} }

View File

@@ -53,6 +53,6 @@ public class ConsumeItem extends Consume{
@Override @Override
public void display(BlockStats stats){ public void display(BlockStats stats){
stats.add(optional ? BlockStat.boostItem : BlockStat.inputItem, item); stats.add(boost ? BlockStat.boostItem : BlockStat.inputItem, item);
} }
} }

View File

@@ -58,6 +58,6 @@ public class ConsumeItemFilter extends Consume{
@Override @Override
public void display(BlockStats stats){ 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));
} }
} }

View File

@@ -44,6 +44,6 @@ public class ConsumeItems extends Consume{
@Override @Override
public void display(BlockStats stats){ 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));
} }
} }

View File

@@ -47,7 +47,7 @@ public class ConsumeLiquid extends Consume{
@Override @Override
public void display(BlockStats stats){ public void display(BlockStats stats){
if(!optional){ if(!boost){
stats.add(BlockStat.liquidUse, use * 60f, StatUnit.liquidSecond); stats.add(BlockStat.liquidUse, use * 60f, StatUnit.liquidSecond);
stats.add(BlockStat.inputLiquid, liquid); stats.add(BlockStat.inputLiquid, liquid);
}else{ }else{

View File

@@ -62,7 +62,7 @@ public class ConsumeLiquidFilter extends Consume{
@Override @Override
public void display(BlockStats stats){ public void display(BlockStats stats){
if(optional){ if(boost){
stats.add(BlockStat.boostLiquid, new LiquidFilterValue(filter)); stats.add(BlockStat.boostLiquid, new LiquidFilterValue(filter));
}else if(isFuel){ }else if(isFuel){
stats.add(BlockStat.inputLiquidFuel, new LiquidFilterValue(filter)); stats.add(BlockStat.inputLiquidFuel, new LiquidFilterValue(filter));