LAccess.speed / Merged #6293

This commit is contained in:
Anuken
2021-12-10 00:36:47 -05:00
parent 84c5bc9bdf
commit 761ee12e6f
8 changed files with 43 additions and 8 deletions

View File

@@ -997,7 +997,7 @@ public class Blocks{
liquidCapacity = 50f;
consumes.liquid(Liquids.water, 5f / 60f);
consumes.liquid(Liquids.water, 10f / 60f);
consumes.power(2f);
drawer = new DrawMulti(
@@ -1021,7 +1021,8 @@ public class Blocks{
);
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};
}};
@@ -1055,7 +1056,7 @@ public class Blocks{
outputItem = new ItemStack(Items.oxide, 1);
consumes.liquid(Liquids.ozone, 1f / 60f);
consumes.liquid(Liquids.ozone, 2f / 60f);
consumes.item(Items.beryllium);
consumes.power(1f);
@@ -1076,7 +1077,7 @@ public class Blocks{
rotateDraw = false;
drawer.iconOverride = new String[]{""};
size = 2;
heatOutput = 2f;
heatOutput = 3f;
consumes.power(0.5f / 60f);
}};
@@ -2043,7 +2044,7 @@ public class Blocks{
ambientSoundVolume = 0.06f;
}};
//TODO coolr name?
//TODO cooler name?
pyrolysisGenerator = new ConsumeGenerator("pyrolysis-generator"){{
//TODO requirements
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);
}};
//TODO output heat
//TODO output heat?
ventCondenser = new AttributeCrafter("vent-condenser"){{
requirements(Category.production, with(Items.graphite, 20, Items.beryllium, 60));
attribute = Attribute.vent;
@@ -2201,7 +2202,7 @@ public class Blocks{
boostScale = 1f / 9f;
outputLiquid = new LiquidStack(Liquids.water, 30f / 60f);
consumes.power(0.5f);
liquidCapacity = 20f;
liquidCapacity = 60f;
}};
cliffCrusher = new WallCrafter("cliff-crusher"){{

View File

@@ -185,6 +185,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
case mineX -> mining() ? mineTile.x : -1;
case mineY -> mining() ? mineTile.y : -1;
case flag -> flag;
case speed -> type.speed * 60f / tilesize;
case controlled -> !isValid() ? 0 :
controller instanceof LogicAI ? ctrlProcessor :
controller instanceof Player ? ctrlPlayer :

View File

@@ -51,6 +51,8 @@ public class Rules{
public boolean unitAmmo = false;
/** Whether cores add to unit limit */
public boolean unitCapVariable = true;
/** If true, unit spawn points are shown. */
public boolean showSpawns = false;
/** How fast unit factories build units. */
public float unitBuildSpeedMultiplier = 1f;
/** How much damage any other units deal. */

View File

@@ -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();
}

View File

@@ -36,6 +36,7 @@ public enum LAccess{
mineX,
mineY,
mining,
speed,
team,
type,
flag,

View File

@@ -248,7 +248,8 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
state.rules.defaultTeam.items().add(Seq.with(ItemStack.with(Items.beryllium, 300, Items.graphite, 300)));
//TODO proper waves
state.rules.waves = !OS.hasProp("mindustry.debug");
state.rules.waves = false;
state.rules.showSpawns = true;
state.rules.waveTimer = true;
state.rules.waveSpacing = 60f * 60f * 10f;
state.rules.spawns = Seq.with(new SpawnGroup(){{

View File

@@ -35,6 +35,7 @@ public class MinimapFragment extends Fragment{
float ratio = (float)renderer.minimap.getTexture().height / renderer.minimap.getTexture().width;
TextureRegion reg = Draw.wrap(renderer.minimap.getTexture());
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);
}