How to capture the amount of damage that an enemy took?

orangepecan

Terrarian
Currently it looks like the closest thing to this would be to use the ModifyIncomingHit hook but I don't think this is correct. I want to create an effect whereby I store the amount of damage that an NPC took during a specific period of time and then do something with that amount of damage after that time has expired.

EDIT: I think I figured it out:

Code:
public override void HitEffect(NPC npc, NPC.HitInfo hit)
{
    GNPC info = npc.GetGlobalNPC<GNPC>();

    if (npc.FindBuffIndex(ModContent.BuffType<Buffs.DeathMark>()) >= -1)
    {
        info.deathMarkDamage += hit.Damage;
    }

    base.HitEffect(npc, hit);
}
 
Last edited:
Back
Top Bottom