// ****************************************************************************
//
// Logic 61: Phobic Phil'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==58) {
   position(ego,70,58);
   ego_dir=0;
   }

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

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

if (prev_room_no == 101) {
    if (phil_chat>56 &&
        phil_chat<65) {
           print("Phil: \"Thank you, Voodoo Girl.  I feel I can now face the outside world.\"");
           set(inmate3);
           escaped++;
           set.view(o1,120);
           move.obj(o1,70,62,1,more_done_flag);
           }
    else {
           print("Phil: \"Well, that just didn't help at all!\"");
           phil_chat=0;
           }
    }

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

  reset(done_flag);

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

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

if (said("look")) {
  print("You are in one of those padded rooms.");
  if (!inmate3) {
      print("There's a grinning madman here.");
      }
}

if (said("look","man")) {
    if (!inmate3) {
        print("He looks terrified!");
        }
    else {
        print("He's not here.");
        }
    }

if (said("look","jacket")) {
    if (!inmate3) {
        print("That's odd.  His straitjacket isn't even clasped shut.");
        }
    else {
        print("Nobody's home.");
        }
     }

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



if (said("talk","man")) {
    print("Inmate: \"Hi, I'm Phil...  Nursie calls me Phobic Phil...  I'm afraid of everything!!\"");
    print("VG: \"Oh, come on.  You're not afraid of me, are you?\"");
    print("Inmate: \"I guess not...  although I'm afraid of your gigantic raver pants...  but that's okay.\"");
    print("Inmate: \"Would you mind talking for a little while.  I'm afraid of loneliness!\"");
    get.string(s1,m9,20,10,1);
    set.string(s2,m10);
        if (compare.strings(s1,s2)) {
            print("Inmate: \"Wow, really?  Thanks!\"");
            phil_chat = 1;
            new.room(101);
            }
        else {
            print("Inmate: \">Sniff<  You're just like everyone else.\"");
            new.room(58);
            }
    }

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

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

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


call(205);
return();

#message 9 "y/n: "
#message 10 "y"