// ****************************************************************************
//
// Logic 244: Preface
//
// ****************************************************************************

#include "defines.txt"
#define bbq o1
#define woman o2
#define girl o3
#define ghoul o4

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

  show.pic();

  animate.obj(bbq);
  load.view(21);
  set.view(bbq,21);
  set.loop(bbq,0);
  set.cel(bbq,0);
  v255 = 4; cycle.time(bbq,v255);
  start.cycling(bbq);
  ignore.objs(bbq);
  position(bbq,75,128);
  draw(bbq);

  animate.obj(woman);
  load.view(23);
  set.view(woman,23);
  set.loop(woman,0);
  ignore.objs(woman);
  position(woman,31,137);
  draw(woman);

  animate.obj(girl);
  set.view(girl,23);
  set.loop(girl,1);
  set.cel(girl,0);
  v254 = 2;
  cycle.time(girl,v254);
  start.cycling(girl);
  ignore.objs(girl);
  position(girl,57,109);
  draw(girl);

  animate.obj(ghoul);
  load.view(22);
  set.view(ghoul,22);
  set.loop(ghoul,1);
  cycle.time(ghoul,v255);
  stop.cycling(ghoul);
  ignore.objs(ghoul);
  position(ghoul,152,152);

  load.sound(4);
  sound(4,f255);
  reset(f254);
  reset(f252);
  reset(f251);

  v254 = 2;
  v253 = 200;
  v252 = 3;

  disable.item(menu_about);
  disable.item(menu_help);
  disable.item(menu_save);
  disable.item(menu_seeobject);
  disable.item(menu_joystick);
  disable.item(menu_status);
  disable.item(menu_inventory);

}

if (v253 > 0) {
  v253--;
}

if (have.key()) {
  if (v254 == 1) {
    v254 = 0;
  }
  else {
    if (v254 == 2) {
      v254 = 1;
    }
  }

}

if (v253 == 70) {
  v254 = 1; v21 = 10;
  print.at("It's another pleasant Sunday afternoon, and the Fergusons are having a barbecue in the backyard.",2,3,35);
  v21 = 8;
  print.at("It's been a year since young Johnny went off to war.",2,3,35); v21 = 8;
  print.at("A year since he came home in a box.",2,3,35); v21 = 8;
  print.at("They try to move on, but they can't.",2,3,35); v21 = 8;
  print.at("These family barbecues just aren't the same since Johnny died.",2,3,35);
}

if (f255) {
  load.sound(2);
  sound(2,f254);
  reset(f255);
  draw(ghoul);
  start.cycling(ghoul); step.time(ghoul,v252);
  move.obj(ghoul,132,128,1,f252);
  set.loop(woman,2);
  stop.cycling(girl);
  set.cel(girl,0);
  set.loop(girl,3); fix.loop(girl); start.cycling(girl);
  v252 = 2; step.time(girl,v252); move.obj(girl,23,134,2,f250);
}

if (f250) {
  reset(f250);
  stop.cycling(girl);
}

if (f252) {
  v21 = 8;
  print.at("Mr. Ferguson cries out, 'No, Johnny, no!'",2,3,35);
  erase(ghoul); stop.cycling(bbq);
  set.loop(bbq,1); set.cel(bbq,0);
  end.of.loop(bbq,f251); reset(f252);
}

if (f251) {
  set.loop(bbq,2);
  start.cycling(bbq);
  reset(f251);
  v251 = 110; set(f249);
}

if (v251 > 0) {
  v251--;
}

if ((v251 == 0) && (f249)) {
  v21 = 8;
  print.at("'That's the fourth time in as many months.'",2,3,35); v21 = 8;
  print.at("'Dammit!  The steak's burning.'",2,3,35);
  v254 = 0;
  reset(f249);
}


if (f254) {
  sound(2,f254);
}

if (v254 == 0) {
  stop.sound();
  stop.motion(ego);
  v253 = 0; v254 = 0;
  reset(f255); reset(f254); v21 = 0; v251 = 0;
  reset(f251); reset(f252); reset(f250); reset(f249);
  new.room(2);
}


return();