Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
DamageManagerComponent Interface Reference
Inheritance diagram for DamageManagerComponent:
[legend]

Public Member Functions

proto external int ComputeStruckHitZones (out notnull array< HitZone > struckHitZones, notnull BaseDamageContext damageContext)
 Clears and fills struckHitZones array with all HZs that should get damaged by this BaseDamageContext.
 
proto external void EnableDamageHandling (bool enable)
 
proto external bool IsDamageHandlingEnabled ()
 
proto external float GetMovementDamage ()
 
proto external float GetAimingDamage ()
 
proto external void SetMovementDamage (float damage)
 
proto external void SetAimingDamage (float damage)
 
proto external float GetHealthScaled ()
 
proto external bool SetHealthScaled (float health)
 
proto external float GetHealth ()
 
proto external float GetMaxHealth ()
 
proto external EDamageState GetState ()
 
proto external bool IsDestroyed ()
 
proto external void SetInstigatorEntity (IEntity instigator)
 
proto external void SetInstigator (notnull Instigator instigator)
 
proto external notnull Instigator GetInstigator ()
 
proto external int GetAttachedColliderIDs (out notnull array< int > outAttachedColliderIDs)
 Fills colliderIDs with all the colliders attached to hitzones this dmg manager owns.
 
proto external void HandleDamage (notnull BaseDamageContext damageContext)
 
proto external bool IsDamagedOverTime (EDamageType dType)
 
proto external float GetDamageOverTime (EDamageType dType)
 
proto external void RemoveDamageOverTime (EDamageType dType)
 Removes DOT of provided damageType from all currently affected HitZones.
 
bool ShouldOverrideInstigator (notnull Instigator currentInstigator, notnull Instigator newInstigator)
 Called whenever an instigator is going to be set.
 
GameMaterial OverrideHitMaterial (HitZone struckHitzone)
 Not all armors are physical so the surface that gets struck by projectiles will not be the one the armor, but the hitzone.
 
bool FilterContact (IEntity owner, IEntity other, Contact contact)
 Event when physics engine registered contact with other RigidBody.
 
bool HijackDamageHandling (notnull BaseDamageContext damageContext)
 Called when this DamageManager is about to handle damage.
 
bool ShouldCountAsHit (notnull BaseDamageContext damageContext)
 Called after HijackDamageHandling.
 
- Public Member Functions inherited from HitZoneContainerComponent
proto external IEntity GetOwner ()
 
proto external HitZone GetDefaultHitZone ()
 
proto external HitZone GetHitZoneByColliderID (int colliderID)
 
proto external int GetHitZonesByColliderIDs (out notnull array< HitZone > outHitZones, notnull array< int > colliderIDs)
 Clears and fills the specified outHitZones array with all HZs that are attached to colliderIDs.
 
proto external HitZone GetHitZone (string colliderName)
 
proto external int GetAllHitZones (out notnull array< HitZone > outHitZones)
 Clears and fills the specified outHitZones array with all HZs in this entity Returns the count of elements that were filled into the array.
 
proto external int GetAllHitZonesInHierarchy (out notnull array< HitZone > outHitZones)
 Clears and fills the specified outHitZones array with all HZs in this entity and its children.
 
proto external HitZoneContainerComponent GetParentHitZoneContainer ()
 
- Public Member Functions inherited from GameComponent
bool OnTicksOnRemoteProxy ()
 

Protected Member Functions

void OnDamageOverTimeAdded (EDamageType dType, float dps, HitZone hz)
 Invoked every time the DoT is added to certain hitzone.
 
void OnDamageOverTimeRemoved (EDamageType dType, HitZone hz)
 Invoked when provided damage type is removed from certain hitzone.
 
void OnDamageStateChanged (EDamageState state)
 Called when the damagestate changes.
 
void OnPostInit (IEntity owner)
 Called after all components are initialized.
 
void OnInit (IEntity owner)
 Called during EOnInit.
 
void OnDelete (IEntity owner)
 
void OnFrame (IEntity owner, float timeSlice)
 Called during EOnFrame.
 
void OnFilteredContact (IEntity owner, IEntity other, Contact contact)
 Only called if FilterContact returned true.
 
void OnDiag (IEntity owner, float timeSlice)
 Called during EOnDiag.
 
void OnDamage (notnull BaseDamageContext damageContext)
 
