This commit is contained in:
Anuken
2019-01-27 09:19:23 -05:00
parent 6723157ca5
commit f31fd622dd
6 changed files with 39 additions and 83 deletions

View File

@@ -507,6 +507,7 @@ liquid.heatcapacity = [LIGHT_GRAY]Heat Capacity: {0}
liquid.viscosity = [LIGHT_GRAY]Viscosity: {0} liquid.viscosity = [LIGHT_GRAY]Viscosity: {0}
liquid.temperature = [LIGHT_GRAY]Temperature: {0} liquid.temperature = [LIGHT_GRAY]Temperature: {0}
block.graphite-press.name = Graphite Press block.graphite-press.name = Graphite Press
block.multi-press.name = Multi-Press
block.constructing = {0} [LIGHT_GRAY](Constructing) block.constructing = {0} [LIGHT_GRAY](Constructing)
block.spawn.name = Enemy Spawn block.spawn.name = Enemy Spawn
block.core.name = Core block.core.name = Core

View File

@@ -361,10 +361,10 @@ public class Blocks implements ContentList{
separator = new Separator("separator"){{ separator = new Separator("separator"){{
requirements(Category.crafting, ItemStack.with(Items.copper, 60, Items.titanium, 50)); requirements(Category.crafting, ItemStack.with(Items.copper, 60, Items.titanium, 50));
results = new ItemStack[]{ results = new ItemStack[]{
new ItemStack(Items.copper, 5), new ItemStack(Items.copper, 5),
new ItemStack(Items.lead, 3), new ItemStack(Items.lead, 3),
new ItemStack(Items.titanium, 2), new ItemStack(Items.titanium, 2),
new ItemStack(Items.thorium, 1) new ItemStack(Items.thorium, 1)
}; };
hasPower = true; hasPower = true;
filterTime = 15f; filterTime = 15f;
@@ -458,7 +458,6 @@ public class Blocks implements ContentList{
titaniumWallLarge = new Wall("titanium-wall-large"){{ titaniumWallLarge = new Wall("titanium-wall-large"){{
requirements(Category.defense, ItemStack.with(Items.titanium, 12 * 4)); requirements(Category.defense, ItemStack.with(Items.titanium, 12 * 4));
requirements(Category.defense, ItemStack.with(Items.titanium, 12));
health = 110 * wallHealthMultiplier * 4; health = 110 * wallHealthMultiplier * 4;
size = 2; size = 2;
}}; }};
@@ -470,7 +469,6 @@ public class Blocks implements ContentList{
thoriumWallLarge = new Wall("thorium-wall-large"){{ thoriumWallLarge = new Wall("thorium-wall-large"){{
requirements(Category.defense, ItemStack.with(Items.thorium, 12 * 4)); requirements(Category.defense, ItemStack.with(Items.thorium, 12 * 4));
requirements(Category.defense, ItemStack.with(Items.thorium, 12));
health = 200 * wallHealthMultiplier * 4; health = 200 * wallHealthMultiplier * 4;
size = 2; size = 2;
}}; }};
@@ -482,7 +480,6 @@ public class Blocks implements ContentList{
phaseWallLarge = new DeflectorWall("phase-wall-large"){{ phaseWallLarge = new DeflectorWall("phase-wall-large"){{
requirements(Category.defense, ItemStack.with(Items.phasefabric, 12 * 4)); requirements(Category.defense, ItemStack.with(Items.phasefabric, 12 * 4));
requirements(Category.defense, ItemStack.with(Items.phasefabric, 12));
health = 150 * 4 * wallHealthMultiplier; health = 150 * 4 * wallHealthMultiplier;
size = 2; size = 2;
}}; }};
@@ -494,7 +491,6 @@ public class Blocks implements ContentList{
surgeWallLarge = new SurgeWall("surge-wall-large"){{ surgeWallLarge = new SurgeWall("surge-wall-large"){{
requirements(Category.defense, ItemStack.with(Items.surgealloy, 12 * 4)); requirements(Category.defense, ItemStack.with(Items.surgealloy, 12 * 4));
requirements(Category.defense, ItemStack.with(Items.surgealloy, 12));
health = 230 * 4 * wallHealthMultiplier; health = 230 * 4 * wallHealthMultiplier;
size = 2; size = 2;
}}; }};
@@ -506,7 +502,6 @@ public class Blocks implements ContentList{
doorLarge = new Door("door-large"){{ doorLarge = new Door("door-large"){{
requirements(Category.defense, ItemStack.with(Items.titanium, 12 * 4, Items.silicon, 8 * 4)); requirements(Category.defense, ItemStack.with(Items.titanium, 12 * 4, Items.silicon, 8 * 4));
requirements(Category.defense, ItemStack.with(Items.titanium, 12, Items.silicon, 8));
openfx = Fx.dooropenlarge; openfx = Fx.dooropenlarge;
closefx = Fx.doorcloselarge; closefx = Fx.doorcloselarge;
health = 100 * 4 * wallHealthMultiplier; health = 100 * 4 * wallHealthMultiplier;
@@ -902,10 +897,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;
@@ -920,9 +915,9 @@ public class Blocks implements ContentList{
hail = new ArtilleryTurret("hail"){{ hail = new ArtilleryTurret("hail"){{
requirements(Category.turret, ItemStack.with(Items.copper, 60, Items.graphite, 35)); requirements(Category.turret, ItemStack.with(Items.copper, 60, Items.graphite, 35));
ammo( ammo(
Items.graphite, Bullets.artilleryDense, Items.graphite, Bullets.artilleryDense,
Items.silicon, Bullets.artilleryHoming, Items.silicon, Bullets.artilleryHoming,
Items.pyratite, Bullets.artlleryIncendiary Items.pyratite, Bullets.artlleryIncendiary
); );
reload = 60f; reload = 60f;
recoil = 2f; recoil = 2f;
@@ -935,10 +930,10 @@ public class Blocks implements ContentList{
wave = new LiquidTurret("wave"){{ wave = new LiquidTurret("wave"){{
requirements(Category.turret, ItemStack.with(Items.titanium, 70, Items.lead, 150)); requirements(Category.turret, ItemStack.with(Items.titanium, 70, Items.lead, 150));
ammo( ammo(
Liquids.water, Bullets.waterShot, Liquids.water, Bullets.waterShot,
Liquids.slag, Bullets.slagShot, Liquids.slag, Bullets.slagShot,
Liquids.cryofluid, Bullets.cryoShot, Liquids.cryofluid, Bullets.cryoShot,
Liquids.oil, Bullets.oilShot Liquids.oil, Bullets.oilShot
); );
size = 2; size = 2;
recoil = 0f; recoil = 0f;
@@ -1001,9 +996,9 @@ public class Blocks implements ContentList{
swarmer = new BurstTurret("swarmer"){{ swarmer = new BurstTurret("swarmer"){{
requirements(Category.turret, ItemStack.with(Items.graphite, 70, Items.titanium, 70, Items.plastanium, 90, Items.silicon, 60)); requirements(Category.turret, ItemStack.with(Items.graphite, 70, Items.titanium, 70, Items.plastanium, 90, Items.silicon, 60));
ammo( ammo(
Items.blastCompound, Bullets.missileExplosive, Items.blastCompound, Bullets.missileExplosive,
Items.pyratite, Bullets.missileIncendiary, Items.pyratite, Bullets.missileIncendiary,
Items.surgealloy, Bullets.missileSurge Items.surgealloy, Bullets.missileSurge
); );
reload = 50f; reload = 50f;
shots = 4; shots = 4;
@@ -1018,11 +1013,11 @@ public class Blocks implements ContentList{
salvo = new BurstTurret("salvo"){{ salvo = new BurstTurret("salvo"){{
requirements(Category.turret, ItemStack.with(Items.copper, 210, Items.graphite, 190, Items.thorium, 130)); requirements(Category.turret, ItemStack.with(Items.copper, 210, Items.graphite, 190, Items.thorium, 130));
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,
Items.thorium, Bullets.standardThorium Items.thorium, Bullets.standardThorium
); );
size = 2; size = 2;
@@ -1042,11 +1037,11 @@ public class Blocks implements ContentList{
ripple = new ArtilleryTurret("ripple"){{ ripple = new ArtilleryTurret("ripple"){{
requirements(Category.turret, ItemStack.with(Items.copper, 300, Items.graphite, 220, Items.thorium, 120)); requirements(Category.turret, ItemStack.with(Items.copper, 300, Items.graphite, 220, Items.thorium, 120));
ammo( ammo(
Items.graphite, Bullets.artilleryDense, Items.graphite, Bullets.artilleryDense,
Items.silicon, Bullets.artilleryHoming, Items.silicon, Bullets.artilleryHoming,
Items.pyratite, Bullets.artlleryIncendiary, Items.pyratite, Bullets.artlleryIncendiary,
Items.blastCompound, Bullets.artilleryExplosive, Items.blastCompound, Bullets.artilleryExplosive,
Items.plastanium, Bullets.arilleryPlastic Items.plastanium, Bullets.arilleryPlastic
); );
size = 3; size = 3;
shots = 4; shots = 4;
@@ -1067,9 +1062,9 @@ public class Blocks implements ContentList{
cyclone = new ItemTurret("cyclone"){{ cyclone = new ItemTurret("cyclone"){{
requirements(Category.turret, ItemStack.with(Items.copper, 400, Items.surgealloy, 200, Items.plastanium, 150)); requirements(Category.turret, ItemStack.with(Items.copper, 400, Items.surgealloy, 200, Items.plastanium, 150));
ammo( ammo(
Items.blastCompound, Bullets.flakExplosive, Items.blastCompound, Bullets.flakExplosive,
Items.plastanium, Bullets.flakPlastic, Items.plastanium, Bullets.flakPlastic,
Items.surgealloy, Bullets.flakSurge Items.surgealloy, Bullets.flakSurge
); );
xRand = 4f; xRand = 4f;
reload = 8f; reload = 8f;
@@ -1099,9 +1094,9 @@ public class Blocks implements ContentList{
spectre = new DoubleTurret("spectre"){{ spectre = new DoubleTurret("spectre"){{
requirements(Category.turret, ItemStack.with(Items.copper, 700, Items.graphite, 600, Items.surgealloy, 500, Items.plastanium, 350, Items.thorium, 500)); requirements(Category.turret, ItemStack.with(Items.copper, 700, Items.graphite, 600, Items.surgealloy, 500, Items.plastanium, 350, Items.thorium, 500));
ammo( ammo(
Items.graphite, Bullets.standardDenseBig, Items.graphite, Bullets.standardDenseBig,
Items.pyratite, Bullets.standardIncendiaryBig, Items.pyratite, Bullets.standardIncendiaryBig,
Items.thorium, Bullets.standardThoriumBig Items.thorium, Bullets.standardThoriumBig
); );
reload = 6f; reload = 6f;
coolantMultiplier = 0.5f; coolantMultiplier = 0.5f;

View File

@@ -153,7 +153,7 @@ public class CoreBlock extends LaunchPad{
//TODO play animation of some sort //TODO play animation of some sort
Effects.effect(Fx.dooropenlarge, tile); Effects.effect(Fx.dooropenlarge, tile);
//items sent are split evenly across every player in the game //items sent are split evenly across every player in the game
data.addItem(item, launchChunkSize / playerGroup.size()); data.addItem(item, launchChunkSize / Math.max(playerGroup.size(), 1));
entity.items.remove(item, launchChunkSize); entity.items.remove(item, launchChunkSize);
} }
} }

View File

@@ -17,31 +17,12 @@ public class ConsumePower extends Consume{
/** 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 powerCapacity, boolean isBuffered){ public ConsumePower(float powerPerTick, float powerCapacity, boolean isBuffered){
this.powerPerTick = powerPerTick; this.powerPerTick = powerPerTick;
this.powerCapacity = powerCapacity; this.powerCapacity = powerCapacity;
this.isBuffered = isBuffered; this.isBuffered = isBuffered;
} }
/**
* Makes the owner consume powerPerTick each tick and disables it unless minimumSatisfaction (1.0 = 100%) of that power is being supplied.
* @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.
*/
public static ConsumePower consumePowerDirect(float powerPerTick){
return new ConsumePower(powerPerTick, 0.0f, false);
}
/**
* Adds a power buffer to the owner which takes ticksToFill number of ticks to be filled.
* Note that this object does not remove power from the buffer.
* @param powerCapacity The maximum capacity in power units.
* @param ticksToFill The number of ticks it shall take to fill the buffer.
*/
public static ConsumePower consumePowerBuffered(float powerCapacity, float ticksToFill){
return new ConsumePower(powerCapacity / ticksToFill, powerCapacity, true);
}
@Override @Override
public void buildTooltip(Table table){ public void buildTooltip(Table table){
// No tooltip for power // No tooltip for power

View File

@@ -42,7 +42,7 @@ public class Consumers{
* @return the created consumer object. * @return the created consumer object.
*/ */
public ConsumePower power(float powerPerTick){ public ConsumePower power(float powerPerTick){
ConsumePower c = ConsumePower.consumePowerDirect(powerPerTick); ConsumePower c = new ConsumePower(powerPerTick, 0.0f, false);
add(c); add(c);
return c; return c;
} }
@@ -62,7 +62,7 @@ public class Consumers{
* @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 ConsumePower powerBuffered(float powerCapacity, float ticksToFill){ public ConsumePower powerBuffered(float powerCapacity, float ticksToFill){
ConsumePower c = ConsumePower.consumePowerBuffered(powerCapacity, ticksToFill); ConsumePower c = new ConsumePower(powerCapacity / ticksToFill, powerCapacity, true);
add(c); add(c);
return c; return c;
} }

View File

@@ -154,27 +154,6 @@ 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'