/// ****************************************************************************
//
// Logic 27: Fishing hole
//
// ****************************************************************************

#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 == 28) {
   position(ego,102,43);
   ego_dir = 0;
   set.loop(ego, 0);
 }

  if ((has("blowfish") ||
       has("blowfish venom"))) {
         animate.obj(o2); //Agwe
         load.view(27);
         set.view(o2, 27);
         position(o2, 130, 72);
         draw(o2);
         }

  index = 0;       

  load.sound(10);
  sound(10, sound_flag);
  accept.input();
  draw(ego);
  show.pic();
}

 if (mode==blowfish) {
       mode=baited;
       new.room(204);
       }

if (said("look")) {
  print("This is the local fishing inlet.");
}

if(said("look","shells")){
   print("The north part of the beach is covered with gracefully scintillating shells...");
   print("Which are razor sharp!");
   }

if(said("look","rock")){
   print("Giant cartoon boulders block your way to the south.");
   }

if(said("look","dock")){
   print("A sturdy wooden dock.  It's probably a good place to \"fish\".");
   }

if(said("look","beach")){
   print("If you plan on tanning, make sure to wear SPF 666 sunblock.");
   }

if((said("look","water") ||
    said("swim") ||
    said("swim","rol") ||
    said("jump") ||
    said("jump","rol"))){
   print("I wouldn't plan on going swimming if I were you.  Bonefish, Stingerfish, and Blowfish populate these waters.");
   }

if ((said("look","man") ||
     said("look","loa") ||
     said("look","agwe"))) {
          print("You see a man wearing military uniform standing hip deep in the water.  All the fish swarm about him, but he is unharmed.");
          }

if ((said("talk","man") ||
     said("talk","loa") ||
     said("talk","agwe"))) {
        if ((has("blowfish") ||
             has("blowfish venom"))) {
          if (new_ego_x > 80) {
              if (index == 3) {
                  index = 0;
                  }
              if (index == 0) {
                  print("VG: \"Hi, I'm Voodoo Girl.\"");
                  print("AG: \"Little girl!!!  Do you know the penalty for trespassing into Lord Agwe's domain and poaching his fish?!\"");
                  print("VG: <teeth chattering> \"N-n-no.\"");
                  print("AG: \"Lord Agwe, the protector and lord of the ocean, the sea, the river, the lake, lord of all water!!!\"");
                  print("VG: \"Eep!\"");
                  print("AG: \"HAHAHAHAHAHAHA, I'm just kidding, little one.  Did you have a good day fishing?\"");
                  }
              if (index == 1) {
                  print("VG: \"Mama Hoodoo sent me for some blowfish venom.\"");
                  print("AG: \"Ah, good.  I'd keep that fishing pole, though.  You may need it later.\"");
                  }
              if (index == 2) {
                  print("VG: \"You Voodoo gods are popping up all over Voodoo Island!\"");
                  print("AG: \"Gods?!  We are not gods...  we are loa.\"");
                  print("VG: \"Isn't that the same thing?\"");
                  print("AG: \"No, it is not!  Loa are the embodiment of certain forces and human traits.\"");
                  print("VG: \"So there's no god in the Voodoo religion?\"");
                  print("AG: \"No, there is one, and he is named Bondye.\"");
                  }

              index++;
              }
          else {
             print("\"Come closer, little girl!!!  Pay Agwe his respect!\"");
             }
            }
          else {
            print("There is no one here with whom to speak.");
            }
          }

if (said("get","shell")) {
    print("It would be unwise to handle those without kevlar gloves.");
    }

if ((said("squeeze","fish") ||
     said("juice","fish") ||
     said("cut","fish"))) {
         print("OUCH!  If you want anything from inside this fish, you'd best take it to a professional.");
         }

if (ego_touching_signal_line) {  // ego touching shells
  print("The north part of the beach is covered with gracefully scintillating shells...");
  print("Which are razor sharp!");
  print("OUCH!!");
  program.control();
  move.obj(ego,80,80,3,done_flag);
}

if ((said("fish") ||
     said("use","fishing pole"))) {
     if (obj.in.box(ego,76,40,120,50)) {
         if (has("fishing rod")) {
             animate.obj(o1);
             load.view(22);
             set.view(o1,22);
             set.priority(o1,15);
             position.v(o1,new_ego_x,new_ego_y);
             set.cel(o1,0);
             erase(ego);
             draw(o1);
             end.of.loop(o1,penultimate_done_flag);
             }
         else {print("You need a fishing pole first.");
             }
         }
     else {
         print("Did you take a sharp knock to the head as a child?  You have to get closer.");
         }
 }

if (penultimate_done_flag) {
    reset(penultimate_done_flag);
    observe.blocks(ego);
    player.control();
    new.room(28);
    }

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

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

return();