Campaign survival wave display tweaks

This commit is contained in:
Anuken
2020-10-30 12:54:24 -04:00
parent 76ff55d7f1
commit a12583eb4d
3 changed files with 46 additions and 41 deletions
+2 -2
View File
@@ -424,7 +424,7 @@ public class Bullets implements ContentList{
} }
}; };
basicFlame = new BulletType(3.35f, 15f){{ basicFlame = new BulletType(3.35f, 16f){{
ammoMultiplier = 3f; ammoMultiplier = 3f;
hitSize = 7f; hitSize = 7f;
lifetime = 18f; lifetime = 18f;
@@ -439,7 +439,7 @@ public class Bullets implements ContentList{
hittable = false; hittable = false;
}}; }};
pyraFlame = new BulletType(3.35f, 22f){{ pyraFlame = new BulletType(3.35f, 25f){{
ammoMultiplier = 4f; ammoMultiplier = 4f;
hitSize = 7f; hitSize = 7f;
lifetime = 18f; lifetime = 18f;
+6 -2
View File
@@ -21,9 +21,10 @@ import mindustry.world.blocks.storage.*;
import static mindustry.Vars.*; import static mindustry.Vars.*;
public class SectorDamage{ public class SectorDamage{
public static final int maxRetWave = 30, maxWavesSimulated = 50;
//direct damage is for testing only //direct damage is for testing only
private static final boolean direct = false, rubble = true; private static final boolean direct = false, rubble = true;
private static final int maxWavesSimulated = 50, maxRetWave = 100;
/** @return calculated capture progress of the enemy */ /** @return calculated capture progress of the enemy */
public static float getDamage(SectorInfo info){ public static float getDamage(SectorInfo info){
@@ -107,7 +108,7 @@ public class SectorDamage{
float damage = getDamage(state.rules.sector.info); float damage = getDamage(state.rules.sector.info);
//scaled damage has a power component to make it seem a little more realistic (as systems fail, enemy capturing gets easier and easier) //scaled damage has a power component to make it seem a little more realistic (as systems fail, enemy capturing gets easier and easier)
float scaled = Mathf.pow(damage, 1.5f); float scaled = Mathf.pow(damage, 1.6f);
//apply damage to units //apply damage to units
float unitDamage = damage * state.rules.sector.info.sumHealth; float unitDamage = damage * state.rules.sector.info.sumHealth;
@@ -429,6 +430,7 @@ public class SectorDamage{
float falloff = (damage) / (Math.max(tiles.width, tiles.height) * Mathf.sqrt2); float falloff = (damage) / (Math.max(tiles.width, tiles.height) * Mathf.sqrt2);
int peak = 0; int peak = 0;
if(damage > 0.1f){
//phase two: propagate the damage //phase two: propagate the damage
while(!frontier.isEmpty()){ while(!frontier.isEmpty()){
peak = Math.max(peak, frontier.size); peak = Math.max(peak, frontier.size);
@@ -479,6 +481,8 @@ public class SectorDamage{
} }
} }
}
static float cost(Tile tile){ static float cost(Tile tile){
return 1f + return 1f +
(tile.block().isStatic() && tile.solid() ? 200f : 0f) + (tile.block().isStatic() && tile.solid() ? 200f : 0f) +
@@ -20,6 +20,7 @@ import mindustry.game.*;
import mindustry.gen.*; import mindustry.gen.*;
import mindustry.graphics.*; import mindustry.graphics.*;
import mindustry.graphics.g3d.*; import mindustry.graphics.g3d.*;
import mindustry.maps.*;
import mindustry.type.*; import mindustry.type.*;
import mindustry.ui.*; import mindustry.ui.*;
import mindustry.world.blocks.storage.*; import mindustry.world.blocks.storage.*;
@@ -382,8 +383,8 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
stable.row(); stable.row();
if(sector.info.wavesSurvived >= 0 && sector.info.wavesSurvived - sector.info.wavesPassed >= 0 && !sector.isBeingPlayed()){ if(sector.info.wavesSurvived >= 0 && sector.info.wavesSurvived - sector.info.wavesPassed >= 0 && !sector.isBeingPlayed()){
boolean plus = (sector.info.wavesSurvived - sector.info.wavesPassed) >= 99; boolean plus = (sector.info.wavesSurvived - sector.info.wavesPassed) >= SectorDamage.maxRetWave - 1;
stable.add("[accent]Will survive " + (sector.info.wavesSurvived - sector.info.wavesPassed) + (plus ? "+" : "") + " waves"); stable.add("[accent]Will survive\n" + (sector.info.wavesSurvived - sector.info.wavesPassed) + (plus ? "+" : "") + " waves");
stable.row(); stable.row();
} }
} }