Package mindustry.entities.units
Class WeaponMount
java.lang.Object
mindustry.entities.units.WeaponMount
- Direct Known Subclasses:
RepairBeamWeapon.HealBeamMount
-
Field Summary
FieldsModifier and TypeFieldDescriptionfloataiming position in world coordinatesfloataiming position in world coordinatesintcounter for which barrel bullets have been fired from; used for alternating patternsmindustry.gen.Bulletcurrent bullet for continuous weaponsfloatcounts up to 1 when charging, 0 when notbooleanis the weapon actively chargingfloatcurrent heat, 0 to 1floatLast aim length of weapon.floatweapon recoilfloat[]weapon barrel recoilfloatreload in frames; 0 means ready to firefloatretarget counterbooleanwhether to rotate to face the target right nowfloatrotation relative to the unit this mount is onbooleanwhether to shoot right nowbooleanextra state for alternating weaponsfloatlerps to reload timesound loop for continuous weaponsmindustry.gen.Teamccurrent target; used for autonomous weapons and AIfloatdestination rotation; do not modify!inttotal bullets fired from this mountfloatlerps to 1 when shooting, 0 when notfinal Weaponweapon associated with this mount -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
weapon
weapon associated with this mount -
reload
public float reloadreload in frames; 0 means ready to fire -
rotation
public float rotationrotation relative to the unit this mount is on -
recoil
public float recoilweapon recoil -
recoils
@Nullable public float[] recoilsweapon barrel recoil -
targetRotation
public float targetRotationdestination rotation; do not modify! -
heat
public float heatcurrent heat, 0 to 1 -
warmup
public float warmuplerps to 1 when shooting, 0 when not -
charging
public boolean chargingis the weapon actively charging -
charge
public float chargecounts up to 1 when charging, 0 when not -
smoothReload
public float smoothReloadlerps to reload time -
aimX
public float aimXaiming position in world coordinates -
aimY
public float aimYaiming position in world coordinates -
shoot
public boolean shootwhether to shoot right now -
rotate
public boolean rotatewhether to rotate to face the target right now -
side
public boolean sideextra state for alternating weapons -
totalShots
public int totalShotstotal bullets fired from this mount -
barrelCounter
public int barrelCountercounter for which barrel bullets have been fired from; used for alternating patterns -
lastLength
public float lastLengthLast aim length of weapon. Only used for point lasers. -
bullet
@Nullable public mindustry.gen.Bullet bulletcurrent bullet for continuous weapons -
sound
sound loop for continuous weapons -
target
@Nullable public mindustry.gen.Teamc targetcurrent target; used for autonomous weapons and AI -
retarget
public float retargetretarget counter
-
-
Constructor Details
-
WeaponMount
-