/* Filename : cape.c * Description : a protective cloak * * written : 03-10-1996 - Gunner * last modified : 27-05-1998 - Gunner * HTML-Version : 04-02-2000 - Ghorwin */ #include <mudlib.h> inherit I_ARMOUR; #define FUNC "/doc/crashcourse/course07/capefuncs" create() { ::create(); set_name("warm cape"); add_id(({"cape","cloak","warm cloak"})); set_short("A warm cape"); set_long("The cape feels warm and good. It can probably keep you " "warm even in the worst weather.\n"); set_weight(2); set_value(500); set_ac(1); set_type("cloak"); set_info("The cape gives some protection against the cold.\n"); add_property(({"hidden","magic","leather","warm"})); add_hook("__wear",(:call_other,FUNC,"wear_cape",this_object():)); add_hook("__remove",(:call_other,FUNC,"remove_cape",this_object():)); replace_program(I_ARMOUR); }
/* Filename : capefuncs.c * Description : the functionfile for cape.c * * written : 03-10-1996 - Gunner * last modified : 27-05-1998 - Gunner * HTML-Version : 04-02-2000 - Ghorwin */ #include <mudlib.h> #include "/doc/crashcourse/defs.h" inherit I_DAEMON; /* * wear_cape : called by the __wear hook in cape.c */ void wear_cape(object cape) { object wearer, room; wearer = environment(cape); if (!wearer) return; // Something's wrong here... room = environment(wearer); if (!room) return; // Something's wrong here... tell_object(wearer,"As you wear the cape, a warm feeling spreads into " "your entire body.\n"); wearer->add_tmp_prop("resist_cold",20); } /* * remove_cape : called by the __remove hook in cape.c */ void remove_cape(object cape) { object wearer, room; wearer = environment(cape); if (!wearer) return; // Something's wrong here... room = environment(wearer); if (!room) return; // Something's wrong here... tell_object(wearer,"As you remove the cape, you feel cold to the bone.\n"); wearer->add_tmp_prop("resist_cold",-20); }