[Package Index | Mudlib Index | Effect Index]

File /std/living/corpse.c

This method will allow all sorts of modifications to a corpse once it has been created, based on the weapon or attack used for the killing stroke.

See also:
death_helper(), make_corpse() and do_death()

Includes

This class includes the following files /include/player.h and /include/playtesters.h

Method index

Public Functions

These are functions that everyone can access.

alter_corpse
int alter_corpse(object corpse,
                 object weapon,
                 string attack)
death_helper
mixed * death_helper(object thing,
                     int death)

This method deals with any cute messages you want to print when something dies or, cute things you want to do (like not dieng at all). It handles the alignment shift due to the killing of this npc as well.

Parameters:
thing - the thing which killed us

See also:
make_corpse()


do_death
varargs object do_death(object thing,
                        object weapon,
                        string attack)

This does the actual death and co ordinates the death into a well ordered feeding frenzy. This method creates the actual corpse itself. If the property "dead" is set on the object no corpse will be created, or if the second_life() function called on the object returns a non-zero value the corpse will not be created.

This method calls the second_life() function on the current object, if this returns 1 it must handle all the the death code itself. This is used in the player code to override the death code.

Parameters:
thing - the thing which killed us
weapon - the weapon (sword,claw,etc) object that attacked and killed us
attack - the actual attack that killed us

Returns:
the corpse, or 0 if no more action is to be taken

See also:
death_helper(), make_corpse() and alter_corpse()


make_corpse
object make_corpse()

This method will create a corpse for the living object when it eventually dies. Of old age of course, no one would die of having sword rammed through them. The function enables different races to produce different corpses through two mechanisms. The simplest one is to define your own clone_corpse() function in the race object and return the corpse object you want. The more complex solution is to define make_corpse() in the race object and do all the work yourse.f

Returns:
the created corpse object

See also:
make_corpse.c and clone_corpse .c