// ****************************************************************************
//
// Logic 9: Plateau's Peak
//
// ****************************************************************************

#include "defines.txt"

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

if (!has("cauldron") &&
    !cauldron_on_stove){
  animate.obj(o2);
  load.view(cauldron);
  set.view(o2,cauldron);
  position(o2,69,112);
  draw(o2);
  }

if (prev_room_no == 8) {
   position(ego,12,140);
 }

  draw(ego);
  show.pic();

  load.sound(7);
  sound(7,sound_flag);
}

distance(ego,o2,range);

if ((said("look") ||
     said("look","plateau"))) {
  print("The top of the plateau looks out on the canopy below, the stream which comes out of the mouth of a cave.");
  print("You can also see the waterfall which is rumored to hide a secret cave.  At the edge of the gulf is the main village.  Above you is a beautiful rainbow.");
  if(!has("cauldron") &&
     !cauldron_on_stove) {
     print("A cauldron is sitting on the plateau.");
     }
}

if (said("look","cauldron")) {
    if (has("cauldron")) {
        show.obj(cauldron);
        }
    else {
        print("It's your missing cauldron, just sitting by itself.  I wonder how it got up here?!");
        }
    }

if (said("look","rainbow")) {
    print("Now isn't that pretty!  According to Voodoo lore, there are two worlds:  The Serpent, which can be thought of as Earth, and The Rainbow, which can be thought of as Heaven.");
    }

if (said("look","ground")) {
    print("Yup, good, solid earth.  According to Voodoo lore, there are two worlds:  The Serpent, which can be thought of as Earth, and The Rainbow, which can be thought of as Heaven.");
    }

if (said("look","cloud")) {
    print("They are fat and grayish white.");
    }

if (said("look","cliff")) {
    print("It's a pretty gentle slope from the top of the plateau.");
    }

if (said("take","cauldron")) {
    if (range<=20) {
        if (!has("cauldron") &&
            !cauldron_on_stove){
            erase(o2);
            get("cauldron");
            print("You recover your cauldron and place it somewhere in your enormous pants.");
            score++;
            }
        else {
            print("You can't take it if you already have it, now can you?");
            }
    }
    else {
        print("Your arms aren't long enough.");
        }
    }

if ((said("throw","mangy doll","plateau") ||
     said("throw","doll","plateau") ||
     said("drop","mangy doll","plateau") ||
     said("drop","doll","plateau"))) {

          print("Nah, the grade is too smooth to do any harm.");

          }

if (ego_edge_code == bottom_edge) {   // ego touching bottom edge of screen
  new.room(204);
}

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

return();