// ****************************************************************************
//
// Logic 3: Outside Mama Hoodoo's
//
// ****************************************************************************

#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 == 2) {
   position(ego,80,162);
 }

 if (prev_room_no == 4) {
   position(ego,41,122);
   }
  animate.obj(o1);
  load.view(15);
  set.view(o1,15);
  ignore.objs(o1);
  position (o1, 70,109);
  wander(o1);
  draw(o1);

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

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

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

if (said("look")) {
  print("Cliffs rise to the north.  The forest spreads like a blanket to the south.  Mama Hoodoo's hut squats near a bush.");
}

if ((said("look","bush") ||
     said("look","tree"))) {
   print("This bush is covered in glistening, red berries.");
   }

if ((said("look","poison berries") ||
     said("examine","poison berries"))) {
   if (!has("poison berries")) {
      print("Ah, these are poison berries.");
      }
   else {
      show.obj(poison_berries_);
      }
   }

if (said("look","hut")) {
    print("Mama Hoodoo has a nice hut for her salary.  She must know the realty market rather well.  The door is open; go on in.");
    }

if (said("look","rock")) {
    print("This rock looks like it was placed here to offset some bad picture resource plotting.");
    }

if (said("look","path")) {
    print("A footworn path goes east, west, and south.");
    }

if (said("look","cliffs")) {
    print("The cyclopean cliffs tower high above, daring the foolish mortals to throw their lives away scaling them.");
    }

if (said("look","forest")) {
    print("The song of the forest is sad and low.  Green leaves and brown bark wrap around the island you call home.");
    }

if (said("look","north")) {
    print("To the north are unscalable cliffs.  Most people just use the western trail instead of scaling them.");
    }

if (said("look","south")) {
    print("Why, that's back home where you started.");
    }

if (said("look","west")) {
    print("To the west are the cliffs that promise instant, perilous death and the trail to the top of the plateau.");
    }

if (said("look","east")) {
    print("To the east is Swampy's Checkpoint.  He's probably still mad about you casting that spell to shrink his loincloth.  You'd better bring him something to calm him down.");
    }


if (said("take","poison berries")){
  if (obj.in.box(ego,70, 90, 105, 108)){
   if (poison_berries<2) {
      print("You carefully pick the ripest berries.");
      poison_berries+=1;
      }
   else {
      print("You're worried that if you keep too many berries in your pocket, they will squish all over and leave a highly toxic stain.");
      }
   }
 else {
     print("Your arms are too short.");
     }
   }

if (said("take","rock")) {
    print("It is far too huge.");
    }

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

if (ego_touching_signal_line) {  // ego in Mama's door
  new.room(4);
  }

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

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

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

return();