// ****************************************************************************
//
// Logic 26:  The Graveyard
//
// ****************************************************************************

#include "defines.txt"

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


// Check what room the player came from and position them on the
// screen accordingly here, e.g:
// if (prev_room_no == 5) {
//   position(ego,12,140);
// }

  animate.obj(o1);
  load.view(6);
  set.view(o1,6);
  position(o1,36,75);
  draw(o1);

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

  index = 0;

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

if (said("look")) {
  print("This is the graveyard, Baron Samedi's realm.");
}

if ((said("talk","man") ||
     said("talk","baron samedi"))) {
     if (obj.in.box(ego,26,46,65,95)) {
         print("Hello, Voodoo Girl.");
     if (!has("yellow grave mold")) {
         print("Baron: \"Help yourself to whatever you need.\"");
         }
     if (!has("dream brew")) {
         print("Baron: \"You'll need to make a dream brew if you want to go to the Dream World.\"");
         print("Baron: \"The Dream King has the Golden Cauldron that Mama Houngan needs.\"");
         print("VG: \"That's great, but she doesn't know how to make a Dream Brew.\"");
         print("Baron: \"Oh, really!  I think you need some sleep moss, and...  some other stuff.\"");
         }
     if ((has("voodoo doll") ||
          has("mangy doll"))) {
          print("Y'know, that cliff just west of Mama Houngan's is just great for getting rid of annoying pests.");
          }
     if (index == 2) {
         index = 0;
         }
     if (index == 0) {
         print("Baron: \"May Damballah bless your good work, Voodoo Girl.\"");
         print("VG: \"Damballah?\"");
         print("Baron: \"Yes, he is the wise snake, a very old loa.  Very good and very powerful.\"");
         }
     if (index == 1) {
         print("Baron: \"Ah, yes, the concert last night was incredible.  Music is very important to the loa, and to Voodoo.\"");
         }
         index++;
         }
     else {
        print("I AM BARON SAMEDI!!!");
        print("I am Lord of the Dead!");
        print("Unfortunately, I went to see the Black Sabbath reunion show last night, and my ears are still ringing!");
     }
  }

if ((said("look","man") ||
     said("look","baron samedi"))) {
     print("This is Baron Samedi, Lord of the Graveyards.");
     print("Do NOT mess with him, because he's one bad...");
     print("Shut yo' mouth.");
     print("I'm just talkin' about Baron Samedi.");
     }

if (said("look","grave")) {
    if (obj.in.box(ego,65,62,80,71)) {
        print("Francois \"Papa Doc\" Duvalier, Born 1907, Died 1971");
        return();
        }
    if (obj.in.box(ego,86,60,102,71)) {
        print("Jean-Claude \"Baby Doc\" Duvalier, Born 1951, Dead...  not yet");
        return();
        }
    if (obj.in.box(ego,107,60,126,71)) {
        print("Marie Laveau, Born 1794, Died 1881");
        return();
        }
    if (obj.in.box(ego,21,96,39,108)) {
        print("Some other guy");
        return();
        }
    if (obj.in.box(ego,43,96,59,108)) {
        print("His brother");
        return();
        }
    if (obj.in.box(ego,64,96,82,108)) {
        print("His sister");
        return();
        }
    if (obj.in.box(ego,88,96,106,108)) {
        print("His cousin Lupe");
        return();
        }
    if (obj.in.box(ego,113,96,129,108)) {
        print("Lupe's dentist's sister's cousin's brother.");
        return();
        }
    if (obj.in.box(ego,17,132,34,141)) {
        print("The engravings on this tombstone are obscured by some yellow mold.");
        return();
        }
    if (obj.in.box(ego,42,132,59,141)) {
        print("That other guy...  you know.");
        return();
        }
    if (obj.in.box(ego,65,132,83,141)) {
        print("Some dude.");
        return();
        }
    if (obj.in.box(ego,83,132,107,141)) {
        print("Some random stranger");
        return();
        }
    if (obj.in.box(ego,114,132,136,141)) {
        print("Innocent bystander");
        return();
        }
    print("You are too far away to see the inscriptions.");
   }

if (said("look","mold")) {
    if (!has("yellow grave mold")) {
        print("It looks like yellow chiffon on head cheese with acid sauce.");
        print("Yum!");
        }
    else {
        show.obj(yellow_grave);
        }
    }

if (said("look","trees")) {
    print("These are Joshua trees, reputed to grow only near graveyards.");
    }

if ((said("get","yellow grave mold") ||
     said("remove","yellow grave mold"))) {
   if (!has("yellow grave mold")) {
    if (obj.in.box(ego,12,131,30,135)) {
        get("yellow grave mold");
        print("Got yellow grave mold.");
        score++;
    }
    else {
        print("Your arms are too short!");
        }
      }
    else {
       print("You already have plenty.  Leave some for others.");
       }
    }

if (ego_edge_code == right_edge) {    // ego touching right edge of screen
  new.room(25);
}


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

return();