DamageAPI - risk-of-thunder/R2API GitHub Wiki
DamageAPI
DamageAPI allows registering custom DamageTypes to the game.
To create a custom DamageType, create a static DamageAPI.ModdedDamageType, then reserve it.
internal static DamageAPI.ModdedDamageType myCustomDamageType;
...
myCustomDamageType = DamageAPI.ReserveDamageType();
Custom damage types can be added to the following types: OverlapAttack
, BlastAttack
, LightningOrb
, DotController.DotStack
, DamageOrb
, BulletAttack
, DamageInfo
, and GenericDamageOrb
. For Types that are not included, it may be necessary to perform an IL hook and modify the DamageInfo it creates.
The exposed method is DamageAPI.AddModdedDamageType
.
To utilize the custom damage type, use the extension HasModdedDamageType
.
To remove the custom damage type from a source, use RemoveModdedDamageType
.