Interface DamageApplier<E extends Entity>
- All Known Implementing Classes:
AeroDamageApplier
,GunEmplacementDamageApplier
,InfantryDamageApplier
,MekDamageApplier
,SimpleDamageApplier
,TankDamageApplier
public interface DamageApplier<E extends Entity>
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault void
applyDamage
(int dmg) Applies damage to the entity.default void
applyDamage
(DamageApplier.HitDetails hitDetails) Hits the entity with the given hit details.default int
applyDamageInClusters
(int dmg, int clusterSize) Applies damage to the entity in clusters of a given size.default int
applyDamageInClusters
(DamageApplier.HitDetails hitDetails, int clusterSize) Applies damage to the entity in clusters of a given size.default DamageApplier.HitDetails
applyDamageToEquipments
(DamageApplier.HitDetails hitDetails) Applies damage to the equipments of the entity.default boolean
default boolean
default DamageApplier.HitDetails
damageArmor
(DamageApplier.HitDetails hitDetails) Applies damage only to the armor of the entity.default DamageApplier.HitDetails
damageInternals
(DamageApplier.HitDetails hitDetails) Applies damage to the internals of the entity.default void
destroyLocation
(int location) Destroys the location of the entity.default DamageApplier.HitDetails
destroyLocation
(DamageApplier.HitDetails hitDetails) Destroys the location of the entity.int
entity()
default boolean
default boolean
default HitData
getHitData
(int hitLocation) Returns the hit data for the given hit location.default int
Returns the location to hit.default boolean
static <E extends Entity>
voidsetEntityDestroyed
(E entity) Sets the entity as destroyed.static <E extends Entity>
voidsetEntityDevastated
(E entity) Sets the entity as devastated.default DamageApplier.HitDetails
setupHitDetails
(HitData hit, int damageToApply) Sets up the hit details for the given hit and damage.default void
tryToDamageCrew
(int hitCrew) Tries to damage the crew of the entity.default void
tryToDamageCrew
(int hitCrew, boolean applyDamagePostEjection) Tries to damage the crew of the entity.
-
Field Details
-
logger
-
-
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 applyclusterSize
- the size of the clusters
-
applyDamageInClusters
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 hitclusterSize
- 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
Hits the entity with the given hit details.- Parameters:
hitDetails
- the hit details
-
damageInternals
Applies damage to the internals of the entity.- Parameters:
hitDetails
- the hit details
-
destroyLocation
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 crewapplyDamagePostEjection
- if the damage should be applied after the crew is ejected
-
setEntityDestroyed
Sets the entity as destroyed.- Type Parameters:
E
- the type of the entity- Parameters:
entity
- entity to be set as destroyed
-
setEntityDevastated
Sets the entity as devastated.- Type Parameters:
E
- the type of the entity- Parameters:
entity
- entity to be set as destroyed
-
applyDamageToEquipments
Applies damage to the equipments of the entity.- Parameters:
hitDetails
- the hit data with information about the location
-
damageArmor
Applies damage only to the armor of the entity.- Parameters:
hitDetails
- the hit details
-
getHitData
Returns the hit data for the given hit location.- Parameters:
hitLocation
- the hit location- Returns:
- the hit data
-
setupHitDetails
Sets up the hit details for the given hit and damage.- Parameters:
hit
- the hit datadamageToApply
- the damage to apply- Returns:
- the hit details
-