mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-27 15:02:03 -08:00
Invasion chance tweaks (#4297)
This commit is contained in:
parent
7372bf37c2
commit
9c846bd2c9
1 changed files with 3 additions and 1 deletions
|
|
@ -217,8 +217,10 @@ public class Universe{
|
|||
|
||||
//queue random invasions
|
||||
if(!sector.isAttacked() && turn > invasionGracePeriod && sector.info.hasSpawns){
|
||||
int count = sector.near().count(Sector::hasEnemyBase);
|
||||
|
||||
//invasion chance depends on # of nearby bases
|
||||
if(Mathf.chance(baseInvasionChance * Math.min(sector.near().count(Sector::hasEnemyBase), 1))){
|
||||
if(count > 0 && Mathf.chance(baseInvasionChance * (0.75f + (count - 1) * 0.3f))){
|
||||
int waveMax = Math.max(sector.info.winWave, sector.isBeingPlayed() ? state.wave : sector.info.wave + sector.info.wavesPassed) + Mathf.random(2, 4) * 5;
|
||||
|
||||
//assign invasion-related things
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue