Implemented new spawnlist
This commit is contained in:
@@ -8,8 +8,6 @@ import io.anuke.mindustry.type.ItemStack;
|
||||
import io.anuke.mindustry.type.StatusEffect;
|
||||
import io.anuke.mindustry.type.Weapon;
|
||||
|
||||
import static io.anuke.mindustry.Vars.state;
|
||||
|
||||
/**A spawn group defines spawn information for a specific type of unit, with optional extra information like
|
||||
* weapon equipped, ammo used, and status effects.
|
||||
* Each spawn group can have multiple sub-groups spawned in different areas of the map.*/
|
||||
@@ -50,7 +48,7 @@ public class SpawnGroup {
|
||||
if(wave < begin || wave > end || (wave - begin) % spacing != 0){
|
||||
return 0;
|
||||
}
|
||||
float scaling = this.unitScaling * state.difficulty.enemyScaling;
|
||||
float scaling = this.unitScaling;
|
||||
|
||||
return Math.min(unitAmount-1 + Math.max((int)((wave / spacing) / scaling), 1), max);
|
||||
}
|
||||
@@ -75,7 +73,7 @@ public class SpawnGroup {
|
||||
}
|
||||
|
||||
if(effect != null){
|
||||
unit.applyEffect(effect, 1f);
|
||||
unit.applyEffect(effect, 10000f);
|
||||
}
|
||||
|
||||
if(items != null){
|
||||
|
||||
@@ -2,7 +2,9 @@ package io.anuke.mindustry.game;
|
||||
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.mindustry.content.Items;
|
||||
import io.anuke.mindustry.content.StatusEffects;
|
||||
import io.anuke.mindustry.content.UnitTypes;
|
||||
import io.anuke.mindustry.content.Weapons;
|
||||
import io.anuke.mindustry.type.ItemStack;
|
||||
|
||||
public class WaveCreator{
|
||||
@@ -10,24 +12,149 @@ public class WaveCreator{
|
||||
public static Array<SpawnGroup> getSpawns(){
|
||||
return Array.with(
|
||||
new SpawnGroup(UnitTypes.scout){{
|
||||
end = 5;
|
||||
}},
|
||||
|
||||
new SpawnGroup(UnitTypes.titan){{
|
||||
begin = 6;
|
||||
}},
|
||||
|
||||
new SpawnGroup(UnitTypes.scout){{
|
||||
begin = 6;
|
||||
items = new ItemStack(Items.thermite, 100);
|
||||
end = 8;
|
||||
unitScaling = 2;
|
||||
}},
|
||||
|
||||
new SpawnGroup(UnitTypes.vtol){{
|
||||
begin = 4;
|
||||
end = 6;
|
||||
}},
|
||||
|
||||
new SpawnGroup(UnitTypes.scout){{
|
||||
begin = 11;
|
||||
unitScaling = 2;
|
||||
spacing = 2;
|
||||
max = 4;
|
||||
}},
|
||||
|
||||
new SpawnGroup(UnitTypes.titan){{
|
||||
begin = 8;
|
||||
spacing = 3;
|
||||
unitScaling = 2;
|
||||
|
||||
end = 30;
|
||||
}},
|
||||
|
||||
new SpawnGroup(UnitTypes.scout){{
|
||||
begin = 10;
|
||||
unitScaling = 2;
|
||||
unitAmount = 1;
|
||||
spacing = 2;
|
||||
ammoItem = Items.tungsten;
|
||||
end = 30;
|
||||
}},
|
||||
|
||||
new SpawnGroup(UnitTypes.titan){{
|
||||
begin = 28;
|
||||
spacing = 3;
|
||||
unitScaling = 2;
|
||||
weapon = Weapons.flamethrower;
|
||||
end = 40;
|
||||
}},
|
||||
|
||||
new SpawnGroup(UnitTypes.titan){{
|
||||
begin = 45;
|
||||
spacing = 3;
|
||||
unitScaling = 2;
|
||||
weapon = Weapons.flamethrower;
|
||||
effect = StatusEffects.overdrive;
|
||||
}},
|
||||
|
||||
new SpawnGroup(UnitTypes.titan){{
|
||||
begin = 120;
|
||||
spacing = 2;
|
||||
unitScaling = 3;
|
||||
unitAmount = 5;
|
||||
weapon = Weapons.flakgun;
|
||||
effect = StatusEffects.overdrive;
|
||||
}},
|
||||
|
||||
new SpawnGroup(UnitTypes.vtol){{
|
||||
begin = 14;
|
||||
unitScaling = 2;
|
||||
spacing = 2;
|
||||
|
||||
end = 39;
|
||||
max = 7;
|
||||
}},
|
||||
|
||||
new SpawnGroup(UnitTypes.scout){{
|
||||
begin = 82;
|
||||
spacing = 3;
|
||||
unitAmount = 4;
|
||||
groupAmount = 2;
|
||||
unitScaling = 3;
|
||||
effect = StatusEffects.overdrive;
|
||||
ammoItem = Items.silicon;
|
||||
}},
|
||||
|
||||
new SpawnGroup(UnitTypes.scout){{
|
||||
begin = 41;
|
||||
spacing = 5;
|
||||
unitAmount = 1;
|
||||
unitScaling = 3;
|
||||
effect = StatusEffects.shielded;
|
||||
ammoItem = Items.thorium;
|
||||
max = 10;
|
||||
}},
|
||||
|
||||
new SpawnGroup(UnitTypes.scout){{
|
||||
begin = 25;
|
||||
spacing = 3;
|
||||
unitAmount = 4;
|
||||
groupAmount = 2;
|
||||
effect = StatusEffects.overdrive;
|
||||
items = new ItemStack(Items.blastCompound, 60);
|
||||
end = 60;
|
||||
}},
|
||||
|
||||
new SpawnGroup(UnitTypes.scout){{
|
||||
begin = 42;
|
||||
spacing = 3;
|
||||
unitAmount = 4;
|
||||
groupAmount = 2;
|
||||
effect = StatusEffects.overdrive;
|
||||
items = new ItemStack(Items.thermite, 100);
|
||||
end = 130;
|
||||
}},
|
||||
|
||||
new SpawnGroup(UnitTypes.monsoon){{
|
||||
begin = 16;
|
||||
begin = 35;
|
||||
ammoItem = Items.blastCompound;
|
||||
unitAmount = 2;
|
||||
unitScaling = 3;
|
||||
max = 8;
|
||||
}},
|
||||
|
||||
new SpawnGroup(UnitTypes.vtol){{
|
||||
begin = 50;
|
||||
unitAmount = 4;
|
||||
unitScaling = 3;
|
||||
spacing = 5;
|
||||
groupAmount = 2;
|
||||
effect = StatusEffects.overdrive;
|
||||
max = 8;
|
||||
}},
|
||||
|
||||
new SpawnGroup(UnitTypes.monsoon){{
|
||||
begin = 53;
|
||||
ammoItem = Items.thermite;
|
||||
unitAmount = 2;
|
||||
unitScaling = 3;
|
||||
spacing = 4;
|
||||
max = 8;
|
||||
end = 74;
|
||||
}},
|
||||
|
||||
new SpawnGroup(UnitTypes.monsoon){{
|
||||
begin = 53;
|
||||
ammoItem = Items.coal;
|
||||
unitAmount = 2;
|
||||
unitScaling = 3;
|
||||
spacing = 4;
|
||||
max = 8;
|
||||
end = 74;
|
||||
}}
|
||||
);
|
||||
}
|
||||
@@ -38,11 +165,21 @@ public class WaveCreator{
|
||||
System.out.print(i+": ");
|
||||
int total = 0;
|
||||
for(SpawnGroup spawn : spawns){
|
||||
int a = spawn.getUnitsSpawned(i);
|
||||
int a = spawn.getUnitsSpawned(i) * spawn.getGroupsSpawned(i);
|
||||
total += a;
|
||||
|
||||
if(a > 0){
|
||||
System.out.print(a+"x" + spawn.type.name);
|
||||
|
||||
if(spawn.weapon != null){
|
||||
System.out.print(":" + spawn.weapon.name);
|
||||
}
|
||||
|
||||
if(spawn.ammoItem != null){
|
||||
System.out.print(":" + spawn.ammoItem.name);
|
||||
}
|
||||
|
||||
System.out.print(" ");
|
||||
}
|
||||
}
|
||||
System.out.print(" (" + total + ")");
|
||||
|
||||
Reference in New Issue
Block a user