Class Damage

java.lang.Object
mindustry.entities.Damage

public class Damage extends Object
Utility class for damaging in an area.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static float
    applyArmor(float damage, float armor)
     
    static void
    applySuppression(Team team, float x, float y, float range, float reload, float maxDelay, float applyParticleChance, Position source)
     
    static float
    collideLaser(mindustry.gen.Bullet b, float length, boolean large, boolean laser, int pierceCap)
    Collides a bullet with blocks in a laser, taking into account absorption blocks.
    static void
    collideLine(mindustry.gen.Bullet hitter, Team team, Effect effect, float x, float y, float angle, float length)
     
    static void
    collideLine(mindustry.gen.Bullet hitter, Team team, Effect effect, float x, float y, float angle, float length, boolean large)
    Damages entities in a line.
    static void
    collideLine(mindustry.gen.Bullet hitter, Team team, Effect effect, float x, float y, float angle, float length, boolean large, boolean laser)
    Damages entities in a line.
    static void
    collideLine(mindustry.gen.Bullet hitter, Team team, Effect effect, float x, float y, float angle, float length, boolean large, boolean laser, int pierceCap)
    Damages entities in a line.
    static void
    collidePoint(mindustry.gen.Bullet hitter, Team team, Effect effect, float x, float y)
    Damages entities on a point.
    static void
    createIncend(float x, float y, float range, int amount)
     
    static void
    damage(float x, float y, float radius, float damage)
    Damages everything in a radius.
    static void
    damage(Team team, float x, float y, float radius, float damage)
    Damages all entities and blocks in a radius that are enemies of the team.
    static void
    damage(Team team, float x, float y, float radius, float damage, boolean complete)
    Damages all entities and blocks in a radius that are enemies of the team.
    static void
    damage(Team team, float x, float y, float radius, float damage, boolean air, boolean ground)
    Damages all entities and blocks in a radius that are enemies of the team.
    static void
    damage(Team team, float x, float y, float radius, float damage, boolean complete, boolean air, boolean ground)
    Damages all entities and blocks in a radius that are enemies of the team.
    static void
    damage(Team team, float x, float y, float radius, float damage, boolean complete, boolean air, boolean ground, boolean scaled, mindustry.gen.Bullet source)
    Damages all entities and blocks in a radius that are enemies of the team.
    static void
    damageUnits(Team team, float x, float y, float size, float damage, Boolf<mindustry.gen.Unit> predicate, Cons<mindustry.gen.Unit> acceptor)
    Damages all entities and blocks in a radius that are enemies of the team.
    static void
    dynamicExplosion(float x, float y, float flammability, float explosiveness, float power, float radius, boolean damage)
    Creates a dynamic explosion based on specified parameters.
    static void
    dynamicExplosion(float x, float y, float flammability, float explosiveness, float power, float radius, boolean damage, boolean fire, Team ignoreTeam)
    Creates a dynamic explosion based on specified parameters.
    static void
    dynamicExplosion(float x, float y, float flammability, float explosiveness, float power, float radius, boolean damage, boolean fire, Team ignoreTeam, Effect explosionFx)
    Creates a dynamic explosion based on specified parameters.
    static void
    dynamicExplosion(float x, float y, float flammability, float explosiveness, float power, float radius, boolean damage, Effect explosionFx)
    Creates a dynamic explosion based on specified parameters.
    static mindustry.gen.Building
    findAbsorber(Team team, float x1, float y1, float x2, float y2)
     
    static float
    findLaserLength(mindustry.gen.Bullet b, float length)
     
    static float
    findLength(mindustry.gen.Bullet b, float length, boolean laser, int pierceCap)
     
    static float
    findPierceLength(mindustry.gen.Bullet b, int pierceCap, boolean laser, float length)
     
    static float
    findPierceLength(mindustry.gen.Bullet b, int pierceCap, float length)
     
    static mindustry.gen.Healthc
    linecast(mindustry.gen.Bullet hitter, float x, float y, float angle, float length)
    Casts forward in a line.
    static void
    status(Team team, float x, float y, float radius, StatusEffect effect, float duration, boolean air, boolean ground)
    Applies a status effect to all enemy units in a range.
    static void
    tileDamage(Team team, int x, int y, float baseRadius, float damage)
     
    static void
    tileDamage(Team team, int x, int y, float baseRadius, float damage, mindustry.gen.Bullet source)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Damage

      public Damage()
  • Method Details

    • applySuppression

      public static void applySuppression(Team team, float x, float y, float range, float reload, float maxDelay, float applyParticleChance, @Nullable Position source)
    • dynamicExplosion

      public static void dynamicExplosion(float x, float y, float flammability, float explosiveness, float power, float radius, boolean damage)
      Creates a dynamic explosion based on specified parameters.
    • dynamicExplosion

      public static void dynamicExplosion(float x, float y, float flammability, float explosiveness, float power, float radius, boolean damage, Effect explosionFx)
      Creates a dynamic explosion based on specified parameters.
    • dynamicExplosion

      public static void dynamicExplosion(float x, float y, float flammability, float explosiveness, float power, float radius, boolean damage, boolean fire, @Nullable Team ignoreTeam)
      Creates a dynamic explosion based on specified parameters.
    • dynamicExplosion

      public static void dynamicExplosion(float x, float y, float flammability, float explosiveness, float power, float radius, boolean damage, boolean fire, @Nullable Team ignoreTeam, Effect explosionFx)
      Creates a dynamic explosion based on specified parameters.
    • createIncend

      public static void createIncend(float x, float y, float range, int amount)
    • findAbsorber

      @Nullable public static mindustry.gen.Building findAbsorber(Team team, float x1, float y1, float x2, float y2)
    • findLength

      public static float findLength(mindustry.gen.Bullet b, float length, boolean laser, int pierceCap)
    • findLaserLength

      public static float findLaserLength(mindustry.gen.Bullet b, float length)
    • findPierceLength

      public static float findPierceLength(mindustry.gen.Bullet b, int pierceCap, float length)
    • findPierceLength

      public static float findPierceLength(mindustry.gen.Bullet b, int pierceCap, boolean laser, float length)
    • collideLaser

      public static float collideLaser(mindustry.gen.Bullet b, float length, boolean large, boolean laser, int pierceCap)
      Collides a bullet with blocks in a laser, taking into account absorption blocks. Resulting length is stored in the bullet's fdata.
    • collideLine

      public static void collideLine(mindustry.gen.Bullet hitter, Team team, Effect effect, float x, float y, float angle, float length)
    • collideLine

      public static void collideLine(mindustry.gen.Bullet hitter, Team team, Effect effect, float x, float y, float angle, float length, boolean large)
      Damages entities in a line. Only enemies of the specified team are damaged.
    • collideLine

      public static void collideLine(mindustry.gen.Bullet hitter, Team team, Effect effect, float x, float y, float angle, float length, boolean large, boolean laser)
      Damages entities in a line. Only enemies of the specified team are damaged.
    • collideLine

      public static void collideLine(mindustry.gen.Bullet hitter, Team team, Effect effect, float x, float y, float angle, float length, boolean large, boolean laser, int pierceCap)
      Damages entities in a line. Only enemies of the specified team are damaged.
    • collidePoint

      public static void collidePoint(mindustry.gen.Bullet hitter, Team team, Effect effect, float x, float y)
      Damages entities on a point. Only enemies of the specified team are damaged.
    • linecast

      public static mindustry.gen.Healthc linecast(mindustry.gen.Bullet hitter, float x, float y, float angle, float length)
      Casts forward in a line.
      Returns:
      the first encountered object.
    • damageUnits

      public static void damageUnits(Team team, float x, float y, float size, float damage, Boolf<mindustry.gen.Unit> predicate, Cons<mindustry.gen.Unit> acceptor)
      Damages all entities and blocks in a radius that are enemies of the team.
    • damage

      public static void damage(float x, float y, float radius, float damage)
      Damages everything in a radius.
    • damage

      public static void damage(Team team, float x, float y, float radius, float damage)
      Damages all entities and blocks in a radius that are enemies of the team.
    • damage

      public static void damage(Team team, float x, float y, float radius, float damage, boolean air, boolean ground)
      Damages all entities and blocks in a radius that are enemies of the team.
    • status

      public static void status(Team team, float x, float y, float radius, StatusEffect effect, float duration, boolean air, boolean ground)
      Applies a status effect to all enemy units in a range.
    • damage

      public static void damage(Team team, float x, float y, float radius, float damage, boolean complete)
      Damages all entities and blocks in a radius that are enemies of the team.
    • damage

      public static void damage(Team team, float x, float y, float radius, float damage, boolean complete, boolean air, boolean ground)
      Damages all entities and blocks in a radius that are enemies of the team.
    • damage

      public static void damage(Team team, float x, float y, float radius, float damage, boolean complete, boolean air, boolean ground, boolean scaled, @Nullable mindustry.gen.Bullet source)
      Damages all entities and blocks in a radius that are enemies of the team.
    • tileDamage

      public static void tileDamage(Team team, int x, int y, float baseRadius, float damage)
    • tileDamage

      public static void tileDamage(Team team, int x, int y, float baseRadius, float damage, @Nullable mindustry.gen.Bullet source)
    • applyArmor

      public static float applyArmor(float damage, float armor)
      Returns:
      resulting armor calculated based off of damage