Merge pull request #2 from Timmeey86/baltitenger
Branch now compiles again (but won't work yet)
This commit is contained in:
@@ -38,7 +38,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
|
|||||||
fluxNeeded = 2;
|
fluxNeeded = 2;
|
||||||
|
|
||||||
consumes.items(new ItemStack[]{new ItemStack(Items.copper, 1), new ItemStack(Items.lead, 2)});
|
consumes.items(new ItemStack[]{new ItemStack(Items.copper, 1), new ItemStack(Items.lead, 2)});
|
||||||
consumes.power(0.1f);
|
basePowerUse = 0.1f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
siliconsmelter = new PowerSmelter("silicon-smelter"){{
|
siliconsmelter = new PowerSmelter("silicon-smelter"){{
|
||||||
@@ -46,13 +46,12 @@ public class CraftingBlocks extends BlockList implements ContentList{
|
|||||||
craftEffect = BlockFx.smeltsmoke;
|
craftEffect = BlockFx.smeltsmoke;
|
||||||
result = Items.silicon;
|
result = Items.silicon;
|
||||||
craftTime = 40f;
|
craftTime = 40f;
|
||||||
powerCapacity = 20f;
|
|
||||||
size = 2;
|
size = 2;
|
||||||
hasLiquids = false;
|
hasLiquids = false;
|
||||||
flameColor = Color.valueOf("ffef99");
|
flameColor = Color.valueOf("ffef99");
|
||||||
|
|
||||||
consumes.items(new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.sand, 2)});
|
consumes.items(new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.sand, 2)});
|
||||||
consumes.power(0.05f);
|
basePowerUse = 0.05f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
plastaniumCompressor = new PlastaniumCompressor("plastanium-compressor"){{
|
plastaniumCompressor = new PlastaniumCompressor("plastanium-compressor"){{
|
||||||
@@ -61,7 +60,6 @@ public class CraftingBlocks extends BlockList implements ContentList{
|
|||||||
craftTime = 60f;
|
craftTime = 60f;
|
||||||
output = Items.plastanium;
|
output = Items.plastanium;
|
||||||
itemCapacity = 30;
|
itemCapacity = 30;
|
||||||
powerCapacity = 40f;
|
|
||||||
size = 2;
|
size = 2;
|
||||||
health = 320;
|
health = 320;
|
||||||
hasPower = hasLiquids = true;
|
hasPower = hasLiquids = true;
|
||||||
@@ -69,7 +67,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
|
|||||||
updateEffect = BlockFx.plasticburn;
|
updateEffect = BlockFx.plasticburn;
|
||||||
|
|
||||||
consumes.liquid(Liquids.oil, 0.25f);
|
consumes.liquid(Liquids.oil, 0.25f);
|
||||||
consumes.power(0.3f);
|
basePowerUse = 0.3f;
|
||||||
consumes.item(Items.titanium, 2);
|
consumes.item(Items.titanium, 2);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -77,24 +75,22 @@ public class CraftingBlocks extends BlockList implements ContentList{
|
|||||||
craftEffect = BlockFx.smeltsmoke;
|
craftEffect = BlockFx.smeltsmoke;
|
||||||
result = Items.phasefabric;
|
result = Items.phasefabric;
|
||||||
craftTime = 120f;
|
craftTime = 120f;
|
||||||
powerCapacity = 50f;
|
|
||||||
size = 2;
|
size = 2;
|
||||||
|
|
||||||
consumes.items(new ItemStack[]{new ItemStack(Items.thorium, 4), new ItemStack(Items.sand, 10)});
|
consumes.items(new ItemStack[]{new ItemStack(Items.thorium, 4), new ItemStack(Items.sand, 10)});
|
||||||
consumes.power(0.5f);
|
basePowerUse = 0.5f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
alloySmelter = new PowerSmelter("alloy-smelter"){{
|
alloySmelter = new PowerSmelter("alloy-smelter"){{
|
||||||
craftEffect = BlockFx.smeltsmoke;
|
craftEffect = BlockFx.smeltsmoke;
|
||||||
result = Items.surgealloy;
|
result = Items.surgealloy;
|
||||||
craftTime = 75f;
|
craftTime = 75f;
|
||||||
powerCapacity = 60f;
|
|
||||||
size = 2;
|
size = 2;
|
||||||
|
|
||||||
useFlux = true;
|
useFlux = true;
|
||||||
fluxNeeded = 3;
|
fluxNeeded = 3;
|
||||||
|
|
||||||
consumes.power(0.4f);
|
basePowerUse = 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)});
|
consumes.items(new ItemStack[]{new ItemStack(Items.titanium, 2), new ItemStack(Items.lead, 4), new ItemStack(Items.silicon, 3), new ItemStack(Items.copper, 3)});
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -105,7 +101,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
|
|||||||
size = 2;
|
size = 2;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
|
|
||||||
consumes.power(0.1f);
|
basePowerUse = 0.1f;
|
||||||
consumes.item(Items.titanium);
|
consumes.item(Items.titanium);
|
||||||
consumes.liquid(Liquids.water, 0.3f);
|
consumes.liquid(Liquids.water, 0.3f);
|
||||||
}};
|
}};
|
||||||
@@ -120,7 +116,7 @@ public class CraftingBlocks extends BlockList 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);
|
basePowerUse = 0.04f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
pyratiteMixer = new PowerSmelter("pyratite-mixer"){{
|
pyratiteMixer = new PowerSmelter("pyratite-mixer"){{
|
||||||
@@ -132,7 +128,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
|
|||||||
|
|
||||||
size = 2;
|
size = 2;
|
||||||
|
|
||||||
consumes.power(0.02f);
|
basePowerUse = 0.02f;
|
||||||
consumes.items(new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.lead, 2), new ItemStack(Items.sand, 2)});
|
consumes.items(new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.lead, 2), new ItemStack(Items.sand, 2)});
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -144,7 +140,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
|
|||||||
craftTime = 10f;
|
craftTime = 10f;
|
||||||
hasLiquids = hasPower = true;
|
hasLiquids = hasPower = true;
|
||||||
|
|
||||||
consumes.power(0.1f);
|
basePowerUse = 0.1f;
|
||||||
consumes.item(Items.stone, 2);
|
consumes.item(Items.stone, 2);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -189,7 +185,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
|
|||||||
size = 2;
|
size = 2;
|
||||||
|
|
||||||
consumes.item(Items.stone, 2);
|
consumes.item(Items.stone, 2);
|
||||||
consumes.power(0.2f);
|
basePowerUse = 0.2f;
|
||||||
consumes.liquid(Liquids.water, 0.5f);
|
consumes.liquid(Liquids.water, 0.5f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -204,7 +200,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
|
|||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
|
|
||||||
consumes.item(Items.biomatter, 1);
|
consumes.item(Items.biomatter, 1);
|
||||||
consumes.power(0.06f);
|
basePowerUse = 0.06f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
pulverizer = new Pulverizer("pulverizer"){{
|
pulverizer = new Pulverizer("pulverizer"){{
|
||||||
@@ -217,7 +213,7 @@ public class CraftingBlocks extends BlockList implements ContentList{
|
|||||||
hasItems = hasPower = true;
|
hasItems = hasPower = true;
|
||||||
|
|
||||||
consumes.item(Items.stone, 1);
|
consumes.item(Items.stone, 1);
|
||||||
consumes.power(0.05f);
|
basePowerUse = 0.05f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
solidifier = new GenericCrafter("solidifer"){{
|
solidifier = new GenericCrafter("solidifer"){{
|
||||||
|
|||||||
@@ -40,7 +40,8 @@ public class DebugBlocks extends BlockList implements ContentList{
|
|||||||
public void load(){
|
public void load(){
|
||||||
powerVoid = new PowerBlock("powervoid"){
|
powerVoid = new PowerBlock("powervoid"){
|
||||||
{
|
{
|
||||||
powerCapacity = Float.MAX_VALUE;
|
// TODO Adapt to new power system if necessary
|
||||||
|
basePowerUse = Float.MAX_VALUE;
|
||||||
shadow = "shadow-round-1";
|
shadow = "shadow-round-1";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,23 +54,23 @@ public class DebugBlocks extends BlockList implements ContentList{
|
|||||||
@Override
|
@Override
|
||||||
public void init(){
|
public void init(){
|
||||||
super.init();
|
super.init();
|
||||||
stats.remove(BlockStat.powerCapacity);
|
// TODO Adapt to new power system if necessary
|
||||||
|
//stats.remove(BlockStat.powerCapacity);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
powerInfinite = new PowerNode("powerinfinite"){
|
powerInfinite = new PowerNode("powerinfinite"){
|
||||||
{
|
{
|
||||||
powerCapacity = 10000f;
|
|
||||||
maxNodes = 100;
|
maxNodes = 100;
|
||||||
outputsPower = true;
|
outputsPower = true;
|
||||||
consumesPower = false;
|
consumesPower = false;
|
||||||
shadow = "shadow-round-1";
|
shadow = "shadow-round-1";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO Adapt to new power system if necessary
|
||||||
@Override
|
@Override
|
||||||
public void update(Tile tile){
|
public float getPowerProduction(Tile tile){
|
||||||
super.update(tile);
|
return 10000f;
|
||||||
tile.entity.power.amount = powerCapacity;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -71,19 +71,19 @@ public class DefenseBlocks extends BlockList implements ContentList{
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
mendProjector = new MendProjector("mend-projector"){{
|
mendProjector = new MendProjector("mend-projector"){{
|
||||||
consumes.power(0.2f);
|
basePowerUse = 0.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"){{
|
||||||
consumes.power(0.35f);
|
basePowerUse = 0.35f;
|
||||||
size = 2;
|
size = 2;
|
||||||
consumes.item(Items.phasefabric).optional(true);
|
consumes.item(Items.phasefabric).optional(true);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
forceProjector = new ForceProjector("force-projector"){{
|
forceProjector = new ForceProjector("force-projector"){{
|
||||||
consumes.power(0.2f);
|
basePowerUse = 0.2f;
|
||||||
size = 3;
|
size = 3;
|
||||||
consumes.item(Items.phasefabric).optional(true);
|
consumes.item(Items.phasefabric).optional(true);
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class DistributionBlocks extends BlockList implements ContentList{
|
|||||||
phaseConveyor = new ItemBridge("phase-conveyor"){{
|
phaseConveyor = new ItemBridge("phase-conveyor"){{
|
||||||
range = 11;
|
range = 11;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
consumes.power(0.05f);
|
basePowerUse = 0.05f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
sorter = new Sorter("sorter");
|
sorter = new Sorter("sorter");
|
||||||
|
|||||||
@@ -20,9 +20,10 @@ public class LiquidBlocks extends BlockList implements ContentList{
|
|||||||
rotaryPump = new Pump("rotary-pump"){{
|
rotaryPump = new Pump("rotary-pump"){{
|
||||||
shadow = "shadow-rounded-2";
|
shadow = "shadow-rounded-2";
|
||||||
pumpAmount = 0.2f;
|
pumpAmount = 0.2f;
|
||||||
consumes.power(0.015f);
|
basePowerUse = 0.015f;
|
||||||
liquidCapacity = 30f;
|
liquidCapacity = 30f;
|
||||||
powerCapacity = 20f;
|
// TODO Verify: No longer buffered
|
||||||
|
basePowerUse = 20f / 60f;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
size = 2;
|
size = 2;
|
||||||
tier = 1;
|
tier = 1;
|
||||||
@@ -31,10 +32,11 @@ public class LiquidBlocks extends BlockList implements ContentList{
|
|||||||
thermalPump = new Pump("thermal-pump"){{
|
thermalPump = new Pump("thermal-pump"){{
|
||||||
shadow = "shadow-rounded-2";
|
shadow = "shadow-rounded-2";
|
||||||
pumpAmount = 0.275f;
|
pumpAmount = 0.275f;
|
||||||
consumes.power(0.03f);
|
basePowerUse = 0.03f;
|
||||||
liquidCapacity = 40f;
|
liquidCapacity = 40f;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
powerCapacity = 20f;
|
// TODO Verify: No longer buffered
|
||||||
|
basePowerUse = 20f / 60f;
|
||||||
size = 2;
|
size = 2;
|
||||||
tier = 2;
|
tier = 2;
|
||||||
}};
|
}};
|
||||||
@@ -69,7 +71,7 @@ public class LiquidBlocks extends BlockList implements ContentList{
|
|||||||
phaseConduit = new LiquidBridge("phase-conduit"){{
|
phaseConduit = new LiquidBridge("phase-conduit"){{
|
||||||
range = 11;
|
range = 11;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
consumes.power(0.05f);
|
basePowerUse = 0.05f;
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,41 +13,40 @@ public class PowerBlocks extends BlockList implements ContentList{
|
|||||||
@Override
|
@Override
|
||||||
public void load(){
|
public void load(){
|
||||||
combustionGenerator = new BurnerGenerator("combustion-generator"){{
|
combustionGenerator = new BurnerGenerator("combustion-generator"){{
|
||||||
powerOutput = 0.09f;
|
powerProduction = 0.09f;
|
||||||
powerCapacity = 40f;
|
|
||||||
itemDuration = 40f;
|
itemDuration = 40f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
thermalGenerator = new LiquidHeatGenerator("thermal-generator"){{
|
thermalGenerator = new LiquidHeatGenerator("thermal-generator"){{
|
||||||
maxLiquidGenerate = 4f;
|
maxLiquidGenerate = 4f;
|
||||||
powerCapacity = 40f;
|
// TODO: Adapt to new power system
|
||||||
|
powerProduction = -1;
|
||||||
powerPerLiquid = 0.1f;
|
powerPerLiquid = 0.1f;
|
||||||
generateEffect = BlockFx.redgeneratespark;
|
generateEffect = BlockFx.redgeneratespark;
|
||||||
size = 2;
|
size = 2;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
turbineGenerator = new TurbineGenerator("turbine-generator"){{
|
turbineGenerator = new TurbineGenerator("turbine-generator"){{
|
||||||
powerOutput = 0.28f;
|
// TODO: Adapt to new power system
|
||||||
powerCapacity = 40f;
|
powerProduction = 0.28f;
|
||||||
|
powerPerLiquid = 0.1f;
|
||||||
itemDuration = 30f;
|
itemDuration = 30f;
|
||||||
powerPerLiquid = 0.7f;
|
|
||||||
consumes.liquid(Liquids.water, 0.05f);
|
consumes.liquid(Liquids.water, 0.05f);
|
||||||
size = 2;
|
size = 2;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
rtgGenerator = new DecayGenerator("rtg-generator"){{
|
rtgGenerator = new DecayGenerator("rtg-generator"){{
|
||||||
powerCapacity = 40f;
|
|
||||||
size = 2;
|
size = 2;
|
||||||
powerOutput = 0.3f;
|
powerProduction = 0.3f;
|
||||||
itemDuration = 220f;
|
itemDuration = 220f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
solarPanel = new PowerGenerator("solar-panel"){{
|
solarPanel = new PowerGenerator("solar-panel"){{
|
||||||
powerGeneration = 0.0045f;
|
powerProduction = 0.0045f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
largeSolarPanel = new PowerGenerator("solar-panel-large"){{
|
largeSolarPanel = new PowerGenerator("solar-panel-large"){{
|
||||||
powerGeneration = 0.055f;
|
powerProduction = 0.055f;
|
||||||
size = 3;
|
size = 3;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -63,12 +62,12 @@ public class PowerBlocks extends BlockList implements ContentList{
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
battery = new Battery("battery"){{
|
battery = new Battery("battery"){{
|
||||||
powerCapacity = 320f;
|
basePowerUse = 320f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
batteryLarge = new Battery("battery-large"){{
|
batteryLarge = new Battery("battery-large"){{
|
||||||
size = 3;
|
size = 3;
|
||||||
powerCapacity = 2000f;
|
basePowerUse = 2000f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
powerNode = new PowerNode("power-node"){{
|
powerNode = new PowerNode("power-node"){{
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public class ProductionBlocks extends BlockList implements ContentList{
|
|||||||
updateEffect = BlockFx.pulverizeMedium;
|
updateEffect = BlockFx.pulverizeMedium;
|
||||||
drillEffect = BlockFx.mineBig;
|
drillEffect = BlockFx.mineBig;
|
||||||
|
|
||||||
consumes.power(0.11f);
|
basePowerUse = 0.11f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
blastDrill = new Drill("blast-drill"){{
|
blastDrill = new Drill("blast-drill"){{
|
||||||
@@ -53,7 +53,7 @@ public class ProductionBlocks extends BlockList implements ContentList{
|
|||||||
rotateSpeed = 6f;
|
rotateSpeed = 6f;
|
||||||
warmupSpeed = 0.01f;
|
warmupSpeed = 0.01f;
|
||||||
|
|
||||||
consumes.power(0.3f);
|
basePowerUse = 0.3f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
plasmaDrill = new Drill("plasma-drill"){{
|
plasmaDrill = new Drill("plasma-drill"){{
|
||||||
@@ -70,7 +70,7 @@ public class ProductionBlocks extends BlockList implements ContentList{
|
|||||||
drillEffect = BlockFx.mineHuge;
|
drillEffect = BlockFx.mineHuge;
|
||||||
warmupSpeed = 0.005f;
|
warmupSpeed = 0.005f;
|
||||||
|
|
||||||
consumes.power(0.7f);
|
basePowerUse = 0.7f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
waterExtractor = new SolidPump("water-extractor"){{
|
waterExtractor = new SolidPump("water-extractor"){{
|
||||||
@@ -80,7 +80,7 @@ public class ProductionBlocks extends BlockList implements ContentList{
|
|||||||
liquidCapacity = 30f;
|
liquidCapacity = 30f;
|
||||||
rotateSpeed = 1.4f;
|
rotateSpeed = 1.4f;
|
||||||
|
|
||||||
consumes.power(0.09f);
|
basePowerUse = 0.09f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
oilExtractor = new Fracker("oil-extractor"){{
|
oilExtractor = new Fracker("oil-extractor"){{
|
||||||
@@ -93,7 +93,7 @@ public class ProductionBlocks extends BlockList implements ContentList{
|
|||||||
liquidCapacity = 30f;
|
liquidCapacity = 30f;
|
||||||
|
|
||||||
consumes.item(Items.sand);
|
consumes.item(Items.sand);
|
||||||
consumes.power(0.3f);
|
basePowerUse = 0.3f;
|
||||||
consumes.liquid(Liquids.water, 0.15f);
|
consumes.liquid(Liquids.water, 0.15f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ public class ProductionBlocks extends BlockList implements ContentList{
|
|||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
|
|
||||||
consumes.power(0.08f);
|
basePowerUse = 0.08f;
|
||||||
consumes.liquid(Liquids.water, 0.2f);
|
consumes.liquid(Liquids.water, 0.2f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|||||||
@@ -102,8 +102,8 @@ public class TurretBlocks extends BlockList implements ContentList{
|
|||||||
recoil = 2f;
|
recoil = 2f;
|
||||||
reload = 100f;
|
reload = 100f;
|
||||||
cooldown = 0.03f;
|
cooldown = 0.03f;
|
||||||
powerUsed = 20f;
|
powerUsed = 1 / 3f;
|
||||||
powerCapacity = 60f;
|
basePowerUse = 60f; // capacity
|
||||||
shootShake = 2f;
|
shootShake = 2f;
|
||||||
shootEffect = ShootFx.lancerLaserShoot;
|
shootEffect = ShootFx.lancerLaserShoot;
|
||||||
smokeEffect = ShootFx.lancerLaserShootSmoke;
|
smokeEffect = ShootFx.lancerLaserShootSmoke;
|
||||||
@@ -121,8 +121,8 @@ public class TurretBlocks extends BlockList implements ContentList{
|
|||||||
shootShake = 1f;
|
shootShake = 1f;
|
||||||
shootCone = 40f;
|
shootCone = 40f;
|
||||||
rotatespeed = 8f;
|
rotatespeed = 8f;
|
||||||
powerUsed = 7f;
|
powerUsed = 7 / 30f;
|
||||||
powerCapacity = 30f;
|
basePowerUse = 30f; // capacity
|
||||||
range = 150f;
|
range = 150f;
|
||||||
shootEffect = ShootFx.lightningShoot;
|
shootEffect = ShootFx.lightningShoot;
|
||||||
heatColor = Color.RED;
|
heatColor = Color.RED;
|
||||||
@@ -255,8 +255,8 @@ public class TurretBlocks extends BlockList implements ContentList{
|
|||||||
recoil = 4f;
|
recoil = 4f;
|
||||||
size = 4;
|
size = 4;
|
||||||
shootShake = 2f;
|
shootShake = 2f;
|
||||||
powerUsed = 60f;
|
powerUsed = 0.5f;
|
||||||
powerCapacity = 120f;
|
basePowerUse = 120f; // capacity
|
||||||
range = 160f;
|
range = 160f;
|
||||||
reload = 200f;
|
reload = 200f;
|
||||||
firingMoveFract = 0.1f;
|
firingMoveFract = 0.1f;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class UnitBlocks extends BlockList implements ContentList{
|
|||||||
type = UnitTypes.spirit;
|
type = UnitTypes.spirit;
|
||||||
produceTime = 5700;
|
produceTime = 5700;
|
||||||
size = 2;
|
size = 2;
|
||||||
consumes.power(0.08f);
|
basePowerUse = 0.08f;
|
||||||
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 30), new ItemStack(Items.lead, 30)});
|
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 30), new ItemStack(Items.lead, 30)});
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ public class UnitBlocks extends BlockList implements ContentList{
|
|||||||
type = UnitTypes.phantom;
|
type = UnitTypes.phantom;
|
||||||
produceTime = 7300;
|
produceTime = 7300;
|
||||||
size = 2;
|
size = 2;
|
||||||
consumes.power(0.2f);
|
basePowerUse = 0.2f;
|
||||||
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 70), new ItemStack(Items.lead, 80), new ItemStack(Items.titanium, 80)});
|
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 70), new ItemStack(Items.lead, 80), new ItemStack(Items.titanium, 80)});
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ public class UnitBlocks extends BlockList implements ContentList{
|
|||||||
type = UnitTypes.wraith;
|
type = UnitTypes.wraith;
|
||||||
produceTime = 1800;
|
produceTime = 1800;
|
||||||
size = 2;
|
size = 2;
|
||||||
consumes.power(0.1f);
|
basePowerUse = 0.1f;
|
||||||
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 10), new ItemStack(Items.titanium, 10)});
|
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 10), new ItemStack(Items.titanium, 10)});
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ public class UnitBlocks extends BlockList implements ContentList{
|
|||||||
type = UnitTypes.ghoul;
|
type = UnitTypes.ghoul;
|
||||||
produceTime = 3600;
|
produceTime = 3600;
|
||||||
size = 3;
|
size = 3;
|
||||||
consumes.power(0.2f);
|
basePowerUse = 0.2f;
|
||||||
shadow = "shadow-round-3";
|
shadow = "shadow-round-3";
|
||||||
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 30), new ItemStack(Items.titanium, 30), new ItemStack(Items.plastanium, 20)});
|
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 30), new ItemStack(Items.titanium, 30), new ItemStack(Items.plastanium, 20)});
|
||||||
}};
|
}};
|
||||||
@@ -53,7 +53,7 @@ public class UnitBlocks extends BlockList implements ContentList{
|
|||||||
type = UnitTypes.revenant;
|
type = UnitTypes.revenant;
|
||||||
produceTime = 8000;
|
produceTime = 8000;
|
||||||
size = 4;
|
size = 4;
|
||||||
consumes.power(0.3f);
|
basePowerUse = 0.3f;
|
||||||
shadow = "shadow-round-4";
|
shadow = "shadow-round-4";
|
||||||
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 80), new ItemStack(Items.titanium, 80), new ItemStack(Items.plastanium, 50)});
|
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 80), new ItemStack(Items.titanium, 80), new ItemStack(Items.plastanium, 50)});
|
||||||
}};
|
}};
|
||||||
@@ -62,7 +62,7 @@ public class UnitBlocks extends BlockList implements ContentList{
|
|||||||
type = UnitTypes.dagger;
|
type = UnitTypes.dagger;
|
||||||
produceTime = 1700;
|
produceTime = 1700;
|
||||||
size = 2;
|
size = 2;
|
||||||
consumes.power(0.05f);
|
basePowerUse = 0.05f;
|
||||||
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 10)});
|
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 10)});
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ public class UnitBlocks extends BlockList implements ContentList{
|
|||||||
type = UnitTypes.titan;
|
type = UnitTypes.titan;
|
||||||
produceTime = 3400;
|
produceTime = 3400;
|
||||||
size = 3;
|
size = 3;
|
||||||
consumes.power(0.15f);
|
basePowerUse = 0.15f;
|
||||||
shadow = "shadow-round-3";
|
shadow = "shadow-round-3";
|
||||||
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 20), new ItemStack(Items.thorium, 30)});
|
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 20), new ItemStack(Items.thorium, 30)});
|
||||||
}};
|
}};
|
||||||
@@ -79,7 +79,7 @@ public class UnitBlocks extends BlockList implements ContentList{
|
|||||||
type = UnitTypes.fortress;
|
type = UnitTypes.fortress;
|
||||||
produceTime = 5000;
|
produceTime = 5000;
|
||||||
size = 3;
|
size = 3;
|
||||||
consumes.power(0.2f);
|
basePowerUse = 0.2f;
|
||||||
shadow = "shadow-round-3";
|
shadow = "shadow-round-3";
|
||||||
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 40), new ItemStack(Items.thorium, 50)});
|
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 40), new ItemStack(Items.thorium, 50)});
|
||||||
}};
|
}};
|
||||||
|
|||||||
@@ -9,55 +9,57 @@ public class UpgradeBlocks extends BlockList{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(){
|
public void load(){
|
||||||
|
// Note: MechPads are buffered; all basePowerUse values represent total capacity
|
||||||
|
|
||||||
alphaPad = new MechPad("alpha-mech-pad"){{
|
alphaPad = new MechPad("alpha-mech-pad"){{
|
||||||
mech = Mechs.alpha;
|
mech = Mechs.alpha;
|
||||||
size = 2;
|
size = 2;
|
||||||
powerCapacity = 50f;
|
basePowerUse = 50f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
deltaPad = new MechPad("delta-mech-pad"){{
|
deltaPad = new MechPad("delta-mech-pad"){{
|
||||||
mech = Mechs.delta;
|
mech = Mechs.delta;
|
||||||
size = 2;
|
size = 2;
|
||||||
powerCapacity = 70f;
|
basePowerUse = 70f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
tauPad = new MechPad("tau-mech-pad"){{
|
tauPad = new MechPad("tau-mech-pad"){{
|
||||||
mech = Mechs.tau;
|
mech = Mechs.tau;
|
||||||
size = 2;
|
size = 2;
|
||||||
powerCapacity = 100f;
|
basePowerUse = 100f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
omegaPad = new MechPad("omega-mech-pad"){{
|
omegaPad = new MechPad("omega-mech-pad"){{
|
||||||
mech = Mechs.omega;
|
mech = Mechs.omega;
|
||||||
size = 3;
|
size = 3;
|
||||||
powerCapacity = 120f;
|
basePowerUse = 120f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
dartPad = new MechPad("dart-ship-pad"){{
|
dartPad = new MechPad("dart-ship-pad"){{
|
||||||
mech = Mechs.dart;
|
mech = Mechs.dart;
|
||||||
size = 2;
|
size = 2;
|
||||||
powerCapacity = 50f;
|
basePowerUse = 50f;
|
||||||
shadow = "shadow-rounded-2";
|
shadow = "shadow-rounded-2";
|
||||||
}};
|
}};
|
||||||
|
|
||||||
javelinPad = new MechPad("javelin-ship-pad"){{
|
javelinPad = new MechPad("javelin-ship-pad"){{
|
||||||
mech = Mechs.javelin;
|
mech = Mechs.javelin;
|
||||||
size = 2;
|
size = 2;
|
||||||
powerCapacity = 80f;
|
basePowerUse = 80f;
|
||||||
shadow = "shadow-rounded-2";
|
shadow = "shadow-rounded-2";
|
||||||
}};
|
}};
|
||||||
|
|
||||||
tridentPad = new MechPad("trident-ship-pad"){{
|
tridentPad = new MechPad("trident-ship-pad"){{
|
||||||
mech = Mechs.trident;
|
mech = Mechs.trident;
|
||||||
size = 2;
|
size = 2;
|
||||||
powerCapacity = 100f;
|
basePowerUse = 100f;
|
||||||
shadow = "shadow-rounded-2";
|
shadow = "shadow-rounded-2";
|
||||||
}};
|
}};
|
||||||
|
|
||||||
glaivePad = new MechPad("glaive-ship-pad"){{
|
glaivePad = new MechPad("glaive-ship-pad"){{
|
||||||
mech = Mechs.glaive;
|
mech = Mechs.glaive;
|
||||||
size = 3;
|
size = 3;
|
||||||
powerCapacity = 120f;
|
basePowerUse = 120f;
|
||||||
shadow = "shadow-round-3";
|
shadow = "shadow-round-3";
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import io.anuke.mindustry.world.blocks.defense.turrets.PowerTurret;
|
|||||||
import io.anuke.mindustry.world.blocks.defense.turrets.Turret;
|
import io.anuke.mindustry.world.blocks.defense.turrets.Turret;
|
||||||
import io.anuke.mindustry.world.blocks.power.NuclearReactor;
|
import io.anuke.mindustry.world.blocks.power.NuclearReactor;
|
||||||
import io.anuke.mindustry.world.blocks.power.PowerGenerator;
|
import io.anuke.mindustry.world.blocks.power.PowerGenerator;
|
||||||
import io.anuke.mindustry.world.blocks.power.SolarGenerator;
|
|
||||||
import io.anuke.mindustry.world.blocks.storage.CoreBlock;
|
import io.anuke.mindustry.world.blocks.storage.CoreBlock;
|
||||||
import io.anuke.mindustry.world.blocks.storage.StorageBlock;
|
import io.anuke.mindustry.world.blocks.storage.StorageBlock;
|
||||||
import io.anuke.mindustry.world.blocks.units.UnitFactory;
|
import io.anuke.mindustry.world.blocks.units.UnitFactory;
|
||||||
@@ -115,7 +114,8 @@ public class FortressGenerator{
|
|||||||
seeder.get(PowerBlocks.solarPanel, tile -> tile.block() == PowerBlocks.largeSolarPanel && gen.random.chance(0.3)),
|
seeder.get(PowerBlocks.solarPanel, tile -> tile.block() == PowerBlocks.largeSolarPanel && gen.random.chance(0.3)),
|
||||||
|
|
||||||
//coal gens
|
//coal gens
|
||||||
seeder.get(PowerBlocks.combustionGenerator, tile -> tile.block() instanceof SolarGenerator && gen.random.chance(0.2)),
|
// TODO Verify - This used to be solar panel
|
||||||
|
seeder.get(PowerBlocks.combustionGenerator, tile -> tile.block() instanceof PowerGenerator && gen.random.chance(0.2)),
|
||||||
|
|
||||||
//water extractors
|
//water extractors
|
||||||
seeder.get(ProductionBlocks.waterExtractor, tile -> tile.block() instanceof NuclearReactor && gen.random.chance(0.5)),
|
seeder.get(ProductionBlocks.waterExtractor, tile -> tile.block() instanceof NuclearReactor && gen.random.chance(0.5)),
|
||||||
@@ -181,7 +181,7 @@ public class FortressGenerator{
|
|||||||
Block block = tile.block();
|
Block block = tile.block();
|
||||||
|
|
||||||
if(block instanceof PowerTurret){
|
if(block instanceof PowerTurret){
|
||||||
tile.entity.power.amount = block.powerCapacity;
|
tile.entity.power.satisfaction = 1.0f;
|
||||||
}else if(block instanceof ItemTurret){
|
}else if(block instanceof ItemTurret){
|
||||||
ItemTurret turret = (ItemTurret)block;
|
ItemTurret turret = (ItemTurret)block;
|
||||||
AmmoType[] type = turret.getAmmoTypes();
|
AmmoType[] type = turret.getAmmoTypes();
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ public abstract class BaseBlock extends MappableContent{
|
|||||||
public boolean outputsPower;
|
public boolean outputsPower;
|
||||||
|
|
||||||
public boolean bufferedPowerConsumer = false;
|
public boolean bufferedPowerConsumer = false;
|
||||||
|
/** In case of unbuffered consumers, this stores the amount of power which is required per tick in order to work at maximum efficiency.
|
||||||
|
* In case of buffered consumers, this stores the maximum power capacity.
|
||||||
|
*/
|
||||||
public float basePowerUse = 0;
|
public float basePowerUse = 0;
|
||||||
|
|
||||||
public int itemCapacity;
|
public int itemCapacity;
|
||||||
|
|||||||
@@ -331,8 +331,8 @@ public class Block extends BaseBlock {
|
|||||||
consumes.forEach(cons -> cons.display(stats));
|
consumes.forEach(cons -> cons.display(stats));
|
||||||
|
|
||||||
if(hasPower){
|
if(hasPower){
|
||||||
if(bufferedPowerConsumer) stats.add(BlockStat.powerUse, basePowerUse, StatUnit.powerUnits);
|
if(bufferedPowerConsumer) stats.add(BlockStat.powerCapacity, basePowerUse, StatUnit.powerUnits);
|
||||||
else stats.add(BlockStat.powerCapacity, basePowerUse, StatUnit.powerUnits);
|
else stats.add(BlockStat.powerUse, basePowerUse * 60, StatUnit.powerUnits);
|
||||||
}
|
}
|
||||||
if(hasLiquids) stats.add(BlockStat.liquidCapacity, liquidCapacity, StatUnit.liquidUnits);
|
if(hasLiquids) stats.add(BlockStat.liquidCapacity, liquidCapacity, StatUnit.liquidUnits);
|
||||||
if(hasItems) stats.add(BlockStat.itemCapacity, itemCapacity, StatUnit.items);
|
if(hasItems) stats.add(BlockStat.itemCapacity, itemCapacity, StatUnit.items);
|
||||||
@@ -340,7 +340,7 @@ public class Block extends BaseBlock {
|
|||||||
|
|
||||||
//TODO make this easier to config.
|
//TODO make this easier to config.
|
||||||
public void setBars(){
|
public void setBars(){
|
||||||
if(hasPower) bars.add(new BlockBar(BarType.power, true, tile -> tile.entity.power.amount / powerCapacity));
|
if(bufferedPowerConsumer) bars.add(new BlockBar(BarType.power, true, tile -> tile.entity.power.satisfaction));
|
||||||
if(hasLiquids)
|
if(hasLiquids)
|
||||||
bars.add(new BlockBar(BarType.liquid, true, tile -> tile.entity.liquids.total() / liquidCapacity));
|
bars.add(new BlockBar(BarType.liquid, true, tile -> tile.entity.liquids.total() / liquidCapacity));
|
||||||
if(hasItems)
|
if(hasItems)
|
||||||
@@ -406,8 +406,8 @@ public class Block extends BaseBlock {
|
|||||||
explosiveness += tile.entity.liquids.sum((liquid, amount) -> liquid.flammability * amount / 2f);
|
explosiveness += tile.entity.liquids.sum((liquid, amount) -> liquid.flammability * amount / 2f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hasPower){
|
if(bufferedPowerConsumer){
|
||||||
power += tile.entity.power.amount;
|
power += tile.entity.power.satisfaction * tile.block().basePowerUse;
|
||||||
}
|
}
|
||||||
|
|
||||||
tempColor.mul(1f / units);
|
tempColor.mul(1f / units);
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class ForceProjector extends Block {
|
|||||||
hasPower = true;
|
hasPower = true;
|
||||||
canOverdrive = false;
|
canOverdrive = false;
|
||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
powerCapacity = 60f;
|
basePowerUse = 60f;
|
||||||
hasItems = true;
|
hasItems = true;
|
||||||
itemCapacity = 10;
|
itemCapacity = 10;
|
||||||
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.1f)).optional(true).update(false);
|
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.1f)).optional(true).update(false);
|
||||||
@@ -106,8 +106,9 @@ public class ForceProjector extends Block {
|
|||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
entity.warmup = Mathf.lerpDelta(entity.warmup, 1f, 0.1f);
|
entity.warmup = Mathf.lerpDelta(entity.warmup, 1f, 0.1f);
|
||||||
float powerUse = Math.min(powerDamage * entity.delta() * (1f + entity.buildup / breakage), powerCapacity);
|
// TODO Adapt power calculations to new power system
|
||||||
entity.power.amount -= powerUse;
|
// float powerUse = Math.min(powerDamage * entity.delta() * (1f + entity.buildup / breakage), powerCapacity);
|
||||||
|
// entity.power.amount -= powerUse;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(entity.buildup > 0){
|
if(entity.buildup > 0){
|
||||||
@@ -144,11 +145,12 @@ public class ForceProjector extends Block {
|
|||||||
Effects.effect(BulletFx.absorb, trait);
|
Effects.effect(BulletFx.absorb, trait);
|
||||||
float hit = trait.getShieldDamage()*powerDamage;
|
float hit = trait.getShieldDamage()*powerDamage;
|
||||||
entity.hit = 1f;
|
entity.hit = 1f;
|
||||||
entity.power.amount -= Math.min(hit, entity.power.amount);
|
// TODO Adapt power calculations to new power system
|
||||||
|
// entity.power.amount -= Math.min(hit, entity.power.amount);
|
||||||
if(entity.power.amount <= 0.0001f){
|
//
|
||||||
entity.buildup += trait.getShieldDamage() * entity.warmup*2f;
|
// if(entity.power.amount <= 0.0001f){
|
||||||
}
|
// entity.buildup += trait.getShieldDamage() * entity.warmup*2f;
|
||||||
|
// }
|
||||||
entity.buildup += trait.getShieldDamage() * entity.warmup;
|
entity.buildup += trait.getShieldDamage() * entity.warmup;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,12 +6,15 @@ import io.anuke.mindustry.world.meta.BlockStat;
|
|||||||
import io.anuke.mindustry.world.meta.StatUnit;
|
import io.anuke.mindustry.world.meta.StatUnit;
|
||||||
|
|
||||||
public abstract class PowerTurret extends CooledTurret{
|
public abstract class PowerTurret extends CooledTurret{
|
||||||
|
/** The percentage of power which will be used per shot. */
|
||||||
protected float powerUsed = 0.5f;
|
protected float powerUsed = 0.5f;
|
||||||
protected AmmoType shootType;
|
protected AmmoType shootType;
|
||||||
|
|
||||||
public PowerTurret(String name){
|
public PowerTurret(String name){
|
||||||
super(name);
|
super(name);
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
|
// TODO Verify for new power system
|
||||||
|
bufferedPowerConsumer = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -23,13 +26,16 @@ public abstract class PowerTurret extends CooledTurret{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasAmmo(Tile tile){
|
public boolean hasAmmo(Tile tile){
|
||||||
return tile.entity.power.amount >= powerUsed;
|
// TODO Verify for new power system
|
||||||
|
// Allow shooting as long as the turret is at least at 50% power
|
||||||
|
return tile.entity.power.satisfaction >= powerUsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AmmoType useAmmo(Tile tile){
|
public AmmoType useAmmo(Tile tile){
|
||||||
if(tile.isEnemyCheat()) return shootType;
|
if(tile.isEnemyCheat()) return shootType;
|
||||||
tile.entity.power.amount -= powerUsed;
|
// Make sure that power can not go negative in case of threading issues or similar
|
||||||
|
tile.entity.power.satisfaction -= Math.min(powerUsed, tile.entity.power.satisfaction);
|
||||||
return shootType;
|
return shootType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import java.io.IOException;
|
|||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
|
// TODO Adapt whole class to new power system
|
||||||
public class MassDriver extends Block{
|
public class MassDriver extends Block{
|
||||||
protected float range;
|
protected float range;
|
||||||
protected float rotateSpeed = 0.04f;
|
protected float rotateSpeed = 0.04f;
|
||||||
@@ -78,7 +79,8 @@ public class MassDriver extends Block{
|
|||||||
MassDriverEntity other = target.entity();
|
MassDriverEntity other = target.entity();
|
||||||
|
|
||||||
entity.reload = 1f;
|
entity.reload = 1f;
|
||||||
entity.power.amount = 0f;
|
|
||||||
|
entity.power.satisfaction = 0f;
|
||||||
|
|
||||||
DriverBulletData data = Pooling.obtain(DriverBulletData.class, DriverBulletData::new);
|
DriverBulletData data = Pooling.obtain(DriverBulletData.class, DriverBulletData::new);
|
||||||
data.from = entity;
|
data.from = entity;
|
||||||
@@ -126,7 +128,7 @@ public class MassDriver extends Block{
|
|||||||
public void setStats(){
|
public void setStats(){
|
||||||
super.setStats();
|
super.setStats();
|
||||||
|
|
||||||
stats.add(BlockStat.powerShot, powerCapacity, StatUnit.powerUnits);
|
stats.add(BlockStat.powerShot, basePowerUse, StatUnit.powerUnits);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -166,7 +168,8 @@ public class MassDriver extends Block{
|
|||||||
entity.rotation = Mathf.slerpDelta(entity.rotation, tile.angleTo(waiter), rotateSpeed);
|
entity.rotation = Mathf.slerpDelta(entity.rotation, tile.angleTo(waiter), rotateSpeed);
|
||||||
}else if(tile.entity.items.total() >= minDistribute &&
|
}else if(tile.entity.items.total() >= minDistribute &&
|
||||||
linkValid(tile) && //only fire when at least at half-capacity and power
|
linkValid(tile) && //only fire when at least at half-capacity and power
|
||||||
tile.entity.power.amount >= powerCapacity * 0.8f &&
|
// TODO adapt
|
||||||
|
//tile.entity.power.amount >= powerCapacity * 0.8f &&
|
||||||
link.block().itemCapacity - link.entity.items.total() >= minDistribute && entity.reload <= 0.0001f){
|
link.block().itemCapacity - link.entity.items.total() >= minDistribute && entity.reload <= 0.0001f){
|
||||||
|
|
||||||
MassDriverEntity other = link.entity();
|
MassDriverEntity other = link.entity();
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ public class FusionReactor extends PowerGenerator{
|
|||||||
super(name);
|
super(name);
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
powerCapacity = 100f;
|
// TODO Adapt to new power system
|
||||||
|
//powerCapacity = 100f;
|
||||||
liquidCapacity = 30f;
|
liquidCapacity = 30f;
|
||||||
hasItems = true;
|
hasItems = true;
|
||||||
}
|
}
|
||||||
@@ -33,6 +34,8 @@ public class FusionReactor extends PowerGenerator{
|
|||||||
public void setStats(){
|
public void setStats(){
|
||||||
super.setStats();
|
super.setStats();
|
||||||
|
|
||||||
|
// TODO Verify for new power system
|
||||||
|
stats.remove(BlockStat.basePowerGeneration);
|
||||||
stats.add(BlockStat.basePowerGeneration, maxPowerProduced * 60f, StatUnit.powerSecond);
|
stats.add(BlockStat.basePowerGeneration, maxPowerProduced * 60f, StatUnit.powerSecond);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,8 +49,9 @@ public class FusionReactor extends PowerGenerator{
|
|||||||
entity.warmup = Mathf.lerpDelta(entity.warmup, 0f, 0.01f);
|
entity.warmup = Mathf.lerpDelta(entity.warmup, 0f, 0.01f);
|
||||||
}
|
}
|
||||||
|
|
||||||
float powerAdded = Math.min(powerCapacity - entity.power.amount, maxPowerProduced * Mathf.pow(entity.warmup, 4f) * Timers.delta());
|
// TODO Adapt to new power system
|
||||||
entity.power.amount += powerAdded;
|
//float powerAdded = Math.min(powerCapacity - entity.power.amount, maxPowerProduced * Mathf.pow(entity.warmup, 4f) * Timers.delta());
|
||||||
|
//entity.power.amount += powerAdded;
|
||||||
entity.totalProgress += entity.warmup * Timers.delta();
|
entity.totalProgress += entity.warmup * Timers.delta();
|
||||||
|
|
||||||
tile.entity.power.graph.update();
|
tile.entity.power.graph.update();
|
||||||
|
|||||||
@@ -51,29 +51,34 @@ public abstract class ItemLiquidGenerator extends ItemGenerator{
|
|||||||
if(liquid != null && entity.liquids.get(liquid) >= 0.001f && entity.cons.valid()){
|
if(liquid != null && entity.liquids.get(liquid) >= 0.001f && entity.cons.valid()){
|
||||||
float powerPerLiquid = getLiquidEfficiency(liquid) * this.powerPerLiquid;
|
float powerPerLiquid = getLiquidEfficiency(liquid) * this.powerPerLiquid;
|
||||||
float used = Math.min(entity.liquids.get(liquid), maxLiquidGenerate * entity.delta());
|
float used = Math.min(entity.liquids.get(liquid), maxLiquidGenerate * entity.delta());
|
||||||
used = Math.min(used, (powerCapacity - entity.power.amount) / powerPerLiquid);
|
// TODO: Adapt to new power system
|
||||||
|
//used = Math.min(used, (powerCapacity - entity.power.amount) / powerPerLiquid);
|
||||||
|
|
||||||
entity.liquids.remove(liquid, used);
|
entity.liquids.remove(liquid, used);
|
||||||
entity.power.amount += used * powerPerLiquid;
|
// TODO: Adapt to new power system
|
||||||
|
//entity.power.amount += used * powerPerLiquid;
|
||||||
|
|
||||||
if(used > 0.001f && Mathf.chance(0.05 * entity.delta())){
|
if(used > 0.001f && Mathf.chance(0.05 * entity.delta())){
|
||||||
Effects.effect(generateEffect, tile.drawx() + Mathf.range(3f), tile.drawy() + Mathf.range(3f));
|
Effects.effect(generateEffect, tile.drawx() + Mathf.range(3f), tile.drawy() + Mathf.range(3f));
|
||||||
}
|
}
|
||||||
}else if(entity.cons.valid()){
|
}else if(entity.cons.valid()){
|
||||||
|
|
||||||
float maxPower = Math.min(powerCapacity - entity.power.amount, powerOutput * entity.delta()) * entity.efficiency;
|
// TODO: Adapt to new power system
|
||||||
|
//float maxPower = Math.min(powerCapacity - entity.power.amount, powerOutput * entity.delta()) * entity.efficiency;
|
||||||
|
|
||||||
if(entity.generateTime <= 0f && entity.items.total() > 0){
|
if(entity.generateTime <= 0f && entity.items.total() > 0){
|
||||||
Effects.effect(generateEffect, tile.worldx() + Mathf.range(3f), tile.worldy() + Mathf.range(3f));
|
Effects.effect(generateEffect, tile.worldx() + Mathf.range(3f), tile.worldy() + Mathf.range(3f));
|
||||||
Item item = entity.items.take();
|
Item item = entity.items.take();
|
||||||
entity.efficiency = getItemEfficiency(item);
|
// TODO: Adapt to new power system
|
||||||
|
//entity.efficiency = getItemEfficiency(item);
|
||||||
entity.explosiveness = item.explosiveness;
|
entity.explosiveness = item.explosiveness;
|
||||||
entity.generateTime = 1f;
|
entity.generateTime = 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(entity.generateTime > 0f){
|
if(entity.generateTime > 0f){
|
||||||
entity.generateTime -= 1f / itemDuration * entity.delta();
|
entity.generateTime -= 1f / itemDuration * entity.delta();
|
||||||
entity.power.amount += maxPower;
|
// TODO: Adapt to new power system
|
||||||
|
//entity.power.amount += maxPower;
|
||||||
entity.generateTime = Mathf.clamp(entity.generateTime);
|
entity.generateTime = Mathf.clamp(entity.generateTime);
|
||||||
|
|
||||||
if(Mathf.chance(entity.delta() * 0.06 * Mathf.clamp(entity.explosiveness - 0.25f))){
|
if(Mathf.chance(entity.delta() * 0.06 * Mathf.clamp(entity.explosiveness - 0.25f))){
|
||||||
|
|||||||
@@ -53,10 +53,12 @@ public abstract class LiquidGenerator extends PowerGenerator{
|
|||||||
if(entity.liquids.get(entity.liquids.current()) >= 0.001f){
|
if(entity.liquids.get(entity.liquids.current()) >= 0.001f){
|
||||||
float powerPerLiquid = getEfficiency(entity.liquids.current()) * this.powerPerLiquid;
|
float powerPerLiquid = getEfficiency(entity.liquids.current()) * this.powerPerLiquid;
|
||||||
float used = Math.min(entity.liquids.currentAmount(), maxLiquidGenerate * entity.delta());
|
float used = Math.min(entity.liquids.currentAmount(), maxLiquidGenerate * entity.delta());
|
||||||
used = Math.min(used, (powerCapacity - entity.power.amount) / powerPerLiquid);
|
// TODO Adapt to new power system
|
||||||
|
//used = Math.min(used, (powerCapacity - entity.power.amount) / powerPerLiquid);
|
||||||
|
|
||||||
entity.liquids.remove(entity.liquids.current(), used);
|
entity.liquids.remove(entity.liquids.current(), used);
|
||||||
entity.power.amount += used * powerPerLiquid;
|
// TODO Adapt to new power system
|
||||||
|
//entity.power.amount += used * powerPerLiquid;
|
||||||
|
|
||||||
if(used > 0.001f && Mathf.chance(0.05 * entity.delta())){
|
if(used > 0.001f && Mathf.chance(0.05 * entity.delta())){
|
||||||
Effects.effect(generateEffect, tile.drawx() + Mathf.range(3f), tile.drawy() + Mathf.range(3f));
|
Effects.effect(generateEffect, tile.drawx() + Mathf.range(3f), tile.drawy() + Mathf.range(3f));
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ public class LiquidHeatGenerator extends LiquidGenerator{
|
|||||||
public void setStats(){
|
public void setStats(){
|
||||||
super.setStats();
|
super.setStats();
|
||||||
|
|
||||||
|
// TODO Verify for new power system
|
||||||
|
stats.remove(BlockStat.basePowerGeneration);
|
||||||
stats.add(BlockStat.basePowerGeneration, maxLiquidGenerate * powerPerLiquid * 60f, StatUnit.powerSecond);
|
stats.add(BlockStat.basePowerGeneration, maxLiquidGenerate * powerPerLiquid * 60f, StatUnit.powerSecond);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,8 @@ public class NuclearReactor extends PowerGenerator{
|
|||||||
super(name);
|
super(name);
|
||||||
itemCapacity = 30;
|
itemCapacity = 30;
|
||||||
liquidCapacity = 50;
|
liquidCapacity = 50;
|
||||||
powerCapacity = 80f;
|
// TODO Adapt to new power system
|
||||||
|
//powerCapacity = 80f;
|
||||||
hasItems = true;
|
hasItems = true;
|
||||||
hasLiquids = true;
|
hasLiquids = true;
|
||||||
|
|
||||||
@@ -75,6 +76,9 @@ public class NuclearReactor extends PowerGenerator{
|
|||||||
public void setStats(){
|
public void setStats(){
|
||||||
super.setStats();
|
super.setStats();
|
||||||
stats.add(BlockStat.inputLiquid, new LiquidFilterValue(liquid -> liquid.temperature <= 0.5f));
|
stats.add(BlockStat.inputLiquid, new LiquidFilterValue(liquid -> liquid.temperature <= 0.5f));
|
||||||
|
|
||||||
|
// TODO Verify for new power system
|
||||||
|
stats.remove(BlockStat.basePowerGeneration);
|
||||||
stats.add(BlockStat.basePowerGeneration, powerMultiplier * 60f * 0.5f, StatUnit.powerSecond);
|
stats.add(BlockStat.basePowerGeneration, powerMultiplier * 60f * 0.5f, StatUnit.powerSecond);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,8 +91,9 @@ public class NuclearReactor extends PowerGenerator{
|
|||||||
|
|
||||||
if(fuel > 0){
|
if(fuel > 0){
|
||||||
entity.heat += fullness * heating * Math.min(entity.delta(), 4f);
|
entity.heat += fullness * heating * Math.min(entity.delta(), 4f);
|
||||||
entity.power.amount += powerMultiplier * fullness * entity.delta();
|
// TODO Adapt to new power system
|
||||||
entity.power.amount = Mathf.clamp(entity.power.amount, 0f, powerCapacity);
|
//entity.power.amount += powerMultiplier * fullness * entity.delta();
|
||||||
|
//entity.power.amount = Mathf.clamp(entity.power.amount, 0f, powerCapacity);
|
||||||
if(entity.timer.get(timerFuel, fuelUseTime)){
|
if(entity.timer.get(timerFuel, fuelUseTime)){
|
||||||
entity.items.remove(consumes.item(), 1);
|
entity.items.remove(consumes.item(), 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package io.anuke.mindustry.world.blocks.power;
|
package io.anuke.mindustry.world.blocks.power;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.world.meta.StatUnit;
|
||||||
import io.anuke.ucore.util.EnumSet;
|
import io.anuke.ucore.util.EnumSet;
|
||||||
|
|
||||||
import io.anuke.mindustry.entities.TileEntity;
|
import io.anuke.mindustry.entities.TileEntity;
|
||||||
@@ -8,6 +9,7 @@ import io.anuke.mindustry.world.meta.BlockFlag;
|
|||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
|
|
||||||
public class PowerGenerator extends PowerDistributor{
|
public class PowerGenerator extends PowerDistributor{
|
||||||
|
/** The amount of power produced per tick. */
|
||||||
public float powerProduction;
|
public float powerProduction;
|
||||||
public BlockStat generationType = BlockStat.basePowerGeneration;
|
public BlockStat generationType = BlockStat.basePowerGeneration;
|
||||||
|
|
||||||
@@ -20,7 +22,7 @@ public class PowerGenerator extends PowerDistributor{
|
|||||||
@Override
|
@Override
|
||||||
public void setStats(){
|
public void setStats(){
|
||||||
super.setStats();
|
super.setStats();
|
||||||
stats.add(generationType, baseGeneration * 60f, StatUnit.powerSecond);
|
stats.add(generationType, powerProduction, StatUnit.powerSecond);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -87,6 +87,8 @@ public class PowerGraph{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void distributePower(float needed, float produced){
|
public void distributePower(float needed, float produced){
|
||||||
|
if(needed == 0f){ return; }
|
||||||
|
|
||||||
float satisfaction = Math.min(1, produced / needed);
|
float satisfaction = Math.min(1, produced / needed);
|
||||||
for(Tile consumer : consumers){
|
for(Tile consumer : consumers){
|
||||||
if(consumer.block().bufferedPowerConsumer){
|
if(consumer.block().bufferedPowerConsumer){
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ public class PowerNode extends PowerBlock{
|
|||||||
super(name);
|
super(name);
|
||||||
expanded = true;
|
expanded = true;
|
||||||
layer = Layer.power;
|
layer = Layer.power;
|
||||||
powerCapacity = 5f;
|
|
||||||
configurable = true;
|
configurable = true;
|
||||||
consumesPower = false;
|
consumesPower = false;
|
||||||
outputsPower = false;
|
outputsPower = false;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class Incinerator extends Block{
|
|||||||
update = true;
|
update = true;
|
||||||
solid = true;
|
solid = true;
|
||||||
|
|
||||||
consumes.power(0.05f);
|
basePowerUse = 0.05f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import io.anuke.mindustry.graphics.Shaders;
|
|||||||
import io.anuke.mindustry.type.Mech;
|
import io.anuke.mindustry.type.Mech;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.consumers.ConsumePowerExact;
|
|
||||||
import io.anuke.mindustry.world.meta.BlockStat;
|
import io.anuke.mindustry.world.meta.BlockStat;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Graphics;
|
import io.anuke.ucore.core.Graphics;
|
||||||
@@ -37,6 +36,7 @@ import static io.anuke.mindustry.Vars.tilesize;
|
|||||||
public class MechPad extends Block{
|
public class MechPad extends Block{
|
||||||
protected Mech mech;
|
protected Mech mech;
|
||||||
protected float buildTime = 60 * 5;
|
protected float buildTime = 60 * 5;
|
||||||
|
protected float requiredSatisfaction = 1f;
|
||||||
|
|
||||||
protected TextureRegion openRegion;
|
protected TextureRegion openRegion;
|
||||||
|
|
||||||
@@ -45,18 +45,19 @@ public class MechPad extends Block{
|
|||||||
update = true;
|
update = true;
|
||||||
solidifes = true;
|
solidifes = true;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
|
bufferedPowerConsumer = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(){
|
public void init(){
|
||||||
consumes.add(new ConsumePowerExact(powerCapacity * 0.8f));
|
|
||||||
super.init();
|
super.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setStats(){
|
public void setStats(){
|
||||||
super.setStats();
|
super.setStats();
|
||||||
stats.remove(BlockStat.powerUse);
|
// TODO Verify for new power system
|
||||||
|
//stats.remove(BlockStat.powerUse);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -66,10 +67,14 @@ public class MechPad extends Block{
|
|||||||
|
|
||||||
@Remote(targets = Loc.both, called = Loc.server)
|
@Remote(targets = Loc.both, called = Loc.server)
|
||||||
public static void onMechFactoryTap(Player player, Tile tile){
|
public static void onMechFactoryTap(Player player, Tile tile){
|
||||||
if(player == null || !checkValidTap(tile, player)) return;
|
if(player == null || !checkValidTap(tile, player) || !(tile.block() instanceof MechPad)) return;
|
||||||
|
|
||||||
MechFactoryEntity entity = tile.entity();
|
MechFactoryEntity entity = tile.entity();
|
||||||
entity.power.amount = 0f;
|
MechPad pad = (MechPad)tile.block();
|
||||||
|
|
||||||
|
if(entity.power.satisfaction < pad.requiredSatisfaction) return;
|
||||||
|
|
||||||
|
entity.power.satisfaction -= Math.min(entity.power.satisfaction, pad.requiredSatisfaction);
|
||||||
player.beginRespawning(entity);
|
player.beginRespawning(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +107,7 @@ public class MechPad extends Block{
|
|||||||
|
|
||||||
protected static boolean checkValidTap(Tile tile, Player player){
|
protected static boolean checkValidTap(Tile tile, Player player){
|
||||||
MechFactoryEntity entity = tile.entity();
|
MechFactoryEntity entity = tile.entity();
|
||||||
return Math.abs(player.x - tile.drawx()) <= tile.block().size * tilesize / 2f &&
|
return Math.abs(player.x - tile.drawx()) <= tile.block().size * tilesize / 2f &&
|
||||||
Math.abs(player.y - tile.drawy()) <= tile.block().size * tilesize / 2f && entity.cons.valid() && entity.player == null;
|
Math.abs(player.y - tile.drawy()) <= tile.block().size * tilesize / 2f && entity.cons.valid() && entity.player == null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ import static io.anuke.mindustry.Vars.*;
|
|||||||
public class Reconstructor extends Block{
|
public class Reconstructor extends Block{
|
||||||
protected float departTime = 30f;
|
protected float departTime = 30f;
|
||||||
protected float arriveTime = 40f;
|
protected float arriveTime = 40f;
|
||||||
protected float powerPerTeleport = 5f;
|
/** Stores the percentage of buffered power to be used upon teleporting. */
|
||||||
|
protected float powerPerTeleport = 0.5f;
|
||||||
protected Effect arriveEffect = Fx.spawn;
|
protected Effect arriveEffect = Fx.spawn;
|
||||||
protected TextureRegion openRegion;
|
protected TextureRegion openRegion;
|
||||||
|
|
||||||
@@ -43,13 +44,15 @@ public class Reconstructor extends Block{
|
|||||||
solidifes = true;
|
solidifes = true;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
configurable = true;
|
configurable = true;
|
||||||
|
basePowerUse = 30f; // capacity
|
||||||
|
bufferedPowerConsumer = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static boolean checkValidTap(Tile tile, ReconstructorEntity entity, Player player){
|
protected static boolean checkValidTap(Tile tile, ReconstructorEntity entity, Player player){
|
||||||
return validLink(tile, entity.link) &&
|
return validLink(tile, entity.link) &&
|
||||||
Math.abs(player.x - tile.drawx()) <= tile.block().size * tilesize / 2f &&
|
Math.abs(player.x - tile.drawx()) <= tile.block().size * tilesize / 2f &&
|
||||||
Math.abs(player.y - tile.drawy()) <= tile.block().size * tilesize / 2f &&
|
Math.abs(player.y - tile.drawy()) <= tile.block().size * tilesize / 2f &&
|
||||||
entity.current == null && entity.power.amount >= ((Reconstructor) tile.block()).powerPerTeleport;
|
entity.current == null && entity.power.satisfaction >= ((Reconstructor) tile.block()).powerPerTeleport;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static boolean validLink(Tile tile, int position){
|
protected static boolean validLink(Tile tile, int position){
|
||||||
@@ -74,13 +77,13 @@ public class Reconstructor extends Block{
|
|||||||
public static void reconstructPlayer(Player player, Tile tile){
|
public static void reconstructPlayer(Player player, Tile tile){
|
||||||
ReconstructorEntity entity = tile.entity();
|
ReconstructorEntity entity = tile.entity();
|
||||||
|
|
||||||
if(!checkValidTap(tile, entity, player) || entity.power.amount < ((Reconstructor) tile.block()).powerPerTeleport)
|
if(!checkValidTap(tile, entity, player) || entity.power.satisfaction < ((Reconstructor) tile.block()).powerPerTeleport)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
entity.departing = true;
|
entity.departing = true;
|
||||||
entity.current = player;
|
entity.current = player;
|
||||||
entity.solid = false;
|
entity.solid = false;
|
||||||
entity.power.amount -= ((Reconstructor) tile.block()).powerPerTeleport;
|
entity.power.satisfaction -= Math.min(entity.power.satisfaction, ((Reconstructor) tile.block()).powerPerTeleport);
|
||||||
entity.updateTime = 1f;
|
entity.updateTime = 1f;
|
||||||
entity.set(tile.drawx(), tile.drawy());
|
entity.set(tile.drawx(), tile.drawy());
|
||||||
player.rotation = 90f;
|
player.rotation = 90f;
|
||||||
@@ -246,13 +249,13 @@ public class Reconstructor extends Block{
|
|||||||
entity.updateTime -= Timers.delta() / departTime;
|
entity.updateTime -= Timers.delta() / departTime;
|
||||||
if(entity.updateTime <= 0f){
|
if(entity.updateTime <= 0f){
|
||||||
//no power? death.
|
//no power? death.
|
||||||
if(other.power.amount < powerPerTeleport){
|
if(other.power.satisfaction < powerPerTeleport){
|
||||||
entity.current.setDead(true);
|
entity.current.setDead(true);
|
||||||
//entity.current.setRespawning(false);
|
//entity.current.setRespawning(false);
|
||||||
entity.current = null;
|
entity.current = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
other.power.amount -= powerPerTeleport;
|
other.power.satisfaction -= Math.min(other.power.satisfaction, powerPerTeleport);
|
||||||
other.current = entity.current;
|
other.current = entity.current;
|
||||||
other.departing = false;
|
other.departing = false;
|
||||||
other.current.set(other.x, other.y);
|
other.current.set(other.x, other.y);
|
||||||
@@ -276,8 +279,8 @@ public class Reconstructor extends Block{
|
|||||||
|
|
||||||
if(validLink(tile, entity.link)){
|
if(validLink(tile, entity.link)){
|
||||||
Tile other = world.tile(entity.link);
|
Tile other = world.tile(entity.link);
|
||||||
if(other.entity.power.amount >= powerPerTeleport && Units.anyEntities(tile, 4f, unit -> unit.getTeam() == entity.getTeam() && unit instanceof Player) &&
|
if(other.entity.power.satisfaction >= powerPerTeleport && Units.anyEntities(tile, 4f, unit -> unit.getTeam() == entity.getTeam() && unit instanceof Player) &&
|
||||||
entity.power.amount >= powerPerTeleport){
|
entity.power.satisfaction >= powerPerTeleport){
|
||||||
entity.solid = false;
|
entity.solid = false;
|
||||||
stayOpen = true;
|
stayOpen = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,8 +37,9 @@ public class RepairPoint extends Block{
|
|||||||
layer = Layer.turret;
|
layer = Layer.turret;
|
||||||
layer2 = Layer.laser;
|
layer2 = Layer.laser;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
powerCapacity = 20f;
|
// TODO Adapt to new power system - Make it use power while repairing
|
||||||
consumes.power(0.06f);
|
basePowerUse = 20f; // capacity
|
||||||
|
bufferedPowerConsumer = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -89,6 +90,7 @@ public class RepairPoint extends Block{
|
|||||||
}else if(entity.target != null){
|
}else if(entity.target != null){
|
||||||
entity.target.health += repairSpeed * Timers.delta() * entity.strength;
|
entity.target.health += repairSpeed * Timers.delta() * entity.strength;
|
||||||
entity.target.clampHealth();
|
entity.target.clampHealth();
|
||||||
|
// TODO: Make it use power here and reset power once target goes null
|
||||||
entity.rotation = Mathf.slerpDelta(entity.rotation, entity.angleTo(entity.target), 0.5f);
|
entity.rotation = Mathf.slerpDelta(entity.rotation, entity.angleTo(entity.target), 0.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,12 +30,6 @@ public class Consumers{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConsumePower power(float amount){
|
|
||||||
ConsumePower p = new ConsumePower(amount);
|
|
||||||
add(p);
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ConsumeLiquid liquid(Liquid liquid, float amount){
|
public ConsumeLiquid liquid(Liquid liquid, float amount){
|
||||||
ConsumeLiquid c = new ConsumeLiquid(liquid, amount);
|
ConsumeLiquid c = new ConsumeLiquid(liquid, amount);
|
||||||
add(c);
|
add(c);
|
||||||
|
|||||||
@@ -8,7 +8,12 @@ import java.io.DataOutput;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class PowerModule extends BlockModule{
|
public class PowerModule extends BlockModule{
|
||||||
|
/** In case of unbuffered consumers, this is the percentage (1.0f = 100%) of the demanded power which can be supplied.
|
||||||
|
* Blocks will work at a reduced efficiency if this is not equal to 1.0f.
|
||||||
|
* In case of buffered consumers, this is the percentage of power stored in relation to the maximum capacity.
|
||||||
|
*/
|
||||||
public float satisfaction;
|
public float satisfaction;
|
||||||
|
/** Specifies power which is required additionally, e.g. while a force projector is being shot at. */
|
||||||
public float extraUse = 0f;
|
public float extraUse = 0f;
|
||||||
public PowerGraph graph = new PowerGraph();
|
public PowerGraph graph = new PowerGraph();
|
||||||
public IntArray links = new IntArray();
|
public IntArray links = new IntArray();
|
||||||
|
|||||||
Reference in New Issue
Block a user