- Protected Member Functions inherited from HitZoneContainerComponent
bool OnRplSave (ScriptBitWriter writer)
 
bool OnRplLoad (ScriptBitReader reader)
 

Member Function Documentation

◆ ComputeStruckHitZones()

proto external int DamageManagerComponent.ComputeStruckHitZones ( out notnull array< HitZone struckHitZones,
notnull BaseDamageContext  damageContext 
)

Clears and fills struckHitZones array with all HZs that should get damaged by this BaseDamageContext.

This function uses BaseDamageContext.colliderID to find the struck hitzones. If no hitzones are attached to the colliderID, it will return default hitzone. Use this to call HandleDamage individually on each of the affected hitzones. Dont call this if: -The DamageManager has been destroyed, struckHitZones will be empty. -DamageContext.struckHitZone is known. It will only return that hitzone.

Parameters
struckHitZonesarray of hitzones that were struck
damageContextInformation about the damage. Only BaseDamageContext.struckHitZone and BaseDamageContext.colliderID are relevant.
Returns
Returns the count of elements that were filled into the array.

◆ EnableDamageHandling()

proto external void DamageManagerComponent.EnableDamageHandling ( bool  enable)

◆ FilterContact()

bool DamageManagerComponent.FilterContact ( IEntity  owner,
IEntity  other,
Contact  contact 
)

Event when physics engine registered contact with other RigidBody.

Parameters
ownerThe owner entity
otherOther Entity who contacted us
contactStructure describing the contact
Returns
If it returns false, contact gets discarded and DamageManagerComponent::OnFilteredContact will not be called

Implemented in SCR_ArmorDamageManagerComponent, SCR_CharacterDamageManagerComponent, SCR_RotorDamageManagerComponent, SCR_VehicleDamageManagerComponent, SCR_DestructionDamageManagerComponent, and SCR_DamageManagerComponent.

◆ GetAimingDamage()

proto external float DamageManagerComponent.GetAimingDamage ( )

◆ GetAttachedColliderIDs()

proto external int DamageManagerComponent.GetAttachedColliderIDs ( out notnull array< int >  outAttachedColliderIDs)

Fills colliderIDs with all the colliders attached to hitzones this dmg manager owns.

◆ GetDamageOverTime()

proto external float DamageManagerComponent.GetDamageOverTime ( EDamageType  dType)
Returns
total DPS inflicted by all DoTs of specified type.

◆ GetHealth()

proto external float DamageManagerComponent.GetHealth ( )

◆ GetHealthScaled()

proto external float DamageManagerComponent.GetHealthScaled ( )

◆ GetInstigator()

proto external notnull Instigator DamageManagerComponent.GetInstigator ( )

◆ GetMaxHealth()

proto external float DamageManagerComponent.GetMaxHealth ( )

◆ GetMovementDamage()

proto external float DamageManagerComponent.GetMovementDamage ( )

◆ GetState()

proto external EDamageState DamageManagerComponent.GetState ( )

◆ HandleDamage()

proto external void DamageManagerComponent.HandleDamage ( notnull BaseDamageContext  damageContext)

◆ HijackDamageHandling()

bool DamageManagerComponent.HijackDamageHandling ( notnull BaseDamageContext  damageContext)

Called when this DamageManager is about to handle damage.

Any modifications done to the damageContext will persist for the rest of the damage handling process return false if damage handling should proceed with the changes done to the DamageContext. return true if damage should be discarded / was fully hijacked and should no longer be applied on this damage manager (e.g.: damage was passed to another dmg manager, so we dont handle damage on this manager ).

Implemented in SCR_ArmorDamageManagerComponent, SCR_CharacterDamageManagerComponent, SCR_MineDamageManager, and SCR_DamageManagerComponent.

◆ IsDamagedOverTime()

proto external bool DamageManagerComponent.IsDamagedOverTime ( EDamageType  dType)
Returns
true if there is active DOT of specified type.

◆ IsDamageHandlingEnabled()

proto external bool DamageManagerComponent.IsDamageHandlingEnabled ( )

◆ IsDestroyed()

proto external bool DamageManagerComponent.IsDestroyed ( )

◆ OnDamage()

void DamageManagerComponent.OnDamage ( notnull BaseDamageContext  damageContext)
protected

◆ OnDamageOverTimeAdded()

void DamageManagerComponent.OnDamageOverTimeAdded ( EDamageType  dType,
float  dps,
HitZone  hz 
)
protected

