Added new recipes, fixed conveyor bug

This commit is contained in:
Anuken 2018-06-26 13:54:06 -04:00
parent e407ba3ad3
commit 24ac823f06
14 changed files with 113 additions and 62 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 B

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 283 B

View File

@ -188,21 +188,21 @@ plasma-drill-top
index: -1
tungsten-drill
rotate: false
xy: 877, 347
xy: 385, 5
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
tungsten-drill-rotator
rotate: false
xy: 385, 5
xy: 395, 5
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
tungsten-drill-top
rotate: false
xy: 395, 5
xy: 405, 5
size: 8, 8
orig: 8, 8
offset: 0, 0
@ -545,49 +545,49 @@ oiledge
index: -1
rock2
rotate: false
xy: 859, 417
xy: 869, 417
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
sand-cliff-edge
rotate: false
xy: 899, 421
xy: 909, 421
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
sand-cliff-edge-1
rotate: false
xy: 909, 421
xy: 919, 421
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
sand-cliff-edge-2
rotate: false
xy: 919, 421
xy: 929, 421
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
sand-cliff-side
rotate: false
xy: 929, 421
xy: 939, 421
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
sand2
rotate: false
xy: 879, 417
xy: 889, 419
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
sand3
rotate: false
xy: 889, 419
xy: 899, 421
size: 8, 8
orig: 8, 8
offset: 0, 0
@ -601,49 +601,49 @@ sandedge
index: -1
shrubshadow
rotate: false
xy: 847, 387
xy: 857, 397
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
snow-cliff-edge
rotate: false
xy: 847, 377
xy: 857, 387
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
snow-cliff-edge-1
rotate: false
xy: 857, 387
xy: 867, 397
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
snow-cliff-edge-2
rotate: false
xy: 867, 397
xy: 877, 407
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
snow-cliff-side
rotate: false
xy: 877, 407
xy: 847, 367
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
snow2
rotate: false
xy: 857, 397
xy: 867, 407
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
snow3
rotate: false
xy: 867, 407
xy: 847, 377
size: 8, 8
orig: 8, 8
offset: 0, 0
@ -664,42 +664,42 @@ spaceedge
index: -1
stone-cliff-edge
rotate: false
xy: 867, 387
xy: 877, 397
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
stone-cliff-edge-1
rotate: false
xy: 877, 397
xy: 847, 357
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
stone-cliff-edge-2
rotate: false
xy: 847, 357
xy: 857, 367
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
stone-cliff-side
rotate: false
xy: 857, 367
xy: 867, 377
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
stone2
rotate: false
xy: 847, 367
xy: 857, 377
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
stone3
rotate: false
xy: 857, 377
xy: 867, 387
size: 8, 8
orig: 8, 8
offset: 0, 0
@ -713,91 +713,91 @@ stoneedge
index: -1
thorium1
rotate: false
xy: 867, 377
xy: 877, 387
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
thorium2
rotate: false
xy: 877, 387
xy: 857, 357
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
thorium3
rotate: false
xy: 857, 357
xy: 867, 367
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
titanium1
rotate: false
xy: 867, 367
xy: 877, 377
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
titanium2
rotate: false
xy: 877, 377
xy: 867, 357
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
titanium3
rotate: false
xy: 867, 357
xy: 877, 367
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
tungsten1
rotate: false
xy: 847, 347
xy: 857, 347
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
tungsten2
rotate: false
xy: 857, 347
xy: 867, 347
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
tungsten3
rotate: false
xy: 867, 347
xy: 877, 347
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
water-cliff-edge
rotate: false
xy: 425, 5
xy: 435, 5
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
water-cliff-edge-1
rotate: false
xy: 435, 5
xy: 445, 17
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
water-cliff-edge-2
rotate: false
xy: 445, 17
xy: 445, 7
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
water-cliff-side
rotate: false
xy: 445, 7
xy: 769, 350
size: 8, 8
orig: 8, 8
offset: 0, 0
@ -1266,7 +1266,7 @@ nuclear-reactor-lights
index: -1
rtg-generator-top
rotate: false
xy: 869, 417
xy: 879, 417
size: 8, 8
orig: 8, 8
offset: 0, 0
@ -1490,7 +1490,7 @@ pulverizer-rotator
index: -1
separator-liquid
rotate: false
xy: 939, 421
xy: 847, 407
size: 8, 8
orig: 8, 8
offset: 0, 0
@ -1726,13 +1726,20 @@ reconstructor-open
orig: 16, 16
offset: 0, 0
index: -1
repairpoint-turret
repairpoint
rotate: false
xy: 849, 417
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
repairpoint-turret
rotate: false
xy: 859, 417
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
ship-factory
rotate: false
xy: 679, 357
@ -1903,7 +1910,7 @@ shell-back
index: -1
shot
rotate: false
xy: 857, 407
xy: 847, 387
size: 8, 8
orig: 8, 8
offset: 0, 0
@ -1917,7 +1924,7 @@ transfer
index: -1
transfer-arrow
rotate: false
xy: 877, 367
xy: 877, 357
size: 8, 8
orig: 8, 8
offset: 0, 0
@ -2741,13 +2748,6 @@ block-icon-repairpoint
orig: 8, 8
offset: 0, 0
index: -1
repairpoint
rotate: false
xy: 777, 401
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
block-icon-resupplypoint
rotate: false
xy: 807, 421
@ -5130,42 +5130,42 @@ generic-weapon
index: -1
shockgun
rotate: false
xy: 847, 407
xy: 847, 397
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
shockgun-equip
rotate: false
xy: 847, 397
xy: 857, 407
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
triblaster
rotate: false
xy: 877, 357
xy: 949, 423
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
triblaster-equip
rotate: false
xy: 949, 423
xy: 847, 347
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
vulcan
rotate: false
xy: 405, 5
xy: 415, 5
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
vulcan-equip
rotate: false
xy: 415, 5
xy: 425, 5
size: 8, 8
orig: 8, 8
offset: 0, 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

