This commit is contained in:
Anuken
2020-11-10 18:13:49 -05:00
parent 8d3df82f81
commit f089f2c2ff
6 changed files with 25 additions and 29 deletions

View File

@@ -150,8 +150,11 @@ public class Universe{
//increment seconds passed for this sector by the time that just passed with this turn
if(!sector.isBeingPlayed()){
//increment time
sector.info.secondsPassed += turnDuration/60f;
//increment time if attacked
if(sector.isAttacked()){
sector.info.secondsPassed += turnDuration/60f;
}
int wavesPassed = (int)(sector.info.secondsPassed*60f / sector.info.waveSpacing);
boolean attacked = sector.info.waves;
@@ -206,7 +209,7 @@ public class Universe{
if(!sector.isAttacked() && turn > invasionGracePeriod){
//invasion chance depends on # of nearby bases
if(Mathf.chance(baseInvasionChance * sector.near().count(Sector::hasEnemyBase))){
int waveMax = Math.max(sector.info.winWave, state.wave) + Mathf.random(2, 5) * 5;
int waveMax = Math.max(sector.info.winWave, sector.isBeingPlayed() ? state.wave : sector.info.wave + sector.info.wavesPassed) + Mathf.random(2, 5) * 5;
//assign invasion-related things
if(sector.isBeingPlayed()){