// ****************************************************************************
//
// Logic 11: River cave mouth
//
// ****************************************************************************

#include "defines.txt"

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

  // The next 6 lines need only be in the first room of the game
  /*if ((prev_room_no == 1 ||    // just come from intro screen
      prev_room_no == 0)) {    // or just started game
    position(ego,120,140);
    status.line.on();
    accept.input();
  }*/

// 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);      //butterfly1
  load.view(15);
  set.view(o1,15);
  ignore.objs(o1);
  position (o1, 70,109);
  wander(o1);
  draw(o1);

  animate.obj(o2);       //butterfly2
  load.view(15);
  set.view(o2,15);
  ignore.objs(o2);
  position (o2, 80,80);
  wander(o2);
  draw(o2);

  animate.obj(o3);     //Lord of the Dance
  load.view(5);
  set.view(o3,5);
  position(o3,70,100);
  universe=2;
  cycle.time(o3, universe);
  draw(o3);

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

  show.pic();

  if (prev_room_no == 204){
     position(ego, 115,125);
     print("Fortunately, the current carries you out of the cave to safety.");
     }

  else {
     position(ego,74,160);
     }

  draw(ego);
}

if (said("look")) {
  print("This is where the river emerges from the cave mouth.  You see a bush and a stone.");
}

if (said("look","stone")) {
    print("Yes...  a stone.");
    }

if ((said("look","bush") ||
     said("look","tree"))) {
    if (obj.in.box(o0,35,70,60,90) &&
        !has("handle")) {
    print("You see an ordinary bush.");
    }
    else {
      print("You can't see much from here.");
      }
    }

if (said("look","moss")) {
    print("That's a bunch of regular, non-medicinal moss.");
    }

if (said("look","river")) {
    print("You see how the source of this clear, clean water is the side of that cliff.  Must be some caves under there.");
    }

if ((said("look","cliff") ||
     said("look","wall"))) {
   print("The imposing cliffs cordon off this area.");
   }



if ((said("look","man") ||
     said("look","loa"))) {
    print("He seems to be some sort of dancing loa from the mid-70's.");
    print("His name is supposed to be Horshack or Travolta or something.");
    }

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

if ((said("talk","man") ||
     said("talk","loa") ||
     said("dance"))) { //talk to dancing god
   new.room(30);
   }



return();