Skip to content

Commit

Permalink
Merge pull request Anuken#3 from Timmeey86/baltitenger
Browse files Browse the repository at this point in the history
Implemented the new power system with Consumers
  • Loading branch information
baltitenger committed Nov 21, 2018
2 parents 12a62f4 + 920491d commit ebb763d
Show file tree
Hide file tree
Showing 23 changed files with 337 additions and 106 deletions.
24 changes: 12 additions & 12 deletions core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void load(){
fluxNeeded = 2;

consumes.items(new ItemStack[]{new ItemStack(Items.copper, 1), new ItemStack(Items.lead, 2)});
basePowerUse = 0.1f;
consumes.powerDirect(0.1f);
}};

siliconsmelter = new PowerSmelter("silicon-smelter"){{
Expand All @@ -51,7 +51,7 @@ public void load(){
flameColor = Color.valueOf("ffef99");

consumes.items(new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.sand, 2)});
basePowerUse = 0.05f;
consumes.powerDirect(0.05f);
}};

plastaniumCompressor = new PlastaniumCompressor("plastanium-compressor"){{
Expand All @@ -67,7 +67,7 @@ public void load(){
updateEffect = BlockFx.plasticburn;

consumes.liquid(Liquids.oil, 0.25f);
basePowerUse = 0.3f;
consumes.powerDirect(0.3f);
consumes.item(Items.titanium, 2);
}};

Expand All @@ -78,7 +78,7 @@ public void load(){
size = 2;

consumes.items(new ItemStack[]{new ItemStack(Items.thorium, 4), new ItemStack(Items.sand, 10)});
basePowerUse = 0.5f;
consumes.powerDirect(0.5f);
}};

alloySmelter = new PowerSmelter("alloy-smelter"){{
Expand All @@ -90,7 +90,7 @@ public void load(){
useFlux = true;
fluxNeeded = 3;

basePowerUse = 0.4f;
consumes.powerDirect(0.4f);
consumes.items(new ItemStack[]{new ItemStack(Items.titanium, 2), new ItemStack(Items.lead, 4), new ItemStack(Items.silicon, 3), new ItemStack(Items.copper, 3)});
}};

Expand All @@ -101,7 +101,7 @@ public void load(){
size = 2;
hasPower = true;

basePowerUse = 0.1f;
consumes.powerDirect(0.1f);
consumes.item(Items.titanium);
consumes.liquid(Liquids.water, 0.3f);
}};
Expand All @@ -116,7 +116,7 @@ public void load(){

consumes.liquid(Liquids.oil, 0.05f);
consumes.item(Items.pyratite, 1);
basePowerUse = 0.04f;
consumes.powerDirect(0.04f);
}};

pyratiteMixer = new PowerSmelter("pyratite-mixer"){{
Expand All @@ -128,7 +128,7 @@ public void load(){

size = 2;

basePowerUse = 0.02f;
consumes.powerDirect(0.02f);
consumes.items(new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.lead, 2), new ItemStack(Items.sand, 2)});
}};

Expand All @@ -140,7 +140,7 @@ public void load(){
craftTime = 10f;
hasLiquids = hasPower = true;

basePowerUse = 0.1f;
consumes.powerDirect(0.1f);
consumes.item(Items.stone, 2);
}};

Expand Down Expand Up @@ -185,7 +185,7 @@ public void load(){
size = 2;

consumes.item(Items.stone, 2);
basePowerUse = 0.2f;
consumes.powerDirect(0.2f);
consumes.liquid(Liquids.water, 0.5f);
}};

Expand All @@ -200,7 +200,7 @@ public void load(){
hasLiquids = true;

consumes.item(Items.biomatter, 1);
basePowerUse = 0.06f;
consumes.powerDirect(0.06f);
}};

