// ****************************************************************************
//
// Logic 16: Just a trail
//
// ****************************************************************************

#include "defines.txt"

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

  reset(done_flag);
  reset(more_done_flag);

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

  draw(ego);
  show.pic();

}

if (said("look")) {
  print("This trail wraps down towards the midst of the waterfall.  There are some trees growing alongside.");
}

if (shattered) {
    if (said("look","tree")) {
        if (golden_caul == 0) {
            print("No, you ain't cheating, kid.");
            return();
            }
        if (golden_caul == 1) {
            print("You see the glint of something golden in the tree.  But you can't leave the trail to get it.");
            }
        else {
            print("You already got that piece.");
            }
        }
    if (said("use","fishing rod")) {
         if (golden_caul == 1) {
            print("That's so crazy...  it just might work.");
            move.obj(ego,66,85,2,done_flag);
            }
         else {
            print("You've already fished this tree dry.");
            }
         }

    if (done_flag) {
        reset(done_flag);

        animate.obj(o1);
        load.view(22);
        set.view(o1,22);
        set.cel(o1,0);
        set.priority(o1,15);
        position.v(o1,new_ego_x,new_ego_y);
        erase(ego);
        draw(o1);

        end.of.loop(o1,more_done_flag);

        }

    if (more_done_flag) {
        reset(more_done_flag);

        print("The hook has snagged on something!");
        print("It's a piece of the Golden Cauldron!");
        golden_caul++;
        score+=1;
        erase(o1);
        draw(ego);
        }

    }

if (said("look","path")) {
    print("It curves from north to west.");
    }

if (said("look","cliff")) {
    print("The protean forms of the rock seem to emulate organic forms.");
    }

if (ego_edge_code == horizon_edge) {  // ego touching horizon
  new.room(12);
}


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

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

return();