LAccess.speed / Merged #6293
This commit is contained in:
@@ -1681,6 +1681,7 @@ laccess.dead = Whether a unit/building is dead or no longer valid.
|
|||||||
laccess.controlled = Returns:\n[accent]@ctrlProcessor[] if unit controller is processor\n[accent]@ctrlPlayer[] if unit/building controller is player\n[accent]@ctrlFormation[] if unit is in formation\nOtherwise, 0.
|
laccess.controlled = Returns:\n[accent]@ctrlProcessor[] if unit controller is processor\n[accent]@ctrlPlayer[] if unit/building controller is player\n[accent]@ctrlFormation[] if unit is in formation\nOtherwise, 0.
|
||||||
laccess.commanded = [red]Deprecated. Will be removed![]\nUse [accent]controlled[] instead.
|
laccess.commanded = [red]Deprecated. Will be removed![]\nUse [accent]controlled[] instead.
|
||||||
laccess.progress = Action progress, 0 to 1.\nReturns production, turret reload or construction progress.
|
laccess.progress = Action progress, 0 to 1.\nReturns production, turret reload or construction progress.
|
||||||
|
lacess.speed = Top speed of a unit, in tiles/sec.
|
||||||
|
|
||||||
graphicstype.clear = Fill the display with a color.
|
graphicstype.clear = Fill the display with a color.
|
||||||
graphicstype.color = Set color for next drawing operations.
|
graphicstype.color = Set color for next drawing operations.
|
||||||
|
|||||||
@@ -997,7 +997,7 @@ public class Blocks{
|
|||||||
|
|
||||||
liquidCapacity = 50f;
|
liquidCapacity = 50f;
|
||||||
|
|
||||||
consumes.liquid(Liquids.water, 5f / 60f);
|
consumes.liquid(Liquids.water, 10f / 60f);
|
||||||
consumes.power(2f);
|
consumes.power(2f);
|
||||||
|
|
||||||
drawer = new DrawMulti(
|
drawer = new DrawMulti(
|
||||||
@@ -1021,7 +1021,8 @@ public class Blocks{
|
|||||||
);
|
);
|
||||||
|
|
||||||
drawer.iconOverride = new String[]{"-bottom", ""};
|
drawer.iconOverride = new String[]{"-bottom", ""};
|
||||||
outputLiquids = LiquidStack.with(Liquids.ozone, 2f * craftTime / 60, Liquids.hydrogen, 3f * craftTime / 60);
|
continuousLiquidOutput = true;
|
||||||
|
outputLiquids = LiquidStack.with(Liquids.ozone, 2f * 2f / 60, Liquids.hydrogen, 2f * 3f / 60);
|
||||||
liquidOutputDirections = new int[]{1, 3};
|
liquidOutputDirections = new int[]{1, 3};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -1055,7 +1056,7 @@ public class Blocks{
|
|||||||
|
|
||||||
outputItem = new ItemStack(Items.oxide, 1);
|
outputItem = new ItemStack(Items.oxide, 1);
|
||||||
|
|
||||||
consumes.liquid(Liquids.ozone, 1f / 60f);
|
consumes.liquid(Liquids.ozone, 2f / 60f);
|
||||||
consumes.item(Items.beryllium);
|
consumes.item(Items.beryllium);
|
||||||
consumes.power(1f);
|
consumes.power(1f);
|
||||||
|
|
||||||
@@ -1076,7 +1077,7 @@ public class Blocks{
|
|||||||
rotateDraw = false;
|
rotateDraw = false;
|
||||||
drawer.iconOverride = new String[]{""};
|
drawer.iconOverride = new String[]{""};
|
||||||
size = 2;
|
size = 2;
|
||||||
heatOutput = 2f;
|
heatOutput = 3f;
|
||||||
consumes.power(0.5f / 60f);
|
consumes.power(0.5f / 60f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -2043,7 +2044,7 @@ public class Blocks{
|
|||||||
ambientSoundVolume = 0.06f;
|
ambientSoundVolume = 0.06f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
//TODO coolr name?
|
//TODO cooler name?
|
||||||
pyrolysisGenerator = new ConsumeGenerator("pyrolysis-generator"){{
|
pyrolysisGenerator = new ConsumeGenerator("pyrolysis-generator"){{
|
||||||
//TODO requirements
|
//TODO requirements
|
||||||
requirements(Category.power, with(Items.graphite, 50, Items.carbide, 50, Items.oxide, 60f, Items.silicon, 50));
|
requirements(Category.power, with(Items.graphite, 50, Items.carbide, 50, Items.oxide, 60f, Items.silicon, 50));
|
||||||
@@ -2182,7 +2183,7 @@ public class Blocks{
|
|||||||
consumes.liquid(Liquids.water, 0.15f);
|
consumes.liquid(Liquids.water, 0.15f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
//TODO output heat
|
//TODO output heat?
|
||||||
ventCondenser = new AttributeCrafter("vent-condenser"){{
|
ventCondenser = new AttributeCrafter("vent-condenser"){{
|
||||||
requirements(Category.production, with(Items.graphite, 20, Items.beryllium, 60));
|
requirements(Category.production, with(Items.graphite, 20, Items.beryllium, 60));
|
||||||
attribute = Attribute.vent;
|
attribute = Attribute.vent;
|
||||||
@@ -2201,7 +2202,7 @@ public class Blocks{
|
|||||||
boostScale = 1f / 9f;
|
boostScale = 1f / 9f;
|
||||||
outputLiquid = new LiquidStack(Liquids.water, 30f / 60f);
|
outputLiquid = new LiquidStack(Liquids.water, 30f / 60f);
|
||||||
consumes.power(0.5f);
|
consumes.power(0.5f);
|
||||||
liquidCapacity = 20f;
|
liquidCapacity = 60f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
cliffCrusher = new WallCrafter("cliff-crusher"){{
|
cliffCrusher = new WallCrafter("cliff-crusher"){{
|
||||||
|
|||||||
@@ -185,6 +185,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
case mineX -> mining() ? mineTile.x : -1;
|
case mineX -> mining() ? mineTile.x : -1;
|
||||||
case mineY -> mining() ? mineTile.y : -1;
|
case mineY -> mining() ? mineTile.y : -1;
|
||||||
case flag -> flag;
|
case flag -> flag;
|
||||||
|
case speed -> type.speed * 60f / tilesize;
|
||||||
case controlled -> !isValid() ? 0 :
|
case controlled -> !isValid() ? 0 :
|
||||||
controller instanceof LogicAI ? ctrlProcessor :
|
controller instanceof LogicAI ? ctrlProcessor :
|
||||||
controller instanceof Player ? ctrlPlayer :
|
controller instanceof Player ? ctrlPlayer :
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ public class Rules{
|
|||||||
public boolean unitAmmo = false;
|
public boolean unitAmmo = false;
|
||||||
/** Whether cores add to unit limit */
|
/** Whether cores add to unit limit */
|
||||||
public boolean unitCapVariable = true;
|
public boolean unitCapVariable = true;
|
||||||
|
/** If true, unit spawn points are shown. */
|
||||||
|
public boolean showSpawns = false;
|
||||||
/** How fast unit factories build units. */
|
/** How fast unit factories build units. */
|
||||||
public float unitBuildSpeedMultiplier = 1f;
|
public float unitBuildSpeedMultiplier = 1f;
|
||||||
/** How much damage any other units deal. */
|
/** How much damage any other units deal. */
|
||||||
|
|||||||
@@ -113,6 +113,33 @@ public class MinimapRenderer{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Draw.reset();
|
||||||
|
if(withLabels){
|
||||||
|
drawSpawns(x, y, w, h, scaling);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void drawSpawns(float x, float y, float w, float h, float scaling){
|
||||||
|
if(!state.rules.showSpawns || !state.hasSpawns() || !state.rules.waves) return;
|
||||||
|
|
||||||
|
TextureRegion icon = Icon.units.getRegion();
|
||||||
|
|
||||||
|
Lines.stroke(3f);
|
||||||
|
|
||||||
|
Draw.color(state.rules.waveTeam.color, Tmp.c2.set(state.rules.waveTeam.color).value(1.2f), Mathf.absin(Time.time, 16f, 1f));
|
||||||
|
|
||||||
|
for(Tile tile : spawner.getSpawns()){
|
||||||
|
float tx = ((tile.x + 0.5f) / world.width()) * w;
|
||||||
|
float ty = ((tile.y + 0.5f) / world.height()) * h;
|
||||||
|
|
||||||
|
float rad = (state.rules.dropZoneRadius / (baseSize / 2f)) * 5f * scaling;
|
||||||
|
float curve = Mathf.curve(Time.time % 240f, 120f, 240f);
|
||||||
|
|
||||||
|
Draw.rect(icon, x + tx, y + ty, icon.width, icon.height);
|
||||||
|
Lines.circle(x + tx, y + ty, rad);
|
||||||
|
if(curve > 0f) Lines.circle(x + tx, y + ty, rad * Interp.pow3Out.apply(curve));
|
||||||
|
}
|
||||||
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ public enum LAccess{
|
|||||||
mineX,
|
mineX,
|
||||||
mineY,
|
mineY,
|
||||||
mining,
|
mining,
|
||||||
|
speed,
|
||||||
team,
|
team,
|
||||||
type,
|
type,
|
||||||
flag,
|
flag,
|
||||||
|
|||||||
@@ -248,7 +248,8 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
|||||||
state.rules.defaultTeam.items().add(Seq.with(ItemStack.with(Items.beryllium, 300, Items.graphite, 300)));
|
state.rules.defaultTeam.items().add(Seq.with(ItemStack.with(Items.beryllium, 300, Items.graphite, 300)));
|
||||||
|
|
||||||
//TODO proper waves
|
//TODO proper waves
|
||||||
state.rules.waves = !OS.hasProp("mindustry.debug");
|
state.rules.waves = false;
|
||||||
|
state.rules.showSpawns = true;
|
||||||
state.rules.waveTimer = true;
|
state.rules.waveTimer = true;
|
||||||
state.rules.waveSpacing = 60f * 60f * 10f;
|
state.rules.waveSpacing = 60f * 60f * 10f;
|
||||||
state.rules.spawns = Seq.with(new SpawnGroup(){{
|
state.rules.spawns = Seq.with(new SpawnGroup(){{
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ public class MinimapFragment extends Fragment{
|
|||||||
float ratio = (float)renderer.minimap.getTexture().height / renderer.minimap.getTexture().width;
|
float ratio = (float)renderer.minimap.getTexture().height / renderer.minimap.getTexture().width;
|
||||||
TextureRegion reg = Draw.wrap(renderer.minimap.getTexture());
|
TextureRegion reg = Draw.wrap(renderer.minimap.getTexture());
|
||||||
Draw.rect(reg, w/2f + panx*zoom, h/2f + pany*zoom, size, size * ratio);
|
Draw.rect(reg, w/2f + panx*zoom, h/2f + pany*zoom, size, size * ratio);
|
||||||
|
|
||||||
renderer.minimap.drawEntities(w/2f + panx*zoom - size/2f, h/2f + pany*zoom - size/2f * ratio, size, size * ratio, zoom, true);
|
renderer.minimap.drawEntities(w/2f + panx*zoom - size/2f, h/2f + pany*zoom - size/2f * ratio, size, size * ratio, zoom, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user