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

    Fields
    Modifier and Type
    Field
    Description
    int
    When this spawn should start
    Status effect applied to the spawned unit.
    int
    When this spawn should end
    Items this unit spawns with.
    int
    Maximum amount of units that spawn
    static 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 spawned
    int
    Amount of enemies spawned initially, with no scaling
    float
    How many waves need to pass before the amount of units spawned increases by 1
  • Constructor Summary

    Constructors
    Constructor
    Description
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canSpawn(int position)
     
     
    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
     
    void
    read(arc.util.serialization.Json json, arc.util.serialization.JsonValue data)
     
     
    void
    write(arc.util.serialization.Json json)
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 arc.struct.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.
    • team

      @Nullable public Team team
      Team that units spawned use. Null for default wave team.
  • 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, 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

      public mindustry.gen.Unit createUnit(Team team, int wave)
      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 interface arc.util.serialization.Json.JsonSerializable
    • read

      public void read(arc.util.serialization.Json json, arc.util.serialization.JsonValue data)
      Specified by:
      read in interface arc.util.serialization.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