Class Turret
- All Implemented Interfaces:
Comparable<Content>
,Senseable
- Direct Known Subclasses:
ContinuousTurret
,ItemTurret
,LiquidTurret
,PayloadAmmoTurret
,PowerTurret
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
class
Nested classes/interfaces inherited from class mindustry.world.blocks.defense.turrets.ReloadTurret
ReloadTurret.ReloadTurretBuild
Nested classes/interfaces inherited from class mindustry.world.blocks.defense.turrets.BaseTurret
BaseTurret.BaseTurretBuild
Nested classes/interfaces inherited from class mindustry.ctype.Content
Content.ModContentInfo
-
Field Summary
Modifier and TypeFieldDescriptionboolean
If true, this turret will accurately target moving targets with respect to charge time.boolean
If true, the turret will always shoot when it has ammo, regardless of targets in range or any control.float
Backwards Y offset of ammo eject effect.int
Ammo units used per shot.Effect created when ammo is used.Boolf<mindustry.gen.Building>
Filter for types of buildings to attack.Sound emitted when shoot.firstShotDelay is >0 and shooting begins.boolean
If true, ammo is only consumed once per shot regardless of bullet count.float
ticks to cool down the heat regionboolean
If true, this block will display ammo multipliers in its stats (irrelevant for certain types of turrets).Defines drawing behavior for this turret.float
Visual elevation of turret shadow, -1 to use defaults.Color of heat region drawn on top (if found)float
Minimum input heat required to fire.float
Bullet angle randomness in degrees.boolean
If true, turret warmup is linear instead of a curve.static final float
int
Maximum ammo units stored.float
Maximum efficiency possible, if this turret uses heat.float
Minimum bullet range.float
Minimum warmup needed to fire.boolean
If false, this turret can't move while charging.boolean
If true, this turret can be controlled by players.boolean
Whether this turret predicts unit movement.float
Visual amount by which the turret recoils back per shot.float
power curve applied to visual recoilint
Number of additional counters for recoil.float
ticks taken for turret to return to starting position in ticks.float
How much the screen shakes per shot.pattern used for bulletsfloat
Maximum angle difference in degrees at which turret will still try to shoot.Optional override for all shoot effects.Sound emitted when a single bullet is shot.float
Lerp speed of turret warmup.float
Turret shoot point.float
Turret shoot point.Optional override for all smoke effects.float
Range for pitch of shoot sound.float
Range for pitch of shoot sound.boolean
If true, this block targets air units.boolean
If true, this block targets ground units and structures.boolean
If true, this block targets friend blocks, to heal them.float
Ticks between attempt at finding a target.boolean
If false, 'under' blocks like conveyors are not targeted.final int
Boolf<mindustry.gen.Unit>
Filter for types of units to attack.Function for choosing which unit to target.float
Fraction of bullet velocity that is random.float
How long warmup is maintained even if this turret isn't shooting.float
Random spread on the X axis.Fields inherited from class mindustry.world.blocks.defense.turrets.ReloadTurret
reload
Fields inherited from class mindustry.world.blocks.defense.turrets.BaseTurret
coolant, coolantMultiplier, coolEffect, fogRadiusMultiplier, placeOverlapMargin, range, rotateSpeed
Fields inherited from class mindustry.world.Block
absorbLasers, acceptsItems, acceptsPayload, albedo, allowConfigInventory, allowDiagonal, allowResupply, alwaysReplace, alwaysUpdateInUnits, ambientSound, ambientSoundVolume, armor, attacks, attributes, autoResetEnabled, barMap, baseExplosiveness, breakable, breakEffect, breakPitchChange, breakSound, buildCost, buildCostMultiplier, buildType, buildVisibility, cacheLayer, canOverdrive, category, clearOnDoubleTap, clipSize, commandable, conductivePower, configurable, configurations, connectedPower, consPower, consumeBuilder, consumers, consumesPower, consumesTap, conveyorPlacement, copyConfig, createRubble, crushDamageMultiplier, customShadow, customShadowRegion, deconstructThreshold, destroyBullet, destroyBulletSameTeam, destroyEffect, destroySound, destructible, displayFlow, drawArrow, drawCracks, drawDisabled, drawLiquidLight, drawTeamOverlay, dumpTime, editorIcon, editorVariantRegions, emitLight, enableDrawStatus, envDisabled, envEnabled, envRequired, fillsTile, flags, floating, fogRadius, forceDark, generatedIcons, group, hasColor, hasConsumers, hasItems, hasLiquids, hasPower, hasShadow, health, inEditor, instantDeconstruct, instantTransfer, insulated, invertFlip, isDuct, itemCapacity, itemDrop, itemFilter, lastConfig, lightColor, lightLiquid, lightRadius, liquidCapacity, liquidFilter, liquidPressure, lockRotation, logicConfigurable, loopSound, loopSoundVolume, 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, 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, unloadable, update, updateConsumers, updateInUnits, useColor, variantRegions, variants, variantShadowRegions
Fields inherited from class mindustry.ctype.UnlockableContent
alwaysUnlocked, description, details, fullIcon, generateIcons, hideDetails, iconId, inlineDescription, localizedName, selectionSize, stats, techNode, techNodes, uiIcon, unlocked
Fields inherited from class mindustry.ctype.MappableContent
name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
icons()
void
init()
Called after all blocks are created.void
limitRange
(BulletType bullet, float margin) void
load()
Called after all content is created, only on non-headless versions.boolean
void
setBars()
void
setStats()
Initializes stats on demand.Methods inherited from class mindustry.world.blocks.defense.turrets.BaseTurret
drawPlace
Methods inherited from class mindustry.world.Block
addBar, addLiquidBar, addLiquidBar, asFloor, beforePlaceBegan, bounds, canBeBuilt, canBreak, canPlaceOn, canReplace, changePlacementPath, changePlacementPath, checkForceDark, config, configClear, configSenseable, consume, consumeCoolant, consumeCoolant, consumeItem, consumeItem, consumeItems, consumeLiquid, consumeLiquids, consumePower, consumePowerBuffered, consumePowerCond, consumePowerDynamic, consumesItem, consumesLiquid, createIcons, drawBase, drawDefaultPlanRegion, drawEnvironmentLight, drawOverlay, drawPlaceText, drawPlan, drawPlan, drawPlanConfig, drawPlanConfigCenter, drawPlanConfigCenter, drawPlanConfigTop, drawPlanRegion, drawPotentialLinks, drawShadow, editorIcon, editorVariantRegions, environmentBuildable, findConsumer, flipRotation, getContentType, getDependencies, getDisplayIcon, getDisplayName, getEdges, getGeneratedIcons, getInsideEdges, getPlanRegion, getReplacement, handlePlacementLine, hasBuilding, hasConsumer, initBuilding, isAccessible, isAir, isFloor, isHidden, isMultiblock, isOverlay, isPlaceable, isStatic, isVisible, isVisibleOn, iterateTaken, listBars, logicVisible, makeIconRegions, minimapColor, nearbySide, newBuilding, nextConfig, onNewPlan, percentSolid, placeBegan, placeBegan, planRotation, pointConfig, removeBar, removeConsumer, requirements, requirements, requirements, researchRequirements, resetGeneratedIcons, rotatedOutput, sense, sense, senseObject, setupRequirements, setupRequirements, sumAttribute, supportsEnv, synthetic, updateClipRadius, variantRegions
Methods inherited from class mindustry.ctype.UnlockableContent
checkStats, clearUnlock, displayDescription, displayExtra, emoji, getLogicId, hasEmoji, loadIcon, locked, makeOutline, makeOutline, makeOutline, onUnlock, quietUnlock, showUnlock, unlock, unlocked, unlockedNow, unlockedNowHost
Methods inherited from class mindustry.ctype.MappableContent
toString
Methods 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. -
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. -
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. -
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 charge time. -
moveWhileCharging
public boolean moveWhileChargingIf false, this turret can't move 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. -
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
Filter for types of units to attack. -
buildingFilter
Filter for types of buildings to attack. -
heatColor
Color 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
Sound emitted when a single bullet is shot. -
chargeSound
Sound emitted when shoot.firstShotDelay is >0 and shooting begins. -
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:
outputsItems
in classBlock
-
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 classReloadTurret
-
setBars
public void setBars() -
init
public void init()Description copied from class:Block
Called after all blocks are created.- Overrides:
init
in classBaseTurret
-
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. -
icons
-
getRegionsToOutline
- Overrides:
getRegionsToOutline
in classBlock
-
limitRange
-