INFO
inheritance - the ineritance mechanism
DESCRIPTION
An object can inherit all variables and functions from another object.
This is done with the declaration 'inherit "file";'. This must come
before any local variables or functions.
EXAMPLE
Defining a monster:
inherit "std/simple_monster";
reset(arg) {
::reset(arg);
set_name("troll");
set_level(9);
set_hp(100);
set_wc(12);
set_al(-60);
set_short("A troll");
set_long("It is a nasty troll that looks very aggressive.\n");
set_aggressive(1);
}
As always, refer to the inherited file to see the functions and
variables available.
NOTE
Some objects have declared their variables as private, in which case
they cannot be directly accessed from inheriting objects, but the
indirect mechanism of function calls must be used.
SEE ALSO
/doc/efun/inherit
Help topics available:
You are guest number 184 since November 2019.
This file was last modified: June 2000.