Class Turret.TurretBuild

All Implemented Interfaces:
Position, QuadTree.QuadTreeObject, Sized, mindustry.gen.Buildingc, mindustry.gen.Entityc, mindustry.gen.Healthc, mindustry.gen.Posc, mindustry.gen.Teamc, mindustry.gen.Timerc, Controllable, Ranged, Senseable, Settable, Displayable, ControlBlock
Direct Known Subclasses:
ContinuousTurret.ContinuousTurretBuild, ItemTurret.ItemTurretBuild, LiquidTurret.LiquidTurretBuild, PayloadAmmoTurret.PayloadTurretBuild, PowerTurret.PowerTurretBuild
Enclosing class:
Turret

public class Turret.TurretBuild extends ReloadTurret.ReloadTurretBuild implements ControlBlock
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    int
     
    float
     
    float
     
    float[]
     
    float
     
    float
     
    float
     
    boolean
     
    int
     
    Turret sprite offset, based on recoil.
    float
     
    float[]
     
    mindustry.gen.Posc
     
     
    int
     
    int
     
    mindustry.gen.BlockUnitc
     
    float
     
    boolean
     

    Fields inherited from class mindustry.world.blocks.defense.turrets.ReloadTurret.ReloadTurretBuild

    reloadCounter

    Fields inherited from class mindustry.world.blocks.defense.turrets.BaseTurret.BaseTurretBuild

    rotation

    Fields inherited from class mindustry.gen.Building

    added, block, bulletDamageEvent, cdump, dead, dumpAccum, efficiency, enabled, healSuppressionTime, health, hitDuration, hitTime, id, index__all, index__build, initialized, items, lastAccessed, lastDamageTime, lastDisabler, lastHealTime, liquids, maxHealth, optionalEfficiency, payloadRotation, potentialEfficiency, power, proximity, recentDamageTime, sleeping, sleepingEntities, sleepTime, sound, team, teamChangeEvent, tempBuilds, tile, timer, timeScale, timeScaleDuration, timeToSleep, tmpTiles, visibleFlags, visualLiquid, wasDamaged, wasVisible, x, y

    Fields inherited from interface mindustry.logic.Senseable

    noSensed
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    float
     
    protected void
    bullet(BulletType type, float xOffset, float yOffset, float angleOffset, Mover mover)
     
    boolean
     
    protected boolean
     
    boolean
     
    void
    control(LAccess type, double p1, double p2, double p3, double p4)
     
    void
    control(LAccess type, Object p1, double p2, double p3, double p4)
     
    void
     
    float
     
    float
     
    protected void
     
    protected void
    handleBullet(mindustry.gen.Bullet bullet, float offsetX, float offsetY, float angleOffset)
     
    void
    handleLiquid(mindustry.gen.Building source, Liquid liquid, float amount)
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
     
    float
     
    float
     
    void
    read(Reads read, byte revision)
     
    double
    sense(LAccess sensor)
     
    protected void
     
    boolean
     
    boolean
     
    boolean
     
    void
    targetPosition(mindustry.gen.Posc pos)
     
    protected void
    turnToTarget(float targetRot)
     
    mindustry.gen.Unit
     
    void
     
    protected void
     
    protected void
     
    void
     
    Consume ammo and return a type.
    protected boolean
     
    byte
     
    float
     
    void
    write(Writes write)
     

    Methods inherited from class mindustry.world.blocks.defense.turrets.ReloadTurret.ReloadTurretBuild

    baseReloadSpeed, updateCooling

    Methods inherited from class mindustry.world.blocks.defense.turrets.BaseTurret.BaseTurretBuild

    drawSelect

    Methods inherited from class mindustry.gen.Building

    absorbLasers, acceptItem, acceptLiquid, acceptPayload, acceptStack, add, addPlan, addPlan, afterDestroyed, afterPickedUp, afterRead, allowUpdate, ambientVolume, applyBoost, applyHealSuppression, applySlowdown, as, back, block, block, blockOn, buildConfiguration, buildOn, calculateHeat, calculateHeat, canConsume, canControlSelect, canDump, canDumpLiquid, canPickup, canResupply, canUnload, canWithdraw, cdump, cdump, changeTeam, cheating, checkSolid, checkSuppression, clampHealth, classId, closestCore, closestEnemyCore, collide, collision, conductsTo, config, configTapped, configure, configureAny, configured, consume, consumeTriggerValid, core, create, create, created, damage, damage, damage, damage, damageContinuous, damageContinuousPierce, damaged, damagePierce, damagePierce, dead, dead, delta, deselect, display, displayBars, displayConsumption, drawConfigure, drawCracks, drawDisabled, drawLight, drawLiquidLight, drawStatus, drawTeam, drawTeamTop, dropped, dump, dump, dumpAccumulate, dumpAccumulate, dumpLiquid, dumpLiquid, dumpLiquid, dumpPayload, edelta, efficiency, efficiency, efficiencyScale, enabled, enabled, explosionItemCap, findClosestEdge, floor, floorOn, flowItems, fogRadius, front, getCommandPosition, getCursor, getDisplayEfficiency, getDisplayIcon, getDisplayName, getLiquidDestination, getMaximumAccepted, getPayload, getPayloads, getPowerConnections, getPowerProduction, getProgressIncrease, getStackOffset, getX, getY, handleDamage, handleItem, handlePayload, handleStack, handleString, handleUnitPayload, heal, heal, healFract, healSuppressionTime, healSuppressionTime, health, health, healthChanged, healthf, hitbox, hitSize, hitTime, hitTime, id, id, incrementDump, inFogTo, init, interactable, isAdded, isDiscovered, isHealSuppressed, isInsulated, isLocal, isNull, isPayload, isRemote, isValid, items, items, itemTaken, kill, killed, lastAccessed, lastAccessed, lastDisabler, lastDisabler, lastHealTime, lastHealTime, left, liquids, liquids, maxHealth, maxHealth, moduleBitmask, moveForward, moveLiquid, moveLiquidForward, movePayload, nearby, nearby, noSleep, offload, onCommand, onConfigureBuildTapped, onConfigureClosed, onConfigureTapped, onControlSelect, onDestroyed, onProximityAdded, onProximityRemoved, onProximityUpdate, onRemoved, onSolid, optionalEfficiency, optionalEfficiency, overwrote, payloadCheck, payloadDraw, payloadRotation, payloadRotation, pickedUp, placed, playerPlaced, pos, potentialEfficiency, potentialEfficiency, power, power, powerGraphRemoved, produced, produced, productionValid, proximity, proximity, put, read, readAll, readBase, recentlyHealed, relativeTo, relativeTo, relativeTo, relativeToEdge, remove, removeFromProximity, removeStack, right, rotation, rotation, rotdeg, self, sense, senseObject, serialize, set, set, setIndex__all, setIndex__build, setProp, setProp, setProp, shouldAmbientSound, shouldHideConfigure, shouldShowConfigure, sleep, status, takePayload, tapped, team, team, tile, tile, tileOn, tileX, tileY, timer, timer, timer, timeScale, toString, totalProgress, transferLiquid, trns, trns, unitOn, unitRemoved, update, updateConsumption, updatePayload, updatePowerGraph, updateProximity, updateTableAlign, visibleFlags, visibleFlags, visualLiquid, visualLiquid, wasDamaged, wasDamaged, wasRecentlyDamaged, wasRecentlyHealed, wasVisible, wasVisible, writeAll, writeBase, x, x, y, y

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface mindustry.world.blocks.ControlBlock

    isControlled, shouldAutoTarget

    Methods inherited from interface mindustry.ui.Displayable

    displayable

    Methods inherited from interface mindustry.gen.Entityc

    afterRead, as, classId, id, id, isAdded, isLocal, isNull, isRemote, read, self, serialize

    Methods inherited from interface mindustry.gen.Posc

    blockOn, buildOn, floorOn, getX, getY, onSolid, set, set, tileOn, trns, trns, x, x, y, y

    Methods inherited from interface arc.math.geom.Position

    angleTo, angleTo, dst, dst, dst2, dst2, within, within

    Methods inherited from interface mindustry.gen.Teamc

    cheating, closestCore, closestEnemyCore, core, team, team
  • Field Details

    • recoilOffset

      public Vec2 recoilOffset
      Turret sprite offset, based on recoil. Updated every frame.
    • ammo

      public Seq<Turret.AmmoEntry> ammo
    • totalAmmo

      public int totalAmmo
    • curRecoil

      public float curRecoil
    • heat

      public float heat
    • logicControlTime

      public float logicControlTime
    • curRecoils

      @Nullable public float[] curRecoils
    • shootWarmup

      public float shootWarmup
    • charge

      public float charge
    • warmupHold

      public float warmupHold
    • totalShots

      public int totalShots
    • barrelCounter

      public int barrelCounter
    • logicShooting

      public boolean logicShooting
    • target

      @Nullable public mindustry.gen.Posc target
    • targetPos

      public Vec2 targetPos
    • unit

      public mindustry.gen.BlockUnitc unit
    • wasShooting

      public boolean wasShooting
    • queuedBullets

      public int queuedBullets
    • heatReq

      public float heatReq
    • sideHeat

      public float[] sideHeat
  • Constructor Details

    • TurretBuild

      public TurretBuild()
  • Method Details

    • estimateDps

      public float estimateDps()
      Overrides:
      estimateDps in class BaseTurret.BaseTurretBuild
    • range

      public float range()
      Specified by:
      range in interface Ranged
      Overrides:
      range in class BaseTurret.BaseTurretBuild
    • warmup

      public float warmup()
      Specified by:
      warmup in interface mindustry.gen.Buildingc
      Overrides:
      warmup in class mindustry.gen.Building
    • drawrot

      public float drawrot()
      Specified by:
      drawrot in interface mindustry.gen.Buildingc
      Overrides:
      drawrot in class mindustry.gen.Building
    • shouldConsume

      public boolean shouldConsume()
      Specified by:
      shouldConsume in interface mindustry.gen.Buildingc
      Overrides:
      shouldConsume in class mindustry.gen.Building
    • canControl

      public boolean canControl()
      Specified by:
      canControl in interface ControlBlock
      Returns:
      whether this block can be controlled at all.
    • control

      public void control(LAccess type, double p1, double p2, double p3, double p4)
      Specified by:
      control in interface mindustry.gen.Buildingc
      Specified by:
      control in interface Controllable
      Overrides:
      control in class mindustry.gen.Building
    • control

      public void control(LAccess type, Object p1, double p2, double p3, double p4)
      Specified by:
      control in interface mindustry.gen.Buildingc
      Specified by:
      control in interface Controllable
      Overrides:
      control in class mindustry.gen.Building
    • sense

      public double sense(LAccess sensor)
      Specified by:
      sense in interface mindustry.gen.Buildingc
      Specified by:
      sense in interface Senseable
      Overrides:
      sense in class mindustry.gen.Building
    • progress

      public float progress()
      Specified by:
      progress in interface mindustry.gen.Buildingc
      Overrides:
      progress in class mindustry.gen.Building
    • isShooting

      public boolean isShooting()
    • unit

      public mindustry.gen.Unit unit()
      Specified by:
      unit in interface ControlBlock
    • logicControlled

      public boolean logicControlled()
    • isActive

      public boolean isActive()
    • targetPosition

      public void targetPosition(mindustry.gen.Posc pos)
    • draw

      public void draw()
      Specified by:
      draw in interface mindustry.gen.Buildingc
      Overrides:
      draw in class mindustry.gen.Building
    • updateTile

      public void updateTile()
      Specified by:
      updateTile in interface mindustry.gen.Buildingc
      Overrides:
      updateTile in class mindustry.gen.Building
    • handleLiquid

      public void handleLiquid(mindustry.gen.Building source, Liquid liquid, float amount)
      Specified by:
      handleLiquid in interface mindustry.gen.Buildingc
      Overrides:
      handleLiquid in class mindustry.gen.Building
    • validateTarget

      protected boolean validateTarget()
    • canHeal

      protected boolean canHeal()
    • findTarget

      protected void findTarget()
    • turnToTarget

      protected void turnToTarget(float targetRot)
    • shouldTurn

      public boolean shouldTurn()
    • updateEfficiencyMultiplier

      public void updateEfficiencyMultiplier()
      Specified by:
      updateEfficiencyMultiplier in interface mindustry.gen.Buildingc
      Overrides:
      updateEfficiencyMultiplier in class mindustry.gen.Building
    • useAmmo

      public BulletType useAmmo()
      Consume ammo and return a type.
    • peekAmmo

      @Nullable public BulletType peekAmmo()
      Returns:
      the ammo type that will be returned if useAmmo is called.
    • hasAmmo

      public boolean hasAmmo()
      Returns:
      whether the turret has ammo.
    • charging

      public boolean charging()
    • updateReload

      protected void updateReload()
    • updateShooting

      protected void updateShooting()
    • shoot

      protected void shoot(BulletType type)
    • bullet

      protected void bullet(BulletType type, float xOffset, float yOffset, float angleOffset, Mover mover)
    • handleBullet

      protected void handleBullet(@Nullable mindustry.gen.Bullet bullet, float offsetX, float offsetY, float angleOffset)
    • activeSoundVolume

      public float activeSoundVolume()
      Specified by:
      activeSoundVolume in interface mindustry.gen.Buildingc
      Overrides:
      activeSoundVolume in class mindustry.gen.Building
    • shouldActiveSound

      public boolean shouldActiveSound()
      Specified by:
      shouldActiveSound in interface mindustry.gen.Buildingc
      Overrides:
      shouldActiveSound in class mindustry.gen.Building
    • write

      public void write(Writes write)
      Specified by:
      write in interface mindustry.gen.Buildingc
      Specified by:
      write in interface mindustry.gen.Entityc
      Overrides:
      write in class mindustry.gen.Building
    • read

      public void read(Reads read, byte revision)
      Specified by:
      read in interface mindustry.gen.Buildingc
      Overrides:
      read in class mindustry.gen.Building
    • version

      public byte version()
      Specified by:
      version in interface mindustry.gen.Buildingc
      Overrides:
      version in class mindustry.gen.Building