Fixed 116 infinite resources / Fixed #11251

This commit is contained in:
Anuken
2025-09-28 10:42:07 -04:00
parent dbe67b056f
commit d6e408267e
7 changed files with 21 additions and 17 deletions
Binary file not shown.
+1
View File
@@ -134,6 +134,7 @@ public class Logic implements ApplicationListener{
//enable building AI on campaign unless the preset disables it
state.rules.coreIncinerates = true;
state.rules.infiniteResources = false;
state.rules.allowEditRules = false;
state.rules.allowEditWorldProcessors = false;
state.rules.waveTeam.rules().infiniteResources = true;
@@ -82,12 +82,12 @@ public class ShieldArcAbility extends Ability{
paramField.data -= unit.health() * paramField.missileUnitMultiplier * Vars.state.rules.unitDamage(unit.team);
paramField.alpha = 1f;
}else{
}else if(paramField.pushUnits && !(!unit.isFlying() && paramUnit.isFlying())){
float reach = paramField.radius + paramField.width;
float overlapDst = reach - unit.dst(paramPos.x,paramPos.y);
if(overlapDst>0){
if(overlapDst > 0){
//stop
unit.vel.setZero();
// get out
@@ -132,6 +132,8 @@ public class ShieldArcAbility extends Ability{
public @Nullable Color color;
/** If true, sprite position will be influenced by x/y. */
public boolean offsetRegion = false;
/** If true, enemy units are pushed out. */
public boolean pushUnits = true;
/** State. */
protected float widthScale, alpha;
@@ -21,7 +21,6 @@ public class Junction extends Block{
underBullets = true;
group = BlockGroup.transportation;
unloadable = false;
floating = true;
noUpdateDisabled = true;
}
@@ -298,18 +298,16 @@ public class StackConveyor extends Block implements Autotiler{
}
}else{ //transfer
if(state != stateLoad || (items.total() >= getMaximumAccepted(lastItem))){
if(front() instanceof StackConveyorBuild e && e.team == team){
if(e.link == -1){
e.items.add(items);
e.lastItem = lastItem;
e.link = tile.pos();
//▲ to | from ▼
link = -1;
items.clear();
if(front() instanceof StackConveyorBuild e && e.team == team && e.link == -1){
e.items.add(items);
e.lastItem = lastItem;
e.link = tile.pos();
//▲ to | from ▼
link = -1;
items.clear();
cooldown = recharge;
e.cooldown = 1;
}
cooldown = recharge;
e.cooldown = 1;
}
}
}
@@ -10,6 +10,7 @@ public class LiquidJunction extends LiquidBlock{
public LiquidJunction(String name){
super(name);
floating = true;
}
@Override
@@ -897,6 +897,9 @@ public class ApplicationTests{
ObjectSet<Item> resources = new ObjectSet<>();
boolean hasSpawnPoint = false;
assertFalse(state.rules.infiniteResources, "Sector " + zone.name + " must not have infinite resources.");
assertFalse(state.rules.allowEditRules, "Sector " + zone.name + " must not have rule editing enabled.");
for(Tile tile : world.tiles){
if(tile.drop() != null){
resources.add(tile.drop());