Crash fix, begin rebalancing

This commit is contained in:
Anuken
2022-05-03 11:23:24 -04:00
parent 6c3eb3fe1e
commit 459428ef25
7 changed files with 15 additions and 16 deletions

Binary file not shown.

View File

@@ -23,6 +23,9 @@ public class Pathfinder implements Runnable{
private static final int updateFPS = 60; private static final int updateFPS = 60;
private static final int updateInterval = 1000 / updateFPS; private static final int updateInterval = 1000 / updateFPS;
/** cached world size */
static int wwidth, wheight;
static final int impassable = -1; static final int impassable = -1;
public static final int public static final int
@@ -66,8 +69,6 @@ public class Pathfinder implements Runnable{
/** maps team, cost, type to flow field*/ /** maps team, cost, type to flow field*/
Flowfield[][][] cache; Flowfield[][][] cache;
/** cached world size */
int wwidth, wheight;
/** unordered array of path data for iteration only. DO NOT iterate or access this in the main thread. */ /** unordered array of path data for iteration only. DO NOT iterate or access this in the main thread. */
Seq<Flowfield> threadList = new Seq<>(), mainList = new Seq<>(); Seq<Flowfield> threadList = new Seq<>(), mainList = new Seq<>();
/** handles task scheduling on the update thread. */ /** handles task scheduling on the update thread. */
@@ -438,7 +439,7 @@ public class Pathfinder implements Runnable{
if(cost != impassable){ if(cost != impassable){
for(Point2 point : Geometry.d4){ for(Point2 point : Geometry.d4){
int dx = (tile % wwidth) + point.x, dy = (tile / wheight) + point.y; int dx = (tile % wwidth) + point.x, dy = (tile / wwidth) + point.y;
if(dx < 0 || dy < 0 || dx >= wwidth || dy >= wheight) continue; if(dx < 0 || dy < 0 || dx >= wwidth || dy >= wheight) continue;

View File

@@ -4213,22 +4213,20 @@ public class Blocks{
}}; }};
mechFabricator = new UnitFactory("mech-fabricator"){{ mechFabricator = new UnitFactory("mech-fabricator"){{
requirements(Category.units, with(Items.silicon, 200, Items.beryllium, 150)); requirements(Category.units, with(Items.silicon, 250, Items.beryllium, 200));
size = 3; size = 3;
configurable = false; configurable = false;
plans.add(new UnitPlan(UnitTypes.merui, 60f * 35f, with(Items.beryllium, 40f, Items.silicon, 50f))); plans.add(new UnitPlan(UnitTypes.merui, 60f * 45f, with(Items.beryllium, 50f, Items.silicon, 70f)));
researchCost = with(Items.beryllium, 200, Items.graphite, 80, Items.silicon, 80);
regionSuffix = "-dark"; regionSuffix = "-dark";
fogRadius = 3; fogRadius = 3;
consumePower(2f); consumePower(2f);
}}; }};
shipFabricator = new UnitFactory("ship-fabricator"){{ shipFabricator = new UnitFactory("ship-fabricator"){{
requirements(Category.units, with(Items.silicon, 200, Items.beryllium, 150)); requirements(Category.units, with(Items.silicon, 200, Items.graphite, 300));
size = 3; size = 3;
configurable = false; configurable = false;
plans.add(new UnitPlan(UnitTypes.osc, 60f * 35f, with(Items.beryllium, 40f, Items.silicon, 50f))); plans.add(new UnitPlan(UnitTypes.osc, 60f * 40f, with(Items.graphite, 40f, Items.silicon, 70f)));
researchCost = with(Items.beryllium, 200, Items.graphite, 80, Items.silicon, 80);
regionSuffix = "-dark"; regionSuffix = "-dark";
fogRadius = 3; fogRadius = 3;
consumePower(2f); consumePower(2f);

View File

@@ -39,13 +39,13 @@ public class UnitTypes{
//legs //legs
public static @EntityDef({Unitc.class, Legsc.class}) UnitType corvus, atrax, public static @EntityDef({Unitc.class, Legsc.class}) UnitType corvus, atrax,
merui, latum, anthicus, merui, latum, anthicus,
bulwark, krepost; bulwark, krepost; //TODO horrid name here
//legs, legacy //legs, legacy
public static @EntityDef(value = {Unitc.class, Legsc.class}, legacy = true) UnitType spiroct, arkyid, toxopid; public static @EntityDef(value = {Unitc.class, Legsc.class}, legacy = true) UnitType spiroct, arkyid, toxopid;
//hover //hover
public static @EntityDef({Unitc.class, ElevationMovec.class}) UnitType osc; public static @EntityDef({Unitc.class, ElevationMovec.class}) UnitType osc; //TODO bad name
//air //air
public static @EntityDef({Unitc.class}) UnitType flare, eclipse, horizon, zenith, antumbra, public static @EntityDef({Unitc.class}) UnitType flare, eclipse, horizon, zenith, antumbra,
@@ -2679,7 +2679,7 @@ public class UnitTypes{
bullet = new BasicBulletType(8f, 140){{ bullet = new BasicBulletType(8f, 140){{
sprite = "missile-large"; sprite = "missile-large";
width = 9.5f; width = 9.5f;
height = 15f; height = 13f;
lifetime = 18f; lifetime = 18f;
hitSize = 6f; hitSize = 6f;
shootEffect = Fx.shootTitan; shootEffect = Fx.shootTitan;
@@ -2702,7 +2702,7 @@ public class UnitTypes{
fragVelocityMin = 1f; fragVelocityMin = 1f;
//TODO //TODO
fragBullet = new BasicBulletType(8f, 30){{ fragBullet = new BasicBulletType(8f, 25){{
sprite = "missile-large"; sprite = "missile-large";
width = 8f; width = 8f;
height = 12f; height = 12f;

View File

@@ -36,7 +36,7 @@ public class Maps{
}; };
/** List of all built-in maps. Filenames only. */ /** List of all built-in maps. Filenames only. */
private static String[] defaultMapNames = {"maze", "fortress", "labyrinth", "islands", "tendrils", "caldera", "wasteland", "shattered", "fork", "triad", "mudFlats", "moltenLake", "archipelago", "debrisField", "veins", "glacier", "passage"}; private static String[] defaultMapNames = {"maze", "fortress", "labyrinth", "islands", "tendrils", "caldera", "wasteland", "shattered", "fork", "triad", "mudFlats", "moltenLake", "archipelago", "debrisField", "erekirwavemap", "veins", "glacier", "passage"};
/** Maps tagged as PvP */ /** Maps tagged as PvP */
private static String[] pvpMaps = {"veins", "glacier", "passage"}; private static String[] pvpMaps = {"veins", "glacier", "passage"};

View File

@@ -141,7 +141,7 @@ public class CustomRulesDialog extends BaseDialog{
check("@rules.waves", b -> rules.waves = b, () -> rules.waves); check("@rules.waves", b -> rules.waves = b, () -> rules.waves);
check("@rules.wavetimer", b -> rules.waveTimer = b, () -> rules.waveTimer); check("@rules.wavetimer", b -> rules.waveTimer = b, () -> rules.waveTimer);
check("@rules.waitForWaveToEnd", b -> rules.waitEnemies = b, () -> rules.waitEnemies); check("@rules.waitForWaveToEnd", b -> rules.waitEnemies = b, () -> rules.waitEnemies);
number("@rules.wavespacing", false, f -> rules.waveSpacing = f * 60f, () -> rules.waveSpacing / 60f, () -> true, 1, Float.MAX_VALUE); number("@rules.wavespacing", false, f -> rules.waveSpacing = f * 60f, () -> rules.waveSpacing / 60f, () -> rules.waveTimer, 1, Float.MAX_VALUE);
//this is experimental, because it's not clear that 0 makes it default. //this is experimental, because it's not clear that 0 makes it default.
if(experimental){ if(experimental){
number("@rules.initialwavespacing", false, f -> rules.initialWaveSpacing = f * 60f, () -> rules.initialWaveSpacing / 60f, () -> true, 0, Float.MAX_VALUE); number("@rules.initialwavespacing", false, f -> rules.initialWaveSpacing = f * 60f, () -> rules.initialWaveSpacing / 60f, () -> true, 0, Float.MAX_VALUE);

View File

@@ -38,7 +38,7 @@ public class ItemSelection{
int i = 0; int i = 0;
for(T item : items){ for(T item : items){
if(!item.unlockedNow() || (item instanceof Item checkVisible && state.rules.hiddenBuildItems.contains(checkVisible))) continue; if(!item.unlockedNow() || (item instanceof Item checkVisible && state.rules.hiddenBuildItems.contains(checkVisible)) || item.isHidden()) continue;
ImageButton button = cont.button(Tex.whiteui, Styles.clearToggleTransi, 24, () -> { ImageButton button = cont.button(Tex.whiteui, Styles.clearToggleTransi, 24, () -> {
if(closeSelect) control.input.config.hideConfig(); if(closeSelect) control.input.config.hideConfig();