/
lib/banish/
lib/d/
lib/doc/
lib/doc/domains/
lib/doc/efun/
lib/doc/examples/
lib/doc/examples/armour/
lib/doc/examples/contain/
lib/doc/examples/food/
lib/doc/examples/magic/
lib/doc/examples/monster/
lib/doc/examples/room/
lib/doc/examples/weapons/
lib/include/
lib/include/fn_specs/
lib/include/skills/
lib/info/
lib/inherit/base/
lib/log/
lib/manuals/312/
lib/news/
lib/obj/party/
lib/objects/components/
lib/open/
lib/open/library/
lib/open/party/
lib/players/
lib/players/zilanthius/
lib/room/
lib/room/city/arena/
lib/room/city/creator/
lib/room/city/garden/monst/
lib/room/city/obj/
lib/room/city/shop/
lib/room/death/
lib/room/registry/
lib/secure/
lib/secure/UDP_CMD_DIR/
lib/skills/
lib/skills/fighter/
lib/skills/thief/
lib/usr/
lib/usr/creators/
lib/usr/players/
/***************************************************************************
/* armour that imbues a magical protection, and spell casting when worn */

#include <mudlib.h>
inherit ARMOUR;
inherit WAND;

string protection;

string query_protection()         { return protection;       }
string set_protection(string str) { return protection = str; }

int query_value() { return armour::query_value()+wand::query_value(); }

status wear(string str) {   /* redo the wear string */
  status flag;

  flag = armour::wear(str);
  if(worn) {
    if(protection) environment()->add_spell_immunity(protection);
    wand::init(); 
  }
  return flag;
}

status drop(status quit) {
  if(protection) environment()->remove_spell_immunity(protection);
  return armour::drop(quit);
}

status remove(string str) {  
  move_object(this_object(), environment()); /* remove spell actions */
  if(protection) environment()->remove_spell_immunity(protection);
  return armour::remove(str);
}

void init() {
  armour::init();
}


/* for info */

string query_protection_string() {
  if(protection) {
    return "The "+ query_name() +" will protect you from "+
           protection +" when it is worn.\n";
  }
}