Power tweaks
This commit is contained in:
@@ -248,7 +248,7 @@ public class Blocks implements ContentList{
|
|||||||
hasItems = true;
|
hasItems = true;
|
||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
|
|
||||||
consumes.power(0.2f);
|
consumes.power(2f);
|
||||||
consumes.item(Items.coal, 2);
|
consumes.item(Items.coal, 2);
|
||||||
consumes.liquid(Liquids.water, 0.1f);
|
consumes.liquid(Liquids.water, 0.1f);
|
||||||
}};
|
}};
|
||||||
@@ -263,7 +263,7 @@ public class Blocks implements ContentList{
|
|||||||
flameColor = Color.valueOf("ffef99");
|
flameColor = Color.valueOf("ffef99");
|
||||||
|
|
||||||
consumes.items(new ItemStack(Items.coal, 1), new ItemStack(Items.sand, 2));
|
consumes.items(new ItemStack(Items.coal, 1), new ItemStack(Items.sand, 2));
|
||||||
consumes.power(0.05f);
|
consumes.power(0.50f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
plastaniumCompressor = new PlastaniumCompressor("plastanium-compressor"){{
|
plastaniumCompressor = new PlastaniumCompressor("plastanium-compressor"){{
|
||||||
@@ -279,7 +279,7 @@ public class Blocks implements ContentList{
|
|||||||
updateEffect = Fx.plasticburn;
|
updateEffect = Fx.plasticburn;
|
||||||
|
|
||||||
consumes.liquid(Liquids.oil, 0.25f);
|
consumes.liquid(Liquids.oil, 0.25f);
|
||||||
consumes.power(0.3f);
|
consumes.power(3f);
|
||||||
consumes.item(Items.titanium, 2);
|
consumes.item(Items.titanium, 2);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -291,7 +291,7 @@ public class Blocks implements ContentList{
|
|||||||
size = 2;
|
size = 2;
|
||||||
|
|
||||||
consumes.items(new ItemStack(Items.thorium, 4), new ItemStack(Items.sand, 10));
|
consumes.items(new ItemStack(Items.thorium, 4), new ItemStack(Items.sand, 10));
|
||||||
consumes.power(0.5f);
|
consumes.power(5f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
surgeSmelter = new PowerSmelter("alloy-smelter"){{
|
surgeSmelter = new PowerSmelter("alloy-smelter"){{
|
||||||
@@ -304,7 +304,7 @@ public class Blocks implements ContentList{
|
|||||||
useFlux = true;
|
useFlux = true;
|
||||||
fluxNeeded = 3;
|
fluxNeeded = 3;
|
||||||
|
|
||||||
consumes.power(0.4f);
|
consumes.power(4f);
|
||||||
consumes.items(new ItemStack(Items.titanium, 2), new ItemStack(Items.lead, 4), new ItemStack(Items.silicon, 3), new ItemStack(Items.copper, 3));
|
consumes.items(new ItemStack(Items.titanium, 2), new ItemStack(Items.lead, 4), new ItemStack(Items.silicon, 3), new ItemStack(Items.copper, 3));
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -315,7 +315,7 @@ public class Blocks implements ContentList{
|
|||||||
size = 2;
|
size = 2;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
|
|
||||||
consumes.power(0.1f);
|
consumes.power(1f);
|
||||||
consumes.item(Items.titanium);
|
consumes.item(Items.titanium);
|
||||||
consumes.liquid(Liquids.water, 0.3f);
|
consumes.liquid(Liquids.water, 0.3f);
|
||||||
}};
|
}};
|
||||||
@@ -330,7 +330,7 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
consumes.liquid(Liquids.oil, 0.05f);
|
consumes.liquid(Liquids.oil, 0.05f);
|
||||||
consumes.item(Items.pyratite, 1);
|
consumes.item(Items.pyratite, 1);
|
||||||
consumes.power(0.04f);
|
consumes.power(0.40f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
pyratiteMixer = new PowerSmelter("pyratite-mixer"){{
|
pyratiteMixer = new PowerSmelter("pyratite-mixer"){{
|
||||||
@@ -342,7 +342,7 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
size = 2;
|
size = 2;
|
||||||
|
|
||||||
consumes.power(0.02f);
|
consumes.power(0.20f);
|
||||||
consumes.items(new ItemStack(Items.coal, 1), new ItemStack(Items.lead, 2), new ItemStack(Items.sand, 2));
|
consumes.items(new ItemStack(Items.coal, 1), new ItemStack(Items.lead, 2), new ItemStack(Items.sand, 2));
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -354,7 +354,7 @@ public class Blocks implements ContentList{
|
|||||||
craftTime = 10f;
|
craftTime = 10f;
|
||||||
hasLiquids = hasPower = true;
|
hasLiquids = hasPower = true;
|
||||||
|
|
||||||
consumes.power(0.1f);
|
consumes.power(1f);
|
||||||
consumes.item(Items.scrap, 1);
|
consumes.item(Items.scrap, 1);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -389,7 +389,7 @@ public class Blocks implements ContentList{
|
|||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
|
|
||||||
consumes.item(Items.biomatter, 1);
|
consumes.item(Items.biomatter, 1);
|
||||||
consumes.power(0.06f);
|
consumes.power(0.60f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
pulverizer = new Pulverizer("pulverizer"){{
|
pulverizer = new Pulverizer("pulverizer"){{
|
||||||
@@ -401,12 +401,13 @@ public class Blocks implements ContentList{
|
|||||||
hasItems = hasPower = true;
|
hasItems = hasPower = true;
|
||||||
|
|
||||||
consumes.item(Items.scrap, 1);
|
consumes.item(Items.scrap, 1);
|
||||||
consumes.power(0.05f);
|
consumes.power(0.50f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
incinerator = new Incinerator("incinerator"){{
|
incinerator = new Incinerator("incinerator"){{
|
||||||
requirements(Category.crafting, ItemStack.with(Items.graphite, 10, Items.lead, 30));
|
requirements(Category.crafting, ItemStack.with(Items.graphite, 10, Items.lead, 30));
|
||||||
health = 90;
|
health = 90;
|
||||||
|
consumes.power(0.50f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
@@ -514,14 +515,14 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
mendProjector = new MendProjector("mend-projector"){{
|
mendProjector = new MendProjector("mend-projector"){{
|
||||||
requirements(Category.effect, ItemStack.with(Items.lead, 200, Items.titanium, 150, Items.titanium, 50, Items.silicon, 180));
|
requirements(Category.effect, ItemStack.with(Items.lead, 200, Items.titanium, 150, Items.titanium, 50, Items.silicon, 180));
|
||||||
consumes.power(0.2f, 1.0f);
|
consumes.power(2f);
|
||||||
size = 2;
|
size = 2;
|
||||||
consumes.item(Items.phasefabric).optional(true);
|
consumes.item(Items.phasefabric).optional(true);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
overdriveProjector = new OverdriveProjector("overdrive-projector"){{
|
overdriveProjector = new OverdriveProjector("overdrive-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));
|
||||||
consumes.power(0.35f, 1.0f);
|
consumes.power(3.50f);
|
||||||
size = 2;
|
size = 2;
|
||||||
consumes.item(Items.phasefabric).optional(true);
|
consumes.item(Items.phasefabric).optional(true);
|
||||||
}};
|
}};
|
||||||
@@ -573,7 +574,7 @@ public class Blocks implements ContentList{
|
|||||||
requirements(Category.distribution, ItemStack.with(Items.phasefabric, 10, Items.silicon, 15, Items.lead, 20, Items.graphite, 20));
|
requirements(Category.distribution, ItemStack.with(Items.phasefabric, 10, Items.silicon, 15, Items.lead, 20, Items.graphite, 20));
|
||||||
range = 12;
|
range = 12;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
consumes.power(0.03f, 1.0f);
|
consumes.power(0.30f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
sorter = new Sorter("sorter"){{
|
sorter = new Sorter("sorter"){{
|
||||||
@@ -615,7 +616,7 @@ public class Blocks implements ContentList{
|
|||||||
rotaryPump = new Pump("rotary-pump"){{
|
rotaryPump = new Pump("rotary-pump"){{
|
||||||
requirements(Category.liquid, ItemStack.with(Items.copper, 140, Items.lead, 100, Items.silicon, 40, Items.titanium, 70));
|
requirements(Category.liquid, ItemStack.with(Items.copper, 140, Items.lead, 100, Items.silicon, 40, Items.titanium, 70));
|
||||||
pumpAmount = 0.2f;
|
pumpAmount = 0.2f;
|
||||||
consumes.power(0.015f);
|
consumes.power(1.50f);
|
||||||
liquidCapacity = 30f;
|
liquidCapacity = 30f;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
size = 2;
|
size = 2;
|
||||||
@@ -625,7 +626,7 @@ public class Blocks implements ContentList{
|
|||||||
thermalPump = new Pump("thermal-pump"){{
|
thermalPump = new Pump("thermal-pump"){{
|
||||||
requirements(Category.liquid, ItemStack.with(Items.copper, 160, Items.lead, 130, Items.silicon, 60, Items.titanium, 80, Items.thorium, 70));
|
requirements(Category.liquid, ItemStack.with(Items.copper, 160, Items.lead, 130, Items.silicon, 60, Items.titanium, 80, Items.thorium, 70));
|
||||||
pumpAmount = 0.275f;
|
pumpAmount = 0.275f;
|
||||||
consumes.power(0.03f);
|
consumes.power(0.30f);
|
||||||
liquidCapacity = 40f;
|
liquidCapacity = 40f;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
size = 2;
|
size = 2;
|
||||||
@@ -670,7 +671,7 @@ public class Blocks implements ContentList{
|
|||||||
requirements(Category.liquid, ItemStack.with(Items.phasefabric, 10, Items.silicon, 15, Items.lead, 20, Items.titanium, 20));
|
requirements(Category.liquid, ItemStack.with(Items.phasefabric, 10, Items.silicon, 15, Items.lead, 20, Items.titanium, 20));
|
||||||
range = 12;
|
range = 12;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
consumes.power(0.03f, 1.0f);
|
consumes.power(0.30f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
@@ -692,19 +693,19 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
battery = new Battery("battery"){{
|
battery = new Battery("battery"){{
|
||||||
requirements(Category.power, ItemStack.with(Items.copper, 8, Items.lead, 30, Items.silicon, 4));
|
requirements(Category.power, ItemStack.with(Items.copper, 8, Items.lead, 30, Items.silicon, 4));
|
||||||
consumes.powerBuffered(320f, 1f);
|
consumes.powerBuffered(3200f, 1f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
batteryLarge = new Battery("battery-large"){{
|
batteryLarge = new Battery("battery-large"){{
|
||||||
requirements(Category.power, ItemStack.with(Items.titanium, 40, Items.lead, 80, Items.silicon, 30));
|
requirements(Category.power, ItemStack.with(Items.titanium, 40, Items.lead, 80, Items.silicon, 30));
|
||||||
requirements(Category.power, ItemStack.with(Items.copper, 8, Items.lead, 30, Items.silicon, 4));
|
requirements(Category.power, ItemStack.with(Items.copper, 8, Items.lead, 30, Items.silicon, 4));
|
||||||
size = 3;
|
size = 3;
|
||||||
consumes.powerBuffered(2000f, 1f);
|
consumes.powerBuffered(20000f, 1f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
combustionGenerator = new BurnerGenerator("combustion-generator"){{
|
combustionGenerator = new BurnerGenerator("combustion-generator"){{
|
||||||
requirements(Category.power, ItemStack.with(Items.copper, 50, Items.lead, 30));
|
requirements(Category.power, ItemStack.with(Items.copper, 50, Items.lead, 30));
|
||||||
powerProduction = 0.09f;
|
powerProduction = 1f;
|
||||||
itemDuration = 40f;
|
itemDuration = 40f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -717,7 +718,7 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
turbineGenerator = new TurbineGenerator("turbine-generator"){{
|
turbineGenerator = new TurbineGenerator("turbine-generator"){{
|
||||||
requirements(Category.power, ItemStack.with(Items.copper, 70, Items.graphite, 50, Items.lead, 80, Items.silicon, 60));
|
requirements(Category.power, ItemStack.with(Items.copper, 70, Items.graphite, 50, Items.lead, 80, Items.silicon, 60));
|
||||||
powerProduction = 0.28f;
|
powerProduction = 4f;
|
||||||
itemDuration = 30f;
|
itemDuration = 30f;
|
||||||
consumes.liquid(Liquids.water, 0.05f);
|
consumes.liquid(Liquids.water, 0.05f);
|
||||||
size = 2;
|
size = 2;
|
||||||
@@ -726,26 +727,26 @@ public class Blocks implements ContentList{
|
|||||||
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;
|
||||||
powerProduction = 0.3f;
|
powerProduction = 3f;
|
||||||
itemDuration = 220f;
|
itemDuration = 220f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
solarPanel = new SolarGenerator("solar-panel"){{
|
solarPanel = new SolarGenerator("solar-panel"){{
|
||||||
requirements(Category.power, ItemStack.with(Items.lead, 20, Items.silicon, 30));
|
requirements(Category.power, ItemStack.with(Items.lead, 20, Items.silicon, 30));
|
||||||
powerProduction = 0.0045f;
|
powerProduction = 0.045f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
largeSolarPanel = new SolarGenerator("solar-panel-large"){{
|
largeSolarPanel = new SolarGenerator("solar-panel-large"){{
|
||||||
requirements(Category.power, ItemStack.with(Items.lead, 200, Items.silicon, 290, Items.phasefabric, 30));
|
requirements(Category.power, ItemStack.with(Items.lead, 200, Items.silicon, 290, Items.phasefabric, 30));
|
||||||
size = 3;
|
size = 3;
|
||||||
powerProduction = 0.055f;
|
powerProduction = 0.55f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
thoriumReactor = new NuclearReactor("thorium-reactor"){{
|
thoriumReactor = new NuclearReactor("thorium-reactor"){{
|
||||||
requirements(Category.power, ItemStack.with(Items.lead, 600, Items.silicon, 400, Items.graphite, 300, Items.thorium, 300));
|
requirements(Category.power, ItemStack.with(Items.lead, 600, Items.silicon, 400, Items.graphite, 300, Items.thorium, 300));
|
||||||
size = 3;
|
size = 3;
|
||||||
health = 700;
|
health = 700;
|
||||||
powerProduction = 1.1f;
|
powerProduction = 11f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
fusionReactor = new FusionReactor("fusion-reactor"){{
|
fusionReactor = new FusionReactor("fusion-reactor"){{
|
||||||
@@ -781,7 +782,7 @@ public class Blocks implements ContentList{
|
|||||||
updateEffect = Fx.pulverizeMedium;
|
updateEffect = Fx.pulverizeMedium;
|
||||||
drillEffect = Fx.mineBig;
|
drillEffect = Fx.mineBig;
|
||||||
|
|
||||||
consumes.power(0.11f);
|
consumes.power(1.10f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
blastDrill = new Drill("blast-drill"){{
|
blastDrill = new Drill("blast-drill"){{
|
||||||
@@ -797,7 +798,7 @@ public class Blocks implements ContentList{
|
|||||||
rotateSpeed = 6f;
|
rotateSpeed = 6f;
|
||||||
warmupSpeed = 0.01f;
|
warmupSpeed = 0.01f;
|
||||||
|
|
||||||
consumes.power(0.3f);
|
consumes.power(3f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
plasmaDrill = new Drill("plasma-drill"){{
|
plasmaDrill = new Drill("plasma-drill"){{
|
||||||
@@ -814,7 +815,7 @@ public class Blocks implements ContentList{
|
|||||||
drillEffect = Fx.mineHuge;
|
drillEffect = Fx.mineHuge;
|
||||||
warmupSpeed = 0.005f;
|
warmupSpeed = 0.005f;
|
||||||
|
|
||||||
consumes.power(0.7f);
|
consumes.power(7f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
waterExtractor = new SolidPump("water-extractor"){{
|
waterExtractor = new SolidPump("water-extractor"){{
|
||||||
@@ -825,7 +826,7 @@ public class Blocks implements ContentList{
|
|||||||
liquidCapacity = 30f;
|
liquidCapacity = 30f;
|
||||||
rotateSpeed = 1.4f;
|
rotateSpeed = 1.4f;
|
||||||
|
|
||||||
consumes.power(0.09f);
|
consumes.power(0.90f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
oilExtractor = new Fracker("oil-extractor"){{
|
oilExtractor = new Fracker("oil-extractor"){{
|
||||||
@@ -839,7 +840,7 @@ public class Blocks implements ContentList{
|
|||||||
liquidCapacity = 30f;
|
liquidCapacity = 30f;
|
||||||
|
|
||||||
consumes.item(Items.sand);
|
consumes.item(Items.sand);
|
||||||
consumes.power(0.3f);
|
consumes.power(3f);
|
||||||
consumes.liquid(Liquids.water, 0.15f);
|
consumes.liquid(Liquids.water, 0.15f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -851,7 +852,7 @@ public class Blocks implements ContentList{
|
|||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
|
|
||||||
consumes.power(0.08f);
|
consumes.power(0.80f);
|
||||||
consumes.liquid(Liquids.water, 0.15f);
|
consumes.liquid(Liquids.water, 0.15f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -892,7 +893,7 @@ public class Blocks implements ContentList{
|
|||||||
itemCapacity = 100;
|
itemCapacity = 100;
|
||||||
launchTime = 60f * 6;
|
launchTime = 60f * 6;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
consumes.power(0.1f);
|
consumes.power(1f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
@@ -901,10 +902,10 @@ public class Blocks implements ContentList{
|
|||||||
duo = new DoubleTurret("duo"){{
|
duo = new DoubleTurret("duo"){{
|
||||||
requirements(Category.turret, ItemStack.with(Items.copper, 60), true);
|
requirements(Category.turret, ItemStack.with(Items.copper, 60), true);
|
||||||
ammo(
|
ammo(
|
||||||
Items.copper, Bullets.standardCopper,
|
Items.copper, Bullets.standardCopper,
|
||||||
Items.graphite, Bullets.standardDense,
|
Items.graphite, Bullets.standardDense,
|
||||||
Items.pyratite, Bullets.standardIncendiary,
|
Items.pyratite, Bullets.standardIncendiary,
|
||||||
Items.silicon, Bullets.standardHoming
|
Items.silicon, Bullets.standardHoming
|
||||||
);
|
);
|
||||||
reload = 20f;
|
reload = 20f;
|
||||||
restitution = 0.03f;
|
restitution = 0.03f;
|
||||||
@@ -969,7 +970,7 @@ public class Blocks implements ContentList{
|
|||||||
reload = 100f;
|
reload = 100f;
|
||||||
cooldown = 0.03f;
|
cooldown = 0.03f;
|
||||||
powerUsed = 1 / 3f;
|
powerUsed = 1 / 3f;
|
||||||
consumes.powerBuffered(60f);
|
consumes.powerBuffered(600f);
|
||||||
shootShake = 2f;
|
shootShake = 2f;
|
||||||
shootEffect = Fx.lancerLaserShoot;
|
shootEffect = Fx.lancerLaserShoot;
|
||||||
smokeEffect = Fx.lancerLaserShootSmoke;
|
smokeEffect = Fx.lancerLaserShootSmoke;
|
||||||
@@ -989,7 +990,7 @@ public class Blocks implements ContentList{
|
|||||||
shootCone = 40f;
|
shootCone = 40f;
|
||||||
rotatespeed = 8f;
|
rotatespeed = 8f;
|
||||||
powerUsed = 1f / 3f;
|
powerUsed = 1f / 3f;
|
||||||
consumes.powerBuffered(30f);
|
consumes.powerBuffered(300f);
|
||||||
range = 150f;
|
range = 150f;
|
||||||
shootEffect = Fx.lightningShoot;
|
shootEffect = Fx.lightningShoot;
|
||||||
heatColor = Color.RED;
|
heatColor = Color.RED;
|
||||||
@@ -1129,7 +1130,7 @@ public class Blocks implements ContentList{
|
|||||||
size = 4;
|
size = 4;
|
||||||
shootShake = 2f;
|
shootShake = 2f;
|
||||||
powerUsed = 0.5f;
|
powerUsed = 0.5f;
|
||||||
consumes.powerBuffered(120f);
|
consumes.powerBuffered(1200f);
|
||||||
range = 160f;
|
range = 160f;
|
||||||
reload = 200f;
|
reload = 200f;
|
||||||
firingMoveFract = 0.1f;
|
firingMoveFract = 0.1f;
|
||||||
@@ -1146,7 +1147,7 @@ public class Blocks implements ContentList{
|
|||||||
type = UnitTypes.spirit;
|
type = UnitTypes.spirit;
|
||||||
produceTime = 5700;
|
produceTime = 5700;
|
||||||
size = 2;
|
size = 2;
|
||||||
consumes.power(0.08f);
|
consumes.power(0.80f);
|
||||||
consumes.items(new ItemStack(Items.silicon, 30), new ItemStack(Items.lead, 30));
|
consumes.items(new ItemStack(Items.silicon, 30), new ItemStack(Items.lead, 30));
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -1155,7 +1156,7 @@ public class Blocks implements ContentList{
|
|||||||
type = UnitTypes.phantom;
|
type = UnitTypes.phantom;
|
||||||
produceTime = 7300;
|
produceTime = 7300;
|
||||||
size = 2;
|
size = 2;
|
||||||
consumes.power(0.2f);
|
consumes.power(2f);
|
||||||
consumes.items(new ItemStack(Items.silicon, 70), new ItemStack(Items.lead, 80), new ItemStack(Items.titanium, 80));
|
consumes.items(new ItemStack(Items.silicon, 70), new ItemStack(Items.lead, 80), new ItemStack(Items.titanium, 80));
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -1164,7 +1165,7 @@ public class Blocks implements ContentList{
|
|||||||
type = UnitTypes.wraith;
|
type = UnitTypes.wraith;
|
||||||
produceTime = 1800;
|
produceTime = 1800;
|
||||||
size = 2;
|
size = 2;
|
||||||
consumes.power(0.1f);
|
consumes.power(1f);
|
||||||
consumes.items(new ItemStack(Items.silicon, 10), new ItemStack(Items.titanium, 10));
|
consumes.items(new ItemStack(Items.silicon, 10), new ItemStack(Items.titanium, 10));
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -1173,7 +1174,7 @@ public class Blocks implements ContentList{
|
|||||||
type = UnitTypes.ghoul;
|
type = UnitTypes.ghoul;
|
||||||
produceTime = 3600;
|
produceTime = 3600;
|
||||||
size = 3;
|
size = 3;
|
||||||
consumes.power(0.2f);
|
consumes.power(2f);
|
||||||
consumes.items(new ItemStack(Items.silicon, 30), new ItemStack(Items.titanium, 30), new ItemStack(Items.plastanium, 20));
|
consumes.items(new ItemStack(Items.silicon, 30), new ItemStack(Items.titanium, 30), new ItemStack(Items.plastanium, 20));
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -1182,7 +1183,7 @@ public class Blocks implements ContentList{
|
|||||||
type = UnitTypes.revenant;
|
type = UnitTypes.revenant;
|
||||||
produceTime = 8000;
|
produceTime = 8000;
|
||||||
size = 4;
|
size = 4;
|
||||||
consumes.power(0.3f);
|
consumes.power(3f);
|
||||||
consumes.items(new ItemStack(Items.silicon, 80), new ItemStack(Items.titanium, 80), new ItemStack(Items.plastanium, 50));
|
consumes.items(new ItemStack(Items.silicon, 80), new ItemStack(Items.titanium, 80), new ItemStack(Items.plastanium, 50));
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -1191,7 +1192,7 @@ public class Blocks implements ContentList{
|
|||||||
type = UnitTypes.dagger;
|
type = UnitTypes.dagger;
|
||||||
produceTime = 1700;
|
produceTime = 1700;
|
||||||
size = 2;
|
size = 2;
|
||||||
consumes.power(0.05f);
|
consumes.power(0.50f);
|
||||||
consumes.items(new ItemStack(Items.silicon, 10));
|
consumes.items(new ItemStack(Items.silicon, 10));
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -1200,7 +1201,7 @@ public class Blocks implements ContentList{
|
|||||||
type = UnitTypes.titan;
|
type = UnitTypes.titan;
|
||||||
produceTime = 3400;
|
produceTime = 3400;
|
||||||
size = 3;
|
size = 3;
|
||||||
consumes.power(0.15f);
|
consumes.power(1.50f);
|
||||||
consumes.items(new ItemStack(Items.silicon, 20), new ItemStack(Items.thorium, 30));
|
consumes.items(new ItemStack(Items.silicon, 20), new ItemStack(Items.thorium, 30));
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -1209,7 +1210,7 @@ public class Blocks implements ContentList{
|
|||||||
type = UnitTypes.fortress;
|
type = UnitTypes.fortress;
|
||||||
produceTime = 5000;
|
produceTime = 5000;
|
||||||
size = 3;
|
size = 3;
|
||||||
consumes.power(0.2f);
|
consumes.power(2f);
|
||||||
consumes.items(new ItemStack(Items.silicon, 40), new ItemStack(Items.thorium, 50));
|
consumes.items(new ItemStack(Items.silicon, 40), new ItemStack(Items.thorium, 50));
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|||||||
@@ -835,7 +835,6 @@ public class Fx implements ContentList{
|
|||||||
Angles.randLenVectors(e.id, 5, e.fin() * 8f, (x, y) -> {
|
Angles.randLenVectors(e.id, 5, e.fin() * 8f, (x, y) -> {
|
||||||
float len = e.fout() * 4f;
|
float len = e.fout() * 4f;
|
||||||
Draw.color(Palette.redSpark, Color.GRAY, e.fin());
|
Draw.color(Palette.redSpark, Color.GRAY, e.fin());
|
||||||
//Draw.alpha(e.fout());
|
|
||||||
Draw.rect("circle", e.x + x, e.y + y, len, len);
|
Draw.rect("circle", e.x + x, e.y + y, len, len);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ public class ForceProjector extends Block {
|
|||||||
|
|
||||||
public class ConsumeForceProjectorPower extends ConsumePower{
|
public class ConsumeForceProjectorPower extends ConsumePower{
|
||||||
public ConsumeForceProjectorPower(float powerCapacity, float ticksToFill){
|
public ConsumeForceProjectorPower(float powerCapacity, float ticksToFill){
|
||||||
super(powerCapacity / ticksToFill, 0.0f, powerCapacity, true);
|
super(powerCapacity / ticksToFill, powerCapacity, true);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public boolean valid(Block block, TileEntity entity){
|
public boolean valid(Block block, TileEntity entity){
|
||||||
|
|||||||
@@ -24,9 +24,6 @@ public class Incinerator extends Block{
|
|||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
update = true;
|
update = true;
|
||||||
solid = true;
|
solid = true;
|
||||||
|
|
||||||
// Incinerator has no speed which could be adjusted, so it will only operate fully powered for now
|
|
||||||
consumes.power(0.05f, 1.0f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import io.anuke.arc.scene.ui.layout.Table;
|
|||||||
|
|
||||||
import static io.anuke.mindustry.Vars.mobile;
|
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{
|
public abstract class Consume{
|
||||||
protected boolean optional;
|
protected boolean optional;
|
||||||
protected boolean update = true;
|
protected boolean update = true;
|
||||||
|
|||||||
@@ -12,16 +12,13 @@ import io.anuke.mindustry.world.meta.StatUnit;
|
|||||||
public class ConsumePower extends Consume{
|
public class ConsumePower extends Consume{
|
||||||
/** The maximum amount of power which can be processed per tick. This might influence efficiency or load a buffer. */
|
/** The maximum amount of power which can be processed per tick. This might influence efficiency or load a buffer. */
|
||||||
protected final float powerPerTick;
|
protected final float powerPerTick;
|
||||||
/** The minimum power satisfaction (fraction of powerPerTick) which must be achieved before the module may work. */
|
|
||||||
public final float minimumSatisfaction;
|
|
||||||
/** The maximum power capacity in power units. */
|
/** The maximum power capacity in power units. */
|
||||||
public final float powerCapacity;
|
public final float powerCapacity;
|
||||||
/** True if the module can store power. */
|
/** True if the module can store power. */
|
||||||
public final boolean isBuffered;
|
public final boolean isBuffered;
|
||||||
|
|
||||||
protected ConsumePower(float powerPerTick, float minimumSatisfaction, float powerCapacity, boolean isBuffered){
|
protected ConsumePower(float powerPerTick, float powerCapacity, boolean isBuffered){
|
||||||
this.powerPerTick = powerPerTick;
|
this.powerPerTick = powerPerTick;
|
||||||
this.minimumSatisfaction = minimumSatisfaction;
|
|
||||||
this.powerCapacity = powerCapacity;
|
this.powerCapacity = powerCapacity;
|
||||||
this.isBuffered = isBuffered;
|
this.isBuffered = isBuffered;
|
||||||
}
|
}
|
||||||
@@ -31,8 +28,8 @@ public class ConsumePower extends Consume{
|
|||||||
* @param powerPerTick The maximum amount of power which is required per tick for 100% efficiency.
|
* @param powerPerTick The maximum amount of power which is required per tick for 100% efficiency.
|
||||||
* @param minimumSatisfaction The percentage of powerPerTick which must be available for the module to work.
|
* @param minimumSatisfaction The percentage of powerPerTick which must be available for the module to work.
|
||||||
*/
|
*/
|
||||||
public static ConsumePower consumePowerDirect(float powerPerTick, float minimumSatisfaction){
|
public static ConsumePower consumePowerDirect(float powerPerTick){
|
||||||
return new ConsumePower(powerPerTick, minimumSatisfaction, 0.0f, false);
|
return new ConsumePower(powerPerTick, 0.0f, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -42,7 +39,7 @@ public class ConsumePower extends Consume{
|
|||||||
* @param ticksToFill The number of ticks it shall take to fill the buffer.
|
* @param ticksToFill The number of ticks it shall take to fill the buffer.
|
||||||
*/
|
*/
|
||||||
public static ConsumePower consumePowerBuffered(float powerCapacity, float ticksToFill){
|
public static ConsumePower consumePowerBuffered(float powerCapacity, float ticksToFill){
|
||||||
return new ConsumePower(powerCapacity / ticksToFill, 0.0f, powerCapacity, true);
|
return new ConsumePower(powerCapacity / ticksToFill, powerCapacity, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -65,7 +62,7 @@ public class ConsumePower extends Consume{
|
|||||||
if(isBuffered){
|
if(isBuffered){
|
||||||
return true;
|
return true;
|
||||||
}else{
|
}else{
|
||||||
return entity.power.satisfaction >= minimumSatisfaction;
|
return entity.power.satisfaction >= 0.9999f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,22 +36,13 @@ public class Consumers{
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a consumer which directly uses power without buffering it. The module will work while at least 50% of power is supplied.
|
|
||||||
* @param powerPerTick The amount of power which is required each tick for 100% efficiency.
|
|
||||||
* @return the created consumer object.
|
|
||||||
*/
|
|
||||||
public ConsumePower power(float powerPerTick){
|
|
||||||
return power(powerPerTick, 0.5f);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a consumer which directly uses power without buffering it. The module will work while the available power is greater than or equal to the minimumSatisfaction percentage (0..1).
|
* Creates a consumer which directly uses power without buffering it. The module will work while the available power is greater than or equal to the minimumSatisfaction percentage (0..1).
|
||||||
* @param powerPerTick The amount of power which is required each tick for 100% efficiency.
|
* @param powerPerTick The amount of power which is required each tick for 100% efficiency.
|
||||||
* @return the created consumer object.
|
* @return the created consumer object.
|
||||||
*/
|
*/
|
||||||
public ConsumePower power(float powerPerTick, float minimumSatisfaction){
|
public ConsumePower power(float powerPerTick){
|
||||||
ConsumePower c = ConsumePower.consumePowerDirect(powerPerTick, minimumSatisfaction);
|
ConsumePower c = ConsumePower.consumePowerDirect(powerPerTick);
|
||||||
add(c);
|
add(c);
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,9 +50,9 @@ public class PowerTestFixture{
|
|||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static Block createFakeDirectConsumer(float powerPerTick, float minimumSatisfaction){
|
protected static Block createFakeDirectConsumer(float powerPerTick){
|
||||||
return new PowerBlock("fakedirectconsumer"){{
|
return new PowerBlock("fakedirectconsumer"){{
|
||||||
consumes.power(powerPerTick, minimumSatisfaction);
|
consumes.power(powerPerTick);
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -154,6 +154,26 @@ task scaleSprites4x(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task processBlocks(){
|
||||||
|
def str = file("/home/anuke/Projects/Mindustry/core/src/io/anuke/mindustry/content/Blocks.java").text
|
||||||
|
def out = str
|
||||||
|
def mat = " consumes.power("
|
||||||
|
|
||||||
|
int i = 0
|
||||||
|
while(str.indexOf(mat, i) != -1){
|
||||||
|
i = str.indexOf(mat, i + 1)
|
||||||
|
if(i == -1) break
|
||||||
|
|
||||||
|
def line = str.substring(i, str.indexOf("\n", i))
|
||||||
|
def num = line.substring(line.indexOf("(") + 1, line.indexOf(")"))
|
||||||
|
float val = Float.parseFloat(num) * 10f;
|
||||||
|
boolean fmt = Math.abs((int)val - val) > 0.01f;
|
||||||
|
|
||||||
|
out = out.replace(line, (line.replace(num, (fmt ? String.format("%.2f", val) : (int)val) + "f")))
|
||||||
|
}
|
||||||
|
|
||||||
|
println(out)
|
||||||
|
}
|
||||||
|
|
||||||
task scaleSprites(){
|
task scaleSprites(){
|
||||||
finalizedBy 'genSprites'
|
finalizedBy 'genSprites'
|
||||||
|
|||||||
Reference in New Issue
Block a user