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

public class BulletType extends Content implements Cloneable
  • Nested Class Summary

    Nested classes/interfaces inherited from class mindustry.ctype.Content

    Content.ModContentInfo
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    boolean
    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 walls
    float
    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 healed
    arc.graphics.Color
    Color used for block heal effects.
    Effect emitted upon blocks that are healed.
    float
    % of block health healed
    arc.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 something
    float
    Volume of the sound made when hitting something
    boolean
    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 direction
    float
    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 impact
    float
    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 minRange
    float
    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 lifetime
    float
    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 > 0
    boolean
    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.

    Fields inherited from class mindustry.ctype.Content

    id, minfo
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    BulletType(float speed, float damage)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    buildingDamage(mindustry.gen.Bullet b)
     
    protected float
     
    float
     
     
    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
    create(mindustry.gen.Entityc owner, Team team, float x, float y, float angle)
     
    mindustry.gen.Bullet
    create(mindustry.gen.Entityc owner, Team team, float x, float y, float angle, float velocityScl)
     
    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
     
    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
    Called after all content and modules are created.
    void
    init(mindustry.gen.Bullet b)
     
    void
    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)
     

    Methods inherited from class mindustry.ctype.Content

    compareTo, hasErrored, isModded, isVanilla, loadIcon, postInit, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • lifetime

      public float lifetime
      Lifetime in ticks.
    • lifeScaleRandMin

      public float lifeScaleRandMin
      Min/max multipliers for lifetime applied to this bullet when spawned.
    • lifeScaleRandMax

      public float lifeScaleRandMax
      Min/max multipliers for lifetime applied to this bullet when spawned.
    • speed

      public float speed
      Speed in units/tick.
    • velocityScaleRandMin

      public float velocityScaleRandMin
      Min/max multipliers for velocity applied to this bullet when spawned.
    • velocityScaleRandMax

      public float velocityScaleRandMax
      Min/max multipliers for velocity applied to this bullet when spawned.
    • damage

      public float damage
      Direct damage dealt on hit.
    • hitSize

      public float hitSize
      Hitbox size.
    • drawSize

      public float drawSize
      Clipping hitbox.
    • angleOffset

      public float angleOffset
      Angle offset applied to bullet when spawned each time.
    • randomAngleOffset

      public float randomAngleOffset
      Angle offset applied to bullet when spawned each time.
    • drag

      public float drag
      Drag as fraction of velocity.
    • accel

      public float accel
      Acceleration per frame.
    • pierce

      public boolean pierce
      Whether to pierce units.
    • pierceBuilding

      public boolean pierceBuilding
      Whether to pierce buildings.
    • pierceCap

      public int pierceCap
      Maximum # of pierced objects.
    • pierceDamageFactor

      public float pierceDamageFactor
      Multiplier of damage decreased per health pierced.
    • maxDamageFraction

      public float maxDamageFraction
      If positive, limits non-splash damage dealt to a fraction of the target's maximum health.
    • removeAfterPierce

      public boolean removeAfterPierce
      If false, this bullet isn't removed after pierceCap is exceeded. Expert usage only.
    • laserAbsorb

      public boolean laserAbsorb
      For piercing lasers, setting this to true makes it get absorbed by plastanium walls.
    • optimalLifeFract

      public float optimalLifeFract
      Life fraction at which this bullet has the best range/damage/etc. Used for lasers and continuous turrets.
    • layer

      public float layer
      Z layer to drawn on.
    • hitEffect

      public Effect hitEffect
      Effect shown on direct hit.
    • despawnEffect

      public Effect despawnEffect
      Effect shown when bullet despawns.
    • shootEffect

      public Effect shootEffect
      Effect created when shooting.
    • chargeEffect

      public Effect chargeEffect
      Effect created when charging starts; only usable in single-shot weapons with a firstShotDelay / shotDelay.
    • smokeEffect

      public Effect smokeEffect
      Extra smoke effect created when shooting.
    • hitSound

      public arc.audio.Sound hitSound
      Sound made when hitting something or getting removed.
    • despawnSound

      public arc.audio.Sound despawnSound
      Sound made when hitting something or getting removed.
    • hitSoundPitch

      public float hitSoundPitch
      Pitch of the sound made when hitting something
    • hitSoundVolume

      public float hitSoundVolume
      Volume of the sound made when hitting something
    • inaccuracy

      public float inaccuracy
      Extra inaccuracy when firing.
    • ammoMultiplier

      public float ammoMultiplier
      How many bullets get created per ammo item/liquid.
    • reloadMultiplier

      public float reloadMultiplier
      Multiplied by turret reload speed to get final shoot speed.
    • buildingDamageMultiplier

      public float buildingDamageMultiplier
      Multiplier of how much base damage is done to tiles.
    • shieldDamageMultiplier

      public float shieldDamageMultiplier
      Multiplier of how much base damage is done to force shields.
    • recoil

      public float recoil
      Recoil from shooter entities.
    • killShooter

      public boolean killShooter
      Whether to kill the shooter when this is shot. For suicide bombers.
    • instantDisappear

      public boolean instantDisappear
      Whether to instantly make the bullet disappear.
    • splashDamage

      public float splashDamage
      Damage dealt in splash. 0 to disable.
    • scaledSplashDamage

      public boolean scaledSplashDamage
      If 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 knockback
      Knockback in velocity.
    • impact

      public boolean impact
      Should knockback follow the bullet's direction
    • status

      public StatusEffect status
      Status effect applied on hit.
    • statusDuration

      public float statusDuration
      Intensity of applied status effect in terms of duration.
    • targetBlocks

      public boolean targetBlocks
      Turret only. If false, blocks will not be targeted.
    • targetMissiles

      public boolean targetMissiles
      Turret only. If false, missiles will not be targeted.
    • collidesTiles

      public boolean collidesTiles
      Whether this bullet type collides with tiles.
    • collidesTeam

      public boolean collidesTeam
      Whether this bullet type collides with tiles that are of the same team.
    • collidesAir

      public boolean collidesAir
      Whether this bullet type collides with air/ground units.
    • collidesGround

      public boolean collidesGround
      Whether this bullet type collides with air/ground units.
    • collides

      public boolean collides
      Whether this bullet types collides with anything at all.
    • collideFloor

      public boolean collideFloor
      If true, this projectile collides with non-surface floors.
    • collideTerrain

      public boolean collideTerrain
      If true, this projectile collides with static walls
    • keepVelocity

      public boolean keepVelocity
      Whether velocity is inherited from the shooter.
    • scaleLife

      public boolean scaleLife
      Whether to scale lifetime (not actually velocity!) to disappear at the target position. Used for artillery.
    • hittable

      public boolean hittable
      Whether this bullet can be hit by point defense.
    • reflectable

      public boolean reflectable
      Whether this bullet can be reflected.
    • absorbable

      public boolean absorbable
      Whether this projectile can be absorbed by shields.
    • backMove

      public boolean backMove
      Whether 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 ignoreSpawnAngle
      If true, the angle param in create is ignored.
    • createChance

      public float createChance
      Chance for this bullet to be created.
    • maxRange

      public float maxRange
      Bullet range positive override.
    • rangeOverride

      public float rangeOverride
      When > 0, overrides range even if smaller than base range.
    • rangeChange

      public float rangeChange
      When used in a turret with multiple ammo types, this can be set to a non-zero value to influence range.
    • extraRangeMargin

      public float extraRangeMargin
      When 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 range
      Range initialized in init().
    • minRangeChange

      public float minRangeChange
      When 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 healAmount
      flat amount of block health healed
    • lifesteal

      public float lifesteal
      Fraction of bullet damage that heals that shooter.
    • makeFire

      public boolean makeFire
      Whether to make fire on impact
    • hitUnder

      public boolean hitUnder
      Whether this bullet will always hit blocks under it.
    • despawnHit

      public boolean despawnHit
      Whether to create hit effects on despawn. Forced to true if this bullet has any special effects like splash damage.
    • fragOnHit

      public boolean fragOnHit
      If true, this bullet will create bullets when it hits anything, not just when it despawns.
    • fragOnAbsorb

      public boolean fragOnAbsorb
      If false, this bullet will not create fraags when absorbed by a shield.
    • pierceArmor

      public boolean pierceArmor
      If true, unit armor is ignored in damage calculations.
    • sticky

      public boolean sticky
      If true, the bullet will "stick" to enemies and get deactivated on collision.
    • stickyExtraLifetime

      public float stickyExtraLifetime
      Extra time added to bullet when it sticks to something.
    • setDefaults

      public boolean setDefaults
      Whether status and despawnHit should automatically be set.
    • hitShake

      public float hitShake
      Amount of shaking produced when this bullet hits something or despawns.
    • despawnShake

      public float despawnShake
      Amount of shaking produced when this bullet hits something or despawns.
    • fragBullet

      @Nullable public BulletType fragBullet
      Bullet type that is created when this bullet expires.
    • delayFrags

      public boolean delayFrags
      If 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 fragRandomSpread
      Degree spread range of fragmentation bullets.
    • fragSpread

      public float fragSpread
      Uniform spread between each frag bullet in degrees.
    • fragAngle

      public float fragAngle
      Angle offset of fragmentation bullets.
    • fragBullets

      public int fragBullets
      Number of fragmentation bullets created.
    • fragVelocityMin

      public float fragVelocityMin
      Random range of frag velocity as a multiplier.
    • fragVelocityMax

      public float fragVelocityMax
      Random range of frag velocity as a multiplier.
    • fragLifeMin

      public float fragLifeMin
      Random range of frag lifetime as a multiplier.
    • fragLifeMax

      public float fragLifeMax
      Random range of frag lifetime as a multiplier.
    • fragOffsetMin

      public float fragOffsetMin
      Random offset of frag bullets from the parent bullet.
    • fragOffsetMax

      public float fragOffsetMax
      Random offset of frag bullets from the parent bullet.
    • pierceFragCap

      public int pierceFragCap
      How many times this bullet can release frag bullets, if pierce = true.
    • intervalBullet

      @Nullable public BulletType intervalBullet
      Bullet that is created at a fixed interval.
    • bulletInterval

      public float bulletInterval
      Interval, in ticks, between which bullet spawn.
    • intervalBullets

      public int intervalBullets
      Number of bullet spawned per interval.
    • intervalRandomSpread

      public float intervalRandomSpread
      Random angle added to interval bullets.
    • intervalSpread

      public float intervalSpread
      Angle spread between individual interval bullets.
    • intervalAngle

      public float intervalAngle
      Angle offset for interval bullets.
    • intervalDelay

      public float intervalDelay
      Use a negative value to disable interval bullet delay.
    • underwater

      public boolean underwater
      If true, this bullet is rendered underwater. Highly experimental!
    • hitColor

      public arc.graphics.Color hitColor
      Color used for hit/despawn effects.
    • healColor

      public arc.graphics.Color healColor
      Color used for block heal effects.
    • healEffect

      public Effect healEffect
      Effect emitted upon blocks that are healed.
    • spawnBullets

      public arc.struct.Seq<BulletType> spawnBullets
      Bullets spawned when this bullet is created. Rarely necessary, used for visuals.
    • spawnBulletRandomSpread

      public float spawnBulletRandomSpread
      Random angle spread of spawn bullets.
    • spawnUnit

      @Nullable public UnitType spawnUnit
      Unit spawned _instead of_ this bullet. Useful for missiles.
    • despawnUnit

      @Nullable public UnitType despawnUnit
      Unit spawned when this bullet hits something or despawns due to it hitting the end of its lifetime.
    • despawnUnitChance

      public float despawnUnitChance
      The chance for despawn units to spawn.
    • despawnUnitCount

      public int despawnUnitCount
      Amount of units spawned when this bullet despawns.
    • despawnUnitRadius

      public float despawnUnitRadius
      Random offset distance from the original bullet despawn/hit coordinate.
    • faceOutwards

      public boolean faceOutwards
      If true, units spawned when this bullet despawns face away from the bullet instead of the same direction as the bullet.
    • parts

      public arc.struct.Seq<DrawPart> parts
      Extra visual parts for this bullet.
    • trailColor

      public arc.graphics.Color trailColor
      Color of trail behind bullet.
    • trailChance

      public float trailChance
      Chance of trail effect spawning on bullet per tick.
    • trailInterval

      public float trailInterval
      Uniform interval in which trail effect is spawned.
    • trailMinVelocity

      public float trailMinVelocity
      Min velocity required for trail effect to spawn.
    • trailEffect

      public Effect trailEffect
      Trail effect that is spawned.
    • trailSpread

      public float trailSpread
      Random offset of trail effect.
    • trailParam

      public float trailParam
      Rotation/size parameter that is passed to trail. Usually, this controls size.
    • trailRotation

      public boolean trailRotation
      Whether the parameter passed to the trail is the bullet rotation, instead of a flat value.
    • trailInterp

      public arc.math.Interp trailInterp
      Interpolation for trail width as function of bullet lifetime
    • trailLength

      public int trailLength
      Length of trail quads. Any value <= 0 disables the trail.
    • trailWidth

      public float trailWidth
      Width of trail, if trailLength > 0
    • trailSinMag

      public float trailSinMag
      If trailSinMag > 0, these values are applied as a sine curve to trail width.
    • trailSinScl

      public float trailSinScl
      If trailSinMag > 0, these values are applied as a sine curve to trail width.
    • circleShooter

      public boolean circleShooter
      If true, the bullet will attempt to circle around its shooting entity.
    • circleShooterRadius

      public float circleShooterRadius
      Radius that the bullet attempts to circle at.
    • circleShooterRadiusSmooth

      public float circleShooterRadiusSmooth
      Smooth extra radius value for circling.
    • circleShooterRotateSpeed

      public float circleShooterRotateSpeed
      Multiplier of speed that is used to adjust velocity when circling.
    • splashDamageRadius

      public float splashDamageRadius
      Use a negative value to disable splash damage.
    • splashDamagePierce

      public boolean splashDamagePierce
      If true, splash damage pierces through tiles.
    • incendAmount

      public int incendAmount
      Amount of fires attempted around bullet.
    • incendSpread

      public float incendSpread
      Spread of fires around bullet.
    • incendChance

      public float incendChance
      Chance of fire being created.
    • homingPower

      public float homingPower
      Power of bullet ability. Usually a number between 0 and 1; try 0.1 as a starting point.
    • homingRange

      public float homingRange
      Range of homing effect around bullet.
    • homingDelay

      public float homingDelay
      Use a negative value to disable homing delay.
    • followAimSpeed

      public float followAimSpeed
      Speed at which bullet rotates to follow cursor. <= 0 to disable.
    • suppressionRange

      public float suppressionRange
      Range of healing block suppression effect.
    • suppressionDuration

      public float suppressionDuration
      Duration of healing block suppression effect.
    • suppressionEffectChance

      public float suppressionEffectChance
      Chance of suppression effect occurring on block, scaled down by number of blocks.
    • suppressColor

      public arc.graphics.Color suppressColor
      Color used for the regenSuppressSeek effect.
    • lightningColor

      public arc.graphics.Color lightningColor
      Color of lightning created by bullet.
    • lightning

      public int lightning
      Number of separate lightning "roots".
    • lightningLength

      public int lightningLength
      Length of each lightning strand.
    • lightningLengthRand

      public int lightningLengthRand
      Extra random length added onto base length of lightning.
    • lightningDamage

      public float lightningDamage
      Use a negative value to use default bullet damage.
    • lightningCone

      public float lightningCone
      Spread of lightning, relative to bullet rotation.
    • lightningAngle

      public float lightningAngle
      Offset of lightning relative to bullet rotation.
    • lightningType

      @Nullable public BulletType lightningType
      The bullet created at lightning points.
    • weaveScale

      public float weaveScale
      Scale of bullet weave pattern. Higher -> less vibration.
    • weaveMag

      public float weaveMag
      Intensity of bullet weaving. Note that this may make bullets inaccurate.
    • weaveRandom

      public boolean weaveRandom
      If true, the bullet weave will randomly switch directions on spawn.
    • rotateSpeed

      public float rotateSpeed
      Rotation speed of the bullet velocity as it travels.
    • puddles

      public int puddles
      Number of individual puddles created.
    • puddleRange

      public float puddleRange
      Range of puddles around bullet position.
    • puddleAmount

      public float puddleAmount
      Liquid count of each puddle created.
    • puddleLiquid

      public Liquid puddleLiquid
      Liquid that puddles created are made of.
    • displayAmmoMultiplier

      public boolean displayAmmoMultiplier
      Whether to display the ammo multiplayer for this bullet type in its stats.
    • lightRadius

      public float lightRadius
      Radius of light emitted by this bullet; <0 to use defaults.
    • lightOpacity

      public float lightOpacity
      Opacity of light color.
    • lightColor

      public arc.graphics.Color lightColor
      Color 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

      public BulletType 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.
      Overrides:
      load in class Content
    • 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!
      Overrides:
      init in class Content
    • getContentType

      public ContentType 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 class Content
    • 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

      @Nullable public mindustry.gen.Bullet create(mindustry.gen.Entityc owner, Team team, float x, float y, float angle, float velocityScl, float lifetimeScl, Mover mover)
    • 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

      @Nullable public mindustry.gen.Bullet create(@Nullable mindustry.gen.Entityc owner, Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl, Object data)
    • create

      @Nullable public mindustry.gen.Bullet create(@Nullable mindustry.gen.Entityc owner, Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl, Object data, @Nullable Mover mover)
    • create

      @Nullable public mindustry.gen.Bullet create(@Nullable mindustry.gen.Entityc owner, Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl, Object data, @Nullable Mover mover, float aimX, float aimY)
    • 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)
    • 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)