Improved texture gen system, mech icon generation
This commit is contained in:
@@ -77,7 +77,6 @@ public class Recipes implements ContentList{
|
||||
new Recipe(crafting, CraftingBlocks.stoneFormer, new ItemStack(Items.steel, 10), new ItemStack(Items.iron, 10));
|
||||
new Recipe(crafting, CraftingBlocks.melter, new ItemStack(Items.steel, 30), new ItemStack(Items.titanium, 15));
|
||||
new Recipe(crafting, CraftingBlocks.incinerator, new ItemStack(Items.steel, 60), new ItemStack(Items.iron, 60));
|
||||
new Recipe(crafting, CraftingBlocks.weaponFactory, new ItemStack(Items.steel, 1), new ItemStack(Items.iron, 1)).setDesktop();
|
||||
|
||||
new Recipe(production, ProductionBlocks.ironDrill, new ItemStack(Items.iron, 25));
|
||||
new Recipe(production, ProductionBlocks.reinforcedDrill, new ItemStack(Items.iron, 25));
|
||||
|
||||
@@ -11,7 +11,7 @@ import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.blocks.production.*;
|
||||
|
||||
public class CraftingBlocks extends BlockList implements ContentList {
|
||||
public static Block smelter, arcsmelter, siliconsmelter, plasteelcompressor, phaseweaver, alloysmelter, alloyfuser, cryofluidmixer, melter, separator, centrifuge, biomatterCompressor, pulverizer, oilRefinery, stoneFormer, weaponFactory, incinerator;
|
||||
public static Block smelter, arcsmelter, siliconsmelter, plasteelcompressor, phaseweaver, alloysmelter, alloyfuser, cryofluidmixer, melter, separator, centrifuge, biomatterCompressor, pulverizer, oilRefinery, stoneFormer, incinerator;
|
||||
|
||||
@Override
|
||||
public void load() {
|
||||
@@ -215,11 +215,6 @@ public class CraftingBlocks extends BlockList implements ContentList {
|
||||
hasLiquids = hasItems = true;
|
||||
}};
|
||||
|
||||
weaponFactory = new MechFactory("weaponfactory") {{
|
||||
size = 2;
|
||||
health = 250;
|
||||
}};
|
||||
|
||||
incinerator = new Incinerator("incinerator") {{
|
||||
health = 90;
|
||||
}};
|
||||
|
||||
@@ -282,12 +282,11 @@ public class Player extends Unit implements BuilderTrait, CarryTrait {
|
||||
Draw.rect(mech.region, x, y, rotation -90);
|
||||
|
||||
for (int i : Mathf.signs) {
|
||||
float tra = rotation - 90,
|
||||
trX = 4*i, trY = 3 - mech.weapon.getRecoil(this, i > 0)*1.5f;
|
||||
float w = i > 0 ? -8 : 8;
|
||||
float tra = rotation - 90, trY = - mech.weapon.getRecoil(this, i > 0)*1.5f;
|
||||
float w = i > 0 ? -12 : 12;
|
||||
Draw.rect(mech.weapon.equipRegion,
|
||||
x + Angles.trnsx(tra, trX, trY),
|
||||
y + Angles.trnsy(tra, trX, trY), w, 8, rotation - 90);
|
||||
x + Angles.trnsx(tra, 0, trY),
|
||||
y + Angles.trnsy(tra, 0, trY), w, 12, rotation - 90);
|
||||
}
|
||||
|
||||
float backTrns = 4f, itemSize = 5f;
|
||||
|
||||
@@ -14,7 +14,7 @@ public class Mech extends Upgrade {
|
||||
public float armor = 1f;
|
||||
public Weapon weapon = Weapons.blaster;
|
||||
|
||||
public TextureRegion baseRegion, legRegion, region;
|
||||
public TextureRegion baseRegion, legRegion, region, iconRegion;
|
||||
|
||||
public Mech(String name, boolean flying){
|
||||
super(name);
|
||||
@@ -29,5 +29,6 @@ public class Mech extends Upgrade {
|
||||
}
|
||||
|
||||
region = Draw.region(name);
|
||||
iconRegion = Draw.optional("mech-icon-"+ name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class CoreBlock extends StorageBlock {
|
||||
if(entity.currentPlayer != null) {
|
||||
Player player = entity.currentPlayer;
|
||||
|
||||
TextureRegion region = Draw.region(player.mech.name);
|
||||
TextureRegion region = player.mech.iconRegion;
|
||||
|
||||
Shaders.build.region = region;
|
||||
Shaders.build.progress = entity.progress;
|
||||
|
||||
@@ -112,7 +112,7 @@ public class Reconstructor extends Block{
|
||||
|
||||
Player player = entity.current;
|
||||
|
||||
TextureRegion region = Draw.region(player.mech.name);
|
||||
TextureRegion region = player.mech.iconRegion;
|
||||
|
||||
Shaders.build.region = region;
|
||||
Shaders.build.progress = progress;
|
||||
@@ -253,6 +253,8 @@ public class Reconstructor extends Block{
|
||||
entity.power.amount -= ((Reconstructor)tile.block()).powerPerTeleport;
|
||||
entity.updateTime = 1f;
|
||||
entity.set(tile.drawx(), tile.drawy());
|
||||
player.rotation = 90f;
|
||||
player.baseRotation = 90f;
|
||||
player.setDead(true);
|
||||
player.setRespawning(true);
|
||||
player.setRespawning();
|
||||
|
||||
Reference in New Issue
Block a user