After

Width:  |  Height:  |  Size: 123 KiB

View File

@ -20,6 +20,12 @@ public class Recipes implements ContentList{
new Recipe(defense, DefenseBlocks.carbideWall, new ItemStack(Items.carbide, 12));
new Recipe(defense, DefenseBlocks.carbideWallLarge, new ItemStack(Items.carbide, 12*4));
new Recipe(defense, DefenseBlocks.thoriumWall, new ItemStack(Items.thorium, 12));
new Recipe(defense, DefenseBlocks.thoriumWallLarge, new ItemStack(Items.thorium, 12*4));
new Recipe(defense, DefenseBlocks.door, new ItemStack(Items.carbide, 12), new ItemStack(Items.silicon, 8));
new Recipe(defense, DefenseBlocks.doorLarge, new ItemStack(Items.carbide, 12*4), new ItemStack(Items.silicon, 8*4));
//TURRETS
new Recipe(weapon, TurretBlocks.duo, new ItemStack(Items.tungsten, 20));
new Recipe(weapon, TurretBlocks.scorch, new ItemStack(Items.tungsten, 25), new ItemStack(Items.carbide, 20));
@ -52,6 +58,14 @@ public class Recipes implements ContentList{
new Recipe(crafting, CraftingBlocks.arcsmelter, new ItemStack(Items.tungsten, 90), new ItemStack(Items.carbide, 60), new ItemStack(Items.lead, 50));
new Recipe(crafting, CraftingBlocks.siliconsmelter, new ItemStack(Items.tungsten, 60), new ItemStack(Items.lead, 50));
//other crafting
//TODO phaseweaver sprites
new Recipe(crafting, CraftingBlocks.phaseweaver, new ItemStack(Items.silicon, 160), new ItemStack(Items.lead, 160), new ItemStack(Items.thorium, 150));
//TODO implement alloy smelter
// new Recipe(crafting, CraftingBlocks.alloySmelter, new ItemStack(Items.silicon, 160), new ItemStack(Items.lead, 160), new ItemStack(Items.thorium, 140));
new Recipe(crafting, CraftingBlocks.plasteelcompressor, new ItemStack(Items.silicon, 60), new ItemStack(Items.lead, 170), new ItemStack(Items.titanium, 170));
//misc
new Recipe(crafting, CraftingBlocks.pulverizer, new ItemStack(Items.tungsten, 60), new ItemStack(Items.lead, 50));
new Recipe(crafting, CraftingBlocks.thermiteMixer, new ItemStack(Items.tungsten, 100), new ItemStack(Items.lead, 50));
@ -81,7 +95,7 @@ public class Recipes implements ContentList{
//DRILLS, PRODUCERS
new Recipe(production, ProductionBlocks.tungstenDrill, new ItemStack(Items.tungsten, 30));
new Recipe(production, ProductionBlocks.carbideDrill, new ItemStack(Items.tungsten, 60), new ItemStack(Items.carbide, 60));
new Recipe(production, ProductionBlocks.laserdrill, new ItemStack(Items.tungsten, 80), new ItemStack(Items.carbide, 90), new ItemStack(Items.silicon, 60), new ItemStack(Items.titanium, 80));
new Recipe(production, ProductionBlocks.laserdrill, new ItemStack(Items.tungsten, 90), new ItemStack(Items.carbide, 110), new ItemStack(Items.silicon, 70), new ItemStack(Items.titanium, 80));
new Recipe(production, ProductionBlocks.waterextractor, new ItemStack(Items.tungsten, 50), new ItemStack(Items.carbide, 50), new ItemStack(Items.lead, 40));
new Recipe(production, ProductionBlocks.cultivator, new ItemStack(Items.tungsten, 20), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 20));
@ -99,6 +113,7 @@ public class Recipes implements ContentList{
//actual unit related stuff
new Recipe(units, UnitBlocks.droneFactory, new ItemStack(Items.tungsten, 30), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 80));
new Recipe(units, UnitBlocks.repairPoint, new ItemStack(Items.lead, 30), new ItemStack(Items.tungsten, 30), new ItemStack(Items.silicon, 30));
new Recipe(units, UnitBlocks.resupplyPoint, new ItemStack(Items.lead, 30), new ItemStack(Items.tungsten, 30), new ItemStack(Items.silicon, 30));
//LIQUIDS
new Recipe(liquid, LiquidBlocks.conduit, new ItemStack(Items.lead, 1));

View File

@ -9,7 +9,7 @@ import io.anuke.mindustry.world.blocks.defense.Door;
import io.anuke.mindustry.world.blocks.defense.PhaseWall;
public class DefenseBlocks extends BlockList implements ContentList {
public static Block tungstenWall, tungstenWallLarge, carbideWall, carbideWallLarge, thoriumWall, thoriumWallLarge, door, largedoor, deflectorwall, deflectorwalllarge,
public static Block tungstenWall, tungstenWallLarge, carbideWall, carbideWallLarge, thoriumWall, thoriumWallLarge, door, doorLarge, deflectorwall, deflectorwalllarge,
phasewall, phasewalllarge;
@Override
@ -63,13 +63,13 @@ public class DefenseBlocks extends BlockList implements ContentList {
}};
door = new Door("door") {{
health = 90 * wallHealthMultiplier;
health = 100 * wallHealthMultiplier;
}};
largedoor = new Door("door-large") {{
doorLarge = new Door("door-large") {{
openfx = BlockFx.dooropenlarge;
closefx = BlockFx.doorcloselarge;
health = 90 * 4 * wallHealthMultiplier;
health = 100 * 4 * wallHealthMultiplier;
size = 2;
}};
}

View File

@ -90,6 +90,10 @@ public class TileEntity extends BaseEntity implements TargetTrait {
}
}
public boolean isSleeping(){
return sleeping;
}
public boolean isDead() {
return dead;
}

View File

@ -7,6 +7,7 @@ import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.game.UnlockableContent;
import io.anuke.mindustry.world.Block;
import static io.anuke.mindustry.Vars.debug;
import static io.anuke.mindustry.Vars.headless;
public class Recipe implements UnlockableContent{
@ -73,7 +74,7 @@ public class Recipe implements UnlockableContent{
r.clear();
for(Recipe recipe : allRecipes){
if(recipe.category == category && Vars.control.database().isUnlocked(recipe)) {
if(recipe.category == category && (Vars.control.database().isUnlocked(recipe) || (debug && recipe.debugOnly))) {
r.add(recipe);
}
}

View File

@ -17,6 +17,7 @@ import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.util.Geometry;
import io.anuke.ucore.util.Mathf;
import static io.anuke.mindustry.Vars.headless;
import static io.anuke.mindustry.Vars.world;
public class Floor extends Block{

View File

@ -2,6 +2,7 @@ package io.anuke.mindustry.world.blocks.distribution;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.GridPoint2;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.LongArray;
import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.Unit;
@ -122,6 +123,8 @@ public class Conveyor extends Block{
public void unitOn(Tile tile, Unit unit) {
ConveyorEntity entity = tile.entity();
entity.wakeUp();
float speed = this.speed * tilesize / 2.3f;
float tx = Geometry.d4[tile.getRotation()].x, ty = Geometry.d4[tile.getRotation()].y;
@ -206,7 +209,6 @@ public class Conveyor extends Block{
}
if (minremove != Integer.MAX_VALUE) entity.convey.truncate(minremove);
}
@Override
@ -295,6 +297,20 @@ public class Conveyor extends Block{
}
}
@Override
public Array<Object> getDebugInfo(Tile tile) {
ConveyorEntity entity = tile.entity();
Array<Object> arr = super.getDebugInfo(tile);
arr.addAll(Array.with(
"mincarry", entity.minCarry,
"minitem", entity.minCarry,
"carrying", entity.carrying,
"clogHeat", entity.clogHeat,
"sleeping", entity.isSleeping()
));
return arr;
}
@Override
public TileEntity getEntity(){
return new ConveyorEntity();

View File

@ -1,6 +1,7 @@
package io.anuke.mindustry.world.blocks.units;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Rectangle;
import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.entities.Unit;
@ -27,6 +28,8 @@ public class RepairPoint extends Block{
protected float repairSpeed = 0.3f;
protected float powerUsage = 0.2f;
protected TextureRegion topRegion;
public RepairPoint(String name) {
super(name);
update = true;
@ -38,6 +41,13 @@ public class RepairPoint extends Block{
powerCapacity = 20f;
}
@Override
public void load() {
super.load();
topRegion = Draw.region(name + "-turret");
}
@Override
public void drawSelect(Tile tile){
Draw.color(Palette.accent);
@ -49,7 +59,7 @@ public class RepairPoint extends Block{
public void drawLayer(Tile tile) {
RepairPointEntity entity = tile.entity();
Draw.rect(name + "-turret", tile.drawx(), tile.drawy(), entity.rotation - 90);
Draw.rect(topRegion, tile.drawx(), tile.drawy(), entity.rotation - 90);
}
@Override

View File

@ -27,6 +27,9 @@ public class Generators {
Image image = context.get(regions[0]);
for(TextureRegion region : regions){
if(region == null){
context.err("Error in block \"{0}\": null region!", block.name);
}
image.draw(region);
}

View File

@ -8,6 +8,7 @@ import java.io.IOException;
public class PackerLauncher {
public static void main(String[] args) throws IOException {
Vars.headless = true;
ImageContext context = new ImageContext();
context.load();
Timers.mark();