Package mindustry.entities.bullet
Class BulletType
java.lang.Object
mindustry.ctype.Content
mindustry.entities.bullet.BulletType
- All Implemented Interfaces:
Cloneable
,Comparable<Content>
- Direct Known Subclasses:
BasicBulletType
,ContinuousBulletType
,EmptyBulletType
,ExplosionBulletType
,FireBulletType
,LaserBulletType
,LightningBulletType
,LiquidBulletType
,MultiBulletType
,PointBulletType
,PointLaserBulletType
,RailBulletType
,SapBulletType
,ShrapnelBulletType
,SpaceLiquidBulletType
-
Nested Class Summary
Nested classes/interfaces inherited from class mindustry.ctype.Content
Content.ModContentInfo
-
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
Whether this projectile can be absorbed by shields.float
Acceleration per frame.float
How many bullets get created per ammo item/liquid.float
Angle offset applied to bullet when spawned each time.boolean
Whether to move the bullet back depending on delta to fix some delta-time related issues.float
Multiplier of how much base damage is done to tiles.float
Interval, in ticks, between which bullet spawn.protected float
Effect created when charging starts; only usable in single-shot weapons with a firstShotDelay / shotDelay.boolean
If true, the bullet will attempt to circle around its shooting entity.float
Radius that the bullet attempts to circle at.float
Smooth extra radius value for circling.float
Multiplier of speed that is used to adjust velocity when circling.boolean
If true, this projectile collides with non-surface floors.boolean
Whether this bullet types collides with anything at all.boolean
Whether this bullet type collides with air/ground units.boolean
Whether this bullet type collides with air/ground units.boolean
Whether this bullet type collides with tiles that are of the same team.boolean
Whether this bullet type collides with tiles.boolean
If true, this projectile collides with static wallsfloat
Chance for this bullet to be created.float
Direct damage dealt on hit.boolean
If true, frag bullets are delayed to the next frame.Effect shown when bullet despawns.boolean
Whether to create hit effects on despawn.float
Amount of shaking produced when this bullet hits something or despawns.arc.audio.Sound
Sound made when hitting something or getting removed.Unit spawned when this bullet hits something or despawns due to it hitting the end of its lifetime.float
The chance for despawn units to spawn.int
Amount of units spawned when this bullet despawns.float
Random offset distance from the original bullet despawn/hit coordinate.boolean
Whether to display the ammo multiplayer for this bullet type in its stats.float
Drag as fraction of velocity.float
Clipping hitbox.float
When used in turrets with limitRange() applied, this adds extra range to the bullets that extends past targeting range.boolean
If true, units spawned when this bullet despawns face away from the bullet instead of the same direction as the bullet.float
Speed at which bullet rotates to follow cursor.float
Angle offset of fragmentation bullets.Bullet type that is created when this bullet expires.int
Number of fragmentation bullets created.float
Random range of frag lifetime as a multiplier.float
Random range of frag lifetime as a multiplier.float
Random offset of frag bullets from the parent bullet.float
Random offset of frag bullets from the parent bullet.boolean
If false, this bullet will not create fraags when absorbed by a shield.boolean
If true, this bullet will create bullets when it hits anything, not just when it despawns.float
Degree spread range of fragmentation bullets.float
Uniform spread between each frag bullet in degrees.float
Random range of frag velocity as a multiplier.float
Random range of frag velocity as a multiplier.float
flat amount of block health healedarc.graphics.Color
Color used for block heal effects.Effect emitted upon blocks that are healed.float
% of block health healedarc.graphics.Color
Color used for hit/despawn effects.Effect shown on direct hit.float
Amount of shaking produced when this bullet hits something or despawns.float
Hitbox size.arc.audio.Sound
Sound made when hitting something or getting removed.float
Pitch of the sound made when hitting somethingfloat
Volume of the sound made when hitting somethingboolean
Whether this bullet can be hit by point defense.boolean
Whether this bullet will always hit blocks under it.float
Use a negative value to disable homing delay.float
Power of bullet ability.float
Range of homing effect around bullet.boolean
If true, the angle param in create is ignored.boolean
Should knockback follow the bullet's directionfloat
Extra inaccuracy when firing.int
Amount of fires attempted around bullet.float
Chance of fire being created.float
Spread of fires around bullet.boolean
Whether to instantly make the bullet disappear.float
Angle offset for interval bullets.Bullet that is created at a fixed interval.int
Number of bullet spawned per interval.float
Use a negative value to disable interval bullet delay.float
Random angle added to interval bullets.float
Angle spread between individual interval bullets.boolean
Whether velocity is inherited from the shooter.boolean
Whether to kill the shooter when this is shot.float
Knockback in velocity.boolean
For piercing lasers, setting this to true makes it get absorbed by plastanium walls.float
Z layer to drawn on.float
Min/max multipliers for lifetime applied to this bullet when spawned.float
Min/max multipliers for lifetime applied to this bullet when spawned.float
Fraction of bullet damage that heals that shooter.float
Lifetime in ticks.arc.graphics.Color
Color of light emitted by this bullet.int
Number of separate lightning "roots".float
Offset of lightning relative to bullet rotation.arc.graphics.Color
Color of lightning created by bullet.float
Spread of lightning, relative to bullet rotation.float
Use a negative value to use default bullet damage.int
Length of each lightning strand.int
Extra random length added onto base length of lightning.The bullet created at lightning points.float
Opacity of light color.float
Radius of light emitted by this bullet; <0 to use defaults.boolean
Whether to make fire on impactfloat
If positive, limits non-splash damage dealt to a fraction of the target's maximum health.float
Bullet range positive override.float
When used in a turret with multiple ammoo types, this can be set to a non-zero value to influence minRangefloat
Life fraction at which this bullet has the best range/damage/etc.arc.struct.Seq<DrawPart>
Extra visual parts for this bullet.boolean
Whether to pierce units.boolean
If true, unit armor is ignored in damage calculations.boolean
Whether to pierce buildings.int
Maximum # of pierced objects.float
Multiplier of damage decreased per health pierced.int
How many times this bullet can release frag bullets, if pierce = true.float
Liquid count of each puddle created.Liquid that puddles created are made of.float
Range of puddles around bullet position.int
Number of individual puddles created.float
Angle offset applied to bullet when spawned each time.float
Range initialized in init().float
When used in a turret with multiple ammo types, this can be set to a non-zero value to influence range.float
When > 0, overrides range even if smaller than base range.float
Recoil from shooter entities.boolean
Whether this bullet can be reflected.float
Multiplied by turret reload speed to get final shoot speed.boolean
If false, this bullet isn't removed after pierceCap is exceeded.float
Rotation speed of the bullet velocity as it travels.boolean
If true, splash damage is "correctly" affected by unit hitbox size.boolean
Whether to scale lifetime (not actually velocity!) to disappear at the target position.boolean
Whether status and despawnHit should automatically be set.float
Multiplier of how much base damage is done to force shields.Effect created when shooting.Extra smoke effect created when shooting.float
Random angle spread of spawn bullets.arc.struct.Seq<BulletType>
Bullets spawned when this bullet is created.Unit spawned _instead of_ this bullet.float
Speed in units/tick.float
Damage dealt in splash.boolean
If true, splash damage pierces through tiles.float
Use a negative value to disable splash damage.Status effect applied on hit.float
Intensity of applied status effect in terms of duration.boolean
If true, the bullet will "stick" to enemies and get deactivated on collision.float
Extra time added to bullet when it sticks to something.arc.graphics.Color
Color used for the regenSuppressSeek effect.float
Duration of healing block suppression effect.float
Chance of suppression effect occurring on block, scaled down by number of blocks.float
Range of healing block suppression effect.boolean
Turret only.boolean
Turret only.float
Chance of trail effect spawning on bullet per tick.arc.graphics.Color
Color of trail behind bullet.Trail effect that is spawned.arc.math.Interp
Interpolation for trail width as function of bullet lifetimefloat
Uniform interval in which trail effect is spawned.int
Length of trail quads.float
Min velocity required for trail effect to spawn.float
Rotation/size parameter that is passed to trail.boolean
Whether the parameter passed to the trail is the bullet rotation, instead of a flat value.float
If trailSinMag > 0, these values are applied as a sine curve to trail width.float
If trailSinMag > 0, these values are applied as a sine curve to trail width.float
Random offset of trail effect.float
Width of trail, if trailLength > 0boolean
If true, this bullet is rendered underwater.float
Min/max multipliers for velocity applied to this bullet when spawned.float
Min/max multipliers for velocity applied to this bullet when spawned.float
Intensity of bullet weaving.boolean
If true, the bullet weave will randomly switch directions on spawn.float
Scale of bullet weave pattern. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloat
buildingDamage
(mindustry.gen.Bullet b) protected float
float
copy()
mindustry.gen.Bullet
create
(mindustry.gen.Bullet parent, float x, float y, float angle) mindustry.gen.Bullet
create
(mindustry.gen.Bullet parent, float x, float y, float angle, float velocityScl) mindustry.gen.Bullet
create
(mindustry.gen.Bullet parent, float x, float y, float angle, float velocityScl, float lifeScale) mindustry.gen.Bullet
mindustry.gen.Bullet
mindustry.gen.Bullet
create
(mindustry.gen.Entityc owner, Team team, float x, float y, float angle, float velocityScl, float lifetimeScl) mindustry.gen.Bullet
create
(mindustry.gen.Entityc owner, Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl, Object data) mindustry.gen.Bullet
create
(mindustry.gen.Entityc owner, Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl, Object data, Mover mover) mindustry.gen.Bullet
create
(mindustry.gen.Entityc owner, Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl, Object data, Mover mover, float aimX, float aimY) mindustry.gen.Bullet
create
(mindustry.gen.Entityc owner, Team team, float x, float y, float angle, float velocityScl, float lifetimeScl, Mover mover) mindustry.gen.Bullet
create
(mindustry.gen.Entityc owner, mindustry.gen.Entityc shooter, Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl, Object data, Mover mover, float aimX, float aimY) mindustry.gen.Bullet
create
(mindustry.gen.Entityc owner, mindustry.gen.Entityc shooter, Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl, Object data, Mover mover, float aimX, float aimY, mindustry.gen.Teamc target) mindustry.gen.Bullet
create
(mindustry.gen.Teamc owner, float x, float y, float angle) static void
createBullet
(BulletType type, Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl) void
createFrags
(mindustry.gen.Bullet b, float x, float y) void
createIncend
(mindustry.gen.Bullet b, float x, float y) void
createNet
(Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl) void
createPuddles
(mindustry.gen.Bullet b, float x, float y) void
createSplashDamage
(mindustry.gen.Bullet b, float x, float y) void
createUnits
(mindustry.gen.Bullet b, float x, float y) float
damageMultiplier
(mindustry.gen.Bullet b) void
despawned
(mindustry.gen.Bullet b) Called when the bullet reaches the end of its lifetime or is destroyed by something external.void
draw
(mindustry.gen.Bullet b) void
drawLight
(mindustry.gen.Bullet b) void
drawParts
(mindustry.gen.Bullet b) void
drawTrail
(mindustry.gen.Bullet b) float
Returns the type name of this piece of content.void
handlePierce
(mindustry.gen.Bullet b, float initialHealth, float x, float y) boolean
heals()
void
hit
(mindustry.gen.Bullet b) void
hit
(mindustry.gen.Bullet b, float x, float y) void
hitEntity
(mindustry.gen.Bullet b, mindustry.gen.Hitboxc entity, float health) void
hitTile
(mindustry.gen.Bullet b, mindustry.gen.Building build, float x, float y, float initialHealth, boolean direct) If direct is false, this is an indirect hit and the tile was already damaged.void
init()
Called after all content and modules are created.void
init
(mindustry.gen.Bullet b) void
load()
Called after all content is created, only on non-headless versions.void
removed
(mindustry.gen.Bullet b) Called when the bullet is removed for any reason.float
shieldDamage
(mindustry.gen.Bullet b) boolean
testCollision
(mindustry.gen.Bullet bullet, mindustry.gen.Building tile) void
update
(mindustry.gen.Bullet b) void
updateBulletInterval
(mindustry.gen.Bullet b) void
updateHoming
(mindustry.gen.Bullet b) void
updateTrail
(mindustry.gen.Bullet b) void
updateTrailEffects
(mindustry.gen.Bullet b) void
updateWeaving
(mindustry.gen.Bullet b)
-
Field Details
-
lifetime
public float lifetimeLifetime in ticks. -
lifeScaleRandMin
public float lifeScaleRandMinMin/max multipliers for lifetime applied to this bullet when spawned. -
lifeScaleRandMax
public float lifeScaleRandMaxMin/max multipliers for lifetime applied to this bullet when spawned. -
speed
public float speedSpeed in units/tick. -
velocityScaleRandMin
public float velocityScaleRandMinMin/max multipliers for velocity applied to this bullet when spawned. -
velocityScaleRandMax
public float velocityScaleRandMaxMin/max multipliers for velocity applied to this bullet when spawned. -
damage
public float damageDirect damage dealt on hit. -
hitSize
public float hitSizeHitbox size. -
drawSize
public float drawSizeClipping hitbox. -
angleOffset
public float angleOffsetAngle offset applied to bullet when spawned each time. -
randomAngleOffset
public float randomAngleOffsetAngle offset applied to bullet when spawned each time. -
drag
public float dragDrag as fraction of velocity. -
accel
public float accelAcceleration per frame. -
pierce
public boolean pierceWhether to pierce units. -
pierceBuilding
public boolean pierceBuildingWhether to pierce buildings. -
pierceCap
public int pierceCapMaximum # of pierced objects. -
pierceDamageFactor
public float pierceDamageFactorMultiplier of damage decreased per health pierced. -
maxDamageFraction
public float maxDamageFractionIf positive, limits non-splash damage dealt to a fraction of the target's maximum health. -
removeAfterPierce
public boolean removeAfterPierceIf false, this bullet isn't removed after pierceCap is exceeded. Expert usage only. -
laserAbsorb
public boolean laserAbsorbFor piercing lasers, setting this to true makes it get absorbed by plastanium walls. -
optimalLifeFract
public float optimalLifeFractLife fraction at which this bullet has the best range/damage/etc. Used for lasers and continuous turrets. -
layer
public float layerZ layer to drawn on. -
hitEffect
Effect shown on direct hit. -
despawnEffect
Effect shown when bullet despawns. -
shootEffect
Effect created when shooting. -
chargeEffect
Effect created when charging starts; only usable in single-shot weapons with a firstShotDelay / shotDelay. -
smokeEffect
Extra smoke effect created when shooting. -
hitSound
public arc.audio.Sound hitSoundSound made when hitting something or getting removed. -
despawnSound
public arc.audio.Sound despawnSoundSound made when hitting something or getting removed. -
hitSoundPitch
public float hitSoundPitchPitch of the sound made when hitting something -
hitSoundVolume
public float hitSoundVolumeVolume of the sound made when hitting something -
inaccuracy
public float inaccuracyExtra inaccuracy when firing. -
ammoMultiplier
public float ammoMultiplierHow many bullets get created per ammo item/liquid. -
reloadMultiplier
public float reloadMultiplierMultiplied by turret reload speed to get final shoot speed. -
buildingDamageMultiplier
public float buildingDamageMultiplierMultiplier of how much base damage is done to tiles. -
shieldDamageMultiplier
public float shieldDamageMultiplierMultiplier of how much base damage is done to force shields. -
recoil
public float recoilRecoil from shooter entities. -
killShooter
public boolean killShooterWhether to kill the shooter when this is shot. For suicide bombers. -
instantDisappear
public boolean instantDisappearWhether to instantly make the bullet disappear. -
splashDamage
public float splashDamageDamage dealt in splash. 0 to disable. -
scaledSplashDamage
public boolean scaledSplashDamageIf true, splash damage is "correctly" affected by unit hitbox size. Used for projectiles that do not collide / have splash as their main source of damage. -
knockback
public float knockbackKnockback in velocity. -
impact
public boolean impactShould knockback follow the bullet's direction -
status
Status effect applied on hit. -
statusDuration
public float statusDurationIntensity of applied status effect in terms of duration. -
targetBlocks
public boolean targetBlocksTurret only. If false, blocks will not be targeted. -
targetMissiles
public boolean targetMissilesTurret only. If false, missiles will not be targeted. -
collidesTiles
public boolean collidesTilesWhether this bullet type collides with tiles. -
collidesTeam
public boolean collidesTeamWhether this bullet type collides with tiles that are of the same team. -
collidesAir
public boolean collidesAirWhether this bullet type collides with air/ground units. -
collidesGround
public boolean collidesGroundWhether this bullet type collides with air/ground units. -
collides
public boolean collidesWhether this bullet types collides with anything at all. -
collideFloor
public boolean collideFloorIf true, this projectile collides with non-surface floors. -
collideTerrain
public boolean collideTerrainIf true, this projectile collides with static walls -
keepVelocity
public boolean keepVelocityWhether velocity is inherited from the shooter. -
scaleLife
public boolean scaleLifeWhether to scale lifetime (not actually velocity!) to disappear at the target position. Used for artillery. -
hittable
public boolean hittableWhether this bullet can be hit by point defense. -
reflectable
public boolean reflectableWhether this bullet can be reflected. -
absorbable
public boolean absorbableWhether this projectile can be absorbed by shields. -
backMove
public boolean backMoveWhether to move the bullet back depending on delta to fix some delta-time related issues. Do not change unless you know what you're doing. -
ignoreSpawnAngle
public boolean ignoreSpawnAngleIf true, the angle param in create is ignored. -
createChance
public float createChanceChance for this bullet to be created. -
maxRange
public float maxRangeBullet range positive override. -
rangeOverride
public float rangeOverrideWhen > 0, overrides range even if smaller than base range. -
rangeChange
public float rangeChangeWhen used in a turret with multiple ammo types, this can be set to a non-zero value to influence range. -
extraRangeMargin
public float extraRangeMarginWhen used in turrets with limitRange() applied, this adds extra range to the bullets that extends past targeting range. Only particularly relevant in vanilla. -
range
public float rangeRange initialized in init(). -
minRangeChange
public float minRangeChangeWhen used in a turret with multiple ammoo types, this can be set to a non-zero value to influence minRange -
healPercent
public float healPercent% of block health healed -
healAmount
public float healAmountflat amount of block health healed -
lifesteal
public float lifestealFraction of bullet damage that heals that shooter. -
makeFire
public boolean makeFireWhether to make fire on impact -
hitUnder
public boolean hitUnderWhether this bullet will always hit blocks under it. -
despawnHit
public boolean despawnHitWhether to create hit effects on despawn. Forced to true if this bullet has any special effects like splash damage. -
fragOnHit
public boolean fragOnHitIf true, this bullet will create bullets when it hits anything, not just when it despawns. -
fragOnAbsorb
public boolean fragOnAbsorbIf false, this bullet will not create fraags when absorbed by a shield. -
pierceArmor
public boolean pierceArmorIf true, unit armor is ignored in damage calculations. -
sticky
public boolean stickyIf true, the bullet will "stick" to enemies and get deactivated on collision. -
stickyExtraLifetime
public float stickyExtraLifetimeExtra time added to bullet when it sticks to something. -
setDefaults
public boolean setDefaultsWhether status and despawnHit should automatically be set. -
hitShake
public float hitShakeAmount of shaking produced when this bullet hits something or despawns. -
despawnShake
public float despawnShakeAmount of shaking produced when this bullet hits something or despawns. -
fragBullet
Bullet type that is created when this bullet expires. -
delayFrags
public boolean delayFragsIf true, frag bullets are delayed to the next frame. Fixes obscure bugs with piercing bullet types spawning frags immediately and screwing up the Damage temporary variables. -
fragRandomSpread
public float fragRandomSpreadDegree spread range of fragmentation bullets. -
fragSpread
public float fragSpreadUniform spread between each frag bullet in degrees. -
fragAngle
public float fragAngleAngle offset of fragmentation bullets. -
fragBullets
public int fragBulletsNumber of fragmentation bullets created. -
fragVelocityMin
public float fragVelocityMinRandom range of frag velocity as a multiplier. -
fragVelocityMax
public float fragVelocityMaxRandom range of frag velocity as a multiplier. -
fragLifeMin
public float fragLifeMinRandom range of frag lifetime as a multiplier. -
fragLifeMax
public float fragLifeMaxRandom range of frag lifetime as a multiplier. -
fragOffsetMin
public float fragOffsetMinRandom offset of frag bullets from the parent bullet. -
fragOffsetMax
public float fragOffsetMaxRandom offset of frag bullets from the parent bullet. -
pierceFragCap
public int pierceFragCapHow many times this bullet can release frag bullets, if pierce = true. -
intervalBullet
Bullet that is created at a fixed interval. -
bulletInterval
public float bulletIntervalInterval, in ticks, between which bullet spawn. -
intervalBullets
public int intervalBulletsNumber of bullet spawned per interval. -
intervalRandomSpread
public float intervalRandomSpreadRandom angle added to interval bullets. -
intervalSpread
public float intervalSpreadAngle spread between individual interval bullets. -
intervalAngle
public float intervalAngleAngle offset for interval bullets. -
intervalDelay
public float intervalDelayUse a negative value to disable interval bullet delay. -
underwater
public boolean underwaterIf true, this bullet is rendered underwater. Highly experimental! -
hitColor
public arc.graphics.Color hitColorColor used for hit/despawn effects. -
healColor
public arc.graphics.Color healColorColor used for block heal effects. -
healEffect
Effect emitted upon blocks that are healed. -
spawnBullets
Bullets spawned when this bullet is created. Rarely necessary, used for visuals. -
spawnBulletRandomSpread
public float spawnBulletRandomSpreadRandom angle spread of spawn bullets. -
spawnUnit
Unit spawned _instead of_ this bullet. Useful for missiles. -
despawnUnit
Unit spawned when this bullet hits something or despawns due to it hitting the end of its lifetime. -
despawnUnitChance
public float despawnUnitChanceThe chance for despawn units to spawn. -
despawnUnitCount
public int despawnUnitCountAmount of units spawned when this bullet despawns. -
despawnUnitRadius
public float despawnUnitRadiusRandom offset distance from the original bullet despawn/hit coordinate. -
faceOutwards
public boolean faceOutwardsIf true, units spawned when this bullet despawns face away from the bullet instead of the same direction as the bullet. -
parts
Extra visual parts for this bullet. -
trailColor
public arc.graphics.Color trailColorColor of trail behind bullet. -
trailChance
public float trailChanceChance of trail effect spawning on bullet per tick. -
trailInterval
public float trailIntervalUniform interval in which trail effect is spawned. -
trailMinVelocity
public float trailMinVelocityMin velocity required for trail effect to spawn. -
trailEffect
Trail effect that is spawned. -
trailSpread
public float trailSpreadRandom offset of trail effect. -
trailParam
public float trailParamRotation/size parameter that is passed to trail. Usually, this controls size. -
trailRotation
public boolean trailRotationWhether the parameter passed to the trail is the bullet rotation, instead of a flat value. -
trailInterp
public arc.math.Interp trailInterpInterpolation for trail width as function of bullet lifetime -
trailLength
public int trailLengthLength of trail quads. Any value <= 0 disables the trail. -
trailWidth
public float trailWidthWidth of trail, if trailLength > 0 -
trailSinMag
public float trailSinMagIf trailSinMag > 0, these values are applied as a sine curve to trail width. -
trailSinScl
public float trailSinSclIf trailSinMag > 0, these values are applied as a sine curve to trail width. -
circleShooter
public boolean circleShooterIf true, the bullet will attempt to circle around its shooting entity. -
circleShooterRadius
public float circleShooterRadiusRadius that the bullet attempts to circle at. -
circleShooterRadiusSmooth
public float circleShooterRadiusSmoothSmooth extra radius value for circling. -
circleShooterRotateSpeed
public float circleShooterRotateSpeedMultiplier of speed that is used to adjust velocity when circling. -
splashDamageRadius
public float splashDamageRadiusUse a negative value to disable splash damage. -
splashDamagePierce
public boolean splashDamagePierceIf true, splash damage pierces through tiles. -
incendAmount
public int incendAmountAmount of fires attempted around bullet. -
incendSpread
public float incendSpreadSpread of fires around bullet. -
incendChance
public float incendChanceChance of fire being created. -
homingPower
public float homingPowerPower of bullet ability. Usually a number between 0 and 1; try 0.1 as a starting point. -
homingRange
public float homingRangeRange of homing effect around bullet. -
homingDelay
public float homingDelayUse a negative value to disable homing delay. -
followAimSpeed
public float followAimSpeedSpeed at which bullet rotates to follow cursor. <= 0 to disable. -
suppressionRange
public float suppressionRangeRange of healing block suppression effect. -
suppressionDuration
public float suppressionDurationDuration of healing block suppression effect. -
suppressionEffectChance
public float suppressionEffectChanceChance of suppression effect occurring on block, scaled down by number of blocks. -
suppressColor
public arc.graphics.Color suppressColorColor used for the regenSuppressSeek effect. -
lightningColor
public arc.graphics.Color lightningColorColor of lightning created by bullet. -
lightning
public int lightningNumber of separate lightning "roots". -
lightningLength
public int lightningLengthLength of each lightning strand. -
lightningLengthRand
public int lightningLengthRandExtra random length added onto base length of lightning. -
lightningDamage
public float lightningDamageUse a negative value to use default bullet damage. -
lightningCone
public float lightningConeSpread of lightning, relative to bullet rotation. -
lightningAngle
public float lightningAngleOffset of lightning relative to bullet rotation. -
lightningType
The bullet created at lightning points. -
weaveScale
public float weaveScaleScale of bullet weave pattern. Higher -> less vibration. -
weaveMag
public float weaveMagIntensity of bullet weaving. Note that this may make bullets inaccurate. -
weaveRandom
public boolean weaveRandomIf true, the bullet weave will randomly switch directions on spawn. -
rotateSpeed
public float rotateSpeedRotation speed of the bullet velocity as it travels. -
puddles
public int puddlesNumber of individual puddles created. -
puddleRange
public float puddleRangeRange of puddles around bullet position. -
puddleAmount
public float puddleAmountLiquid count of each puddle created. -
puddleLiquid
Liquid that puddles created are made of. -
displayAmmoMultiplier
public boolean displayAmmoMultiplierWhether to display the ammo multiplayer for this bullet type in its stats. -
lightRadius
public float lightRadiusRadius of light emitted by this bullet; <0 to use defaults. -
lightOpacity
public float lightOpacityOpacity of light color. -
lightColor
public arc.graphics.Color lightColorColor of light emitted by this bullet. -
cachedDps
protected float cachedDps
-
-
Constructor Details
-
BulletType
public BulletType(float speed, float damage) -
BulletType
public BulletType()
-
-
Method Details
-
copy
-
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. -
estimateDPS
public float estimateDPS()- Returns:
- estimated damage per shot. this can be very inaccurate.
-
calculateRange
protected float calculateRange()- Returns:
- maximum distance the bullet this bullet type has can travel.
-
continuousDamage
public float continuousDamage()- Returns:
- continuous damage in damage/sec, or -1 if not continuous.
-
heals
public boolean heals() -
testCollision
public boolean testCollision(mindustry.gen.Bullet bullet, mindustry.gen.Building tile) -
hitTile
public void hitTile(mindustry.gen.Bullet b, mindustry.gen.Building build, float x, float y, float initialHealth, boolean direct) If direct is false, this is an indirect hit and the tile was already damaged. TODO this is a mess. -
hitEntity
public void hitEntity(mindustry.gen.Bullet b, mindustry.gen.Hitboxc entity, float health) -
handlePierce
public void handlePierce(mindustry.gen.Bullet b, float initialHealth, float x, float y) -
damageMultiplier
public float damageMultiplier(mindustry.gen.Bullet b) -
hit
public void hit(mindustry.gen.Bullet b) -
hit
public void hit(mindustry.gen.Bullet b, float x, float y) -
createIncend
public void createIncend(mindustry.gen.Bullet b, float x, float y) -
createPuddles
public void createPuddles(mindustry.gen.Bullet b, float x, float y) -
createSplashDamage
public void createSplashDamage(mindustry.gen.Bullet b, float x, float y) -
createFrags
public void createFrags(mindustry.gen.Bullet b, float x, float y) -
createUnits
public void createUnits(mindustry.gen.Bullet b, float x, float y) -
despawned
public void despawned(mindustry.gen.Bullet b) Called when the bullet reaches the end of its lifetime or is destroyed by something external. -
removed
public void removed(mindustry.gen.Bullet b) Called when the bullet is removed for any reason. -
buildingDamage
public float buildingDamage(mindustry.gen.Bullet b) -
shieldDamage
public float shieldDamage(mindustry.gen.Bullet b) -
draw
public void draw(mindustry.gen.Bullet b) -
drawTrail
public void drawTrail(mindustry.gen.Bullet b) -
drawParts
public void drawParts(mindustry.gen.Bullet b) -
drawLight
public void drawLight(mindustry.gen.Bullet b) -
init
public void init(mindustry.gen.Bullet b) -
update
public void update(mindustry.gen.Bullet b) -
updateBulletInterval
public void updateBulletInterval(mindustry.gen.Bullet b) -
updateHoming
public void updateHoming(mindustry.gen.Bullet b) -
updateWeaving
public void updateWeaving(mindustry.gen.Bullet b) -
updateTrailEffects
public void updateTrailEffects(mindustry.gen.Bullet b) -
updateTrail
public void updateTrail(mindustry.gen.Bullet b) -
init
public void init()Description copied from class:Content
Called after all content and modules are created. Do not use to load regions or texture data! -
getContentType
Description copied from class:Content
Returns the type name of this piece of content. This should return the same value for all instances of this content type.- Specified by:
getContentType
in classContent
-
create
@Nullable public mindustry.gen.Bullet create(mindustry.gen.Teamc owner, float x, float y, float angle) -
create
@Nullable public mindustry.gen.Bullet create(mindustry.gen.Entityc owner, Team team, float x, float y, float angle) -
create
@Nullable public mindustry.gen.Bullet create(mindustry.gen.Entityc owner, Team team, float x, float y, float angle, float velocityScl) -
create
@Nullable public mindustry.gen.Bullet create(mindustry.gen.Entityc owner, Team team, float x, float y, float angle, float velocityScl, float lifetimeScl) -
create
-
create
@Nullable public mindustry.gen.Bullet create(mindustry.gen.Bullet parent, float x, float y, float angle) -
create
@Nullable public mindustry.gen.Bullet create(mindustry.gen.Bullet parent, float x, float y, float angle, float velocityScl, float lifeScale) -
create
@Nullable public mindustry.gen.Bullet create(mindustry.gen.Bullet parent, float x, float y, float angle, float velocityScl) -
create
-
create
-
create
-
create
-
create
@Nullable public mindustry.gen.Bullet create(@Nullable mindustry.gen.Entityc owner, @Nullable mindustry.gen.Entityc shooter, Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl, Object data, @Nullable Mover mover, float aimX, float aimY, @Nullable mindustry.gen.Teamc target) -
createNet
public void createNet(Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl) -
createBullet
public static void createBullet(BulletType type, Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl)
-