// ****************************************************************************
//
// Logic 62: Obsessive Ollie's Room
//
// ****************************************************************************

#include "defines.txt"

if (new_room) {
  universe=56;
  load.pic(universe);
  draw.pic(universe);
  discard.pic(universe);
  set.horizon(37);

  if (prev_room_no==59) {
   position(ego,70,58);
   ego_dir=0;
   }

  if (prev_room_no == 107) {
      position(ego,70,135);
      }

  if (!inmate5) {
   animate.obj(o1);
  load.view(128);
  set.view(o1,128);
  position(o1,64,92);
  draw(o1);
  }

  if (!has("food tray")) {
      animate.obj(o2);
      load.view(food_tray);
      set.view(o2,food_tray);
      position(o2,80,120);
      ignore.objs(o2);
      set.priority(o2,4);
      draw(o2);
      }

  load.sound(35);
  sound(35, sound_flag);

  draw(ego);
  show.pic();
}

if (said("look")) {
  print("You are in another of these padded rooms.");
  if (!inmate5) {
      print("You see one of the largest inmates you've ever seen.");
      }
}

if (said("look","wall"))
     {
          print("It is covered with some soft padding.  The padding is stained with age, cold sweat, and hospital food.  There is a vent attached to the wall.");
          }

if (said("look","floor")) {
    print("It is covered with some soft padding.  The padding is stained with age, cold sweat, and hospital food.");
    if (!has("food tray")) {
        print("Speaking of which, there's a tray of the nasty stuff right there.");
        }
    }

if (said("look","ceiling")) {
    print("Wow, even the ceilings are padded.  What kind of people are committed here?");
    }

if (said("look","vent")) {
    print("There's a stale draft blowing from the vent.  The screws are loose.");
    }

if ((said("look","food","tray") ||
     said("look","food") ||
     said("look","tray"))) {
    print("Deviled beets, boiled meat loaf, creamed beans, and a brownie.  Yeck!");
    print("I just hate brownies.");
    }

if (said("attack","vent")) {
    print("The cover just slips off.  There's no need to break it.");
    }

if ((said("take","vent") ||
     said("remove","vent"))) {
    print("Three of the screws are loose, but the fourth is still in place.  Moreover, it's a left-handed womple drive, which is impossible to get on Voodoo Island.");
    print("You can probably just open it and climb through.");
    }

if ((said("enter","vent") ||
     said("use","vent") ||
     said("climb","vent") ||
     said("open","vent") ||
     said("get","vent"))) {
    if (obj.in.box(ego, 60, 125, 87, 136)) {
        new.room(107);
        }
    else {
        print("What?!  Are you going to hurl yourself across the room?");
        }
    }



if (said("look","man")) {
    print("Maybe he has a glandular disorder...");
    }

if ((said("look","jacket") ||
     said("untie","jacket"))) {
    print("You might have a chance to untie his straitjacket, except his great girth has overlapped the clasps.");
    }



if (said("talk","man")) {
    print("Inmate: \"Hello, my name is Ollie, and I'm an obsessive-compulsive overeater.\"");
    print("VG: \"Hi, Ollie!\"");
    print("Inmate: \"I just can't stop eating.  I'm as big as Nursie, now!!!\"");
    }

if ((said("eat","food") ||
    said("eat","tray") ||
    said("eat","food","tray"))) {
         print("Thank you, no.  Even when you still ate mortal food, you would never resort to this grade of hospital food.");
         }

if ((said("take","food") ||
     said("take","tray") ||
     said("take","food","tray"))) {
       if (!has("food tray")) {
          distance(ego,o2, range);
          if (range<=10) {
              print("You stash the tray in the recesses of your pants.");
              get("food tray");
              erase(o2);
              set(really_done_flag);
              }
          else {
              print("...  closer...");
              }
          }
       else {
           print("No more...  all gone!");
           }
       }

if (really_done_flag &&
    !inmate5) {
       reset(really_done_flag);
       load.view(116);
       set.view(o1,116);
       print("Inmate: \"Wow!!!  Without the constant eating, I'm svelte again!  Moreover, I can slip right out of my straitjacket!!\"");
       print("Note to self:  Begin selling Voodoo Girl's Special Weight Loss Program.");
        move.obj(o1,70,45,1,more_done_flag);
       set(inmate5);
       escaped++;
    }


if (more_done_flag) {
    reset(more_done_flag);
    erase(o1);
    }

if (ego_touching_signal_line) { //ego at the door
    new.room(59);
    }


if (sound_flag) {
    sound(35, sound_flag);
    }    

call(205);
return();