Mass-deletion of enemy code
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
package io.anuke.mindustry.game;
|
||||
|
||||
import io.anuke.mindustry.entities.enemies.EnemyType;
|
||||
import io.anuke.mindustry.entities.enemies.UnitType;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
import static io.anuke.mindustry.Vars.state;
|
||||
|
||||
public class EnemySpawn{
|
||||
/**The enemy type spawned*/
|
||||
public final EnemyType type;
|
||||
public final UnitType type;
|
||||
/**When this spawns should end*/
|
||||
protected int before = Integer.MAX_VALUE;
|
||||
/**When this spawns should start*/
|
||||
@@ -27,7 +27,7 @@ public class EnemySpawn{
|
||||
/**Amount of enemies spawned initially, with no scaling*/
|
||||
protected int amount = 1;
|
||||
|
||||
public EnemySpawn(EnemyType type){
|
||||
public EnemySpawn(UnitType type){
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@@ -41,6 +41,6 @@ public class EnemySpawn{
|
||||
}
|
||||
|
||||
public int tier(int wave, int lane){
|
||||
return Mathf.clamp(tier + (wave-after)/tierscale, 1, EnemyType.maxtier);
|
||||
return Mathf.clamp(tier + (wave-after)/tierscale, 1, UnitType.maxtier);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package io.anuke.mindustry.game;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.entities.BulletType;
|
||||
import io.anuke.mindustry.entities.TileEntity;
|
||||
import io.anuke.mindustry.entities.enemies.Enemy;
|
||||
import io.anuke.mindustry.entities.enemies.BaseUnit;
|
||||
import io.anuke.mindustry.resource.Weapon;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
@@ -41,7 +41,7 @@ public class EventType {
|
||||
}
|
||||
|
||||
public interface EnemyDeathEvent extends Event{
|
||||
void handle(Enemy enemy);
|
||||
void handle(BaseUnit enemy);
|
||||
}
|
||||
|
||||
public interface BlockDestroyEvent extends Event{
|
||||
|
||||
15
core/src/io/anuke/mindustry/game/Team.java
Normal file
15
core/src/io/anuke/mindustry/game/Team.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package io.anuke.mindustry.game;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
|
||||
public enum Team {
|
||||
none(Color.GRAY),
|
||||
blue(Color.BLUE),
|
||||
red(Color.RED);
|
||||
|
||||
public final Color color;
|
||||
|
||||
Team(Color color){
|
||||
this.color = color;
|
||||
}
|
||||
}
|
||||
@@ -1,130 +1,12 @@
|
||||
package io.anuke.mindustry.game;
|
||||
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.mindustry.entities.enemies.EnemyTypes;
|
||||
|
||||
public class WaveCreator{
|
||||
|
||||
public static Array<EnemySpawn> getSpawns(){
|
||||
|
||||
return Array.with(
|
||||
new EnemySpawn(EnemyTypes.standard){{
|
||||
scaling = 1;
|
||||
before = 3;
|
||||
}},
|
||||
|
||||
new EnemySpawn(EnemyTypes.fast){{
|
||||
scaling = 1;
|
||||
after = 3;
|
||||
spacing = 5;
|
||||
amount = 3;
|
||||
tierscaleback = 0;
|
||||
}},
|
||||
|
||||
new EnemySpawn(EnemyTypes.blast){{
|
||||
after = 4;
|
||||
amount = 2;
|
||||
spacing = 5;
|
||||
scaling = 2;
|
||||
tierscaleback = 1;
|
||||
}},
|
||||
|
||||
new EnemySpawn(EnemyTypes.tank){{
|
||||
after = 5;
|
||||
spacing = 5;
|
||||
scaling = 2;
|
||||
amount = 2;
|
||||
}},
|
||||
|
||||
new EnemySpawn(EnemyTypes.rapid){{
|
||||
after = 7;
|
||||
spacing = 5;
|
||||
scaling = 2;
|
||||
amount = 3;
|
||||
}},
|
||||
|
||||
new EnemySpawn(EnemyTypes.healer){{
|
||||
after = 5;
|
||||
spacing = 5;
|
||||
scaling = 1;
|
||||
amount = 1;
|
||||
}},
|
||||
|
||||
new EnemySpawn(EnemyTypes.standard){{
|
||||
scaling = 3;
|
||||
after = 8;
|
||||
spacing = 4;
|
||||
tier = 2;
|
||||
}},
|
||||
|
||||
new EnemySpawn(EnemyTypes.titan){{
|
||||
after = 6;
|
||||
amount = 2;
|
||||
spacing = 5;
|
||||
scaling = 3;
|
||||
}},
|
||||
|
||||
new EnemySpawn(EnemyTypes.flamer){{
|
||||
after = 12;
|
||||
amount = 2;
|
||||
spacing = 5;
|
||||
scaling = 3;
|
||||
}},
|
||||
|
||||
new EnemySpawn(EnemyTypes.emp){{
|
||||
after = 15;
|
||||
amount = 1;
|
||||
spacing = 5;
|
||||
scaling = 2;
|
||||
}},
|
||||
|
||||
new EnemySpawn(EnemyTypes.blast){{
|
||||
after = 4 + 5 + 5;
|
||||
amount = 3;
|
||||
spacing = 5;
|
||||
scaling = 2;
|
||||
tierscaleback = 0;
|
||||
}},
|
||||
//boss wave
|
||||
new EnemySpawn(EnemyTypes.fortress){{
|
||||
after = 16;
|
||||
amount = 1;
|
||||
spacing = 5;
|
||||
scaling = 1;
|
||||
}},
|
||||
|
||||
new EnemySpawn(EnemyTypes.titan){{
|
||||
after = 16;
|
||||
amount = 1;
|
||||
spacing = 5;
|
||||
scaling = 3;
|
||||
tierscaleback = 0;
|
||||
}},
|
||||
|
||||
new EnemySpawn(EnemyTypes.healer){{
|
||||
after = 16;
|
||||
spacing = 5;
|
||||
scaling = 2;
|
||||
amount = 2;
|
||||
}},
|
||||
//end boss wave
|
||||
|
||||
//enchanced boss wave
|
||||
new EnemySpawn(EnemyTypes.mortar){{
|
||||
after = 16 + 5;
|
||||
amount = 1;
|
||||
spacing = 5;
|
||||
scaling = 3;
|
||||
}},
|
||||
|
||||
new EnemySpawn(EnemyTypes.emp){{
|
||||
after = 16 + 5;
|
||||
amount = 1;
|
||||
spacing = 5;
|
||||
scaling = 3;
|
||||
}}
|
||||
//end enchanced boss wave
|
||||
);
|
||||
//TODO
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void testWaves(int from, int to){
|
||||
|
||||
Reference in New Issue
Block a user