All Implemented Interfaces:
Comparable<Content>, Senseable
Direct Known Subclasses:
ContinuousTurret, ItemTurret, LiquidTurret, PayloadAmmoTurret, PowerTurret

public class Turret extends ReloadTurret
  • Field Details

    • logicControlCooldown

      public static final float logicControlCooldown
      See Also:
    • timerTarget

      public final int timerTarget
    • targetInterval

      public float targetInterval
      Ticks between attempt at finding a target.
    • maxAmmo

      public int maxAmmo
      Maximum ammo units stored.
    • ammoPerShot

      public int ammoPerShot
      Ammo units used per shot.
    • consumeAmmoOnce

      public boolean consumeAmmoOnce
      If true, ammo is only consumed once per shot regardless of bullet count.
    • heatRequirement

      public float heatRequirement
      Minimum input heat required to fire.
    • maxHeatEfficiency

      public float maxHeatEfficiency
      Maximum efficiency possible, if this turret uses heat.
    • inaccuracy

      public float inaccuracy
      Bullet angle randomness in degrees.
    • velocityRnd

      public float velocityRnd
      Fraction of bullet velocity that is random.
    • shootCone

      public float shootCone
      Maximum angle difference in degrees at which turret will still try to shoot.
    • shootX

      public float shootX
      Turret shoot point.
    • shootY

      public float shootY
      Turret shoot point.
    • xRand

      public float xRand
      Random spread on the X axis.
    • minRange

      public float minRange
      Minimum bullet range. Used for artillery only.
    • minWarmup

      public float minWarmup
      Minimum warmup needed to fire.
    • accurateDelay

      public boolean accurateDelay
      If true, this turret will accurately target moving targets with respect to charge time.
    • moveWhileCharging

      public boolean moveWhileCharging
      If false, this turret can't move while charging.
    • warmupMaintainTime

      public float warmupMaintainTime
      How long warmup is maintained even if this turret isn't shooting.
    • shoot

      public ShootPattern shoot
      pattern used for bullets
    • targetAir

      public boolean targetAir
      If true, this block targets air units.
    • targetGround

      public boolean targetGround
      If true, this block targets ground units and structures.
    • targetHealing

      public boolean targetHealing
      If true, this block targets friend blocks, to heal them.
    • playerControllable

      public boolean playerControllable
      If true, this turret can be controlled by players.
    • displayAmmoMultiplier

      public boolean displayAmmoMultiplier
      If true, this block will display ammo multipliers in its stats (irrelevant for certain types of turrets).
    • targetUnderBlocks

      public boolean targetUnderBlocks
      If false, 'under' blocks like conveyors are not targeted.
    • alwaysShooting

      public boolean alwaysShooting
      If true, the turret will always shoot when it has ammo, regardless of targets in range or any control.
    • predictTarget

      public boolean predictTarget
      Whether this turret predicts unit movement.
    • unitSort

      public Units.Sortf unitSort
      Function for choosing which unit to target.
    • unitFilter

      public Boolf<mindustry.gen.Unit> unitFilter
      Filter for types of units to attack.
    • buildingFilter

      public Boolf<mindustry.gen.Building> buildingFilter
      Filter for types of buildings to attack.
    • heatColor

      public Color heatColor
      Color of heat region drawn on top (if found)
    • shootEffect

      @Nullable public Effect shootEffect
      Optional override for all shoot effects.
    • smokeEffect

      @Nullable public Effect smokeEffect
      Optional override for all smoke effects.
    • ammoUseEffect

      public Effect ammoUseEffect
      Effect created when ammo is used. Not optional.
    • shootSound

      public Sound shootSound
      Sound emitted when a single bullet is shot.
    • chargeSound

      public Sound chargeSound
      Sound emitted when shoot.firstShotDelay is >0 and shooting begins.
    • soundPitchMin

      public float soundPitchMin
      Range for pitch of shoot sound.
    • soundPitchMax

      public float soundPitchMax
      Range for pitch of shoot sound.
    • ammoEjectBack

      public float ammoEjectBack
      Backwards Y offset of ammo eject effect.
    • shootWarmupSpeed

      public float shootWarmupSpeed
      Lerp speed of turret warmup.
    • linearWarmup

      public boolean linearWarmup
      If true, turret warmup is linear instead of a curve.
    • recoil

      public float recoil
      Visual amount by which the turret recoils back per shot.
    • recoils

      public int recoils
      Number of additional counters for recoil.
    • recoilTime

      public float recoilTime
      ticks taken for turret to return to starting position in ticks. uses reload time by default
    • recoilPow

      public float recoilPow
      power curve applied to visual recoil
    • cooldownTime

      public float cooldownTime
      ticks to cool down the heat region
    • elevation

      public float elevation
      Visual elevation of turret shadow, -1 to use defaults.
    • shake

      public float shake
      How much the screen shakes per shot.
    • drawer

      public DrawBlock drawer
      Defines drawing behavior for this turret.
  • Constructor Details

    • Turret

      public Turret(String name)
  • Method Details

    • outputsItems

      public boolean outputsItems()
      Overrides:
      outputsItems in class Block
    • setStats

      public void setStats()
      Description copied from class: UnlockableContent
      Initializes stats on demand. Should only be called once. Only called before something is displayed.
      Overrides:
      setStats in class ReloadTurret
    • setBars

      public void setBars()
      Overrides:
      setBars in class Block
    • init

      public void init()
      Description copied from class: Block
      Called after all blocks are created.
      Overrides:
      init in class BaseTurret
    • load

      public void load()
      Description copied from class: Content
      Called after all content is created, only on non-headless versions. Use for loading regions or other image data.
      Overrides:
      load in class Block
    • icons

      public TextureRegion[] icons()
      Overrides:
      icons in class Block
    • getRegionsToOutline

      public void getRegionsToOutline(Seq<TextureRegion> out)
      Overrides:
      getRegionsToOutline in class Block
    • limitRange

      public void limitRange(BulletType bullet, float margin)