Invoked every time the DoT is added to certain hitzone.

Implemented in SCR_DamageManagerComponent.

◆ OnDamageOverTimeRemoved()

void DamageManagerComponent.OnDamageOverTimeRemoved ( EDamageType  dType,
HitZone  hz 
)
protected

Invoked when provided damage type is removed from certain hitzone.

Implemented in SCR_DamageManagerComponent.

◆ OnDamageStateChanged()

void DamageManagerComponent.OnDamageStateChanged ( EDamageState  state)
protected

◆ OnDelete()

void DamageManagerComponent.OnDelete ( IEntity  owner)
protected

◆ OnDiag()

void DamageManagerComponent.OnDiag ( IEntity  owner,
float  timeSlice 
)
protected

Called during EOnDiag.

Parameters
ownerEntity this component is attached to.
timeSliceDelta time since last update.

◆ OnFilteredContact()

void DamageManagerComponent.OnFilteredContact ( IEntity  owner,
IEntity  other,
Contact  contact 
)
protected

Only called if FilterContact returned true.

Parameters
ownerThe owner entity
otherOther Entity who contacted us
contactStructure describing the contact

Implemented in SCR_CharacterDamageManagerComponent, SCR_RotorDamageManagerComponent, SCR_VehicleDamageManagerComponent, SCR_DestructibleBuildingComponent, and SCR_DestructionDamageManagerComponent.

◆ OnFrame()

void DamageManagerComponent.OnFrame ( IEntity  owner,
float  timeSlice 
)
protected

Called during EOnFrame.

Parameters
ownerEntity this component is attached to.
timeSliceDelta time since last update.

Implemented in SCR_DestructibleBuildingComponent, and SCR_DestructionTireComponent.

◆ OnInit()

void DamageManagerComponent.OnInit ( IEntity  owner)
protected

Called during EOnInit.

Parameters
ownerEntity this component is attached to.

Implemented in SCR_CharacterDamageManagerComponent, and SCR_RotorDamageManagerComponent.

◆ OnPostInit()

void DamageManagerComponent.OnPostInit ( IEntity  owner)
protected

◆ OverrideHitMaterial()

GameMaterial DamageManagerComponent.OverrideHitMaterial ( HitZone  struckHitzone)

Not all armors are physical so the surface that gets struck by projectiles will not be the one the armor, but the hitzone.

This is a workaround to solve that issue. It gets called every time a projectile strikes a hitzone We can override material of the hit with the corresponding one from the armor (if needed)

Implemented in SCR_CharacterDamageManagerComponent.

◆ RemoveDamageOverTime()

proto external void DamageManagerComponent.RemoveDamageOverTime ( EDamageType  dType)

Removes DOT of provided damageType from all currently affected HitZones.

◆ SetAimingDamage()

proto external void DamageManagerComponent.SetAimingDamage ( float  damage)

◆ SetHealthScaled()

proto external bool DamageManagerComponent.SetHealthScaled ( float  health)

◆ SetInstigator()

proto external void DamageManagerComponent.SetInstigator ( notnull Instigator  instigator)

◆ SetInstigatorEntity()

proto external void DamageManagerComponent.SetInstigatorEntity ( IEntity  instigator)

◆ SetMovementDamage()

proto external void DamageManagerComponent.SetMovementDamage ( float  damage)

◆ ShouldCountAsHit()

bool DamageManagerComponent.ShouldCountAsHit ( notnull BaseDamageContext  damageContext)

Called after HijackDamageHandling.

If it returns true, damage will be dealt. If it returns false, damage will not be handled. Use this to introduce randomness on hit chances (e.g.: moving helicopter rotors)

Implemented in SCR_RotorDamageManagerComponent.

◆ ShouldOverrideInstigator()

bool DamageManagerComponent.ShouldOverrideInstigator ( notnull Instigator  currentInstigator,
notnull Instigator  newInstigator 
)

Called whenever an instigator is going to be set.

Parameters
currentInstigatorThis damage manager's last instigator
newInstigatorThe new instigator for this damage manager
Returns
If it returns true, newInstigator will become the new current instigator for the damage manager and it will receive kill credit.

Implemented in SCR_CharacterDamageManagerComponent, SCR_VehicleDamageManagerComponent, and SCR_DamageManagerComponent.


The documentation for this interface was generated from the following file: