// ****************************************************************************
//
// Logic 45: Inside the Gates to the Castle
//
// ****************************************************************************

#include "defines.txt"

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



// Check what room the player came from and position them on the
// screen accordingly here, e.g:
 if (prev_room_no == 44) {
     position(ego,44,72);
     ego_dir = 5;
 }
  load.view(0);
  load.view(2);
  load.view(103);
  load.view(129);

  animate.obj(o1); //vases
  animate.obj(o2);
  load.view(112);
  set.view(o1,112);
  set.view(o2,112);
  position(o1, 128,97);
  position(o2, 93,43);
  draw(o1);
  draw(o2);

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

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

if (said("look")) {
  print("You are inside the gate to the castle.");
}

if (said("look","gate")) {
   print("You have conquered the gate, and now have access to the castle proper.");
   }

if (said("look","hole")) {
    print("Just look at that hole!  I hope no gigantic rats are scurrying around in here!");
    }

if ((said("look","ladder") ||
     said("climb","ladder"))) {
          print("It looks sturdy enough.  Just push up or down when you're centered on the ladder to climb.");
          }

if ((said("look","statue") ||
     said("push","statue") ||
     said("get","statue"))) {
          print("There are some creepy statues here, and as much as you'd like them out of the way, they are firmly cemented to the floor.");
          }

if (said("jump")) {
    print("This is a non-jumping game.");
    }



if (ego_on_water) {
    if (is_zombie) {
        set.view(ego,129);
        }
    else {
        set.view(ego,2);
        }
    }
else {
    if (is_zombie) {
        set.view(ego, 103);
        }
    else {
        set.view(ego,0);
        }
   }

if (ego_touching_signal_line) {  // ego touching horizon
  new.room(44);
}

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

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

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

return();