// ****************************************************************************
//
// Logic 85:  First Meeting the Dream King
//
// ****************************************************************************

#include "defines.txt"

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

  position(ego,25,106);
  set.loop(ego,0);
  set.cel(ego,5);
  ego_dir = 0;
  program.control();


  animate.obj(o1); //Dream King
  load.view(123);
  set.view(o1,123);
  position(o1,83,109);
  set.loop(o1,1);
  draw(o1);

  animate.obj(o2); //Golden Cauldron
  load.view(gold_cauldron);
  set.view(o2, gold_cauldron);
  position(o2, 60,80);
  set.loop(o2, 0);


  draw(ego);
  show.pic();

  reset(done_flag);
  reset(more_done_flag);
  reset(penultimate_done_flag);
  index = 1;
  temp_x = 15;
  temp_y = 5;
  universe = 30;

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

}

//Dream King speaks
if (index == 1) {
   print.at(m1, 15, 5, 30);
   index++;
   }

if (index == 2) {
    print.at(m2, 15, 5, 30);
    index++;
    }

if (index == 3) {
    print.at(m3, 15, 5, 30);
    index++;
    }

if (index == 4) {
    print.at(m4, 15, 5, 30);
    index++;
    }

if (index == 5) {
    draw(o2);
    print.at(m5, 15, 5, 30);
    index++;
    }

if (index == 6) {
    print.at(m6, 15, 5, 30);
    index++;
    }


    //Golden Cauldron is shattered and scattered

if (index == 7) {
    print.at(m7, 15, 5, 30);
    set.loop(o2, 1);
    end.of.loop(o2, done_flag);
    index++;
    }

if (index == 8 &&
    done_flag) {
       print.at(m8, 15, 5, 30);
       index++;
       }

if (index == 9) {
    print.at(m9, 15, 5, 30);
    index++;
    }

if (index == 10) {
    print.at(m10, 15, 5, 30);
    index++;

    }

//Dream King casts you back to Earth!
if (index == 11) {
    print.at(m11, 15, 5, 30);
    set(shattered);

    new.room(204);
    }


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

return();

#message 1 "Dream King: \"Who are you who invades my inner sanctum?\""
#message 2 "VG: \"You stole this kingdom from Erzulie!  None of this belongs to you!\""
#message 3 "DK: \"What you say may be true, but it is MY kingdom now...  and you are a trespasser!\""
#message 4 "VG: \"I came to claim the Golden Cauldron from you.\""
#message 5 "DK: \"What?!  You want my Golden Cauldron?!\""
#message 6 "VG: \"That's right, tall, dark, and foggy!\""
#message 7 "DK: \"I won't let you have it!  If I can't have it, no one can!!!\""
#message 8 "VG: \"AAAAAUUUGGHHH!!!\""
#message 9 "DK: \"Go back to your Voodoo Island and harrass me no more!\""
#message 10 "VG: \"If I find that cauldron, you'll be sorry!\""
#message 11 "DK: \"No, child, you will!\""