// ****************************************************************************
//
// Logic 20: Waterfall Base
//
// ****************************************************************************

#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 == 19) {
   position(ego,12,140);
 }
  animate.obj(o1);        //Foam
  animate.obj(o2);
  animate.obj(o3);
  animate.obj(o4);
  animate.obj(o5);
  animate.obj(o6);
  load.view(16);
  set.view(o1,16);
  set.view(o2,16);
  set.view(o3,16);
  set.view(o4,16);
  set.view(o5,16);
  set.view(o6,16);
  position(o1,65,140);
  position(o2,75,140);
  position(o3,85,140);
  position(o4,65,135);
  position(o5,75,135);
  position(o6,85,135);
  set.cel(o2,4);
  set.cel(o4,4);
  set.cel(o6,4);
  draw(o1);
  draw(o2);
  draw(o3);
  draw(o4);
  draw(o5);
  draw(o6);

   random(0,6,temp_x);
  if (temp_x==0 &&
      !has("eye of newt")) {
      animate.obj(o9);
      load.view(19);
      set.view(o9,19);
      position(o9,78,151);
        ignore.objs(o9);
      set.priority(o9,4);
      draw(o9);
      }

  animate.obj(o10); //Erzulie
  load.view(18);
  set.view(o10, 18);
  position(o10, 30, 140);
  draw(o10);

  index = 0;

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

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

if (said("look")) {
   print("This is the base of the waterfall.  The air is filled with a refreshing mist.");
   if (!has("eye of newt") &&
       temp_x == 0) {
          print("Awww, a little newt is sunning himself on a rock.");
          }
  }

if (said("look","waterfall")) {
    print("This is the base.  The rest of the waterfall stretches up to nearly the top of the plateau.");
    }

if (said("look","rocks")) {
    print("Some smooth white stones can be used to step across right here.");
    if (!has("eye of newt") &&
        temp_x == 0) {
        print("A little, bitty newt is sitting here.");
        }
    }

if (said("look","newt")) {
    if (temp_x==0 &&
        !has("eye of newt")) {
       print("He's sunning himself on that little patch of rock.");
       }
    else {
       if (has("eye of newt")) {
           show.obj(eye_newt);
           }
       else {
           print("You see no newt here.");
           }
       }
   }

if (said("look","water")) {
    print("In addition to the waterfall, there is the churning pool, and the river continuing to the south.");
    }

if ((said("look","flower") ||
     said("get","flower"))) {
    print("They're pretty, but you don't really want any.");
    }

if (said("look","spray")) {
    print("It kind of tickles.");
    }

if ((said("look","woman") ||
     said("look","loa") ||
     said("look","erzulie"))) {
    print("Wow!  She's beautiful!  Although she's smiling, you can feel a sadness inside her.");
    }

if ((said("talk","woman") ||
     said("talk","loa") ||
     said("talk","erzulie"))) {
  if (obj.in.box(ego, 13,133, 63,163)) {
   if (index == 3) {
        index = 0;
        }
    if (index == 0) {
        print("VG: \"Hello, I'm Voodoo Girl.  What's your name?\"");
        print("ER: \"I am Erzulie, the loa of dream and emotion.\"");
        print("VG: \"Um...  you don't say!\"");
        }
    if (index == 1) {
        print("VG: \"You seem a little sad.  Is there anything wrong?\"");
        print("ER: \"You've heard of this Dream King fellow, haven't you?\"");
        print("VG: \"Oh, yeah, I'm supposed to go the Dream World and bring back the Golden Cauldron.\"");
        print("ER: \"Well, you see, I'm supposed to be in charge of dreams around here.  That wicked thing broke into my Dream World, smashed through the portcullis, and used the power of that Golden Cauldron to banish me from my home.\"");
        print("VG: \"Eep!\"");
        }
    if (index == 2) {
        print("ER: \"Don't worry, little dear.  Evil is a thing that lives in the universe.  Duality is a part of Voodoo.\"");
        print("VG: \"Du-what?!\"");
        print("ER: \"Well, for every peaceful loa, the Rada loa, there is an angry loa, the Petro loa.\"");
        print("VG: \"Wow, really?!\"");
        print("ER: \"Something like that...\"");
        }

    index++;
     }
    else {
       print("Erzulie: \"My ears are far too delicate for all that shouting.  Come closer, my child.\"");
       }
    }
if ((said("drink","water") ||
     said("get","water"))) {
    print("Nah, you keep a little refillable bottle of charcoal-purified water exclusively for your drinking purposes.");
    }

if (said("get","newt")) {
    distance(o9,ego, universe);
    if (universe<=10) {
        print("You ravage the little beastie, munch on him, and save an eye for later.");
        get("eye of newt");
        new.room(20);
        }
    else {
        print("Summertime daylight...");
        print("You should know by now, my friend...");
        print("Your arms are too short.");
        }
    }



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

if (ego_edge_code == left_edge) {     // ego touching left edge of screen
  new.room(19);
}

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

return();