#pragma save_binary

inherit "/std/object";

#include "/sys/stdproperties.h"
#include "/sys/macros.h"

string gMessage, gSender,dSender;

void
reset_short()
{
}


create_object()
{
   gMessage = "Nic.\n";
   gSender = "Ktos";
   ustaw_nazwe(({"wiadomosc","wiadomosci","wiadomosci","wiadomosc","wiadomoscia","wiadomosci"}),
      ({"wiadomosci","wiadomosciom","wiadomosci","wiadomosci","wiadomosciami","wiadomosciach"}),
      PL_ZENSKI);      
 
   set_long("@@read_message");
   add_prop(OBJ_I_WEIGHT, 100);
   add_prop(OBJ_I_VOLUME, 100);
   add_prop(OBJ_I_NO_DROP, "@@do_destruct");
}

init()
{
   ::init();
   add_action("do_read", "przeczytaj",0);
}


string
read_message()
{
   return ("Tekst wiadomosci:\n" + gMessage);
}

int
do_read(string str)
{
   if (str == "wiadomosc" || str == query_short(PL_BIE))
   {
      write(read_message());
      return 1;
   }
}



void
do_destruct()
{
   set_alarm(2.0,0.0,"destruct_me");
   return 0;
}

void
set_message(string str)
{
   gMessage = str;
}

void
set_sender(string str)
{
   gSender = str;
}

string
query_sender()
{
   return gSender;
}

void
destruct_me()
{
   object room;
   if (living(room = environment()))
      room = environment(room);
   tell_room(room, "Mala karteczka odlatuje z podmuchem wiatru.\n");
   remove_object();
}
