// ****************************************************************************
//
// Logic 23: Church sanctuary
//
// ****************************************************************************

#include "defines.txt"
#define man o1

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



  if (prev_room_no == 24) {
   position(ego,77,163);
  }

  load.view(2);
  set.view(ego,2);
  set(f16);

  draw(ego);
  show.pic();

  animate.obj(man);
  load.view(39);
  set.view(man,39);
  set.loop(man,0);
  position(man,86,59);
  stop.cycling(man);
  draw(man);

}

if ((said("look","water") || said("look","vat") || said("look","sink") || said("look","holy water") || said("look","fountain"))) {
  if (posn(ego,83,66,106,77)) {
    print("The holy font contains sacred healing water, blessed by the priest.");
  }
  else {
    print("You can't see it from here.");
  }
}

if ((said("drink","water") || said("drink","pot") || said("drink","holy water") || said("drink","sink") || said("drink","fountain"))) {
  if (posn(ego,83,66,106,77)) {
    print("As you swallow a mouthful of the water, you feel your health being restored.");
    health = max_health;
  }
  else {
    print("You're not close enough.");
  }
}

if ((said("fill","flask","water") || said("put","water","flask") || said("fill","flask","sink") ||
     said("fill","flask","elixir") || said("fill","flask","fountain") || said("put","elixir","flask") ||
     said("put","sink","flask") || said("take","elixir","flask") || said("take","water","flask") ||
     said("put","fountain","flask") || said("fill","flask","pot"))) {
  if (has("empty flask")) {
    if (posn(ego,83,66,106,77)) {
      print("You dip the flask into the font, filling it with healing elixir.");
      drop("empty flask"); get("sacred elixir");
    }
    else {
      print("You're not close enough.");
    }
  }
  else {
    if (has("sacred elixir")) {
      print("The flask already contains holy water.");
    }
    else {
      print("You don't have it.");
    }
  }
}

if ((said("take","water") || said("take","elixir") || said("take","sink") || said("take","fountain"))) {
  print("You need something to carry it in.");
}

if (said("look","priest")) {
  print("Father McCullen looks very grim.");
}

if ((said("talk","priest") || said("talk","person"))) {
  if (posn(ego,75,58,102,66)) {
    v255 = 23;
    if (obj.in.room("sacred elixir",v255)) {
      print("'Take this elixir.  It will heal you in your time of desperation,' he says, handing you a flask.");
      score++;
      get("sacred elixir"); v255 = 0; put("empty flask",v255);
    }
    print("'Come here to restore your health completely by drinking the holy water.'");
    print("You say to him, 'What do you make of the returning dead in this town, Father?'");
    print("He replies, 'It is most troubling, but what is even more troubling is how little attention the townspeople pay to this evil.'");
    print("'They ignore it.  These are dark times, John Mordred.  Dark times indeed.'");
    print("'I will have more to say in the full version of this game,' says the priest with a grin.");
  }
  else {
    print("You're not close enough.");
  }
}

if (said("look","pulpit")) {
  print("From that pulpit, the priest speaks his sermons to an empty church.");
  print("Well, not as empty as it is now... it's not Sunday.");
}

if (said("look","pew")) {
  print("The pews are empty.");
}

if (said("sit","rol")) {
  print("No time for praying.  It's time for action.");
}

if (said("look","door")) {
  print("There are two side doorways in the sanctuary.  In the full game, they will lead to the inner hallways of the church.");
}

if (said("look","cross")) {
  print("A large wooden cross looks over the sanctuary.");
}

if (said("look","piano")) {
  print("A large organ is in the back of the sanctuary.");
}

if (said("use","piano")) {
  print("You used to be quite the piano player in your younger days, but a tragic accident at a recital broke your hands, and your playing has never been the same since.");
}

if ((said("look") || said("look","church") || said("look","room"))) {
  print("You are in the large church sanctuary.  The priest stands at the back near his pulpit and a font full of liquid.");
}

if (f3) {
  new.room(24);
}

//if (ego_edge_code == right_edge) {
//  new.room(2);
//}

//if (ego_edge_code == left_edge) {
//  new.room(2);
//}

return();