// ****************************************************************************
//
// Logic 24: Church office
//
// ****************************************************************************

#include "defines.txt"
#define door o1
#define woman o2

if (new_room) {
  load.pic(room_no);
  draw.pic(room_no);
  discard.pic(room_no);
  set.horizon(10);

  if (prev_room_no == 4) {
    position(ego,77,126);
  }

  if (prev_room_no == 23) {
    position(ego,88,81);
    reset(f16);
    load.view(0);
    set.view(ego,0);
  }

  draw(ego);
  show.pic();

  animate.obj(door);
  load.view(38);
  set.view(door,38);
  set.loop(door,6);
  stop.cycling(door);
  position(door,86,80);
  draw(door);

  animate.obj(woman);
  load.view(39);
  set.view(woman,39);
  set.loop(woman,1);
  stop.cycling(woman);
  position(woman,55,83);
  draw(woman);

}

if (f244) {
  set.cel(door,1);
  ignore.objs(door);
}
else {
  set.cel(door,0);
  observe.objs(door);
}

if (said("open","door")) {
  if (posn(ego,79,81,101,87)) {
    toggle(f244);
  }
  else {
    print("You're not close enough.");
  }
}

if ((said("look") || said("look","house") || said("look","room"))) {
  print("You are in the church's front office.");
}

if (said("look","desk")) {
  print("There is a computer, a phone, and a lamp on the desk.");
}

if ((said("look","woman") || said("look","person"))) {
  print("It's the church secretary.  She answers the phone and such.");
}

if (said("read","calendar")) {
  print("You've no interest in the church's events.");
}

if (said("look","painting")) {
  print("The painting is of heavenly light shining upon Golgotha, the scene of the Crucifixion.");
}

if (said("look","computer")) {
  print("You've no interest in the affairs of church secretaries.");
}

if (said("look","lamp")) {
  print("Luminescent.");
}

if ((said("use","phone") || said("get","phone") || said("dial","phone"))) {
  print("The secretary doesn't want you using her phone.");
}

if (said("look","phone")) {
  print("It's an ordinary phone.");
}

if (said("open","drawer")) {
  print("You can't snoop in the church's files.");
}

if (said("look","carpet")) {
  print("Soft.");
}

if ((said("talk","lady") || said("talk","person"))) {
  print("'Don't bother me.  I'm working.  If you need someone to bother, Father McCullen is in the sanctuary.  He's never busy.'");
}

if (f3) {
  if (v31 > 120) {
    new.room(4);
  }
  else {
    new.room(23);
  }
}

return();