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 TypeFieldDescriptionintWhen this spawn should startStatus effect applied to the spawned unit.intWhen this spawn should endItems this unit spawns with.intMaximum amount of units that spawnstatic final intarc.struct.Seq<UnitType>Seq of payloads that this unit will spawn with.floatShield points that this unit has.floatHow much shields get increased by per wave.intThe spacing, in waves, of spawns.intIf not -1, the unit will only spawn in spawnpoints with these packed coordinates.Team that units spawned use.The unit type spawnedintAmount of enemies spawned initially, with no scalingfloatHow many waves need to pass before the amount of units spawned increases by 1 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanSpawn(int position) copy()mindustry.gen.UnitcreateUnit(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.UnitcreateUnit(Team team, int wave) Creates a unit, and assigns correct values based on this group's data.booleanfloatgetShield(int wave) intgetSpawned(int wave) inthashCode()voidread(arc.util.serialization.Json json, arc.util.serialization.JsonValue data) toString()voidwrite(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:
writein interfacearc.util.serialization.Json.JsonSerializable
-
read
public void read(arc.util.serialization.Json json, arc.util.serialization.JsonValue data) - Specified by:
readin interfacearc.util.serialization.Json.JsonSerializable
-
toString
-
copy
-
equals
-
hashCode
public int hashCode()
-