I think what's going on here is something to do with the
MeansOfDeath global variable. When something is damaged, the damage type is stored in this variable.
ClientObituary() (the obituary function) reads it to determine the damage type. Going by what I could piece from your post, let's say we have this:
Code: Select all
class TestPlayer : DoomPlayer
{
override void Die (Actor source, Actor inflictor, int dmgflags)
{
if (source)
{
source.A_Die('Ice');
}
Super.Die(source, inflictor, dmgflags);
}
}
When ObitImp damages the player, MeansOfDeath becomes whatever the damage type the imp inflicted (let's say "claw", in this case). If the imp's attack was enough to kill the player, TestPlayer.Die() is called, and the first thing it does is kill the imp with ice damage. Now MeansOfDeath changes to "Ice". Then, Super.Die() is called to do its thing, which includes calling ClientObituary(). At this point the damage type is "Ice", which what is used as the obituary message.
In TestPlayer.Die(), if you call the super function before killing 'source', the damage type and thus the obituary will be "claw".
Here is something people can load and test: summon ObitImp and let it kill you with its melee attack. Upon your death, the imp dies, and you get "Ice" printed as the obituary message.