/
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/
inherit "inherit/base/consume";

string query_object_type() { return "Food"; }
status query_food()        { return 1;      }

#ifdef NATIVE_MODE
void create() {
#else
void reset(status arg) {

  /* Default values */
  if(arg) return;
#endif /* native */

  set_sell_destruct(1);
  set_name("bread");
  set_short("A stale loaf of bread");
  set_long("It looks a little moldy.\n");
  set_room_msg(
    "@@query_name:$this_player()$@@ munches on some "+
    "@@query_name:$this_object()$@@.\n");
  set_consumer_msg("Yum yum!!\n");
  set_strength(2);
}

void init() {
  ::init();
  if(environment() != this_player()) return;
  add_action("eat", "eat");
}

status eat(string str) {
  object tp, ob;

  tp = this_player();

  if(!str) { 
    write("Eat what?\n");
    return 1;
  }
  
  if(!(ob = present(str,tp))) {
    if(!str) str = "food";
    write("You don't have any "+ str +" to eat.\n");
    return 1;
  }

  if(ob != this_object()) return 0;

  if((int)tp->query_constitution() * 8 < strength) {
    write("You realize even before trying that you'll never be able\n"+ 
       "to eat all this.\n");
    return 1;
  }
  if(!tp->eat_food(strength)) return 1;
  ::consume(str);
  destruct(this_object());
  return 1;
}

void set_eater_mess(string str) { set_consumer_msg(str); }

void set_eating_mess(string str){ set_room_msg(str);     }