Added two more generators

This commit is contained in:
Anuken
2017-10-24 21:54:21 -04:00
parent 0d750b509f
commit c3c83dc13b
12 changed files with 78 additions and 17 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 380 B

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

View File

@@ -60,6 +60,13 @@ blocks/coalgenerator
orig: 8, 8
offset: 0, 0
index: -1
blocks/combustiongenerator
rotate: false
xy: 230, 52
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/coalpurifier
rotate: false
xy: 230, 42
@@ -613,55 +620,62 @@ blocks/stonewall
orig: 8, 8
offset: 0, 0
index: -1
blocks/titanium1
blocks/thermalgenerator
rotate: false
xy: 427, 298
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titanium2
blocks/titanium1
rotate: false
xy: 437, 308
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titanium3
blocks/titanium2
rotate: false
xy: 447, 318
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titaniumdrill
blocks/titanium3
rotate: false
xy: 427, 288
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titaniumpurifier
blocks/titaniumdrill
rotate: false
xy: 437, 298
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titaniumshieldwall
blocks/titaniumpurifier
rotate: false
xy: 447, 308
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titaniumwall
blocks/titaniumshieldwall
rotate: false
xy: 437, 288
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/titaniumwall
rotate: false
xy: 447, 298
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/turret
rotate: false
xy: 397, 346
@@ -671,35 +685,35 @@ blocks/turret
index: -1
blocks/uranium1
rotate: false
xy: 447, 288
xy: 427, 278
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/uranium2
rotate: false
xy: 427, 278
xy: 437, 278
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/uranium3
rotate: false
xy: 437, 278
xy: 447, 278
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/uraniumdrill
rotate: false
xy: 447, 278
xy: 252, 173
size: 8, 8
orig: 8, 8
offset: 0, 0
index: -1
blocks/water
rotate: false
xy: 252, 173
xy: 262, 173
size: 8, 8
orig: 8, 8
offset: 0, 0
@@ -1360,7 +1374,7 @@ weapons/railgun
index: -1
weapons/triblaster
rotate: false
xy: 447, 298
xy: 447, 288
size: 8, 8
orig: 8, 8
offset: 0, 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

@@ -579,7 +579,9 @@ public class UI extends SceneModule{
Draw.region(recipe.result.name() + "-icon") : Draw.region(recipe.result.name());
header.addImage(region).size(8*5).padTop(4).units(Unit.dp);
header.add(recipe.result.formalName).padLeft(4).units(Unit.dp);
Label nameLabel = new Label(recipe.result.formalName);
nameLabel.setWrap(true);
header.add(nameLabel).padLeft(4).width(160f).units(Unit.dp);
desctable.add().pad(2).units(Unit.dp);

View File

@@ -52,6 +52,8 @@ public enum Recipe{
omnidrill(production, ProductionBlocks.omnidrill, stack(Item.titanium, 20), stack(Item.dirium, 20)),
coalgenerator(power, ProductionBlocks.coalgenerator, stack(Item.titanium, 10), stack(Item.dirium, 10)),
thermalgenerator(power, ProductionBlocks.thermalgenerator, stack(Item.titanium, 10), stack(Item.dirium, 10)),
combustiongenerator(power, ProductionBlocks.combustiongenerator, stack(Item.titanium, 10), stack(Item.dirium, 10)),
nuclearreactor(power, ProductionBlocks.nuclearReactor, stack(Item.titanium, 10), stack(Item.dirium, 10)),
shieldgenerator(power, DefenseBlocks.shieldgenerator, stack(Item.titanium, 10), stack(Item.dirium, 10)),

View File

@@ -61,6 +61,9 @@ public class DefenseBlocks{
},
shieldgenerator = new ShieldBlock("shieldgenerator"){
//TODO
{
//TODO
formalName = "shield generator";
}
};
}

View File

@@ -85,7 +85,7 @@ public class ProductionBlocks{
titaniumpurifier = new LiquidCrafter("titaniumpurifier"){
{
formalName = "titanium\nextractor";
formalName = "titanium extractor";
input = Item.iron;
inputAmount = 6;
inputLiquid = Liquid.water;
@@ -178,13 +178,46 @@ public class ProductionBlocks{
coalgenerator = new ItemPowerGenerator("coalgenerator"){
{
//TODO
formalName = "coal generator";
generateItem = Item.coal;
generateAmount = 4f;
powerCapacity = 40f;
}
},
thermalgenerator = new LiquidPowerGenerator("thermalgenerator"){
{
formalName = "thermal generator";
//TODO
generateLiquid = Liquid.lava;
inputLiquid = 2f;
generatePower = 1f;
powerCapacity = 40f;
}
@Override
public String description(){
return "Generates power from lava.";
}
},
combustiongenerator = new LiquidPowerGenerator("combustiongenerator"){
{
formalName = "combustion generator";
//TODO
generateLiquid = Liquid.oil;
inputLiquid = 2f;
generatePower = 1f;
powerCapacity = 40f;
}
@Override
public String description(){
return "Generates power from oil.";
}
},
nuclearReactor = new LiquidItemPowerGenerator("nuclearreactor"){
{
//TODO
formalName = "nuclear reactor";
width = 2;
height = 2;
generateLiquid = Liquid.water;
@@ -196,5 +229,10 @@ public class ProductionBlocks{
breaktime *= 2.2f;
powerCapacity = 100f;
}
@Override
public String description(){
return "Generates power from uranium + water.";
}
};
}

View File

@@ -34,7 +34,8 @@ public class LiquidItemPowerGenerator extends LiquidPowerGenerator{
@Override
public void update(Tile tile){
LiquidPowerEntity entity = tile.entity();
//TODO don't generate when full of energy
if(entity.liquidAmount >= inputLiquid && entity.hasItem(generateItem, itemInput)
&& Timers.get(tile, "consume", generateTime)){
entity.liquidAmount -= inputLiquid;

View File

@@ -48,6 +48,7 @@ public class LiquidPowerGenerator extends Generator implements LiquidAcceptor{
public void update(Tile tile){
LiquidPowerEntity entity = tile.entity();
//TODO don't generate when full of energy
if(entity.liquidAmount >= inputLiquid && Timers.get(tile, "consume", generateTime)){
entity.liquidAmount -= inputLiquid;
entity.power += generatePower;