Class Turret
- All Implemented Interfaces:
Comparable<Content>,Senseable
- Direct Known Subclasses:
ContinuousTurret,ItemTurret,LiquidTurret,PayloadAmmoTurret,PowerTurret
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classclassNested classes/interfaces inherited from class mindustry.world.blocks.defense.turrets.ReloadTurret
ReloadTurret.ReloadTurretBuildNested classes/interfaces inherited from class mindustry.world.blocks.defense.turrets.BaseTurret
BaseTurret.BaseTurretBuildNested classes/interfaces inherited from class mindustry.ctype.Content
Content.ModContentInfo -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanIf true, this turret will accurately target moving targets with respect to shoot.firstShotDelay.booleanIf true, the turret will always shoot when it has ammo, regardless of targets in range or any control.floatBackwards Y offset of ammo eject effect.intAmmo units used per shot.Effect created when ammo is used.arc.func.Boolf<mindustry.gen.Building>Filter for types of buildings to attack.arc.audio.SoundSound emitted when shoot.firstShotDelay is >0 and shooting begins.booleanIf true, ammo is only consumed once per shot regardless of bullet count.floatticks to cool down the heat regionbooleanIf true, this block will display ammo multipliers in its stats (irrelevant for certain types of turrets).Defines drawing behavior for this turret.booleanIf true, a range ring is also drawn for minRange.floatVisual elevation of turret shadow, -1 to use defaults.arc.graphics.ColorColor of heat region drawn on top (if found)floatMinimum input heat required to fire.floatBullet angle randomness in degrees.booleanIf true, turret warmup is linear instead of a curve.static final floatarc.audio.SoundThe sound that this block makes while active.floatActive sound base volume.intMaximum ammo units stored.floatMaximum efficiency possible, if this turret uses heat.floatMinimum bullet range.floatMinimum warmup needed to fire.booleanIf false, this turret can't move while charging.floatTarget interval for when this turret already has a valid target.booleanIf true, this turret can be controlled by players.booleanWhether this turret predicts unit movement.floatVisual amount by which the turret recoils back per shot.floatpower curve applied to visual recoilintNumber of additional counters for recoil.floatticks taken for turret to return to starting position in ticks.booleanIf false, this turret can't reload while chargingfloatFraction of lifetime that is added to bullets with lifeScale.floatHow much the screen shakes per shot.pattern used for bulletsfloatMaximum angle difference in degrees at which turret will still try to shoot.Optional override for all shoot effects.arc.audio.SoundSound emitted when a single bullet is shot.floatLerp speed of turret warmup.floatTurret shoot point.floatTurret shoot point.Optional override for all smoke effects.floatRange for pitch of shoot sound.floatRange for pitch of shoot sound.booleanIf true, this block targets air units.booleanIf true, this block targets blocks.booleanIf true, this block targets ground units and structures.booleanIf true, this block targets friend blocks, to heal them.floatTicks between attempt at finding a target.booleanIf false, 'under' blocks like conveyors are not targeted.final intfloatRange at which it finds and locks on to the target, but does not shoot.arc.func.Boolf<mindustry.gen.Unit>Filter for types of units to attack.Function for choosing which unit to target.floatFraction of bullet velocity that is random.floatHow long warmup is maintained even if this turret isn't shooting.floatRandom spread on the X axis.Fields inherited from class mindustry.world.blocks.defense.turrets.ReloadTurret
reloadFields inherited from class mindustry.world.blocks.defense.turrets.BaseTurret
coolant, coolantMultiplier, coolEffect, disableOverlapCheck, fogRadiusMultiplier, placeOverlapMargin, range, rotateSpeedFields inherited from class mindustry.world.Block
absorbLasers, acceptsItems, acceptsPayload, acceptsUnitPayloads, albedo, allowConfigInventory, allowDerelictRepair, allowDiagonal, allowRectanglePlacement, allowResupply, alwaysReplace, alwaysUpdateInUnits, ambientSound, ambientSoundVolume, armor, attacks, attributes, autoResetEnabled, barMap, baseExplosiveness, baseShake, breakable, breakEffect, breakPitchChange, breakSound, buildCostMultiplier, buildTime, buildType, buildVisibility, cacheLayer, canOverdrive, canPickup, category, clearOnDoubleTap, clipSize, commandable, conductivePower, configurable, configurations, connectedPower, consPower, consumeBuilder, consumers, consumesPower, consumesTap, conveyorPlacement, copyConfig, createRubble, crushDamageMultiplier, customShadow, customShadowRegion, deconstructDropAllLiquid, deconstructThreshold, destroyBullet, destroyBulletSameTeam, destroyEffect, destroyPitchMax, destroyPitchMin, destroySound, destructible, displayFlow, drawArrow, drawCracks, drawDisabled, drawLiquidLight, drawTeamOverlay, dumpTime, editorConfigurable, emitLight, enableDrawStatus, envDisabled, envEnabled, envRequired, explosivenessScale, fillsTile, flags, flammabilityScale, floating, fogRadius, forceDark, forceTeam, generatedIcons, group, hasColor, hasConsumers, hasItems, hasLiquids, hasPower, hasShadow, health, ignoreBuildDarkness, ignoreResizeConfig, inEditor, instantBuild, instantDeconstruct, instantTransfer, insulated, invertFlip, isDuct, itemCapacity, itemDrop, itemFilter, lastConfig, lightClipSize, lightColor, lightLiquid, lightRadius, liquidCapacity, liquidFilter, liquidPressure, lockRotation, logicConfigurable, mapColor, nonOptionalConsumers, noSideBlend, noUpdateDisabled, offset, optionalConsumers, outlineColor, outlinedIcon, outlineIcon, outlineRadius, outputFacing, outputsLiquid, outputsPayload, outputsPower, placeableLiquid, placeableOn, placeablePlayer, placeEffect, placeOverlapRange, placePitchChange, placeSound, playerUnmineable, priority, privileged, quickRotate, rebuildable, region, regionRotated1, regionRotated2, replaceable, requirements, requiresWater, researchCost, researchCostMultiplier, researchCostMultipliers, rotate, rotateDraw, rotateDrawEditor, saveConfig, saveData, scaledHealth, schematicPriority, selectionColumns, selectionRows, selectScroll, separateItemCapacity, size, sizeOffset, solid, solidifes, squareSprite, subclass, suppressable, swapDiagonalPlacement, sync, targetable, teamPassable, teamRegion, teamRegions, tempBuilds, tempTiles, timerDump, timers, underBullets, unitCapModifier, unitMoveBreakable, unloadable, update, updateConsumers, updateInUnits, useColor, variantRegions, variants, variantShadowRegions, visualRotationOffsetFields inherited from class mindustry.ctype.UnlockableContent
allDatabaseTabs, alwaysUnlocked, databaseTabs, description, details, fullIcon, fullOverride, generateIcons, hideDatabase, hideDetails, inlineDescription, localizedName, selectionSize, shownPlanets, stats, techNode, techNodes, uiIcon, unlockedFields inherited from class mindustry.ctype.MappableContent
name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddrawPlace(int x, int y, int rotation, boolean valid) Drawn when you are placing a block.voiddrawPlanRegion(BuildPlan plan, arc.util.Eachable<BuildPlan> list) voidgetRegionsToOutline(arc.struct.Seq<arc.graphics.g2d.TextureRegion> out) arc.graphics.g2d.TextureRegion[]icons()voidinit()Called after all blocks are created.voidlimitRange(BulletType bullet, float margin) voidload()Called after all content is created, only on non-headless versions.booleanvoidplaceEnded(Tile tile, mindustry.gen.Unit builder, int rotation, Object config) Called when building of this block ends.voidsetBars()voidsetStats()Initializes stats on demand.Methods inherited from class mindustry.world.Block
addBar, addLiquidBar, addLiquidBar, asFloor, beforePlaceBegan, blockChanged, bounds, buildEditorConfig, canBeBuilt, canBreak, canPlaceOn, canReplace, changePlacementPath, changePlacementPath, checkForceDark, config, configClear, configSenseable, consume, consumeCoolant, consumeCoolant, consumeItem, consumeItem, consumeItems, consumeLiquid, consumeLiquids, consumePower, consumePowerBuffered, consumePowerCond, consumePowerDynamic, consumePowerDynamic, consumesItem, consumesLiquid, createIcons, displayShadow, drawBase, drawDefaultPlanRegion, drawEnvironmentLight, drawOverlay, drawPlaceText, drawPlan, drawPlan, drawPlanConfig, drawPlanConfigCenter, drawPlanConfigCenter, drawPlanConfigTop, drawPotentialLinks, drawShadow, drawSideRegion, editorPicked, environmentBuildable, findConsumer, flipRotation, getConfig, getContentType, getDependencies, getDisplayIcon, getDisplayName, getEdges, getGeneratedIcons, getInsideEdges, getPlanConfigs, getPlanRegion, getReplacement, handlePlacementLine, hasBuilding, hasConsumer, initBuilding, isAccessible, isAir, isBanned, isDarkened, isFloor, isHidden, isMultiblock, isOverlay, isPlaceable, isStatic, isVisible, iterateTaken, listBars, logicVisible, makeIconRegions, minimapColor, nearbySide, newBuilding, nextConfig, onNewPlan, onPicked, percentSolid, placeBegan, placeBegan, planRotation, pointConfig, postInit, removeBar, removeConsumer, removeConsumers, requirements, requirements, requirements, researchRequirements, resetGeneratedIcons, rotatedOutput, rotatedOutput, sense, sense, senseObject, setupRequirements, setupRequirements, sumAttribute, supportsEnv, synthetic, updateClipRadius, variantRegionsMethods inherited from class mindustry.ctype.UnlockableContent
checkStats, clearUnlock, displayDescription, displayExtra, emoji, emojiChar, getLogicId, hasEmoji, isOnPlanet, loadIcon, locked, makeOutline, makeOutline, makeOutline, onUnlock, quietUnlock, showUnlock, unlock, unlocked, unlockedHost, unlockedNow, unlockedNowHostMethods inherited from class mindustry.ctype.MappableContent
toStringMethods inherited from class mindustry.ctype.Content
compareTo, hasErrored, isModded, isVanilla
-
Field Details
-
logicControlCooldown
public static final float logicControlCooldown- See Also:
-
timerTarget
public final int timerTarget -
targetInterval
public float targetIntervalTicks between attempt at finding a target. -
newTargetInterval
public float newTargetIntervalTarget interval for when this turret already has a valid target. -1 = targetInterval -
maxAmmo
public int maxAmmoMaximum ammo units stored. -
ammoPerShot
public int ammoPerShotAmmo units used per shot. -
consumeAmmoOnce
public boolean consumeAmmoOnceIf true, ammo is only consumed once per shot regardless of bullet count. -
heatRequirement
public float heatRequirementMinimum input heat required to fire. -
maxHeatEfficiency
public float maxHeatEfficiencyMaximum efficiency possible, if this turret uses heat. -
inaccuracy
public float inaccuracyBullet angle randomness in degrees. -
velocityRnd
public float velocityRndFraction of bullet velocity that is random. -
scaleLifetimeOffset
public float scaleLifetimeOffsetFraction of lifetime that is added to bullets with lifeScale. -
shootCone
public float shootConeMaximum angle difference in degrees at which turret will still try to shoot. -
shootX
public float shootXTurret shoot point. -
shootY
public float shootYTurret shoot point. -
xRand
public float xRandRandom spread on the X axis. -
drawMinRange
public boolean drawMinRangeIf true, a range ring is also drawn for minRange. -
trackingRange
public float trackingRangeRange at which it finds and locks on to the target, but does not shoot. -
minRange
public float minRangeMinimum bullet range. Used for artillery only. -
minWarmup
public float minWarmupMinimum warmup needed to fire. -
accurateDelay
public boolean accurateDelayIf true, this turret will accurately target moving targets with respect to shoot.firstShotDelay. -
moveWhileCharging
public boolean moveWhileChargingIf false, this turret can't move while charging. -
reloadWhileCharging
public boolean reloadWhileChargingIf false, this turret can't reload while charging -
warmupMaintainTime
public float warmupMaintainTimeHow long warmup is maintained even if this turret isn't shooting. -
shoot
pattern used for bullets -
targetAir
public boolean targetAirIf true, this block targets air units. -
targetGround
public boolean targetGroundIf true, this block targets ground units and structures. -
targetBlocks
public boolean targetBlocksIf true, this block targets blocks. -
targetHealing
public boolean targetHealingIf true, this block targets friend blocks, to heal them. -
playerControllable
public boolean playerControllableIf true, this turret can be controlled by players. -
displayAmmoMultiplier
public boolean displayAmmoMultiplierIf true, this block will display ammo multipliers in its stats (irrelevant for certain types of turrets). -
targetUnderBlocks
public boolean targetUnderBlocksIf false, 'under' blocks like conveyors are not targeted. -
alwaysShooting
public boolean alwaysShootingIf true, the turret will always shoot when it has ammo, regardless of targets in range or any control. -
predictTarget
public boolean predictTargetWhether this turret predicts unit movement. -
unitSort
Function for choosing which unit to target. -
unitFilter
public arc.func.Boolf<mindustry.gen.Unit> unitFilterFilter for types of units to attack. -
buildingFilter
public arc.func.Boolf<mindustry.gen.Building> buildingFilterFilter for types of buildings to attack. -
heatColor
public arc.graphics.Color heatColorColor of heat region drawn on top (if found) -
shootEffect
Optional override for all shoot effects. -
smokeEffect
Optional override for all smoke effects. -
ammoUseEffect
Effect created when ammo is used. Not optional. -
shootSound
public arc.audio.Sound shootSoundSound emitted when a single bullet is shot. -
chargeSound
public arc.audio.Sound chargeSoundSound emitted when shoot.firstShotDelay is >0 and shooting begins. -
loopSound
public arc.audio.Sound loopSoundThe sound that this block makes while active. One sound loop. Do not overuse. -
loopSoundVolume
public float loopSoundVolumeActive sound base volume. -
soundPitchMin
public float soundPitchMinRange for pitch of shoot sound. -
soundPitchMax
public float soundPitchMaxRange for pitch of shoot sound. -
ammoEjectBack
public float ammoEjectBackBackwards Y offset of ammo eject effect. -
shootWarmupSpeed
public float shootWarmupSpeedLerp speed of turret warmup. -
linearWarmup
public boolean linearWarmupIf true, turret warmup is linear instead of a curve. -
recoil
public float recoilVisual amount by which the turret recoils back per shot. -
recoils
public int recoilsNumber of additional counters for recoil. -
recoilTime
public float recoilTimeticks taken for turret to return to starting position in ticks. uses reload time by default -
recoilPow
public float recoilPowpower curve applied to visual recoil -
cooldownTime
public float cooldownTimeticks to cool down the heat region -
elevation
public float elevationVisual elevation of turret shadow, -1 to use defaults. -
shake
public float shakeHow much the screen shakes per shot. -
drawer
Defines drawing behavior for this turret.
-
-
Constructor Details
-
Turret
-
-
Method Details
-
outputsItems
public boolean outputsItems()- Overrides:
outputsItemsin classBlock
-
setStats
public void setStats()Description copied from class:UnlockableContentInitializes stats on demand. Should only be called once. Only called before something is displayed.- Overrides:
setStatsin classReloadTurret
-
setBars
public void setBars() -
init
public void init()Description copied from class:BlockCalled after all blocks are created.- Overrides:
initin classBaseTurret
-
load
public void load()Description copied from class:ContentCalled after all content is created, only on non-headless versions. Use for loading regions or other image data. -
drawPlanRegion
- Overrides:
drawPlanRegionin classBlock
-
icons
public arc.graphics.g2d.TextureRegion[] icons() -
getRegionsToOutline
public void getRegionsToOutline(arc.struct.Seq<arc.graphics.g2d.TextureRegion> out) - Overrides:
getRegionsToOutlinein classBlock
-
limitRange
-
drawPlace
public void drawPlace(int x, int y, int rotation, boolean valid) Description copied from class:BlockDrawn when you are placing a block.- Overrides:
drawPlacein classBaseTurret
-
placeEnded
public void placeEnded(Tile tile, @Nullable mindustry.gen.Unit builder, int rotation, @Nullable Object config) Description copied from class:BlockCalled when building of this block ends.- Overrides:
placeEndedin classBlock
-