Scale waves based on difficulty; improve map editor

This commit is contained in:
Anuken
2017-12-18 17:37:14 -05:00
parent 1ae875ebf4
commit 7953a21073
34 changed files with 857 additions and 714 deletions
@@ -1,9 +1,12 @@
package io.anuke.mindustry.entities;
import io.anuke.mindustry.entities.enemies.Enemy;
import io.anuke.ucore.core.Settings;
import io.anuke.ucore.util.Mathf;
public class EnemySpawn{
private static float[] scalings = {2f, 1.5f, 1f};
/**The enemy type spawned*/
public final Class<? extends Enemy> type;
/**When this spawns should end*/
@@ -33,6 +36,8 @@ public class EnemySpawn{
if(wave < after || wave > before || (wave - after) % spacing != 0){
return 0;
}
float scaling = this.scaling * scalings[(Settings.getInt("difficulty"))];
return Math.min(amount-1 + 1 * Math.max((int)((wave / spacing) / scaling), 1) - (tier(wave, lane)-1) * tierscaleback, max);
}
@@ -331,6 +331,15 @@ public class Fx{
Draw.reset();
}),
shieldhit = new Effect(9, e -> {
Draw.thickness(1f);
Draw.color(Color.WHITE, Color.SKY, e.ifract());
Draw.spikes(e.x, e.y, e.ifract() * 5f, 2, 6);
Draw.thickness(4f*e.fract());
Draw.circle(e.x, e.y, e.ifract()*14f);
Draw.reset();
}),
shoot = new Effect(8, e -> {
Draw.thickness(1f);
Draw.color(Color.WHITE, Color.GOLD, e.ifract());