Sector simplification

This commit is contained in:
Anuken
2020-10-11 10:51:33 -04:00
parent 65d9978fa1
commit 3d99e38f10
13 changed files with 64 additions and 27 deletions

View File

@@ -15,6 +15,7 @@ import arc.scene.ui.layout.*;
import arc.struct.*;
import arc.util.*;
import mindustry.annotations.Annotations.*;
import mindustry.content.*;
import mindustry.core.GameState.*;
import mindustry.ctype.*;
import mindustry.game.EventType.*;
@@ -47,6 +48,26 @@ public class HudFragment extends Fragment{
@Override
public void build(Group parent){
//warn about guardian/boss waves
Events.on(WaveEvent.class, e -> {
int max = 10;
outer:
for(int i = state.wave - 1; i <= state.wave + max; i++){
for(SpawnGroup group : state.rules.spawns){
if(group.effect == StatusEffects.boss && group.getUnitsSpawned(i) > 0){
int diff = (i + 2) - state.wave;
//increments at which to warn about incoming guardian
if(diff == 1 || diff == 2 || diff == 5 || diff == 10){
showToast(Icon.warning, Core.bundle.format("wave.guardianwarn" + (diff == 1 ? ".one" : ""), diff));
}
break outer;
}
}
}
});
//TODO details and stuff
Events.on(SectorCaptureEvent.class, e ->{
//TODO localize