This commit is contained in:
Anuken
2022-08-30 21:17:39 -04:00
parent 2f6ef4cefe
commit 4cd78aad91
3 changed files with 13 additions and 6 deletions

View File

@@ -900,6 +900,7 @@ ability.statusfield = {0} Status Field
ability.unitspawn = {0} Factory ability.unitspawn = {0} Factory
ability.shieldregenfield = Shield Regen Field ability.shieldregenfield = Shield Regen Field
ability.movelightning = Movement Lightning ability.movelightning = Movement Lightning
ability.shieldarc = Shield Arc
ability.energyfield = Energy Field: [accent]{0}[] damage ~ [accent]{1}[] blocks / [accent]{2}[] targets ability.energyfield = Energy Field: [accent]{0}[] damage ~ [accent]{1}[] blocks / [accent]{2}[] targets
bar.onlycoredeposit = Only Core Depositing Allowed bar.onlycoredeposit = Only Core Depositing Allowed

View File

@@ -22,7 +22,7 @@ public class ControlPathfinder{
private static final long maxUpdate = Time.millisToNanos(30); private static final long maxUpdate = Time.millisToNanos(30);
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;
private static final int wallImpassableCap = 100_000; private static final int wallImpassableCap = 1_000_000;
public static final PathCost public static final PathCost
@@ -134,15 +134,19 @@ public class ControlPathfinder{
} }
} }
}else{ }else{
var view = Core.camera.bounds(Tmp.r1);
int len = req.frontier.size; int len = req.frontier.size;
float[] weights = req.frontier.weights; float[] weights = req.frontier.weights;
int[] poses = req.frontier.queue; int[] poses = req.frontier.queue;
for(int i = 0; i < len; i++){ for(int i = 0; i < Math.min(len, 1000); i++){
Draw.color(Tmp.c1.set(Color.white).fromHsv((weights[i] * 4f) % 360f, 1f, 0.9f));
int pos = poses[i]; int pos = poses[i];
if(view.contains(pos % wwidth * tilesize, pos / wwidth * tilesize)){
Draw.color(Tmp.c1.set(Color.white).fromHsv((weights[i] * 4f) % 360f, 1f, 0.9f));
Lines.square(pos % wwidth * tilesize, pos / wwidth * tilesize, 4f); Lines.square(pos % wwidth * tilesize, pos / wwidth * tilesize, 4f);
} }
} }
}
Draw.reset(); Draw.reset();
}); });
} }
@@ -529,6 +533,8 @@ public class ControlPathfinder{
float add = tileCost(team, cost, current, next); float add = tileCost(team, cost, current, next);
float currentCost = costs.get(current); float currentCost = costs.get(current);
if(add < 0) continue;
//the cost can include an impassable enemy wall, so cap the cost if so and add the base cost instead //the cost can include an impassable enemy wall, so cap the cost if so and add the base cost instead
//essentially this means that any path with enemy walls will only count the walls once, preventing strange behavior like avoiding based on wall count //essentially this means that any path with enemy walls will only count the walls once, preventing strange behavior like avoiding based on wall count
float newCost = currentCost >= wallImpassableCap && add >= wallImpassableCap ? currentCost + add - wallImpassableCap : currentCost + add; float newCost = currentCost >= wallImpassableCap && add >= wallImpassableCap ? currentCost + add - wallImpassableCap : currentCost + add;

View File

@@ -4367,10 +4367,10 @@ public class Blocks{
lustre = new ContinuousTurret("lustre"){{ lustre = new ContinuousTurret("lustre"){{
requirements(Category.turret, with(Items.silicon, 250, Items.graphite, 200, Items.oxide, 50, Items.carbide, 90)); requirements(Category.turret, with(Items.silicon, 250, Items.graphite, 200, Items.oxide, 50, Items.carbide, 90));
range = 100f; range = 130f;
shootType = new PointLaserBulletType(){{ shootType = new PointLaserBulletType(){{
damage = 140f; damage = 180f;
buildingDamageMultiplier = 0.3f; buildingDamageMultiplier = 0.3f;
hitColor = Color.valueOf("fda981"); hitColor = Color.valueOf("fda981");
}}; }};