Class SpawnGroup

java.lang.Object
mindustry.game.SpawnGroup
All Implemented Interfaces:
Json.JsonSerializable, Cloneable

public class SpawnGroup extends Object implements 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 Details

    • never

      public static final int never
      See Also:
    • type

      public UnitType type
      The unit type spawned
    • end

      public int end
      When this spawn should end
    • begin

      public int begin
      When this spawn should start
    • spacing

      public int spacing
      The spacing, in waves, of spawns. For example, 2 = spawns every other wave
    • max

      public int max
      Maximum amount of units that spawn
    • unitScaling

      public float unitScaling
      How many waves need to pass before the amount of units spawned increases by 1
    • shields

      public float shields
      Shield points that this unit has.
    • shieldScaling

      public float shieldScaling
      How much shields get increased by per wave.
    • unitAmount

      public int unitAmount
      Amount of enemies spawned initially, with no scaling
    • spawn

      public int spawn
      If not -1, the unit will only spawn in spawnpoints with these packed coordinates.
    • payloads

      @Nullable public Seq<UnitType> payloads
      Seq of payloads that this unit will spawn with.
    • effect

      @Nullable public StatusEffect effect
      Status effect applied to the spawned unit. Null to disable.
    • items

      @Nullable public ItemStack items
      Items this unit spawns with. Null to disable.
  • Constructor Details

    • SpawnGroup

      public SpawnGroup(UnitType type)
    • 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, int wave)
      Creates a unit, and assigns correct values based on this group's data. This method does not add() the unit.
    • write

      public void write(Json json)
      Specified by:
      write in interface Json.JsonSerializable
    • read

      public void read(Json json, JsonValue data)
      Specified by:
      read in interface Json.JsonSerializable
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • copy

      public SpawnGroup copy()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object