Package mindustry.game
Class SpawnGroup
java.lang.Object
mindustry.game.SpawnGroup
- All Implemented Interfaces:
arc.util.serialization.Json.JsonSerializable
,Cloneable
public class SpawnGroup
extends Object
implements arc.util.serialization.Json.JsonSerializable, Cloneable
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionint
When this spawn should startStatus effect applied to the spawned unit.int
When this spawn should endItems this unit spawns with.int
Maximum amount of units that spawnstatic final int
arc.struct.Seq<UnitType>
Seq of payloads that this unit will spawn with.float
Shield points that this unit has.float
How much shields get increased by per wave.int
The spacing, in waves, of spawns.int
If not -1, the unit will only spawn in spawnpoints with these packed coordinates.Team that units spawned use.The unit type spawnedint
Amount of enemies spawned initially, with no scalingfloat
How many waves need to pass before the amount of units spawned increases by 1 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
canSpawn
(int position) copy()
mindustry.gen.Unit
createUnit
(Team team, float x, float y, float rotation, int wave, arc.func.Cons<mindustry.gen.Unit> cons) Creates a unit, and assigns correct values based on this group's data.mindustry.gen.Unit
createUnit
(Team team, int wave) Creates a unit, and assigns correct values based on this group's data.boolean
float
getShield
(int wave) int
getSpawned
(int wave) int
hashCode()
void
read
(arc.util.serialization.Json json, arc.util.serialization.JsonValue data) toString()
void
write
(arc.util.serialization.Json json)
-
Field Details
-
never
public static final int never- See Also:
-
type
The unit type spawned -
end
public int endWhen this spawn should end -
begin
public int beginWhen this spawn should start -
spacing
public int spacingThe spacing, in waves, of spawns. For example, 2 = spawns every other wave -
max
public int maxMaximum amount of units that spawn -
unitScaling
public float unitScalingHow many waves need to pass before the amount of units spawned increases by 1 -
shields
public float shieldsShield points that this unit has. -
shieldScaling
public float shieldScalingHow much shields get increased by per wave. -
unitAmount
public int unitAmountAmount of enemies spawned initially, with no scaling -
spawn
public int spawnIf not -1, the unit will only spawn in spawnpoints with these packed coordinates. -
payloads
Seq of payloads that this unit will spawn with. -
effect
Status effect applied to the spawned unit. Null to disable. -
items
Items this unit spawns with. Null to disable. -
team
Team that units spawned use. Null for default wave team.
-
-
Constructor Details
-
SpawnGroup
-
SpawnGroup
public SpawnGroup()
-
-
Method Details
-
canSpawn
public boolean canSpawn(int position) -
getSpawned
public int getSpawned(int wave) - Returns:
- amount of units spawned on a specific wave.
-
getShield
public float getShield(int wave) - Returns:
- amount of shields each unit has at a specific wave.
-
createUnit
public mindustry.gen.Unit createUnit(Team team, float x, float y, float rotation, int wave, arc.func.Cons<mindustry.gen.Unit> cons) Creates a unit, and assigns correct values based on this group's data. -
createUnit
Creates a unit, and assigns correct values based on this group's data. -
write
public void write(arc.util.serialization.Json json) - Specified by:
write
in interfacearc.util.serialization.Json.JsonSerializable
-
read
public void read(arc.util.serialization.Json json, arc.util.serialization.JsonValue data) - Specified by:
read
in interfacearc.util.serialization.Json.JsonSerializable
-
toString
-
copy
-
equals
-
hashCode
public int hashCode()
-