Package mindustry.game
Class SpawnGroup
java.lang.Object
mindustry.game.SpawnGroup
- All Implemented Interfaces:
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
Modifier 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
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.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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canSpawn
(int position) copy()
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
toString()
void
-
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.
-
-
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
Creates a unit, and assigns correct values based on this group's data. This method does not add() the unit. -
write
- Specified by:
write
in interfaceJson.JsonSerializable
-
read
- Specified by:
read
in interfaceJson.JsonSerializable
-
toString
-
copy
-
equals
-
hashCode
public int hashCode()
-