Large cliff crusher block / Erekir ammo tweaks / Android file chooser fixes

This commit is contained in:
Anuken 2025-01-07 20:35:35 -05:00
parent 6c1952c674
commit a84a99aed6
17 changed files with 178 additions and 19 deletions

View File

@ -110,6 +110,7 @@ public class AndroidLauncher extends AndroidApplication{
Intent intent = new Intent(open ? Intent.ACTION_OPEN_DOCUMENT : Intent.ACTION_CREATE_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType(extension.equals("zip") && !open && extensions.length == 1 ? "application/zip" : "*/*");
intent.putExtra(Intent.EXTRA_TITLE, "export." + extension);
addResultListener(i -> startActivityForResult(intent, i), (code, in) -> {
if(code == Activity.RESULT_OK && in != null && in.getData() != null){

Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 B

After

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -1889,8 +1889,9 @@ block.chemical-combustion-chamber.name = Chemical Combustion Chamber
block.pyrolysis-generator.name = Pyrolysis Generator
block.vent-condenser.name = Vent Condenser
block.cliff-crusher.name = Cliff Crusher
block.large-cliff-crusher.name = Advanced Cliff Crusher
block.plasma-bore.name = Plasma Bore
block.large-plasma-bore.name = Large Plasma Bore
block.large-plasma-bore.name = Advanced Plasma Bore
block.impact-drill.name = Impact Drill
block.eruption-drill.name = Eruption Drill
block.core-bastion.name = Core: Bastion
@ -2269,6 +2270,7 @@ block.vent-condenser.description = Condenses vent gases into water. Consumes pow
block.plasma-bore.description = When placed facing an ore wall, outputs items indefinitely. Requires small amounts of power.\nOptionally uses hydrogen to boost efficiency.
block.large-plasma-bore.description = A larger plasma bore. Capable of mining tungsten and thorium. Requires hydrogen and power.\nOptionally uses nitrogen to boost efficiency.
block.cliff-crusher.description = Crushes walls, outputting sand indefinitely. Requires power. Efficiency varies based on type of wall.
block.large-cliff-crusher.description = Crushes walls, outputting sand indefinitely. Requires power and ozone. Efficiency varies based on type of wall. Optionally consumes tungsten to increase efficiency.
block.impact-drill.description = When placed on ore, outputs items in bursts indefinitely. Requires power and water.
block.eruption-drill.description = An improved impact drill. Capable of mining thorium. Requires hydrogen.
block.reinforced-conduit.description = Moves fluids forward. Doesn't accept non-conduit inputs to the sides.

View File

@ -591,3 +591,4 @@
63091=remove-wall|block-remove-wall-ui
63090=remove-ore|block-remove-ore-ui
63089=small-heat-redirector|block-small-heat-redirector-ui
63088=large-cliff-crusher|block-large-cliff-crusher-ui

Binary file not shown.

View File

@ -125,7 +125,7 @@ public class Blocks{
//production
mechanicalDrill, pneumaticDrill, laserDrill, blastDrill, waterExtractor, oilExtractor, cultivator,
cliffCrusher, plasmaBore, largePlasmaBore, impactDrill, eruptionDrill,
cliffCrusher, largeCliffCrusher, plasmaBore, largePlasmaBore, impactDrill, eruptionDrill,
//storage
coreShard, coreFoundation, coreNucleus, vault, container, unloader,
@ -1436,7 +1436,6 @@ public class Blocks{
}});
consumeItem(Items.silicon, 3);
//TODO consume hydrogen/ozone?
consumeLiquid(Liquids.slag, 40f / 60f);
consumePower(2f);
}};
@ -1466,7 +1465,6 @@ public class Blocks{
liquidCapacity = 80f;
outputLiquid = new LiquidStack(Liquids.cyanogen, 3f / 60f);
//consumeLiquids(LiquidStack.with(Liquids.hydrogen, 3f / 60f, Liquids.nitrogen, 2f / 60f));
consumeLiquid(Liquids.arkycite, 40f / 60f);
consumeItem(Items.graphite);
consumePower(2f);
@ -2804,6 +2802,28 @@ public class Blocks{
ambientSoundVolume = 0.04f;
}};
largeCliffCrusher = new WallCrafter("large-cliff-crusher"){{
requirements(Category.production, with(Items.silicon, 80, Items.surgeAlloy, 60, Items.beryllium, 100, Items.tungsten, 50));
consumePower(30 / 60f);
drillTime = 50f;
size = 3;
attribute = Attribute.sand;
output = Items.sand;
fogRadius = 3;
ambientSound = Sounds.drill;
ambientSoundVolume = 0.05f;
consumeLiquid(Liquids.ozone, 1f / 60f);
itemConsumer = consumeItem(Items.tungsten).boost();
itemCapacity = 20;
boostItemUseTime = 60f * 10f;
//alternatively, boost using nitrogen:
//consumeLiquid(Liquids.nitrogen, 3f / 60f).boost();
}};
plasmaBore = new BeamDrill("plasma-bore"){{
requirements(Category.production, with(Items.beryllium, 40));
consumePower(0.15f);
@ -2818,7 +2838,6 @@ public class Blocks{
consumeLiquid(Liquids.hydrogen, 0.25f / 60f).boost();
}};
//TODO awful name
largePlasmaBore = new BeamDrill("large-plasma-bore"){{
requirements(Category.production, with(Items.silicon, 100, Items.oxide, 25, Items.beryllium, 100, Items.tungsten, 70));
consumePower(0.8f);
@ -4035,7 +4054,7 @@ public class Blocks{
shootEffect = sfe;
smokeEffect = Fx.shootBigSmoke;
ammoMultiplier = 1;
reloadMultiplier = 0.67f;
reloadMultiplier = 0.7f;
hitColor = backColor = trailColor = Color.valueOf("ab8ec5");
frontColor = Color.white;
trailWidth = 2.2f;
@ -4047,6 +4066,7 @@ public class Blocks{
buildingDamageMultiplier = 0.3f;
targetBlocks = false;
targetMissiles = false;
trailRotation = true;
}}
);
@ -4213,7 +4233,6 @@ public class Blocks{
shootSound = Sounds.none;
loopSoundVolume = 1f;
//TODO balance, set up, where is liquid/sec displayed? status effects maybe?
ammo(
Liquids.ozone, new ContinuousFlameBulletType(){{
damage = 60f;
@ -4291,8 +4310,8 @@ public class Blocks{
height = 19f;
width = 17f;
splashDamageRadius = 55f;
splashDamage = 600f;
rangeChange = 8f*8f;
splashDamage = 650f;
rangeChange = 10f*8f;
scaledSplashDamage = true;
backColor = hitColor = trailColor = Color.valueOf("ab8ec5");
frontColor = Color.white;
@ -4317,6 +4336,41 @@ public class Blocks{
shrinkX = 0.2f;
shrinkY = 0.1f;
buildingDamageMultiplier = 0.3f;
}},
Items.oxide, new ArtilleryBulletType(2.5f, 300, "shell"){{
hitEffect = new MultiEffect(Fx.titanExplosionLarge, Fx.titanSmokeLarge);
despawnEffect = Fx.none;
knockback = 2f;
lifetime = 190f;
height = 19f;
width = 17f;
reloadMultiplier = 0.8f;
splashDamageRadius = 110f;
rangeChange = 8f;
splashDamage = 300f;
scaledSplashDamage = true;
hitColor = backColor = trailColor = Color.valueOf("a0b380");
frontColor = Color.valueOf("e4ffd6");
ammoMultiplier = 1f;
hitSound = Sounds.titanExplosion;
status = StatusEffects.blasted;
trailLength = 32;
trailWidth = 3.35f;
trailSinScl = 2.5f;
trailSinMag = 0.5f;
trailEffect = Fx.vapor;
trailInterval = 3f;
despawnShake = 7f;
shootEffect = Fx.shootTitan;
smokeEffect = Fx.shootSmokeTitan;
trailInterp = v -> Math.max(Mathf.slope(v), 0.8f);
shrinkX = 0.2f;
shrinkY = 0.1f;
buildingDamageMultiplier = 0.25f;
}}
);
@ -4633,7 +4687,6 @@ public class Blocks{
range = 250f;
scaledHealth = 210;
//TODO is this a good idea to begin with?
unitSort = UnitSorts.strongest;
consumeLiquid(Liquids.nitrogen, 6f / 60f);

View File

@ -28,7 +28,7 @@ public class Fx{
public static final Effect
none = new Effect(0, 0f, e -> {}),
blockCrash = new Effect(90f, e -> {
if(!(e.data instanceof Block block)) return;
@ -445,6 +445,20 @@ public class Fx{
}
}),
titanExplosionLarge = new Effect(45f, 220f, e -> {
color(e.color);
stroke(e.fout() * 3f);
float circleRad = 6f + e.finpow() * 110f;
Lines.circle(e.x, e.y, circleRad);
rand.setSeed(e.id);
for(int i = 0; i < 21; i++){
float angle = rand.random(360f);
float lenRand = rand.random(0.5f, 1f);
Lines.lineAngle(e.x, e.y, angle, e.foutpow() * 50f * rand.random(1f, 0.6f) + 2f, e.finpow() * 100f * lenRand + 6f);
}
}),
titanSmoke = new Effect(300f, 300f, b -> {
float intensity = 3f;
@ -465,6 +479,26 @@ public class Fx{
}
}),
titanSmokeLarge = new Effect(400f, 400f, b -> {
float intensity = 4f;
color(b.color, 0.65f);
for(int i = 0; i < 4; i++){
rand.setSeed(b.id*2 + i);
float lenScl = rand.random(0.5f, 1f);
int fi = i;
b.scaled(b.lifetime * lenScl, e -> {
randLenVectors(e.id + fi - 1, e.fin(Interp.pow10Out), (int)(2.9f * intensity), 26f * intensity, (x, y, in, out) -> {
float fout = e.fout(Interp.pow5Out) * rand.random(0.5f, 1f);
float rad = fout * ((2f + intensity) * 2.35f);
Fill.circle(e.x + x, e.y + y, rad);
Drawf.light(e.x + x, e.y + y, rad * 2.5f, b.color, 0.5f);
});
});
}
}),
missileTrailSmoke = new Effect(180f, 300f, b -> {
float intensity = 2f;
@ -761,7 +795,7 @@ public class Fx{
Fill.circle(e.x + x, e.y + y, e.fout() * 2f);
});
}),
hitLaserBlast = new Effect(12, e -> {
color(e.color);
stroke(e.fout() * 1.5f);
@ -1114,7 +1148,7 @@ public class Fx{
stroke(2f * e.fout());
Lines.circle(e.x, e.y, 5f * e.fout());
}),
forceShrink = new Effect(20, e -> {
color(e.color, e.fout());
if(renderer.animateShields){

View File

@ -13,7 +13,6 @@ public class ArtilleryBulletType extends BasicBulletType{
collides = false;
collidesAir = false;
scaleLife = true;
trailRotation = false;
hitShake = 1f;
hitSound = Sounds.explosion;
hitEffect = Fx.flakExplosion;

View File

@ -239,6 +239,8 @@ public class Turret extends ReloadTurret{
public float heatReq;
public float[] sideHeat = new float[4];
float lastRangeChange;
@Override
public float estimateDps(){
if(!hasAmmo()) return 0f;
@ -316,6 +318,11 @@ public class Turret extends ReloadTurret{
};
}
@Override
public float fogRadius(){
return (range + (hasAmmo() ? peekAmmo().rangeChange : 0f)) / tilesize * fogRadiusMultiplier;
}
@Override
public float progress(){
return Mathf.clamp(reloadCounter / reload);
@ -415,6 +422,14 @@ public class Turret extends ReloadTurret{
//turret always reloads regardless of whether it's targeting something
updateReload();
if(state.rules.fog){
float newRange = hasAmmo() ? peekAmmo().rangeChange : 0f;
if(newRange != lastRangeChange){
lastRangeChange = newRange;
fogControl.forceUpdate(team, this);
}
}
if(hasAmmo()){
if(Float.isNaN(reloadCounter)) reloadCounter = 0;

View File

@ -17,6 +17,7 @@ import mindustry.graphics.*;
import mindustry.type.*;
import mindustry.ui.*;
import mindustry.world.*;
import mindustry.world.consumers.*;
import mindustry.world.meta.*;
import static mindustry.Vars.*;
@ -30,6 +31,8 @@ public class WallCrafter extends Block{
/** Time to produce one item at 100% efficiency. */
public float drillTime = 150f;
/** How many times faster the drill will progress when boosted by liquid. */
public float liquidBoostIntensity = 1.6f;
/** Effect randomly played while drilling. */
public Effect updateEffect = Fx.mineWallSmall;
public float updateEffectChance = 0.02f;
@ -39,6 +42,14 @@ public class WallCrafter extends Block{
public Item output = Items.sand;
public float boostItemUseTime = 120f;
/** How many times faster the drill will progress when boosted by items. Note: Using item and liquid boosters at once is not supported. */
public float itemBoostIntensity = 1.6f;
public @Nullable Consume itemConsumer;
public boolean hasLiquidBooster;
public final int timerUse = timers ++;
public WallCrafter(String name){
super(name);
@ -67,6 +78,31 @@ public class WallCrafter extends Block{
stats.add(Stat.output, output);
stats.add(Stat.tiles, StatValues.blocks(attribute, floating, 1f, true, false));
stats.add(Stat.drillSpeed, 60f / drillTime * size, StatUnit.itemsSecond);
boolean consItems = itemConsumer != null;
if(consItems) stats.timePeriod = boostItemUseTime;
if(consItems && itemConsumer instanceof ConsumeItems coni){
stats.remove(Stat.booster);
stats.add(Stat.booster, StatValues.itemBoosters("{0}" + StatUnit.timesSpeed.localized(), stats.timePeriod, itemBoostIntensity, 0f, coni.items, i -> Structs.contains(coni.items, s -> s.item == i)));
}
if(liquidBoostIntensity != 1 && findConsumer(f -> f instanceof ConsumeLiquidBase && f.booster) instanceof ConsumeLiquidBase consBase){
stats.remove(Stat.booster);
stats.add(Stat.booster,
StatValues.speedBoosters("{0}" + StatUnit.timesSpeed.localized(),
consBase.amount,
liquidBoostIntensity, false, consBase::consumes)
);
}
}
@Override
public void init(){
super.init();
hasLiquidBooster = findConsumer(f -> f instanceof ConsumeLiquidBase && f.booster) != null;
}
@Override
@ -151,6 +187,7 @@ public class WallCrafter extends Block{
super.updateTile();
boolean cons = shouldConsume();
boolean itemValid = itemConsumer != null && itemConsumer.efficiency(this) > 0;
warmup = Mathf.approachDelta(warmup, Mathf.num(efficiency > 0), 1f / 40f);
float dx = Geometry.d4x(rotation) * 0.5f, dy = Geometry.d4y(rotation) * 0.5f;
@ -164,7 +201,11 @@ public class WallCrafter extends Block{
dest.block().mapColor
);
}
}, null);
}, null) * Mathf.lerp(1f, liquidBoostIntensity, hasLiquidBooster ? optionalEfficiency : 0f) * (itemValid ? itemBoostIntensity : 1f);
if(itemValid && eff * efficiency > 0 && timer(timerUse, boostItemUseTime)){
consume();
}
lastEfficiency = eff * timeScale * efficiency;
@ -173,16 +214,16 @@ public class WallCrafter extends Block{
time %= drillTime;
}
totalTime += edelta() * warmup;
totalTime += edelta() * warmup * (eff <= 0f ? 0f : 1f);
if(timer(timerDump, dumpTime)){
dump();
dump(output);
}
}
@Override
public boolean shouldConsume(){
return items.total() < itemCapacity;
return items.get(output) < itemCapacity;
}
@Override

View File

@ -50,4 +50,9 @@ public class ConsumeLiquid extends ConsumeLiquidBase{
public void display(Stats stats){
stats.add(booster ? Stat.booster : Stat.input, liquid, amount * 60f, true);
}
@Override
public boolean consumes(Liquid liquid){
return liquid == this.liquid;
}
}

View File

@ -1,5 +1,6 @@
package mindustry.world.consumers;
import mindustry.type.*;
import mindustry.world.*;
public abstract class ConsumeLiquidBase extends Consume{
@ -16,4 +17,6 @@ public abstract class ConsumeLiquidBase extends Consume{
public void apply(Block block){
block.hasLiquids = true;
}
public abstract boolean consumes(Liquid liquid);
}

View File

@ -53,7 +53,7 @@ public class ConsumeLiquidFilter extends ConsumeLiquidBase{
if(ed <= 0.00000001f) return 0f;
return liq != null ? Math.min(build.liquids.get(liq) / (amount * ed * multiplier.get(build)), 1f) : 0f;
}
public @Nullable Liquid getConsumed(Building build){
if(filter.get(build.liquids.current()) && build.liquids.currentAmount() > 0){
return build.liquids.current();
@ -74,4 +74,9 @@ public class ConsumeLiquidFilter extends ConsumeLiquidBase{
public void display(Stats stats){
stats.add(booster ? Stat.booster : Stat.input, StatValues.liquids(filter, amount * 60f, true));
}
@Override
public boolean consumes(Liquid liquid){
return filter.get(liquid);
}
}