Interface DamageApplier<E extends Entity>

All Known Implementing Classes:
AeroDamageApplier, GunEmplacementDamageApplier, InfantryDamageApplier, MekDamageApplier, SimpleDamageApplier, TankDamageApplier

public interface DamageApplier<E extends Entity>
  • Field Details

  • Method Details

    • entity

      E entity()
    • entityFinalState

      EntityFinalState entityFinalState()
    • crewMayDie

      default boolean crewMayDie()
    • entityMustSurvive

      default boolean entityMustSurvive()
    • noCrewDamage

      default boolean noCrewDamage()
    • crewMustSurvive

      default boolean crewMustSurvive()
    • entityMustBeDevastated

      default boolean entityMustBeDevastated()
    • applyDamageInClusters

      default int applyDamageInClusters(int dmg, int clusterSize)
      Applies damage to the entity in clusters of a given size. This is USUALLY the function you will want to use.
      Parameters:
      dmg - the total damage to apply
      clusterSize - the size of the clusters
    • applyDamageInClusters

      default int applyDamageInClusters(DamageApplier.HitDetails hitDetails, int clusterSize)
      Applies damage to the entity in clusters of a given size. This is USUALLY the function you will want to use.
      Parameters:
      hitDetails - the details of the hit
      clusterSize - the size of the clusters
    • devastateUnit

      int devastateUnit()
    • applyDamage

      default void applyDamage(int dmg)
      Applies damage to the entity.
      Parameters:
      dmg - the total damage to apply
    • getRandomHitLocation

      default int getRandomHitLocation()
      Returns the location to hit.
      Returns:
      returns a valid random location to be hit.
    • applyDamage

      default void applyDamage(DamageApplier.HitDetails hitDetails)
      Hits the entity with the given hit details.
      Parameters:
      hitDetails - the hit details
    • damageInternals

      default DamageApplier.HitDetails damageInternals(DamageApplier.HitDetails hitDetails)
      Applies damage to the internals of the entity.
      Parameters:
      hitDetails - the hit details
    • destroyLocation

      default DamageApplier.HitDetails destroyLocation(DamageApplier.HitDetails hitDetails)
      Destroys the location of the entity. This one is used when you have the HitData.
      Parameters:
      hitDetails - the hit details with information about the location
    • destroyLocation

      default void destroyLocation(int location)
      Destroys the location of the entity. This one is used when the location is already known.
      Parameters:
      location - the location index in the entity
    • tryToDamageCrew

      default void tryToDamageCrew(int hitCrew)
      Tries to damage the crew of the entity. If the crew is dead, the entity is marked as destroyed. The crew won't be damaged if they are already ejected or already dead. This function also does try to not outright kill the crew, as it has proven to be a bit too deadly.
      Parameters:
      hitCrew - the amount of hits to apply to ALL crew
    • tryToDamageCrew

      default void tryToDamageCrew(int hitCrew, boolean applyDamagePostEjection)
      Tries to damage the crew of the entity. If the crew is dead, the entity is marked as destroyed. The crew won't be damaged if they are already ejected or already dead. This function also does try to not outright kill the crew, as it has proven to be a bit too deadly.
      Parameters:
      hitCrew - the amount of hits to apply to ALL crew
      applyDamagePostEjection - if the damage should be applied after the crew is ejected
    • setEntityDestroyed

      static <E extends Entity> void setEntityDestroyed(E entity)
      Sets the entity as destroyed.
      Type Parameters:
      E - the type of the entity
      Parameters:
      entity - entity to be set as destroyed
    • setEntityDevastated

      static <E extends Entity> void setEntityDevastated(E entity)
      Sets the entity as devastated.
      Type Parameters:
      E - the type of the entity
      Parameters:
      entity - entity to be set as destroyed
    • applyDamageToEquipments

      default DamageApplier.HitDetails applyDamageToEquipments(DamageApplier.HitDetails hitDetails)
      Applies damage to the equipments of the entity.
      Parameters:
      hitDetails - the hit data with information about the location
    • damageArmor

      default DamageApplier.HitDetails damageArmor(DamageApplier.HitDetails hitDetails)
      Applies damage only to the armor of the entity.
      Parameters:
      hitDetails - the hit details
    • getHitData

      default HitData getHitData(int hitLocation)
      Returns the hit data for the given hit location.
      Parameters:
      hitLocation - the hit location
      Returns:
      the hit data
    • setupHitDetails

      default DamageApplier.HitDetails setupHitDetails(HitData hit, int damageToApply)
      Sets up the hit details for the given hit and damage.
      Parameters:
      hit - the hit data
      damageToApply - the damage to apply
      Returns:
      the hit details