pulverizer = new Pulverizer("pulverizer"){{
Expand All @@ -213,7 +213,7 @@ public void load(){
hasItems = hasPower = true;

consumes.item(Items.stone, 1);
basePowerUse = 0.05f;
consumes.powerDirect(0.05f);
}};

solidifier = new GenericCrafter("solidifer"){{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void load(){
powerVoid = new PowerBlock("powervoid"){
{
// TODO Adapt to new power system if necessary
basePowerUse = Float.MAX_VALUE;
consumes.powerDirect(Float.MAX_VALUE);
shadow = "shadow-round-1";
}

Expand Down
6 changes: 3 additions & 3 deletions core/src/io/anuke/mindustry/content/blocks/DefenseBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ public void load(){
}};

mendProjector = new MendProjector("mend-projector"){{
basePowerUse = 0.2f;
consumes.powerDirect(0.2f);
size = 2;
consumes.item(Items.phasefabric).optional(true);
}};

overdriveProjector = new OverdriveProjector("overdrive-projector"){{
basePowerUse = 0.35f;
consumes.powerDirect(0.35f);
size = 2;
consumes.item(Items.phasefabric).optional(true);
}};

forceProjector = new ForceProjector("force-projector"){{
basePowerUse = 0.2f;
consumes.powerDirect(0.2f);
size = 3;
consumes.item(Items.phasefabric).optional(true);
}};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void load(){
phaseConveyor = new ItemBridge("phase-conveyor"){{
range = 11;
hasPower = true;
basePowerUse = 0.05f;
consumes.powerDirect(0.05f);
}};

sorter = new Sorter("sorter");
Expand Down
10 changes: 5 additions & 5 deletions core/src/io/anuke/mindustry/content/blocks/LiquidBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public void load(){
rotaryPump = new Pump("rotary-pump"){{
shadow = "shadow-rounded-2";
pumpAmount = 0.2f;
basePowerUse = 0.015f;
consumes.powerDirect(0.015f);
liquidCapacity = 30f;
// TODO Verify: No longer buffered
basePowerUse = 20f / 60f;
consumes.powerDirect(20f / 60f);
hasPower = true;
size = 2;
tier = 1;
Expand All @@ -32,11 +32,11 @@ public void load(){
thermalPump = new Pump("thermal-pump"){{
shadow = "shadow-rounded-2";
pumpAmount = 0.275f;
basePowerUse = 0.03f;
consumes.powerDirect(0.03f);
liquidCapacity = 40f;
hasPower = true;
// TODO Verify: No longer buffered
basePowerUse = 20f / 60f;
consumes.powerDirect(20f / 60f);
size = 2;
tier = 2;
}};
Expand Down Expand Up @@ -71,7 +71,7 @@ public void load(){
phaseConduit = new LiquidBridge("phase-conduit"){{
range = 11;
hasPower = true;
basePowerUse = 0.05f;
consumes.powerDirect(0.05f);
}};
}
}
4 changes: 2 additions & 2 deletions core/src/io/anuke/mindustry/content/blocks/PowerBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ public void load(){
}};

battery = new Battery("battery"){{
basePowerUse = 320f;
consumes.powerBuffered(320f, 120f);
}};

batteryLarge = new Battery("battery-large"){{
size = 3;
basePowerUse = 2000f;
consumes.powerBuffered(2000f, 600f);
}};

powerNode = new PowerNode("power-node"){{
Expand Down
12 changes: 6 additions & 6 deletions core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void load(){
updateEffect = BlockFx.pulverizeMedium;
drillEffect = BlockFx.mineBig;

basePowerUse = 0.11f;
consumes.powerDirect(0.11f);
}};

blastDrill = new Drill("blast-drill"){{
Expand All @@ -53,7 +53,7 @@ public void load(){
rotateSpeed = 6f;
warmupSpeed = 0.01f;

basePowerUse = 0.3f;
consumes.powerDirect(0.3f);
}};

plasmaDrill = new Drill("plasma-drill"){{
Expand All @@ -70,7 +70,7 @@ public void load(){
drillEffect = BlockFx.mineHuge;
warmupSpeed = 0.005f;

basePowerUse = 0.7f;
consumes.powerDirect(0.7f);
}};

waterExtractor = new SolidPump("water-extractor"){{
Expand All @@ -80,7 +80,7 @@ public void load(){
liquidCapacity = 30f;
rotateSpeed = 1.4f;

basePowerUse = 0.09f;
consumes.powerDirect(0.09f);
}};

oilExtractor = new Fracker("oil-extractor"){{
Expand All @@ -93,7 +93,7 @@ public void load(){
liquidCapacity = 30f;

consumes.item(Items.sand);
basePowerUse = 0.3f;
consumes.powerDirect(0.3f);
consumes.liquid(Liquids.water, 0.15f);
}};

Expand All @@ -104,7 +104,7 @@ public void load(){
hasLiquids = true;
hasPower = true;

basePowerUse = 0.08f;
consumes.powerDirect(0.08f);
consumes.liquid(Liquids.water, 0.2f);
}};

Expand Down
6 changes: 3 additions & 3 deletions core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void load(){
reload = 100f;
cooldown = 0.03f;
powerUsed = 1 / 3f;
basePowerUse = 60f; // capacity
consumes.powerBuffered(60f);
shootShake = 2f;
shootEffect = ShootFx.lancerLaserShoot;
smokeEffect = ShootFx.lancerLaserShootSmoke;
Expand All @@ -122,7 +122,7 @@ public void load(){
shootCone = 40f;
rotatespeed = 8f;
powerUsed = 7 / 30f;
basePowerUse = 30f; // capacity
consumes.powerBuffered(30f);
range = 150f;
shootEffect = ShootFx.lightningShoot;
heatColor = Color.RED;
Expand Down Expand Up @@ -256,7 +256,7 @@ public void load() {
size = 4;
shootShake = 2f;
powerUsed = 0.5f;
basePowerUse = 120f; // capacity
consumes.powerBuffered(120f);
range = 160f;
reload = 200f;
firingMoveFract = 0.1f;
Expand Down
16 changes: 8 additions & 8 deletions core/src/io/anuke/mindustry/content/blocks/UnitBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,31 @@ public void load(){
type = UnitTypes.spirit;
produceTime = 5700;
size = 2;
basePowerUse = 0.08f;
consumes.powerDirect(0.08f);
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 30), new ItemStack(Items.lead, 30)});
}};

phantomFactory = new UnitFactory("phantom-factory"){{
type = UnitTypes.phantom;
produceTime = 7300;
size = 2;
basePowerUse = 0.2f;
consumes.powerDirect(0.2f);
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 70), new ItemStack(Items.lead, 80), new ItemStack(Items.titanium, 80)});
}};

wraithFactory = new UnitFactory("wraith-factory"){{
type = UnitTypes.wraith;
produceTime = 1800;
size = 2;
basePowerUse = 0.1f;
consumes.powerDirect(0.1f);
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 10), new ItemStack(Items.titanium, 10)});
}};

ghoulFactory = new UnitFactory("ghoul-factory"){{
type = UnitTypes.ghoul;
produceTime = 3600;
size = 3;
basePowerUse = 0.2f;
consumes.powerDirect(0.2f);
shadow = "shadow-round-3";
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 30), new ItemStack(Items.titanium, 30), new ItemStack(Items.plastanium, 20)});
}};
Expand All @@ -53,7 +53,7 @@ public void load(){
type = UnitTypes.revenant;
produceTime = 8000;
size = 4;
basePowerUse = 0.3f;
consumes.powerDirect(0.3f);
shadow = "shadow-round-4";
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 80), new ItemStack(Items.titanium, 80), new ItemStack(Items.plastanium, 50)});
}};
Expand All @@ -62,15 +62,15 @@ public void load(){
type = UnitTypes.dagger;
produceTime = 1700;
size = 2;
basePowerUse = 0.05f;
consumes.powerDirect(0.05f);
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 10)});
}};

titanFactory = new UnitFactory("titan-factory"){{
type = UnitTypes.titan;
produceTime = 3400;
size = 3;
basePowerUse = 0.15f;
consumes.powerDirect(0.15f);
shadow = "shadow-round-3";
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 20), new ItemStack(Items.thorium, 30)});
}};
Expand All @@ -79,7 +79,7 @@ public void load(){
type = UnitTypes.fortress;
produceTime = 5000;
size = 3;
basePowerUse = 0.2f;
consumes.powerDirect(0.2f);
shadow = "shadow-round-3";
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 40), new ItemStack(Items.thorium, 50)});
}};
Expand Down

0 comments on commit ebb763d

Please sign in to comment.