Class WeaponMount

java.lang.Object
mindustry.entities.units.WeaponMount
Direct Known Subclasses:
RepairBeamWeapon.HealBeamMount

public class WeaponMount extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    float
    aiming position in world coordinates
    float
    aiming position in world coordinates
    int
    counter for which barrel bullets have been fired from; used for alternating patterns
    mindustry.gen.Bullet
    current bullet for continuous weapons
    float
    counts up to 1 when charging, 0 when not
    boolean
    is the weapon actively charging
    float
    current heat, 0 to 1
    float
    weapon recoil
    float[]
    weapon barrel recoil
    float
    reload in frames; 0 means ready to fire
    float
    retarget counter
    boolean
    whether to rotate to face the target right now
    float
    rotation relative to the unit this mount is on
    boolean
    whether to shoot right now
    boolean
    extra state for alternating weapons
    float
    lerps to reload time
    sound loop for continuous weapons
    mindustry.gen.Teamc
    current target; used for autonomous weapons and AI
    float
    destination rotation; do not modify!
    int
    total bullets fired from this mount
    float
    lerps to 1 when shooting, 0 when not
    final Weapon
    weapon associated with this mount
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • weapon

      public final Weapon weapon
      weapon associated with this mount
    • reload

      public float reload
      reload in frames; 0 means ready to fire
    • rotation

      public float rotation
      rotation relative to the unit this mount is on
    • recoil

      public float recoil
      weapon recoil
    • recoils

      @Nullable public float[] recoils
      weapon barrel recoil
    • targetRotation

      public float targetRotation
      destination rotation; do not modify!
    • heat

      public float heat
      current heat, 0 to 1
    • warmup

      public float warmup
      lerps to 1 when shooting, 0 when not
    • charging

      public boolean charging
      is the weapon actively charging
    • charge

      public float charge
      counts up to 1 when charging, 0 when not
    • smoothReload

      public float smoothReload
      lerps to reload time
    • aimX

      public float aimX
      aiming position in world coordinates
    • aimY

      public float aimY
      aiming position in world coordinates
    • shoot

      public boolean shoot
      whether to shoot right now
    • rotate

      public boolean rotate
      whether to rotate to face the target right now
    • side

      public boolean side
      extra state for alternating weapons
    • totalShots

      public int totalShots
      total bullets fired from this mount
    • barrelCounter

      public int barrelCounter
      counter for which barrel bullets have been fired from; used for alternating patterns
    • bullet

      @Nullable public mindustry.gen.Bullet bullet
      current bullet for continuous weapons
    • sound

      @Nullable public SoundLoop sound
      sound loop for continuous weapons
    • target

      @Nullable public mindustry.gen.Teamc target
      current target; used for autonomous weapons and AI
    • retarget

      public float retarget
      retarget counter
  • Constructor Details

    • WeaponMount

      public WeaponMount(Weapon weapon)