// ****************************************************************************
//
// Logic 55: Mad Murray's Room
//
// ****************************************************************************

#include "defines.txt"

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

  if (prev_room_no==58) {
   position(ego,74,120);
   ego_dir=0;
   }

    if (prev_room_no == 107) {
    position(ego,75,56);
    }

if(!inmate2) {
  animate.obj(o1);
  load.view(116);
  load.view(120);
  set.view(o1,116);
  position(o1,70,80);
  draw(o1);
  }

  reset(done_flag);

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

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

if (said("look")) {
  print("You are in a padded room.");
  if(!inmate2) {
     print("There's another one of those strange, grinning men in here.");
     }
}

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 (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("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, 67, 56, 88, 66)) {
        new.room(107);
        }
    else {
        print("What?!  Are you going to hurl yourself across the room?");
        }
    }



if (said("look","man")) {
    print("Yes, a madman.");
    }

if (said("talk","man")) {
   if (!inmate2) {
    print("Inmate: \"I'm Mad Murray, what's your name?\"");
    print("VG: \"Voodoo Girl.\"");
    print("Inmate: \"I understand the Voodoo part, but why are called a Girl?\"");
    print("VG: \"Uh...  what?\"");
    print("Inmate: \"I'm just kidding.  That's a little institutional humor.  By the way, my straitjacket says hi.\"");
    print("VG: \"Uh...  hi...  straitjacket.\"");
    print("Inmate: \"Are you crazy?  Straitjackets can't talk.  But he is thirsty.\"");
     }
    }

if (!inmate2) {
if ((said("look","straitjacket") ||
     said("untie","straitjacket")) &&
     !inmate2) {
          print("Hmm, it's a complicated knot, and according to the label, it's been treated with pest-repellent, so even a purple slime eater wouldn't be able to tolerate the taste.");
          print("If only you had something caustic and fizzy.");
          }

if ((said("put","vile chug","on","straitjacket") ||
     said("use","vile chug","on","straitjacket") ||
     said("pour","vile chug","on","straitjacket") ||
     said("put","vile chug","straitjacket") ||
     said("use","vile chug","straitjacket") ||
     said("pour","vile chug","straitjacket"))) {
       distance(o1, ego, range);
       if (range <= 10) {
         if(has("vile chug")) {
            print("The vile chug dissolves the inmate's bonds.");
            drop("vile chug");
            set(inmate2);
            escaped++;
            print("\"Hey, thanks!  I can't believe I used to drink that stuff!\"");
            set.view(o1,120);
            move.obj(o1,74,120,1,done_flag);
            }
         else {
            print("Oh, would that you had one.");
            }
         }
      else {
         print("It's okay to get close to the inmate.  They're people, too.");
         }
     }
}

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



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


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

call(205);
return();