/
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/function/
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/
/* illusion shadow for visual illusion, and permanent illusion spells */

inherit "obj/shadows/shadow";
inherit "inherit/timer";

string illusion_name;
string illusion_short;
string illusion_long;
object who;

void illusion(object ob, string name, string short, string long) {
  who = ob;
  if(name != "")  illusion_name = name;
  if(short != "") illusion_short = short;
  if(long != "")  illusion_long = long;
  log_file("Illusions",
 "Permanent illusion of "+(string)who->query_name(1)+":"+ file_name(who)+"\n"
 +"  Caster: "+ (string)this_player()->query_name(1) +"\n"+
  "  Name: "+ illusion_name +"\n"+
  "  Short: "+  illusion_short +"\n"+
  "  Long: "+ illusion_long +"\n");
  shadow_object(who);  
}


string query_name(status arg) {
  if(arg) return (string)who->query_name(1);
  if(!illusion_name) return (string)who->query_name(arg);
  return illusion_name;
}


string short(status wiz, status true_sight) {
  if(!illusion_short) return (string)who->short(wiz);
  if(wiz || true_sight) {
    return "Illusion of "+ illusion_short +" on "+ (string)who->short(wiz);
  }
  return illusion_short;
}


void long(status wiz, status true_sight) {
  if(!illusion_long)
    who->long(wiz);
  else {
    if(wiz || true_sight) write("There is an illusion: \n");
    write(illusion_long +"\n");    
    if(wiz || true_sight) {
      write("\nWhich is Really:\n");
      who->long(wiz);
    }
  }
}


status id(string str) {
  return str == query_name(0)
      || str == "Illusion"
      || (status)who->id(str);
}


object query_illusion_object() { return this_object(); }

void time_out() {
  tell_room(environment(who), "An Illusion of "+ illusion_short +
      " dissapates to reveal "+ (string)who->short() +".\n");
  ::time_out();
}
 
void dispel_magic() {  time_out(); }