Closes Anuken/Mindustry-Suggestions/issues/4452
This commit is contained in:
@@ -253,7 +253,7 @@ public class Universe{
|
|||||||
|
|
||||||
//queue random invasions
|
//queue random invasions
|
||||||
if(!sector.isAttacked() && sector.planet.allowSectorInvasion && sector.info.minutesCaptured > invasionGracePeriod && sector.info.hasSpawns){
|
if(!sector.isAttacked() && sector.planet.allowSectorInvasion && sector.info.minutesCaptured > invasionGracePeriod && sector.info.hasSpawns){
|
||||||
int count = sector.near().count(Sector::hasEnemyBase);
|
int count = sector.near().count(s -> s.hasEnemyBase() && !s.hasBase());
|
||||||
|
|
||||||
//invasion chance depends on # of nearby bases
|
//invasion chance depends on # of nearby bases
|
||||||
if(count > 0 && Mathf.chance(baseInvasionChance * (0.8f + (count - 1) * 0.3f))){
|
if(count > 0 && Mathf.chance(baseInvasionChance * (0.8f + (count - 1) * 0.3f))){
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ public class Sector{
|
|||||||
return save != null && (info.waves || info.attack) && info.hasCore;
|
return save != null && (info.waves || info.attack) && info.hasCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return whether the player has a base here. */
|
/** @return whether the player has a base (active save with a core) here. */
|
||||||
public boolean hasBase(){
|
public boolean hasBase(){
|
||||||
return save != null && info.hasCore && !(Vars.state.isGame() && Vars.state.rules.sector == this && state.gameOver);
|
return save != null && info.hasCore && !(Vars.state.isGame() && Vars.state.rules.sector == this && state.gameOver);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user