unit Picture3;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, MPlayer, jpeg, StdCtrls, Transparentpanel, Buttons,
  Spin, GIFImage;

type
  TPic3 = class(TForm)
    Image1: TImage;
    left_sensor: TImage;
    TopSensor: TImage;
    right_sensor: TImage;
    bottom_sensor: TImage;
    Music1: TMediaPlayer;
    Inventar1: TMediaPlayer;
    Video1: TMediaPlayer;
    InvPic: TImage;
    InvBev: TBevel;
    CenterSensor: TImage;
    sensor23: TImage;
    inv_delay: TTimer;
    slidersensor: TImage;
    turnersensor: TImage;
    buttonsensor: TImage;
    button2sensor: TImage;
    desksensor: TImage;
    crowbarsensor: TImage;
    crowbar2sensor: TImage;
    portalsensor: TImage;
    crowsensor1: TImage;
    crowsensor2: TImage;
    crowsensor3: TImage;
    crowsensor4: TImage;
    cheat7: TSpeedButton;
    crowsensor5: TImage;
    dustsensor: TImage;
    statshow: TTimer;
    SpinEdit1: TSpinEdit;
    cornersensor: TImage;
    carpetsensor: TImage;
    floorsensor: TImage;
    buttonsensor2: TImage;
    cardsensor: TImage;
    cardslotsensor: TImage;
    switchsensor: TImage;
    cheat8: TSpeedButton;
    keypadsensor: TImage;
    keypad3: TTransparentPanel;
    k3btn1: TImage;
    k3btn2: TImage;
    k3btn3: TImage;
    k3btn4: TImage;
    k3btn5: TImage;
    k3btn6: TImage;
    k3btn7: TImage;
    k3btn8: TImage;
    k3btn9: TImage;
    k3btn0: TImage;
    Edit1: TEdit;
    sound: TMediaPlayer;
    board: TTransparentPanel;
    pic4x4: TImage;
    pic4x3: TImage;
    pic4x2: TImage;
    pic4x1: TImage;
    pic4x0: TImage;
    pic3x4: TImage;
    pic3x3: TImage;
    pic3x2: TImage;
    pic3x1: TImage;
    pic3x0: TImage;
    pic2x4: TImage;
    pic2x3: TImage;
    pic2x2: TImage;
    pic2x1: TImage;
    pic2x0: TImage;
    pic1x4: TImage;
    pic1x3: TImage;
    pic1x2: TImage;
    pic1x1: TImage;
    pic1x0: TImage;
    pic0x4: TImage;
    pic0x3: TImage;
    pic0x2: TImage;
    pic0x1: TImage;
    pic0x0: TImage;
    check: TTimer;
    mirrorsensor: TImage;
    labsensor: TImage;
    labsmallsensor: TImage;
    cheat6: TSpeedButton;
    shieldsensor: TImage;
    cauldronsensor: TImage;
    bookstandsensor: TImage;
    labexitsensor: TImage;
    shieldbooksensor2: TImage;
    cloaksensor: TImage;
    powdersensor: TImage;
    b_page: TImage;
    f_page: TImage;
    magic1sound: TImage;
    magic2sound: TImage;
    magic3sound: TImage;
    magic4sound: TImage;
    cauldron: TImage;
    cheat5: TSpeedButton;
    chamberexit: TImage;
    lever1: TImage;
    lever2: TImage;
    woodaccesssensor: TImage;
    woodaccesssensor2: TImage;
    cheat3: TSpeedButton;
    gotowoods: TImage;
    exitwoodssensor: TImage;
    enterwoodsensor: TImage;
    gamesound: TMediaPlayer;
    guardiantime: TTimer;
    guardiansensor: TImage;
    podestsensor: TImage;
    altarsensor: TImage;
    cheat4: TSpeedButton;
    altarswitch: TImage;
    altaroffering: TImage;
    cavernentrance: TImage;
    cavernexit: TImage;
    watersensor: TImage;
    drawingsensor: TImage;
    stonesensor: TImage;
    cupsensor: TImage;
    cheat1: TSpeedButton;
    final2sound: TMediaPlayer;
    cheat2: TSpeedButton;
    delay_vidstart: TTimer;
    cheat9: TSpeedButton;
    procedure FormActivate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure Music1Notify(Sender: TObject);
    procedure bottom_sensorDblClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure Video1Notify(Sender: TObject);
    procedure left_sensorDblClick(Sender: TObject);
    procedure right_sensorDblClick(Sender: TObject);
    procedure CenterSensorDblClick(Sender: TObject);
    procedure sensor23DblClick(Sender: TObject);
    procedure inv_delayTimer(Sender: TObject);
    procedure InvPicClick(Sender: TObject);
    procedure slidersensorDblClick(Sender: TObject);
    procedure turnersensorDblClick(Sender: TObject);
    procedure buttonsensorDblClick(Sender: TObject);
    procedure button2sensorDblClick(Sender: TObject);
    procedure desksensorDblClick(Sender: TObject);
    procedure crowbarsensorDblClick(Sender: TObject);
    procedure crowbar2sensorDblClick(Sender: TObject);
    procedure portalsensorDblClick(Sender: TObject);
    procedure InvPicMouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure InvPicEndDrag(Sender, Target: TObject; X, Y: Integer);
    procedure crowsensor1DragOver(Sender, Source: TObject; X, Y: Integer;
      State: TDragState; var Accept: Boolean);
    procedure crowsensor1DragDrop(Sender, Source: TObject; X, Y: Integer);
    procedure cheat7Click(Sender: TObject);
    procedure dustsensorDblClick(Sender: TObject);
    procedure crowsensor2DragOver(Sender, Source: TObject; X, Y: Integer;
      State: TDragState; var Accept: Boolean);
    procedure crowsensor5DragOver(Sender, Source: TObject; X, Y: Integer;
      State: TDragState; var Accept: Boolean);
    procedure crowsensor3DragOver(Sender, Source: TObject; X, Y: Integer;
      State: TDragState; var Accept: Boolean);
    procedure crowsensor2DragDrop(Sender, Source: TObject; X, Y: Integer);
    procedure crowsensor3DragDrop(Sender, Source: TObject; X, Y: Integer);
    procedure crowsensor5DragDrop(Sender, Source: TObject; X, Y: Integer);
    procedure statshowTimer(Sender: TObject);
    procedure crowsensor4DblClick(Sender: TObject);
    procedure carpetsensorDblClick(Sender: TObject);
    procedure floorsensorDragOver(Sender, Source: TObject; X, Y: Integer;
      State: TDragState; var Accept: Boolean);
    procedure floorsensorDragDrop(Sender, Source: TObject; X, Y: Integer);
    procedure buttonsensor2DblClick(Sender: TObject);
    procedure cardsensorDblClick(Sender: TObject);
    procedure cardslotsensorDragOver(Sender, Source: TObject; X,
      Y: Integer; State: TDragState; var Accept: Boolean);
    procedure cardslotsensorDragDrop(Sender, Source: TObject; X,
      Y: Integer);
    procedure switchsensorDblClick(Sender: TObject);
    procedure cheat8Click(Sender: TObject);
    procedure keypadsensorDblClick(Sender: TObject);
    procedure k3btn1Click(Sender: TObject);
    procedure k3btn2Click(Sender: TObject);
    procedure k3btn3Click(Sender: TObject);
    procedure k3btn4Click(Sender: TObject);
    procedure k3btn5Click(Sender: TObject);
    procedure k3btn6Click(Sender: TObject);
    procedure k3btn7Click(Sender: TObject);
    procedure k3btn8Click(Sender: TObject);
    procedure k3btn9Click(Sender: TObject);
    procedure k3btn0Click(Sender: TObject);
    procedure pic0x0Click(Sender: TObject);
    procedure pic0x1Click(Sender: TObject);
    procedure pic0x2Click(Sender: TObject);
    procedure pic0x3Click(Sender: TObject);
    procedure pic0x4Click(Sender: TObject);
    procedure pic1x0Click(Sender: TObject);
    procedure pic1x1Click(Sender: TObject);
    procedure pic1x2Click(Sender: TObject);
    procedure pic1x3Click(Sender: TObject);
    procedure pic1x4Click(Sender: TObject);
    procedure pic2x0Click(Sender: TObject);
    procedure pic2x1Click(Sender: TObject);
    procedure pic2x2Click(Sender: TObject);
    procedure pic2x3Click(Sender: TObject);
    procedure pic2x4Click(Sender: TObject);
    procedure pic3x0Click(Sender: TObject);
    procedure pic3x1Click(Sender: TObject);
    procedure pic3x2Click(Sender: TObject);
    procedure pic3x3Click(Sender: TObject);
    procedure pic3x4Click(Sender: TObject);
    procedure pic4x0Click(Sender: TObject);
    procedure pic4x1Click(Sender: TObject);
    procedure pic4x2Click(Sender: TObject);
    procedure pic4x3Click(Sender: TObject);
    procedure pic4x4Click(Sender: TObject);
    procedure checkTimer(Sender: TObject);
    procedure cornersensorDblClick(Sender: TObject);
    procedure mirrorsensorDragOver(Sender, Source: TObject; X, Y: Integer;
      State: TDragState; var Accept: Boolean);
    procedure mirrorsensorDragDrop(Sender, Source: TObject; X, Y: Integer);
    procedure labsensorDblClick(Sender: TObject);
    procedure labsmallsensorDblClick(Sender: TObject);
    procedure labsensorDragOver(Sender, Source: TObject; X, Y: Integer;
      State: TDragState; var Accept: Boolean);
    procedure labsensorDragDrop(Sender, Source: TObject; X, Y: Integer);
    procedure cheat6Click(Sender: TObject);
    procedure labexitsensorDblClick(Sender: TObject);
    procedure shieldsensorDblClick(Sender: TObject);
    procedure shieldbooksensor2DblClick(Sender: TObject);
    procedure InvPicDblClick(Sender: TObject);
    procedure Inventar1Notify(Sender: TObject);
    procedure cloaksensorDblClick(Sender: TObject);
    procedure powdersensorDblClick(Sender: TObject);
    procedure cauldronsensorDblClick(Sender: TObject);
    procedure bookstandsensorDblClick(Sender: TObject);
    procedure f_pageClick(Sender: TObject);
    procedure b_pageClick(Sender: TObject);
    procedure magic1soundDblClick(Sender: TObject);
    procedure magic2soundDblClick(Sender: TObject);
    procedure magic3soundDblClick(Sender: TObject);
    procedure magic4soundDblClick(Sender: TObject);
    procedure cauldronDragOver(Sender, Source: TObject; X, Y: Integer;
      State: TDragState; var Accept: Boolean);
    procedure cauldronDragDrop(Sender, Source: TObject; X, Y: Integer);
    procedure cheat5Click(Sender: TObject);
    procedure soundNotify(Sender: TObject);
    procedure chamberexitDblClick(Sender: TObject);
    procedure lever1DblClick(Sender: TObject);
    procedure lever2DblClick(Sender: TObject);
    procedure woodaccesssensorDblClick(Sender: TObject);
    procedure woodaccesssensor2DblClick(Sender: TObject);
    procedure cheat3Click(Sender: TObject);
    procedure gotowoodsDblClick(Sender: TObject);
    procedure exitwoodssensorDblClick(Sender: TObject);
    procedure enterwoodsensorDblClick(Sender: TObject);
    procedure guardiantimeTimer(Sender: TObject);
    procedure guardiansensorDragOver(Sender, Source: TObject; X,
      Y: Integer; State: TDragState; var Accept: Boolean);
    procedure guardiansensorDragDrop(Sender, Source: TObject; X,
      Y: Integer);
    procedure podestsensorDblClick(Sender: TObject);
    procedure altarsensorDblClick(Sender: TObject);
    procedure cheat4Click(Sender: TObject);
    procedure altarswitchDblClick(Sender: TObject);
    procedure altarofferingDragOver(Sender, Source: TObject; X, Y: Integer;
      State: TDragState; var Accept: Boolean);
    procedure altarofferingDragDrop(Sender, Source: TObject; X,
      Y: Integer);
    procedure cavernentranceDblClick(Sender: TObject);
    procedure cavernexitDblClick(Sender: TObject);
    procedure watersensorDragOver(Sender, Source: TObject; X, Y: Integer;
      State: TDragState; var Accept: Boolean);
    procedure watersensorDragDrop(Sender, Source: TObject; X, Y: Integer);
    procedure drawingsensorDblClick(Sender: TObject);
    procedure stonesensorDragOver(Sender, Source: TObject; X, Y: Integer;
      State: TDragState; var Accept: Boolean);
    procedure stonesensorDragDrop(Sender, Source: TObject; X, Y: Integer);
    procedure cupsensorDblClick(Sender: TObject);
    procedure cheat1Click(Sender: TObject);
    procedure gamesoundNotify(Sender: TObject);
    procedure final2soundNotify(Sender: TObject);
    procedure cheat2Click(Sender: TObject);
    procedure delay_vidstartTimer(Sender: TObject);
    procedure cheat9Click(Sender: TObject);
  private
    { Private declarations }
    procedure checkcombination;
    procedure fieldshow;
    procedure checkend;
    procedure startgame;
    procedure startgame2;
    procedure startgame3;
    procedure Book_cClick(Sender: TObject);
    procedure Videoplay(videofile:string);
    procedure CVideoPlay(videofile:string;Left, Top, Width, Height:Integer);
    procedure magicsound(audiofile:string);
    procedure Bookdisplay(imagename:string);
  public
    { Public declarations }
    Status, round, magicpages:Integer;
    crowbar, firsttimecrowbar, dust, firsttimedust, card, firsttimecard, exnode, musicstart,
    cardinserted, keypadabort, gamestart, stone, mirror, firsttimemirror, dustused,
    shieldbook, firsttimeshieldbook, cloak, powder, book3open, book3opened, firsttimecloak,
    firsttimepowder, powderused, mirrorused, shieldbookused, potion1, gotyellowflask,
    yellowflask, potion1used, levervaultopen, paper, woodaccess, enterwoods,launchwoodmusic,
    exitwoods, launchmainmusic, guardian, launchcavernmusic, waterflask, firsttimewaterflask,
    glass1, firsttimeglass1, potion2ready, golddustused, glass2, potion2, glass2give, final2,
    continuemusic, glass3, firsttimeglass3, shieldbook2, firsttimeshieldbook2, potion1filled,
    potion1finished, exit2node, cloakused, powderconsumed:Boolean;
    gamecombination, ingredients:String;
    book_c:TImage;
  end;

var
  Pic3: TPic3;

var
 Status:Integer;
 Panel:TTransparentPanel;
 InvPanel:TTransparentpanel;
 Matrix : Array[0..4] of Array[0..4] of Boolean;

implementation

uses evo_menu, Picture2, help_evo, Picture1;

{$R *.dfm}

procedure TPic3.BookDisplay(imagename:string);
begin
 Book_c:=TImage.Create(self);
 Book_c.Parent := Self;
 Book_c.Left := 72;
 Book_c.Top := 40;
 Book_c.Width:=640;
 Book_c.Height:=480;
 Book_c.OnClick:=Book_cClick;
 Book_c.Picture.loadfromfile(imagename);
end;

procedure TPic3.Videoplay(videofile:string);
begin
 Panel:=TTransparentPanel.Create(self);
 Panel.Parent := Self;
 Panel.Left := 72;
 Panel.Top := 40;
 Panel.Width:=640;
 Panel.Height:=480;
 video1.FileName:=videofile;
 video1.Open;
 video1.Display:=panel;
 video1.DisplayRect:=Panel.ClientRect;
 video1.play;
end;

procedure TPic3.CVideoPlay(videofile:string;Left, Top, Width, Height:Integer);
begin
 Panel:=TTransparentPanel.Create(self);
 Panel.Parent := Self;
 Panel.Left :=left;
 Panel.Top :=top;
 Panel.Width:=width;
 Panel.Height:=height;
 video1.FileName:=videofile;
 video1.Open;
 video1.Display:=panel;
 video1.DisplayRect:=Panel.ClientRect;
 video1.play;
end;

procedure TPic3.magicsound(audiofile:string);
begin
 music1.Notify:=false;
 music1.Pause;
 continuemusic:=true;
 gamesound.FileName:=audiofile;
 gamesound.open;
 gamesound.play;
end;

procedure TPic3.FormActivate(Sender: TObject);
begin
 image1.Picture.LoadFromFile('resources\img\black.jpeg');
 keypad3.Visible:=false;
 board.visible:=false;
 exit2node:=false;
 invpic.Visible:=true;
 musicstart:=true;
 Status:=0;
end;

procedure TPic3.FormClose(Sender: TObject; var Action: TCloseAction);
begin
 if musicstart=false then
  begin
   music1.notify:=false;
   music1.stop;
  end;
 evomenu.show;
end;

procedure TPic3.Music1Notify(Sender: TObject);
begin
if music1.NotifyValue=nvSuccessful then
  begin
    music1.Play;
    music1.Notify := True;
  end
end;

procedure TPic3.bottom_sensorDblClick(Sender: TObject);
begin
 if status=5 then
  begin
   videoplay('resources\anim\2_288.avi');
   status:=7;
  end
else
 if status=8 then
  begin
   videoplay('resources\anim\2_294.avi');
   status:=5;
  end
else
 if status=9 then
  begin
   videoplay('resources\anim\2_297.avi');
   status:=5;
  end
else
 if status=10 then
  begin
   videoplay('resources\anim\2_299.avi');
   status:=5;
  end
else
 if status=13 then
  begin
   videoplay('resources\anim\2_215.avi');
   status:=14;
  end
else
 if status=14 then
  begin
   videoplay('resources\anim\2_211.avi');
   status:=13;
  end
else
 if status=19 then
  begin
   videoplay('resources\anim\2_321.avi');
   status:=17;
  end
else
 if status=24 then
  begin
   videoplay('resources\anim\2_323.avi');
   status:=17;
  end
else
 if status=23 then
  begin
   videoplay('resources\anim\2_324.avi');
   status:=17;
  end
else
 if status=21 then
  begin
   videoplay('resources\anim\2_326.avi');
   status:=17;
  end
else
 if status=20 then
  begin
   videoplay('resources\anim\2_325.avi');
   status:=17;
  end
else
 if status=22 then
  begin
   videoplay('resources\anim\2_346.avi');
   status:=17;
  end
else
 if status=25 then
  begin
   videoplay('resources\anim\2_327.avi');
   status:=17;
  end
else
 if status=26 then
  begin
   videoplay('resources\anim\2_329.avi');
   status:=17;
  end
else
 if (status=27) and (card=false) then
  begin
   videoplay('resources\anim\2_332.avi');
   status:=17;
  end
else
 if (status=27) and (card=true) then
  begin
   videoplay('resources\anim\2_334.avi');
   status:=17;
  end
else
 if status=29 then
  begin
   videoplay('resources\anim\2_296.avi');
   status:=5;
  end
else
 if status=28 then
  begin
   video1.FileName:='resources\anim\2_295.avi';
   keypadabort:=true;
   status:=5;
  end
else
 if status=31 then
  begin
   image1.Picture.LoadFromFile('resources\img\black.jpeg');
   videoplay('resources\anim\2_304.avi');
   invpic.Visible:=true;
   board.visible:=false;
   exnode:=false;

   keypadabort:=true;
   status:=5;
  end
else
 if status=33 then
  begin
   videoplay('resources\anim\2_339.avi');
   status:=18;
  end
else
 if status=34 then
  begin
   videoplay('resources\anim\2_208.avi');
   status:=14;
  end
else
 if (status=37) and (shieldbook=false) then
  begin
   videoplay('resources\anim\2_258.avi');
   status:=35;
  end
else
 if (status=38) and (shieldbook=true) then
  begin
   videoplay('resources\anim\2_260.avi');
   status:=35;
  end
else
 if (status=40) and (potion2=true) then
  begin
   videoplay('resources\anim\2_253.avi');
   status:=35;
  end
else
 if (status=40) and (potion2ready=true) and (golddustused=false) then
  begin
   videoplay('resources\anim\2_256.avi');
   status:=35;
  end
else
 if (status=40) and (potion2ready=true) and (golddustused=true) then
  begin
   videoplay('resources\anim\2_249.avi');
   status:=35;
  end
else
 if (status=40) and (powderused=false) then
  begin
   videoplay('resources\anim\2_256.avi');
   status:=35;
  end
else
 if (status=40) and (powderused=true) and (potion1=false) then
  begin
   videoplay('resources\anim\2_249.avi');
   status:=35;
  end
else
 if (status=40) and (powderused=true) and (potion1=true) then
  begin
   videoplay('resources\anim\2_253.avi');
   status:=35;
  end
else
 if status=42 then
  begin
   videoplay('resources\anim\2_267.avi');
   status:=47;
  end
else
 if status=43 then
  begin
   videoplay('resources\anim\2_268.avi');
   status:=47;
  end
else
 if status=44 then
  begin
   videoplay('resources\anim\2_269.avi');
   status:=47;
  end
else
 if status=45 then
  begin
   videoplay('resources\anim\2_270.avi');
   status:=47;
  end
else
 if status=46 then
  begin
   videoplay('resources\anim\2_271.avi');
   status:=47;
  end
else
 if status=51 then
  begin
   videoplay('resources\anim\2_344.avi');
   status:=53;
  end
else
 if status=52 then
  begin
   videoplay('resources\anim\2_342.avi');
   status:=53;
  end
else
 if status=15 then
  begin
   videoplay('resources\anim\2_228.avi');
   status:=13;
  end
else
 if status=16 then
  begin
   videoplay('resources\anim\2_226.avi');
   status:=13;
  end
else
 if status=55 then
  begin
   videoplay('resources\anim\2_364.avi');
   status:=57;
  end
else
 if status=58 then
  begin
   videoplay('resources\anim\2_358.avi');
   status:=55;
  end
else
 if status=59 then
  begin
   videoplay('resources\anim\2_360.avi');
   status:=58;
  end
else
 if status=61 then
  begin
   videoplay('resources\anim\2_372.avi');
   status:=60;
  end
end;

procedure TPic3.FormShow(Sender: TObject);
begin
 delay_vidstart.enabled:=true;
end;

procedure TPic3.Video1Notify(Sender: TObject);
begin
with Sender as TMediaPlayer do
 begin
  case Mode of mpStopped:
   begin
    panel.free;

    if exit2node=true then
     begin
      music1.notify:=false;
      music1.stop;
      pic1.swordused:=true;
      status:=0;
      pic1.Starused:=true;
      pic1.status:=2;
      pic3.Hide;
      pic1.show;
     end;

    if status=0 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_064.jpeg');
      centersensor.visible:=true;
      sensor23.Visible:=false;
      inv_delay.enabled:=true;
      portalsensor.Visible:=false;

      if musicstart=true then
       begin
        Music1.FileName:='resources\music\l.avi';
        Music1.Open;
        Music1.play;
        Music1.notify:=true;
        musicstart:=false;
       end;

     end;

    if status=1 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_065.jpeg');
      centersensor.visible:=true;
      sensor23.Visible:=false;
      portalsensor.Visible:=false;
      labsmallsensor.visible:=false;
      woodaccesssensor.visible:=false;
      woodaccesssensor2.visible:=false;
     end;

    if status=2 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_077.jpeg');
      centersensor.visible:=false;
      sensor23.Visible:=true;
      portalsensor.Visible:=false;
      labsmallsensor.visible:=false;
      woodaccesssensor.visible:=false;
      woodaccesssensor2.visible:=false;
     end;

    if status=3 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_066.jpeg');
      centersensor.visible:=false;
      sensor23.Visible:=false;
      portalsensor.Visible:=true;
      labsmallsensor.visible:=true;
     end;

     if status=4 then
     begin
      music1.Notify:=true;
      music1.play;

      image1.Picture.LoadFromFile('resources\img\2_078.jpeg');
      sensor23.Visible:=false;
      centersensor.visible:=true;
      labsmallsensor.visible:=false;
     end;

     if (status=5) and (keypadabort=false) then
     begin
      image1.Picture.LoadFromFile('resources\img\2_081.jpeg');
      sensor23.Visible:=false;
      centersensor.visible:=false;

      crowbar2sensor.visible:=false;
      crowbarsensor.Visible:=true;
      buttonsensor.visible:=true;
      button2sensor.visible:=true;
      slidersensor.visible:=true;
      turnersensor.visible:=true;
      desksensor.Visible:=true;
      cardslotsensor.visible:=false;
      switchsensor.visible:=false;
      keypadsensor.Visible:=true;
      keypad3.Visible:=false;
     end
    else
     if (status=5) and (keypadabort=true) then
     begin
      videoplay('resources\anim\2_277.avi');
      keypadabort:=false;
     end;

     if status=6 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_079.jpeg');
      centersensor.visible:=false;

      crowbarsensor.Visible:=false;
      buttonsensor.visible:=false;
      button2sensor.visible:=false;
      slidersensor.visible:=false;
      turnersensor.visible:=false;
      desksensor.Visible:=false;
      cardslotsensor.visible:=true;
      switchsensor.visible:=true;
      keypadsensor.Visible:=false;
     end;

     if status=7 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_080.jpeg');
      centersensor.visible:=true;

      crowbarsensor.Visible:=false;
      buttonsensor.visible:=false;
      button2sensor.visible:=false;
      slidersensor.visible:=false;
      turnersensor.visible:=false;
      desksensor.Visible:=false;
      cardslotsensor.visible:=false;
      switchsensor.visible:=false;
      keypadsensor.Visible:=false;
     end;

     if status=8 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_082.jpeg');
      centersensor.visible:=false;

      crowbarsensor.Visible:=false;
      buttonsensor.visible:=false;
      button2sensor.visible:=false;
      slidersensor.visible:=false;
      turnersensor.visible:=false;
      desksensor.Visible:=false;
      keypadsensor.Visible:=false;
     end;

     if status=9 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_083.jpeg');
      centersensor.visible:=false;

      crowbar2sensor.visible:=true;
      crowbarsensor.Visible:=false;
      buttonsensor.visible:=false;
      button2sensor.visible:=false;
      slidersensor.visible:=false;
      turnersensor.visible:=false;
      desksensor.Visible:=false;
      keypadsensor.Visible:=false;
     end;

     if status=10 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_084.jpeg');
      centersensor.visible:=false;

      crowbar2sensor.visible:=false;
      crowbarsensor.Visible:=false;
      buttonsensor.visible:=false;
      button2sensor.visible:=false;
      slidersensor.visible:=false;
      turnersensor.visible:=false;
      desksensor.Visible:=false;

      if firsttimecrowbar=true then
       begin
        crowbar:=true;
        invpic.Picture.loadfromfile('resources\inv\crowbar.gif');
        pic2.displayeditem:='crowbar';
        firsttimecrowbar:=false;
       end
     end;

     if status=11 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_070.jpeg');
      centersensor.visible:=true;

      portalsensor.Visible:=false;
      labsmallsensor.visible:=false;
      woodaccesssensor.visible:=false;
      woodaccesssensor2.visible:=false;
     end;

     if status=12 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_076.jpeg');
      centersensor.Visible:=false;
      woodaccesssensor2.visible:=true;
     end;

     if status=13 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_068.jpeg');
      centersensor.Visible:=true;
      labsensor.Visible:=false;

      labexitsensor.visible:=false;
      cloaksensor.Visible:=false;
      powdersensor.visible:=false;
      woodaccesssensor.visible:=true;
      gotowoods.visible:=false;
     end;

     if status=14 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_067.jpeg');
      centersensor.Visible:=false;
      labsensor.Visible:=true;
      labsmallsensor.Visible:=false;
      woodaccesssensor.visible:=false;
      woodaccesssensor2.visible:=false;
     end;

     if status=15 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_069.jpeg');
      centersensor.Visible:=false;
      labsensor.Visible:=false;
      woodaccesssensor.visible:=false;
      woodaccesssensor2.visible:=false;
     end;

     if status=16 then
     begin
      if exitwoods=true then
       begin
        image1.Picture.LoadFromFile('resources\img\black.jpeg');
        videoplay('resources\anim\2_188.avi');
        exitwoods:=false;
        launchmainmusic:=true;
       end
      else
       begin
        image1.Picture.LoadFromFile('resources\img\2_116.jpeg');
        centersensor.Visible:=false;
        labsensor.Visible:=false;
        woodaccesssensor.visible:=false;
        woodaccesssensor2.visible:=false;
        gotowoods.visible:=true;
        enterwoodsensor.visible:=false;

        if launchmainmusic=true then
         begin
          music1.FileName:='resources\music\l.avi';
          music1.open;
          music1.Notify:=true;
          music1.Play;
          launchmainmusic:=false;
         end
        end;
     end;

     if status=17 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_071.jpeg');
      centersensor.Visible:=false;
      crowsensor1.Visible:=true;
      crowsensor2.visible:=true;
      crowsensor3.Visible:=true;
      crowsensor4.Visible:=true;
      crowsensor5.Visible:=true;
      dustsensor.Visible:=false;
      cornersensor.visible:=true;
      carpetsensor.Visible:=false;
      floorsensor.Visible:=false;
      buttonsensor2.visible:=false;
      cardsensor.visible:=false;
     end;

     if status=18 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_073.jpeg');
      centersensor.Visible:=true;
      crowsensor1.Visible:=false;
      crowsensor2.visible:=false;
      crowsensor3.Visible:=false;
      crowsensor4.Visible:=false;
      crowsensor5.Visible:=false;
      cornersensor.visible:=false;
      chamberexit.visible:=false;
     end;

     if status=19 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_089.jpeg');
      centersensor.Visible:=false;
      crowsensor1.Visible:=false;
      crowsensor2.visible:=false;
      crowsensor3.Visible:=false;
      crowsensor4.Visible:=false;
      crowsensor5.Visible:=false;
      dustsensor.visible:=true;
      cornersensor.visible:=false;
     end;

     if status=20 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_093.jpeg');
      centersensor.Visible:=false;
      crowsensor1.Visible:=false;
      crowsensor2.visible:=false;
      crowsensor3.Visible:=false;
      crowsensor4.Visible:=false;
      crowsensor5.Visible:=false;
      cornersensor.visible:=false;
     end;

     if status=21 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_092.jpeg');
      centersensor.Visible:=false;
      crowsensor1.Visible:=false;
      crowsensor2.visible:=false;
      crowsensor3.Visible:=false;
      crowsensor4.Visible:=false;
      crowsensor5.Visible:=false;
      cornersensor.visible:=false;
     end;

     if status=22 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_074.jpeg');
      centersensor.Visible:=false;
      crowsensor1.Visible:=false;
      crowsensor2.visible:=false;
      crowsensor3.Visible:=false;
      crowsensor4.Visible:=false;
      crowsensor5.Visible:=false;
      cornersensor.visible:=false;
      carpetsensor.visible:=true;
     end;

     if status=23 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_091.jpeg');
      centersensor.Visible:=false;
      crowsensor1.Visible:=false;
      crowsensor2.visible:=false;
      crowsensor3.Visible:=false;
      crowsensor4.Visible:=false;
      crowsensor5.Visible:=false;
      cornersensor.visible:=false;
     end;

     if status=24 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_090.jpeg');
      centersensor.Visible:=false;
      crowsensor1.Visible:=false;
      crowsensor2.visible:=false;
      crowsensor3.Visible:=false;
      crowsensor4.Visible:=false;
      crowsensor5.Visible:=false;
      dustsensor.visible:=false;
      cornersensor.visible:=false;

      if firsttimedust=true then
       begin
        firsttimedust:=false;
        dust:=true;
        invpic.Picture.LoadFromFile('resources\inv\dust.gif');
        pic2.displayeditem:='dust';
       end;
     end;

     if status=25 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_075.jpeg');
      carpetsensor.visible:=false;
      floorsensor.Visible:=true;
     end;

     if status=26 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_085.jpeg');
      floorsensor.Visible:=false;
      buttonsensor2.visible:=true;
     end;

     if (status=27) and (card=false) then
     begin
      image1.Picture.LoadFromFile('resources\img\2_086.jpeg');
      buttonsensor2.visible:=false;
      cardsensor.Visible:=true;
     end
      else if (status=27) and (card=true) then
     begin
      image1.Picture.LoadFromFile('resources\img\2_087.jpeg');
      buttonsensor2.visible:=false;

      if firsttimecard=true then
       begin
        firsttimecard:=false;
        invpic.Picture.LoadFromFile('resources\inv\card.gif');
        pic2.displayeditem:='card';
       end;
     end;

     if status=28 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_088.jpeg');
      switchsensor.Visible:=false;
      cardslotsensor.Visible:=false;
      keypad3.Visible:=true;
      check.enabled:=true;
     end;

     if status=29 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_094.jpeg');
      keypad3.Visible:=true;

      crowbarsensor.Visible:=false;
      buttonsensor.visible:=false;
      button2sensor.visible:=false;
      slidersensor.visible:=false;
      turnersensor.visible:=false;
      desksensor.Visible:=false;
      cardslotsensor.visible:=false;
      switchsensor.visible:=false;
      keypadsensor.Visible:=false;
     end;

     if status=31 then
     begin
      image1.Picture.LoadFromFile('resources\game\empty.jpeg');
      invpic.visible:=false;
      board.Visible:=true;
      if round=0 then startgame;
      if round=1 then startgame2;
      if (round=2) and (exnode=false) then
       begin
        videoplay('resources\anim\2_302.avi');
        startgame3;
        exnode:=true;
       end;
     end;

     if (status=30) and (gamestart=false) then
     begin
      image1.Picture.LoadFromFile('resources\game\start.jpeg');
      videoplay('resources\anim\2_278.avi');
      gamestart:=true;
     end
    else
     if (status=30) and (gamestart=true) then
     begin
      image1.Picture.LoadFromFile('resources\img\black.jpeg');
      videoplay('resources\anim\2_300.avi');
      status:=31;
      gamestart:=false;
     end;

     if status=32 then
     begin
      board.visible:=false;
      invpic.visible:=true;
      stone:=true;
      invpic.Picture.loadfromfile('resources\inv\stone.gif');
      pic2.displayeditem:='stone';

      image1.Picture.LoadFromFile('resources\img\black.jpeg');

      videoplay('resources\anim\2_304.avi');
      board.visible:=false;

      keypadabort:=true;
      status:=5;
     end;

     if status=33 then
     begin
      if potion1used=true then
       begin
        image1.Picture.LoadFromFile('resources\img\2_111.jpeg');

        status:=48;

        sound.FileName:='resources\audio\mirrorseq1.avi';
        sound.Open;
        sound.play;
        potion1used:=false;
        potion1finished:=true;
       end
      else
       begin
        image1.Picture.LoadFromFile('resources\img\2_095.jpeg');
       end;

      crowsensor1.Visible:=false;
      crowsensor2.visible:=false;
      crowsensor3.Visible:=false;
      crowsensor4.Visible:=false;
      crowsensor5.Visible:=false;
      cornersensor.visible:=false;

      mirrorsensor.visible:=true;
     end;

     if status=34 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_107.jpeg');
     end;

     if status=35 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_096.jpeg');
      labsensor.Visible:=false;

      shieldsensor.visible:=true;
      cauldronsensor.Visible:=true;
      bookstandsensor.Visible:=true;
      shieldbooksensor2.visible:=false;
      cloaksensor.Visible:=false;
      powdersensor.visible:=false;

      magic1sound.Visible:=false;
      magic2sound.Visible:=false;
      magic3sound.Visible:=false;
      magic4sound.Visible:=false;
      b_page.Visible:=false;
      f_page.visible:=false;
      cauldron.Visible:=false;
     end;

     if status=36 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_100.jpeg');

      shieldsensor.visible:=false;
      cauldronsensor.Visible:=false;
      bookstandsensor.Visible:=false;

      cloaksensor.Visible:=true;
      labexitsensor.visible:=true;
     end;

     if status=37 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_098.jpeg');

      shieldsensor.visible:=false;
      cauldronsensor.Visible:=false;
      bookstandsensor.Visible:=false;
      shieldbooksensor2.visible:=true;
     end;

     if status=38 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_099.jpeg');

      shieldsensor.visible:=false;
      cauldronsensor.Visible:=false;
      bookstandsensor.Visible:=false;
      shieldbooksensor2.visible:=false;

      if firsttimeshieldbook=true then
       begin
        firsttimeshieldbook:=false;
        invpic.Picture.LoadFromFile('resources\inv\shieldbook.gif');
        pic2.displayeditem:='shieldbook';
       end;
     end;

     if status=39 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_101.jpeg');

      shieldsensor.visible:=false;
      cauldronsensor.Visible:=false;
      bookstandsensor.Visible:=false;

      cloaksensor.Visible:=false;
      labexitsensor.visible:=true;
      if powder=false then powdersensor.visible:=true;

      if firsttimecloak=true then
       begin
        firsttimecloak:=false;
        invpic.Picture.LoadFromFile('resources\inv\cloak.gif');
        pic2.displayeditem:='cloak';
       end;

       if firsttimepowder=true then
       begin
        firsttimepowder:=false;
        invpic.Picture.LoadFromFile('resources\inv\powder.gif');
        pic2.displayeditem:='powder';
       end;
     end;

     if status=40 then
     begin
      if potion2=true then
       begin
        image1.Picture.LoadFromFile('resources\img\2_110.jpeg');
       end
      else
      if (potion2ready=true) and (golddustused=false) then
       begin
        image1.Picture.LoadFromFile('resources\img\2_097.jpeg');
       end
      else
      if (potion2ready=true) and (golddustused=true) then
       begin
        image1.Picture.LoadFromFile('resources\img\2_109.jpeg');
       end
      else
      begin
      if (powderused=true) and (potion1=false) then
       begin
        image1.Picture.LoadFromFile('resources\img\2_109.jpeg');
       end
      else
       if (powderused=true) and (potion1=true) then
       begin
        image1.Picture.LoadFromFile('resources\img\2_110.jpeg');
       end
      else
       begin
        image1.Picture.LoadFromFile('resources\img\2_097.jpeg');
       end;
      end;

      if glass2give=true then
       begin
        glass1:=false;
        glass2:=true;
        invpic.Picture.LoadFromFile('resources\inv\glass2.gif');
        pic2.displayeditem:='glass2';
        glass2give:=false;
       end;

      shieldsensor.visible:=false;
      cauldronsensor.Visible:=false;
      bookstandsensor.Visible:=false;
      cauldron.Visible:=true;

      if (powderused=true) and (shieldbookused=true) and (mirrorused=true) and (potion1finished=false) then ingredients:='potion1';
      if gotyellowflask=true then
       begin
        invpic.Picture.LoadFromFile('resources\inv\flask_yellow.gif');
        pic2.displayeditem:='yellowflask';
        gotyellowflask:=false;
       end;

       if firsttimeshieldbook2=true then
       begin
        invpic.Picture.LoadFromFile('resources\inv\shieldbook2.gif');
        pic2.displayeditem:='shieldbook2';
        firsttimeshieldbook2:=false;
       end;

       if firsttimeglass3=true then
       begin
        invpic.Picture.LoadFromFile('resources\inv\glass3.gif');
        pic2.displayeditem:='glass3';
        firsttimeglass3:=false;
       end;
     end;

     if status=42 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_102.jpeg');
     end;

     if status=43 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_103.jpeg');

      magic1sound.Visible:=true;
      magic2sound.Visible:=false;
      magic3sound.Visible:=false;
      magic4sound.Visible:=false;
     end;

     if status=44 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_104.jpeg');

      magic1sound.Visible:=false;
      magic2sound.Visible:=true;
      magic3sound.Visible:=false;
      magic4sound.Visible:=false;
     end;

     if status=45 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_105.jpeg');

      magic1sound.Visible:=false;
      magic2sound.Visible:=false;
      magic3sound.Visible:=true;
      magic4sound.Visible:=false;
     end;

     if status=46 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_106.jpeg');

      magic1sound.Visible:=false;
      magic2sound.Visible:=false;
      magic3sound.Visible:=false;
      magic4sound.Visible:=true;
     end;

     if status=41 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_108.jpeg');

      shieldsensor.visible:=false;
      cauldronsensor.Visible:=false;
      bookstandsensor.Visible:=false;

      b_page.visible:=true;
      f_page.visible:=true;

      if magicpages=0 then
       begin
        videoplay('resources\anim\2_272.avi');
        status:=42;
       end
      else
       if magicpages=1 then
       begin
        videoplay('resources\anim\2_273.avi');
        status:=43;
       end
      else
       if magicpages=2 then
       begin
        videoplay('resources\anim\2_274.avi');
        status:=44;
       end
      else
       if magicpages=3 then
       begin
        videoplay('resources\anim\2_275.avi');
        status:=45;
       end
      else
       if magicpages=4 then
       begin
        videoplay('resources\anim\2_276.avi');
        status:=46;
       end;
     end;

     if status=47 then
      begin
       b_page.visible:=false;
       f_page.visible:=false;

       videoplay('resources\anim\2_241.avi');
       status:=35;
      end;

     if status=51 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_113.jpeg');
      mirrorsensor.visible:=false;
      lever1.Visible:=true;
      lever2.visible:=false;
      invpic.visible:=true;
      music1.Notify:=true;
      music1.Play;
     end;

     if status=52 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_114.jpeg');
      lever2.Visible:=true;
      lever1.visible:=false;
     end;

     if status=53 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_115.jpeg');
      chamberexit.visible:=true;
      lever1.Visible:=false;
      lever2.Visible:=false;
     end;

     if status=54 then
      begin
       if enterwoods=true then
        begin
         image1.Picture.LoadFromFile('resources\img\black.jpeg');

         videoplay('resources\anim\2_350.avi');
         enterwoods:=false;
         launchwoodmusic:=true;
        end
       else
        begin
         image1.Picture.LoadFromFile('resources\img\2_117.jpeg');
         exitwoodssensor.visible:=true;
         enterwoodsensor.visible:=true;
         gotowoods.Visible:=false;
         guardiansensor.visible:=false;
         podestsensor.Visible:=false;

         if launchwoodmusic=true then
          begin
           music1.FileName:='resources\music\p.avi';
           music1.open;
           music1.Notify:=true;
           music1.Play;
           launchwoodmusic:=false;
          end
         end;
        end;

     if status=56 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_118.jpeg');
      guardiantime.Enabled:=true;
      guardiansensor.visible:=true;
     end;

     if status=55 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_119.jpeg');
      exitwoodssensor.visible:=false;
      enterwoodsensor.visible:=false;
      podestsensor.Visible:=false;
      altarswitch.visible:=false;
      altaroffering.Visible:=false;

      if guardian=true then altarsensor.Visible:=true;

      if guardian=false then
       begin
        videoplay('resources\anim\2_354.avi');
        status:=56;
       end;
     end;

    if status=57 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_125.jpeg');
      podestsensor.Visible:=true;
      altarsensor.Visible:=false;
     end;

     if status=58 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_120.jpeg');
      altarsensor.Visible:=false;
      altarswitch.visible:=true;
      altaroffering.Visible:=true;
      cavernentrance.Visible:=false;
     end;

     if status=59 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_121.jpeg');
      altarswitch.visible:=false;
      altaroffering.Visible:=false;
      cavernentrance.Visible:=true;
      cavernexit.visible:=false;
      watersensor.visible:=false;
      drawingsensor.visible:=false;

      if launchwoodmusic=true then
       begin
        music1.FileName:='resources\music\p.avi';
        music1.open;
        music1.Notify:=true;
        music1.Play;
        launchwoodmusic:=false;
       end
     end;

     if status=60 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_122.jpeg');
      cavernentrance.Visible:=false;
      cavernexit.visible:=true;
      watersensor.visible:=true;
      drawingsensor.visible:=true;
      stonesensor.visible:=false;
      cupsensor.visible:=false;

      if firsttimewaterflask=true then
       begin
        invpic.Picture.LoadFromFile('resources\inv\flask2.gif');
        pic2.displayeditem:='waterflask';
        firsttimewaterflask:=false;
       end;

       if firsttimeglass1=true then
       begin
        invpic.Picture.LoadFromFile('resources\inv\glass1.gif');
        pic2.displayeditem:='glass1';
        firsttimeglass1:=false;
       end;

      if launchcavernmusic=true then
       begin
        music1.FileName:='resources\music\q.avi';
        music1.open;
        music1.Notify:=true;
        music1.Play;
        launchcavernmusic:=false;
       end
     end;

     if status=61 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_123.jpeg');
      watersensor.visible:=false;
      drawingsensor.visible:=false;
      stonesensor.visible:=true;
     end;

     if status=62 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_124.jpeg');
      stonesensor.visible:=false;
      cupsensor.visible:=true;
     end;

     if status=63 then
     begin
      image1.Picture.LoadFromFile('resources\img\2_126.jpeg');
      altarswitch.visible:=false;
      altaroffering.Visible:=false;

      shieldbook2:=false;
      glass3:=false;
      paper:=false;

      final2sound.FileName:='resources\audio\final2.avi';
      final2sound.Open;
      final2sound.play;
     end;

     if status=64 then
     begin
      final2:=true;
      pic3.hide;
      pic1.show;
     end;

    end;
   end;
  Notify := True;
 end;
end;

procedure TPic3.left_sensorDblClick(Sender: TObject);
begin
 if status=0 then
  begin
   videoplay('resources\anim\2_190.avi');
   status:=1;
  end
else
 if status=2 then
  begin
   videoplay('resources\anim\2_197.avi');
   status:=1;
  end
else
 if status=1 then
  begin
   videoplay('resources\anim\2_201.avi');
   status:=3;
  end
else
 if status=3 then
  begin
   videoplay('resources\anim\2_202.avi');
   status:=2;
  end
else
 if status=4 then
  begin
   videoplay('resources\anim\2_193.avi');
   status:=1;
  end
else
 if status=5 then
  begin
   videoplay('resources\anim\2_283.avi');
   status:=6;
  end
else
 if status=6 then
  begin
   videoplay('resources\anim\2_293.avi');
   status:=7;
  end
else
 if status=11 then
  begin
   videoplay('resources\anim\2_219.avi');
   status:=12;
  end
else
 if status=12 then
  begin
   videoplay('resources\anim\2_222.avi');
   status:=14;
  end
else
 if status=13 then
  begin
   videoplay('resources\anim\2_214.avi');
   status:=1;
  end
else
 if status=17 then
  begin
   videoplay('resources\anim\2_311.avi');
   status:=18;
  end
else
 if status=33 then
  begin
   videoplay('resources\anim\2_339.avi');
   status:=18;
  end
else
 if (status=35) and (cloakused=true) then
  begin
   videoplay('resources\anim\2_235.avi');
   status:=39;
  end
else
 if (status=35) and (cloak=false) then
  begin
   videoplay('resources\anim\2_236.avi');
   status:=36;
  end
else
 if (status=35) and (cloak=true) then
  begin
   videoplay('resources\anim\2_235.avi');
   status:=39;
  end
end;

procedure TPic3.right_sensorDblClick(Sender: TObject);
begin
 if status=1 then
  begin
   videoplay('resources\anim\2_200.avi');
   status:=0;
  end
else
 if status=0 then
  begin
   videoplay('resources\anim\2_191.avi');
   status:=3;
  end
else
 if status=3 then
  begin
   videoplay('resources\anim\2_203.avi');
   status:=1;
  end
else
 if status=2 then
  begin
   videoplay('resources\anim\2_198.avi');
   status:=3;
  end
else
 if status=4 then
  begin
   videoplay('resources\anim\2_194.avi');
   status:=3;
  end
else
 if status=6 then
  begin
   videoplay('resources\anim\2_291.avi');
   status:=5;
  end
else
 if status=7 then
  begin
   videoplay('resources\anim\2_308.avi');
   status:=5;
  end
else
 if status=12 then
  begin
   videoplay('resources\anim\2_223.avi');
   status:=13;
  end
else
 if status=13 then
  begin
   videoplay('resources\anim\2_216.avi');
   status:=11;
  end
else
 if status=14 then
  begin
   videoplay('resources\anim\2_211.avi');
   status:=13;
  end
else
 if status=18 then
  begin
   videoplay('resources\anim\2_310.avi');
   status:=17;
  end
else
 if (status=36) and (cloak=false) then
  begin
   videoplay('resources\anim\2_262.avi');
   status:=35;
  end
else
 if (status=39) and (cloakused=true) then
  begin
   videoplay('resources\anim\2_266.avi');
   status:=35;
  end
else
 if (status=39) and (cloak=true) then
  begin
   videoplay('resources\anim\2_266.avi');
   status:=35;
  end
else
 if status=57 then
  begin
   videoplay('resources\anim\2_365.avi');
   status:=55;
  end
end;

procedure TPic3.CenterSensorDblClick(Sender: TObject);
begin
 if status=1 then
  begin
   videoplay('resources\anim\2_199.avi');
   status:=0;
   exit2node:=true;
  end
else
 if status=0 then
  begin
   videoplay('resources\anim\2_189.avi');
   status:=2;
  end
else
 if status=4 then
  begin
   videoplay('resources\anim\2_195.avi');
   status:=5;
  end
else
 if status=7 then
  begin
   videoplay('resources\anim\2_307.avi');
   status:=1;
  end
else
 if status=13 then
  begin
   videoplay('resources\anim\2_213.avi');
   status:=2;
  end
else
 if status=11 then
  begin
   videoplay('resources\anim\2_220.avi');
   status:=17;
  end
else
 if status=18 then
  begin
   videoplay('resources\anim\2_309.avi');
   status:=12;
  end
end;

procedure TPic3.sensor23DblClick(Sender: TObject);
begin
if status=2 then
  begin
   music1.Notify:=false;
   music1.pause;

   videoplay('resources\anim\2_196.avi');
   status:=4;
  end
end;

procedure TPic3.inv_delayTimer(Sender: TObject);
begin
 pic2.finite:=false;

 pic2.cycles:=0;

 repeat
 if pic2.invitem<31 then pic2.invitem:=pic2.invitem+1 else
  begin
   pic2.invitem:=1;
   pic2.cycles:=1;
  end;

 if (pic2.invitem=1) and (pic2.book=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=1) and (pic2.book=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\book.gif');
   pic2.displayeditem:='book';
   pic2.finite:=true;
  end;

 if (pic2.invitem=2) and (pic2.drawerempty=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=2) and (pic2.drawerempty=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\shirt.gif');
   pic2.displayeditem:='shirt';
   pic2.finite:=true;
  end;

 if (pic2.invitem=3) and (pic2.coins=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=3) and (pic2.coins=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\coins.gif');
   pic2.displayeditem:='coins';
   pic2.finite:=true;
  end;

 if (pic2.invitem=4) and (pic2.spear=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=4) and (pic2.spear=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\spear.gif');
   pic2.displayeditem:='spear';
   pic2.finite:=true;
  end;

 if (pic2.invitem=5) and (pic2.medallion=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=5) and (pic2.medallion=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\medallion.gif');
   pic2.displayeditem:='medallion';
   pic2.finite:=true;
  end;

 if (pic2.invitem=6) and (pic2.book2=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=6) and (pic2.book2=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\book2.gif');
   pic2.displayeditem:='book2';
   pic2.finite:=true;
  end;

 if (pic2.invitem=7) and (pic2.token=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=7) and (pic2.token=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\token.gif');
   pic2.displayeditem:='token';
   pic2.finite:=true;
  end;

 if (pic2.invitem=8) and (pic2.lens=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=8) and (pic2.lens=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\lens.gif');
   pic2.displayeditem:='lens';
   pic2.finite:=true;
  end;

 if (pic2.invitem=9) and (pic2.blanket=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=9) and (pic2.blanket=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\blanket.gif');
   pic2.displayeditem:='blanket';
   pic2.finite:=true;
  end;

 if (pic2.invitem=10) and (pic2.scroll=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=10) and (pic2.scroll=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\scroll.gif');
   pic2.displayeditem:='scroll';
   pic2.finite:=true;
  end;

 if (pic2.invitem=11) and (pic2.spear2=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=11) and (pic2.spear2=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\spear2.gif');
   pic2.displayeditem:='spear2';
   pic2.finite:=true;
  end;

 if (pic2.invitem=12) and (pic2.spear3=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=12) and (pic2.spear3=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\spear3.gif');
   pic2.displayeditem:='spear3';
   pic2.finite:=true;
  end;

 if (pic2.invitem=13) and (pic2.flask1=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=13) and (pic2.flask1=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\flask1.gif');
   pic2.displayeditem:='flask1';
   pic2.finite:=true;
  end;

 if (pic2.invitem=14) and (pic2.key1=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=14) and (pic2.key1=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\key1.gif');
   pic2.displayeditem:='key1';
   pic2.finite:=true;
  end;

 if (pic2.invitem=15) and (pic2.emptyflask=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=15) and (pic2.emptyflask=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\flask_empty.gif');
   pic2.displayeditem:='emptyflask';
   pic2.finite:=true;
  end;

 if (pic2.invitem=16) and (pic2.sword=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=16) and (pic2.sword=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\sword.gif');
   pic2.displayeditem:='sword';
   pic2.finite:=true;
  end;

 if (pic2.invitem=17) and (pic3.crowbar=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=17) and (pic3.crowbar=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\crowbar.gif');
   pic2.displayeditem:='crowbar';
   pic2.finite:=true;
  end;

 if (pic2.invitem=18) and (pic3.dust=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=18) and (pic3.dust=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\dust.gif');
   pic2.displayeditem:='dust';
   pic2.finite:=true;
  end;

 if (pic2.invitem=19) and (pic3.card=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=19) and (pic3.card=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\card.gif');
   pic2.displayeditem:='card';
   pic2.finite:=true;
  end;

 if (pic2.invitem=20) and (pic3.stone=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=20) and (pic3.stone=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\stone.gif');
   pic2.displayeditem:='stone';
   pic2.finite:=true;
  end;

 if (pic2.invitem=21) and (pic3.mirror=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=21) and (pic3.mirror=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\mirror.gif');
   pic2.displayeditem:='mirror';
   pic2.finite:=true;
  end;

 if (pic2.invitem=22) and (pic3.shieldbook=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=22) and (pic3.shieldbook=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\shieldbook.gif');
   pic2.displayeditem:='shieldbook';
   pic2.finite:=true;
  end;

 if (pic2.invitem=23) and (pic3.cloak=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=23) and (pic3.cloak=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\cloak.gif');
   pic2.displayeditem:='cloak';
   pic2.finite:=true;
  end;

 if (pic2.invitem=24) and (pic3.powder=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=24) and (pic3.powder=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\powder.gif');
   pic2.displayeditem:='powder';
   pic2.finite:=true;
  end;

 if (pic2.invitem=25) and (pic3.yellowflask=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=25) and (pic3.yellowflask=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\flask_yellow.gif');
   pic2.displayeditem:='yellowflask';
   pic2.finite:=true;
  end;

 if (pic2.invitem=26) and (pic3.paper=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=26) and (pic3.paper=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\paper.gif');
   pic2.displayeditem:='paper';
   pic2.finite:=true;
  end;

 if (pic2.invitem=27) and (pic3.waterflask=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=27) and (pic3.waterflask=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\flask2.gif');
   pic2.displayeditem:='waterflask';
   pic2.finite:=true;
  end;

 if (pic2.invitem=28) and (pic3.glass1=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=28) and (pic3.glass1=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\glass1.gif');
   pic2.displayeditem:='glass1';
   pic2.finite:=true;
  end;

 if (pic2.invitem=29) and (pic3.glass2=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=29) and (pic3.glass2=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\glass2.gif');
   pic2.displayeditem:='glass2';
   pic2.finite:=true;
  end;

 if (pic2.invitem=30) and (pic3.glass3=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=30) and (pic3.glass3=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\glass3.gif');
   pic2.displayeditem:='glass3';
   pic2.finite:=true;
  end;

 if (pic2.invitem=31) and (pic3.shieldbook2=false) then pic2.invitem:=pic2.invitem+1;
 if (pic2.invitem=31) and (pic3.shieldbook2=true) then
  begin
   invpic.Picture.loadfromfile('resources\inv\shieldbook2.gif');
   pic2.displayeditem:='shieldbook2';
   pic2.finite:=true;
  end;

until (pic2.cycles=1) or (pic2.finite=true);

inv_delay.enabled:=false;

end;

procedure TPic3.InvPicClick(Sender: TObject);
begin
 Inv_delay.Enabled:=true;
end;

procedure TPic3.slidersensorDblClick(Sender: TObject);
begin
if status=5 then
  begin
   videoplay('resources\anim\2_279.avi');
  end
end;

procedure TPic3.turnersensorDblClick(Sender: TObject);
begin
if status=5 then
  begin
   videoplay('resources\anim\2_280.avi');
  end
end;

procedure TPic3.buttonsensorDblClick(Sender: TObject);
begin
if status=5 then
  begin
   videoplay('resources\anim\2_281.avi');
  end
end;

procedure TPic3.button2sensorDblClick(Sender: TObject);
begin
if status=5 then
  begin
   videoplay('resources\anim\2_282.avi');
  end
end;

procedure TPic3.desksensorDblClick(Sender: TObject);
begin
if status=5 then
  begin
   videoplay('resources\anim\2_284.avi');
   status:=8;
  end
end;

procedure TPic3.crowbarsensorDblClick(Sender: TObject);
begin
if (status=5) and (crowbar=false) then
  begin
   videoplay('resources\anim\2_287.avi');
   status:=9;
  end
else
 if (status=5) and (crowbar=true) then
  begin
   videoplay('resources\anim\2_286.avi');
   status:=10;
  end
end;

procedure TPic3.crowbar2sensorDblClick(Sender: TObject);
begin
 if status=9 then
  begin
   videoplay('resources\anim\2_298.avi');
   firsttimecrowbar:=true;
   status:=10;
  end
end;

procedure TPic3.portalsensorDblClick(Sender: TObject);
begin
if status=3 then
  begin
   videoplay('resources\anim\2_205.avi');
   status:=11;
  end
end;

procedure TPic3.InvPicMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
 if (Button = mbRight) and (pic2.displayeditem='crowbar') then InvPic.BeginDrag(False);
 if (Button = mbRight) and (pic2.displayeditem='card') then InvPic.BeginDrag(False);
 if (Button = mbRight) and (pic2.displayeditem='dust') then InvPic.BeginDrag(False);
 if (Button = mbRight) and (pic2.displayeditem='powder') then InvPic.BeginDrag(False);
 if (Button = mbRight) and (pic2.displayeditem='shieldbook') then InvPic.BeginDrag(False);
 if (Button = mbRight) and (pic2.displayeditem='mirror') then InvPic.BeginDrag(False);
 if (Button = mbRight) and (pic2.displayeditem='emptyflask') then InvPic.BeginDrag(False);
 if (Button = mbRight) and (pic2.displayeditem='yellowflask') then InvPic.BeginDrag(False);
 if (Button = mbRight) and (pic2.displayeditem='cloak') then InvPic.BeginDrag(False);
 if (Button = mbRight) and (pic2.displayeditem='stone') then InvPic.BeginDrag(False);
 if (Button = mbRight) and (pic2.displayeditem='waterflask') then InvPic.BeginDrag(False);
 if (Button = mbRight) and (pic2.displayeditem='glass1') then InvPic.BeginDrag(False);
 if (Button = mbRight) and (pic2.displayeditem='glass2') then InvPic.BeginDrag(False);
 if (Button = mbRight) and (pic2.displayeditem='glass3') then InvPic.BeginDrag(False);
 if (Button = mbRight) and (pic2.displayeditem='shieldbook2') then InvPic.BeginDrag(False);
 if (Button = mbRight) and (pic2.displayeditem='paper') then InvPic.BeginDrag(False);
end;

procedure TPic3.InvPicEndDrag(Sender, Target: TObject; X, Y: Integer);
begin
if (Target = stonesensor) then
  begin
   if pic2.displayeditem='stone' then
    begin
     pic3.stone:=false;
     invpic.picture.loadfromfile('resources/img/black.jpeg');
     inv_delay.Enabled:=true;
    end
   end
else
if (Target = watersensor) then
  begin
   if pic2.displayeditem='emptyflask' then
    begin
     pic2.emptyflask:=false;
     invpic.picture.loadfromfile('resources/img/black.jpeg');
     inv_delay.Enabled:=true;
    end
   end
else
if (Target = guardiansensor) then
  begin
   if pic2.displayeditem='cloak' then
    begin
     cloak:=false;
     invpic.picture.loadfromfile('resources/img/black.jpeg');
     inv_delay.Enabled:=true;
    end
   end
else
if (Target = mirrorsensor) then
  begin
   if pic2.displayeditem='yellowflask' then
    begin
     yellowflask:=false;
     invpic.picture.loadfromfile('resources/img/black.jpeg');
     inv_delay.Enabled:=true;
    end
   end
else
if (Target = cardslotsensor) then
  begin
   if pic2.displayeditem='card' then
    begin
     card:=false;
     invpic.picture.loadfromfile('resources/img/black.jpeg');
     inv_delay.Enabled:=true;
    end
   end
else
if (Target = labsensor) then
  begin
   if pic2.displayeditem='dust' then
    begin
     dust:=false;
     invpic.picture.loadfromfile('resources/img/black.jpeg');
     inv_delay.Enabled:=true;
    end
   end
else
if (Target = cauldron) then
  begin
   if pic2.displayeditem='powder' then
    begin
     powder:=false;
     invpic.picture.loadfromfile('resources/img/black.jpeg');
     inv_delay.Enabled:=true;
    end
  else
   if (pic2.displayeditem='mirror') and (powderused=true) then
    begin
     mirror:=false;
     invpic.picture.loadfromfile('resources/img/black.jpeg');
     inv_delay.Enabled:=true;
    end
  else
   if (pic2.displayeditem='emptyflask') and (potion1=true) and (potion1filled=false) then
    begin
     pic2.emptyflask:=false;
     invpic.picture.loadfromfile('resources/img/black.jpeg');
     inv_delay.Enabled:=true;
     potion1filled:=true;
    end
  end
end;

procedure TPic3.crowsensor1DragOver(Sender, Source: TObject; X, Y: Integer;
  State: TDragState; var Accept: Boolean);
begin
if (Status=17) and (pic2.displayeditem='crowbar') then
  begin
   if (Source = InvPic) then Accept := True;
  end
 else Accept:=false;
end;

procedure TPic3.crowsensor1DragDrop(Sender, Source: TObject; X,
  Y: Integer);
begin
 if (status=17) and (dust=false) then
  begin
   videoplay('resources\anim\2_313.avi');
   status:=19;
  end
else
 if (status=17) and (dust=true) then
  begin
   videoplay('resources\anim\2_312.avi');
   status:=24;
  end
end;

procedure TPic3.cheat7Click(Sender: TObject);
begin
 crowbar:=true;
 inv_delay.enabled:=true;
end;

procedure TPic3.dustsensorDblClick(Sender: TObject);
begin
 if status=19 then
  begin
   videoplay('resources\anim\2_322.avi');
   firsttimedust:=true;
   status:=24;
  end
end;

procedure TPic3.crowsensor2DragOver(Sender, Source: TObject; X, Y: Integer;
  State: TDragState; var Accept: Boolean);
begin
if (Status=17) and (pic2.displayeditem='crowbar') then
  begin
   if (Source = InvPic) then Accept := True;
  end
 else Accept:=false;
end;

procedure TPic3.crowsensor5DragOver(Sender, Source: TObject; X, Y: Integer;
  State: TDragState; var Accept: Boolean);
begin
if (Status=17) and (pic2.displayeditem='crowbar') then
  begin
   if (Source = InvPic) then Accept := True;
  end
 else Accept:=false;
end;

procedure TPic3.crowsensor3DragOver(Sender, Source: TObject; X, Y: Integer;
  State: TDragState; var Accept: Boolean);
begin
if (Status=17) and (pic2.displayeditem='crowbar') then
  begin
   if (Source = InvPic) then Accept := True;
  end
 else Accept:=false;
end;

procedure TPic3.crowsensor2DragDrop(Sender, Source: TObject; X,
  Y: Integer);
begin
if status=17 then
  begin
   videoplay('resources\anim\2_315.avi');
   status:=20;
  end
end;

procedure TPic3.crowsensor3DragDrop(Sender, Source: TObject; X,
  Y: Integer);
begin
if status=17 then
  begin
   videoplay('resources\anim\2_316.avi');
   status:=21;
  end
end;

procedure TPic3.crowsensor5DragDrop(Sender, Source: TObject; X,
  Y: Integer);
begin
if status=17 then
  begin
   videoplay('resources\anim\2_314.avi');
   status:=23;
  end
end;

procedure TPic3.statshowTimer(Sender: TObject);
begin
 spinedit1.value:=status;
 edit1.text:=pic2.displayeditem;
end;

procedure TPic3.crowsensor4DblClick(Sender: TObject);
begin
if status=17 then
  begin
   videoplay('resources\anim\2_317.avi');
   status:=22;
  end
end;

procedure TPic3.carpetsensorDblClick(Sender: TObject);
begin
if status=22 then
  begin
   videoplay('resources\anim\2_335.avi');
   status:=25;
  end
end;

procedure TPic3.floorsensorDragOver(Sender, Source: TObject; X, Y: Integer;
  State: TDragState; var Accept: Boolean);
begin
if (Status=25) and (pic2.displayeditem='crowbar') then
  begin
   if (Source = InvPic) then Accept := True;
  end
 else Accept:=false;
end;

procedure TPic3.floorsensorDragDrop(Sender, Source: TObject; X,
  Y: Integer);
begin
 if status=25 then
  begin
   videoplay('resources\anim\2_328.avi');
   status:=26;
  end
end;

procedure TPic3.buttonsensor2DblClick(Sender: TObject);
begin
if (status=26) and (card=false) then
  begin
   videoplay('resources\anim\2_330.avi');
   status:=27;
  end
 else
 if (status=26) and (card=true) then
  begin
   videoplay('resources\anim\2_331.avi');
   status:=27;
  end
end;

procedure TPic3.cardsensorDblClick(Sender: TObject);
begin
if (status=27) and (card=false) then
  begin
   videoplay('resources\anim\2_333.avi');
   card:=true;
   firsttimecard:=true;
  end
end;

procedure TPic3.cardslotsensorDragOver(Sender, Source: TObject; X,
  Y: Integer; State: TDragState; var Accept: Boolean);
begin
if (Status=6) and (pic2.displayeditem='card') then
  begin
   if (Source = InvPic) then Accept := True;
  end
 else Accept:=false;
end;

procedure TPic3.cardslotsensorDragDrop(Sender, Source: TObject; X,
  Y: Integer);
begin
if (status=6) and (card=true) then
  begin
   videoplay('resources\anim\2_290.avi');
   cardinserted:=true;
  end
end;

procedure TPic3.switchsensorDblClick(Sender: TObject);
begin
 if (status=6) and (cardinserted=false) then
  begin
   videoplay('resources\anim\2_289.avi');
  end
else
 begin
 if (status=6) and (cardinserted=true) then
  begin
   videoplay('resources\anim\2_292.avi');
   gamecombination:='';
   status:=28;
  end
 end;
end;

procedure TPic3.cheat8Click(Sender: TObject);
begin
 card:=true;
 inv_delay.enabled:=true;
end;

procedure TPic3.keypadsensorDblClick(Sender: TObject);
begin
if status=5 then
  begin
   videoplay('resources\anim\2_285.avi');
   status:=29;
  end
end;

procedure TPic3.k3btn1Click(Sender: TObject);
begin
 keypad3.Visible:=false;
 Cvideoplay('resources\effects\vbtn_1.avi',306,235,36,32);
 if status=28 then
  begin
   gamecombination:=gamecombination+'1';
  end;
end;

procedure TPic3.k3btn2Click(Sender: TObject);
begin
 keypad3.Visible:=false;
 Cvideoplay('resources\effects\vbtn_2.avi',362,235,34,30);
 if status=28 then
  begin
   gamecombination:=gamecombination+'2';
  end;
end;

procedure TPic3.k3btn3Click(Sender: TObject);
begin
 keypad3.Visible:=false;
 Cvideoplay('resources\effects\vbtn_3.avi',412,233,33,29);
 if status=28 then
  begin
   gamecombination:=gamecombination+'3';
  end;
end;

procedure TPic3.k3btn4Click(Sender: TObject);
begin
 keypad3.Visible:=false;
 Cvideoplay('resources\effects\vbtn_4.avi',315,281,38,36);
 if status=28 then
  begin
   gamecombination:=gamecombination+'4';
  end;
end;

procedure TPic3.k3btn5Click(Sender: TObject);
begin
 keypad3.Visible:=false;
 Cvideoplay('resources\effects\vbtn_5.avi',375,277,37,33);
 if status=28 then
  begin
   gamecombination:=gamecombination+'5';
  end;
end;

procedure TPic3.k3btn6Click(Sender: TObject);
begin
 keypad3.Visible:=false;
 Cvideoplay('resources\effects\vbtn_6.avi',428,275,37,31);
 if status=28 then
  begin
   gamecombination:=gamecombination+'6';
  end;
end;

procedure TPic3.k3btn7Click(Sender: TObject);
begin
 keypad3.Visible:=false;
 Cvideoplay('resources\effects\vbtn_7.avi',325,336,43,42);
 if status=28 then
  begin
   gamecombination:=gamecombination+'7';
  end;
end;

procedure TPic3.k3btn8Click(Sender: TObject);
begin
 keypad3.Visible:=false;
 Cvideoplay('resources\effects\vbtn_8.avi',391,329,41,39);
 if status=28 then
  begin
   gamecombination:=gamecombination+'8';
  end;
end;

procedure TPic3.k3btn9Click(Sender: TObject);
begin
 keypad3.Visible:=false;
 Cvideoplay('resources\effects\vbtn_9.avi',448,323,41,35);
 if status=28 then
  begin
   gamecombination:=gamecombination+'9';
  end;
end;

procedure TPic3.k3btn0Click(Sender: TObject);
begin
 keypad3.Visible:=false;
 Cvideoplay('resources\effects\vbtn_0.avi',410,391,46,47);
 if status=28 then
  begin
   gamecombination:=gamecombination+'0';
  end;
end;

procedure TPic3.checkcombination;
begin
 if gamecombination='10357' then
  begin
   videoplay('resources\anim\2_295.avi');
   keypad3.Visible:=false;
   status:=30;
   invpic.visible:=false;
  end
 else
  begin
   videoplay('resources\anim\2_295.avi');
   keypadabort:=true;
   status:=5;
  end;
end;

procedure TPic3.fieldshow;
begin
 board.Visible:=false;
 if Matrix[0,0]=true then pic0x0.visible:=true else pic0x0.visible:=false;
 if Matrix[0,1]=true then pic0x1.visible:=true else pic0x1.visible:=false;
 if Matrix[0,2]=true then pic0x2.visible:=true else pic0x2.visible:=false;
 if Matrix[0,3]=true then pic0x3.visible:=true else pic0x3.visible:=false;
 if Matrix[0,4]=true then pic0x4.visible:=true else pic0x4.visible:=false;

 if Matrix[1,0]=true then pic1x0.visible:=true else pic1x0.visible:=false;
 if Matrix[1,1]=true then pic1x1.visible:=true else pic1x1.visible:=false;
 if Matrix[1,2]=true then pic1x2.visible:=true else pic1x2.visible:=false;
 if Matrix[1,3]=true then pic1x3.visible:=true else pic1x3.visible:=false;
 if Matrix[1,4]=true then pic1x4.visible:=true else pic1x4.visible:=false;

 if Matrix[2,0]=true then pic2x0.visible:=true else pic2x0.visible:=false;
 if Matrix[2,1]=true then pic2x1.visible:=true else pic2x1.visible:=false;
 if Matrix[2,2]=true then pic2x2.visible:=true else pic2x2.visible:=false;
 if Matrix[2,3]=true then pic2x3.visible:=true else pic2x3.visible:=false;
 if Matrix[2,4]=true then pic2x4.visible:=true else pic2x4.visible:=false;

 if Matrix[3,0]=true then pic3x0.visible:=true else pic3x0.visible:=false;
 if Matrix[3,1]=true then pic3x1.visible:=true else pic3x1.visible:=false;
 if Matrix[3,2]=true then pic3x2.visible:=true else pic3x2.visible:=false;
 if Matrix[3,3]=true then pic3x3.visible:=true else pic3x3.visible:=false;
 if Matrix[3,4]=true then pic3x4.visible:=true else pic3x4.visible:=false;

 if Matrix[4,0]=true then pic4x0.visible:=true else pic4x0.visible:=false;
 if Matrix[4,1]=true then pic4x1.visible:=true else pic4x1.visible:=false;
 if Matrix[4,2]=true then pic4x2.visible:=true else pic4x2.visible:=false;
 if Matrix[4,3]=true then pic4x3.visible:=true else pic4x3.visible:=false;
 if Matrix[4,4]=true then pic4x4.visible:=true else pic4x4.visible:=false;
 board.Visible:=true;
end;

procedure TPic3.checkend;
begin
 gamesound.FileName:='resources\game\game_sound.avi';
 gamesound.Open;
 gamesound.play;

 if  (Matrix[0,0]=false)
 and (Matrix[0,1]=false)
 and (Matrix[0,2]=false)
 and (Matrix[0,3]=false)
 and (Matrix[0,4]=false)
 and (Matrix[1,0]=false)
 and (Matrix[1,1]=false)
 and (Matrix[1,2]=false)
 and (Matrix[1,3]=false)
 and (Matrix[1,4]=false)
 and (Matrix[2,0]=false)
 and (Matrix[2,1]=false)
 and (Matrix[2,2]=false)
 and (Matrix[2,3]=false)
 and (Matrix[2,4]=false)
 and (Matrix[3,0]=false)
 and (Matrix[3,1]=false)
 and (Matrix[3,2]=false)
 and (Matrix[3,3]=false)
 and (Matrix[3,4]=false)
 and (Matrix[4,0]=false)
 and (Matrix[4,1]=false)
 and (Matrix[4,2]=false)
 and (Matrix[4,3]=false)
 and (Matrix[4,4]=false)

 then
  begin
   round:=round+1;
   if round=1 then
    begin
     videoplay('resources\anim\2_301.avi');
    end;
   if round=2 then
    begin
     videoplay('resources\anim\2_303.avi');
     status:=32;
    end;
  end;
end;

procedure TPic3.startgame;
begin
 Matrix[0,0]:=false;
 Matrix[0,1]:=false;
 Matrix[0,2]:=false;
 Matrix[0,3]:=false;
 Matrix[0,4]:=false;

 Matrix[1,0]:=false;
 Matrix[1,1]:=true;
 Matrix[1,2]:=false;
 Matrix[1,3]:=true;
 Matrix[1,4]:=false;

 Matrix[2,0]:=false;
 Matrix[2,1]:=false;
 Matrix[2,2]:=false;
 Matrix[2,3]:=false;
 Matrix[2,4]:=false;

 Matrix[3,0]:=false;
 Matrix[3,1]:=true;
 Matrix[3,2]:=false;
 Matrix[3,3]:=true;
 Matrix[3,4]:=false;

 Matrix[4,0]:=false;
 Matrix[4,1]:=false;
 Matrix[4,2]:=false;
 Matrix[4,3]:=false;
 Matrix[4,4]:=false;

 fieldshow;
end;

procedure TPic3.startgame2;
begin
 Matrix[0,0]:=true;
 Matrix[0,1]:=false;
 Matrix[0,2]:=false;
 Matrix[0,3]:=false;
 Matrix[0,4]:=true;

 Matrix[1,0]:=false;
 Matrix[1,1]:=true;
 Matrix[1,2]:=false;
 Matrix[1,3]:=true;
 Matrix[1,4]:=false;

 Matrix[2,0]:=false;
 Matrix[2,1]:=false;
 Matrix[2,2]:=false;
 Matrix[2,3]:=false;
 Matrix[2,4]:=false;

 Matrix[3,0]:=false;
 Matrix[3,1]:=true;
 Matrix[3,2]:=false;
 Matrix[3,3]:=true;
 Matrix[3,4]:=false;

 Matrix[4,0]:=true;
 Matrix[4,1]:=false;
 Matrix[4,2]:=false;
 Matrix[4,3]:=false;
 Matrix[4,4]:=true;

 fieldshow;
end;

procedure TPic3.startgame3;
begin
 Matrix[0,0]:=false;
 Matrix[0,1]:=false;
 Matrix[0,2]:=false;
 Matrix[0,3]:=false;
 Matrix[0,4]:=false;

 Matrix[1,0]:=false;
 Matrix[1,1]:=false;
 Matrix[1,2]:=true;
 Matrix[1,3]:=false;
 Matrix[1,4]:=false;

 Matrix[2,0]:=false;
 Matrix[2,1]:=true;
 Matrix[2,2]:=false;
 Matrix[2,3]:=true;
 Matrix[2,4]:=false;

 Matrix[3,0]:=false;
 Matrix[3,1]:=false;
 Matrix[3,2]:=true;
 Matrix[3,3]:=false;
 Matrix[3,4]:=false;

 Matrix[4,0]:=false;
 Matrix[4,1]:=false;
 Matrix[4,2]:=false;
 Matrix[4,3]:=false;
 Matrix[4,4]:=false;

 fieldshow;
end;

procedure TPic3.pic0x0Click(Sender: TObject);
begin
 if Matrix[0,0]=true then
  begin
    matrix[0,0]:= not matrix[0,0];
    matrix[0,1]:= not matrix[0,1];
    matrix[0,2]:= not matrix[0,2];
    matrix[0,3]:= not matrix[0,3];
    matrix[0,4]:= not matrix[0,4];

    matrix[1,0]:= not matrix[1,0];
    matrix[2,0]:= not matrix[2,0];
    matrix[3,0]:= not matrix[3,0];
    matrix[4,0]:= not matrix[4,0];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic0x1Click(Sender: TObject);
begin
 if Matrix[0,1]=true then
  begin
    matrix[0,0]:= not matrix[0,0];
    matrix[0,1]:= not matrix[0,1];
    matrix[0,2]:= not matrix[0,2];
    matrix[0,3]:= not matrix[0,3];
    matrix[0,4]:= not matrix[0,4];

    matrix[1,1]:= not matrix[1,1];
    matrix[2,1]:= not matrix[2,1];
    matrix[3,1]:= not matrix[3,1];
    matrix[4,1]:= not matrix[4,1];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic0x2Click(Sender: TObject);
begin
 if Matrix[0,2]=true then
  begin
    matrix[0,0]:= not matrix[0,0];
    matrix[0,1]:= not matrix[0,1];
    matrix[0,2]:= not matrix[0,2];
    matrix[0,3]:= not matrix[0,3];
    matrix[0,4]:= not matrix[0,4];

    matrix[1,2]:= not matrix[1,2];
    matrix[2,2]:= not matrix[2,2];
    matrix[3,2]:= not matrix[3,2];
    matrix[4,2]:= not matrix[4,2];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic0x3Click(Sender: TObject);
begin
 if Matrix[0,3]=true then
  begin
    matrix[0,0]:= not matrix[0,0];
    matrix[0,1]:= not matrix[0,1];
    matrix[0,2]:= not matrix[0,2];
    matrix[0,3]:= not matrix[0,3];
    matrix[0,4]:= not matrix[0,4];

    matrix[1,3]:= not matrix[1,3];
    matrix[2,3]:= not matrix[2,3];
    matrix[3,3]:= not matrix[3,3];
    matrix[4,3]:= not matrix[4,3];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic0x4Click(Sender: TObject);
begin
 if Matrix[0,4]=true then
  begin
    matrix[0,0]:= not matrix[0,0];
    matrix[0,1]:= not matrix[0,1];
    matrix[0,2]:= not matrix[0,2];
    matrix[0,3]:= not matrix[0,3];
    matrix[0,4]:= not matrix[0,4];

    matrix[1,4]:= not matrix[1,4];
    matrix[2,4]:= not matrix[2,4];
    matrix[3,4]:= not matrix[3,4];
    matrix[4,4]:= not matrix[4,4];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic1x0Click(Sender: TObject);
begin
 if Matrix[1,0]=true then
  begin
    matrix[1,0]:= not matrix[1,0];
    matrix[1,1]:= not matrix[1,1];
    matrix[1,2]:= not matrix[1,2];
    matrix[1,3]:= not matrix[1,3];
    matrix[1,4]:= not matrix[1,4];

    matrix[0,0]:= not matrix[0,0];
    matrix[2,0]:= not matrix[2,0];
    matrix[3,0]:= not matrix[3,0];
    matrix[4,0]:= not matrix[4,0];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic1x1Click(Sender: TObject);
begin
 if Matrix[1,1]=true then
  begin
    matrix[1,0]:= not matrix[1,0];
    matrix[1,1]:= not matrix[1,1];
    matrix[1,2]:= not matrix[1,2];
    matrix[1,3]:= not matrix[1,3];
    matrix[1,4]:= not matrix[1,4];

    matrix[0,1]:= not matrix[0,1];
    matrix[2,1]:= not matrix[2,1];
    matrix[3,1]:= not matrix[3,1];
    matrix[4,1]:= not matrix[4,1];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic1x2Click(Sender: TObject);
begin
 if Matrix[1,2]=true then
  begin
    matrix[1,0]:= not matrix[1,0];
    matrix[1,1]:= not matrix[1,1];
    matrix[1,2]:= not matrix[1,2];
    matrix[1,3]:= not matrix[1,3];
    matrix[1,4]:= not matrix[1,4];

    matrix[0,2]:= not matrix[0,2];
    matrix[2,2]:= not matrix[2,2];
    matrix[3,2]:= not matrix[3,2];
    matrix[4,2]:= not matrix[4,2];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic1x3Click(Sender: TObject);
begin
 if Matrix[1,3]=true then
  begin
    matrix[1,0]:= not matrix[1,0];
    matrix[1,1]:= not matrix[1,1];
    matrix[1,2]:= not matrix[1,2];
    matrix[1,3]:= not matrix[1,3];
    matrix[1,4]:= not matrix[1,4];

    matrix[0,3]:= not matrix[0,3];
    matrix[2,3]:= not matrix[2,3];
    matrix[3,3]:= not matrix[3,3];
    matrix[4,3]:= not matrix[4,3];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic1x4Click(Sender: TObject);
begin
 if Matrix[1,4]=true then
  begin
    matrix[1,0]:= not matrix[1,0];
    matrix[1,1]:= not matrix[1,1];
    matrix[1,2]:= not matrix[1,2];
    matrix[1,3]:= not matrix[1,3];
    matrix[1,4]:= not matrix[1,4];

    matrix[0,4]:= not matrix[0,4];
    matrix[2,4]:= not matrix[2,4];
    matrix[3,4]:= not matrix[3,4];
    matrix[4,4]:= not matrix[4,4];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic2x0Click(Sender: TObject);
begin
 if Matrix[2,0]=true then
  begin
    matrix[2,0]:= not matrix[2,0];
    matrix[2,1]:= not matrix[2,1];
    matrix[2,2]:= not matrix[2,2];
    matrix[2,3]:= not matrix[2,3];
    matrix[2,4]:= not matrix[2,4];

    matrix[0,0]:= not matrix[0,0];
    matrix[1,0]:= not matrix[1,0];
    matrix[3,0]:= not matrix[3,0];
    matrix[4,0]:= not matrix[4,0];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic2x1Click(Sender: TObject);
begin
 if Matrix[2,1]=true then
  begin
    matrix[2,0]:= not matrix[2,0];
    matrix[2,1]:= not matrix[2,1];
    matrix[2,2]:= not matrix[2,2];
    matrix[2,3]:= not matrix[2,3];
    matrix[2,4]:= not matrix[2,4];

    matrix[0,1]:= not matrix[0,1];
    matrix[1,1]:= not matrix[1,1];
    matrix[3,1]:= not matrix[3,1];
    matrix[4,1]:= not matrix[4,1];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic2x2Click(Sender: TObject);
begin
 if Matrix[2,2]=true then
  begin
    matrix[2,0]:= not matrix[2,0];
    matrix[2,1]:= not matrix[2,1];
    matrix[2,2]:= not matrix[2,2];
    matrix[2,3]:= not matrix[2,3];
    matrix[2,4]:= not matrix[2,4];

    matrix[0,2]:= not matrix[0,2];
    matrix[1,2]:= not matrix[1,2];
    matrix[3,2]:= not matrix[3,2];
    matrix[4,2]:= not matrix[4,2];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic2x3Click(Sender: TObject);
begin
 if Matrix[2,3]=true then
  begin
    matrix[2,0]:= not matrix[2,0];
    matrix[2,1]:= not matrix[2,1];
    matrix[2,2]:= not matrix[2,2];
    matrix[2,3]:= not matrix[2,3];
    matrix[2,4]:= not matrix[2,4];

    matrix[0,3]:= not matrix[0,3];
    matrix[1,3]:= not matrix[1,3];
    matrix[3,3]:= not matrix[3,3];
    matrix[4,3]:= not matrix[4,3];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic2x4Click(Sender: TObject);
begin
 if Matrix[2,4]=true then
  begin
    matrix[2,0]:= not matrix[2,0];
    matrix[2,1]:= not matrix[2,1];
    matrix[2,2]:= not matrix[2,2];
    matrix[2,3]:= not matrix[2,3];
    matrix[2,4]:= not matrix[2,4];

    matrix[0,4]:= not matrix[0,4];
    matrix[1,4]:= not matrix[1,4];
    matrix[3,4]:= not matrix[3,4];
    matrix[4,4]:= not matrix[4,4];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic3x0Click(Sender: TObject);
begin
 if Matrix[3,0]=true then
  begin
    matrix[3,0]:= not matrix[3,0];
    matrix[3,1]:= not matrix[3,1];
    matrix[3,2]:= not matrix[3,2];
    matrix[3,3]:= not matrix[3,3];
    matrix[3,4]:= not matrix[3,4];

    matrix[0,0]:= not matrix[0,0];
    matrix[1,0]:= not matrix[1,0];
    matrix[2,0]:= not matrix[2,0];
    matrix[4,0]:= not matrix[4,0];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic3x1Click(Sender: TObject);
begin
 if Matrix[3,1]=true then
  begin
    matrix[3,0]:= not matrix[3,0];
    matrix[3,1]:= not matrix[3,1];
    matrix[3,2]:= not matrix[3,2];
    matrix[3,3]:= not matrix[3,3];
    matrix[3,4]:= not matrix[3,4];

    matrix[0,1]:= not matrix[0,1];
    matrix[1,1]:= not matrix[1,1];
    matrix[2,1]:= not matrix[2,1];
    matrix[4,1]:= not matrix[4,1];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic3x2Click(Sender: TObject);
begin
 if Matrix[3,2]=true then
  begin
    matrix[3,0]:= not matrix[3,0];
    matrix[3,1]:= not matrix[3,1];
    matrix[3,2]:= not matrix[3,2];
    matrix[3,3]:= not matrix[3,3];
    matrix[3,4]:= not matrix[3,4];

    matrix[0,2]:= not matrix[0,2];
    matrix[1,2]:= not matrix[1,2];
    matrix[2,2]:= not matrix[2,2];
    matrix[4,2]:= not matrix[4,2];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic3x3Click(Sender: TObject);
begin
 if Matrix[3,3]=true then
  begin
    matrix[3,0]:= not matrix[3,0];
    matrix[3,1]:= not matrix[3,1];
    matrix[3,2]:= not matrix[3,2];
    matrix[3,3]:= not matrix[3,3];
    matrix[3,4]:= not matrix[3,4];

    matrix[0,3]:= not matrix[0,3];
    matrix[1,3]:= not matrix[1,3];
    matrix[2,3]:= not matrix[2,3];
    matrix[4,3]:= not matrix[4,3];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic3x4Click(Sender: TObject);
begin
 if Matrix[3,4]=true then
  begin
    matrix[3,0]:= not matrix[3,0];
    matrix[3,1]:= not matrix[3,1];
    matrix[3,2]:= not matrix[3,2];
    matrix[3,3]:= not matrix[3,3];
    matrix[3,4]:= not matrix[3,4];

    matrix[0,4]:= not matrix[0,4];
    matrix[1,4]:= not matrix[1,4];
    matrix[2,4]:= not matrix[2,4];
    matrix[4,4]:= not matrix[4,4];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic4x0Click(Sender: TObject);
begin
 if Matrix[4,0]=true then
  begin
    matrix[4,0]:= not matrix[4,0];
    matrix[4,1]:= not matrix[4,1];
    matrix[4,2]:= not matrix[4,2];
    matrix[4,3]:= not matrix[4,3];
    matrix[4,4]:= not matrix[4,4];

    matrix[0,0]:= not matrix[0,0];
    matrix[1,0]:= not matrix[1,0];
    matrix[2,0]:= not matrix[2,0];
    matrix[3,0]:= not matrix[3,0];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic4x1Click(Sender: TObject);
begin
 if Matrix[4,1]=true then
  begin
    matrix[4,0]:= not matrix[4,0];
    matrix[4,1]:= not matrix[4,1];
    matrix[4,2]:= not matrix[4,2];
    matrix[4,3]:= not matrix[4,3];
    matrix[4,4]:= not matrix[4,4];

    matrix[0,1]:= not matrix[0,1];
    matrix[1,1]:= not matrix[1,1];
    matrix[2,1]:= not matrix[2,1];
    matrix[3,1]:= not matrix[3,1];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic4x2Click(Sender: TObject);
begin
 if Matrix[4,2]=true then
  begin
    matrix[4,0]:= not matrix[4,0];
    matrix[4,1]:= not matrix[4,1];
    matrix[4,2]:= not matrix[4,2];
    matrix[4,3]:= not matrix[4,3];
    matrix[4,4]:= not matrix[4,4];

    matrix[0,2]:= not matrix[0,2];
    matrix[1,2]:= not matrix[1,2];
    matrix[2,2]:= not matrix[2,2];
    matrix[3,2]:= not matrix[3,2];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic4x3Click(Sender: TObject);
begin
 if Matrix[4,3]=true then
  begin
    matrix[4,0]:= not matrix[4,0];
    matrix[4,1]:= not matrix[4,1];
    matrix[4,2]:= not matrix[4,2];
    matrix[4,3]:= not matrix[4,3];
    matrix[4,4]:= not matrix[4,4];

    matrix[0,3]:= not matrix[0,3];
    matrix[1,3]:= not matrix[1,3];
    matrix[2,3]:= not matrix[2,3];
    matrix[3,3]:= not matrix[3,3];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.pic4x4Click(Sender: TObject);
begin
 if Matrix[4,4]=true then
  begin
    matrix[4,0]:= not matrix[4,0];
    matrix[4,1]:= not matrix[4,1];
    matrix[4,2]:= not matrix[4,2];
    matrix[4,3]:= not matrix[4,3];
    matrix[4,4]:= not matrix[4,4];

    matrix[0,4]:= not matrix[0,4];
    matrix[1,4]:= not matrix[1,4];
    matrix[2,4]:= not matrix[2,4];
    matrix[3,4]:= not matrix[3,4];

    fieldshow;
    checkend;
  end
end;

procedure TPic3.checkTimer(Sender: TObject);
begin
 if length(gamecombination)=5 then checkcombination;
 check.enabled:=false;
end;

procedure TPic3.cornersensorDblClick(Sender: TObject);
begin
if (status=17) and (levervaultopen=false) then
  begin
   videoplay('resources\anim\2_318.avi');
   status:=33;
  end
else
 if (status=17) and (levervaultopen=true) and (woodaccess=false) then
  begin
   videoplay('resources\anim\2_319.avi');
   status:=51;
  end
else
 if (status=17) and (levervaultopen=true) and (woodaccess=true) then
  begin
   videoplay('resources\anim\2_320.avi');
   status:=52;
  end
end;

procedure TPic3.mirrorsensorDragOver(Sender, Source: TObject; X,
  Y: Integer; State: TDragState; var Accept: Boolean);
begin
if (Status=33) and (pic2.displayeditem='crowbar') then
  begin
   if (Source = InvPic) then Accept := True;
  end
 else
if (Status=33) and (pic2.displayeditem='yellowflask') then
  begin
   if (Source = InvPic) then Accept := True;
  end
 else Accept:=false;
end;

procedure TPic3.mirrorsensorDragDrop(Sender, Source: TObject; X,
  Y: Integer);
begin
 if (status=33) and (pic2.displayeditem='crowbar') and (mirror=false) then
  begin
   videoplay('resources\anim\2_338.avi');
   mirror:=true;
   invpic.Picture.loadfromfile('resources\inv\mirror.gif');
   pic2.displayeditem:='mirror';
  end
else
 if (status=33) and (pic2.displayeditem='yellowflask') then
  begin
   videoplay('resources\anim\2_336.avi');
   music1.Notify:=false;
   music1.Pause;
   invpic.Visible:=false;

   pic2.emptyflask:=true;
   //potion1:=false;
   potion1used:=true;
  end
end;

procedure TPic3.labsensorDblClick(Sender: TObject);
begin
 if (status=14) and (dustused=false) then
  begin
   videoplay('resources\anim\2_210.avi');
   status:=34;
  end
 else
 if (status=14) and (dustused=true) then
  begin
   videoplay('resources\anim\2_212.avi');
   status:=35;
  end;
end;

procedure TPic3.labsmallsensorDblClick(Sender: TObject);
begin
 if status=3 then
  begin
   videoplay('resources\anim\2_204.avi');
   status:=14;
  end;
end;

procedure TPic3.labsensorDragOver(Sender, Source: TObject; X, Y: Integer;
  State: TDragState; var Accept: Boolean);
begin
if (Status=34) and (pic2.displayeditem='dust') then
  begin
   if (Source = InvPic) then Accept := True;
  end
 else Accept:=false;
end;

procedure TPic3.labsensorDragDrop(Sender, Source: TObject; X, Y: Integer);
begin
if (status=34) and (dust=true) then
  begin
   videoplay('resources\anim\2_209.avi');
   dustused:=true;
   status:=35;
  end
end;

procedure TPic3.cheat6Click(Sender: TObject);
begin
 dust:=true;
 mirror:=true;
 powder:=true;
 cloak:=true;
 dustused:=true;
 shieldbook:=true;
 inv_delay.enabled:=true;
end;

procedure TPic3.labexitsensorDblClick(Sender: TObject);
begin
 if (status=39) and (cloakused=true) then
  begin
   videoplay('resources\anim\2_265.avi');
   status:=13;
  end
else
 if (status=36) and (cloak=false) then
  begin
   videoplay('resources\anim\2_261.avi');
   status:=13;
  end
else
 if (status=39) and (cloak=true) then
  begin
   videoplay('resources\anim\2_265.avi');
   status:=13;
  end
end;

procedure TPic3.shieldsensorDblClick(Sender: TObject);
begin
 if (status=35) and (shieldbook=false) then
  begin
   videoplay('resources\anim\2_234.avi');
   status:=37;
  end
else
 if (status=35) and (shieldbook=true) then
  begin
   videoplay('resources\anim\2_233.avi');
   status:=38;
  end
end;

procedure TPic3.shieldbooksensor2DblClick(Sender: TObject);
begin
 if (status=37) and (shieldbook=false) then
  begin
   videoplay('resources\anim\2_259.avi');
   shieldbook:=true;
   firsttimeshieldbook:=true;
   status:=38;
  end
end;

procedure TPic3.InvPicDblClick(Sender: TObject);
begin
 inv_delay.enabled:=false;
 if (book3open=false) and (pic2.displayeditem='shieldbook') then
  begin
   Bookdisplay('resources\books\2_063_a.jpeg');
   book3open:=true;
  end
 else
 begin
  if (book3open=true) and (pic2.displayeditem='shieldbook') then
   begin
    book_c.free;
    book3open:=false;
    book3opened:=false;
   end
 end;
end;

procedure TPic3.Book_cClick(Sender: TObject);
begin
 if book3opened=false then
  begin
  invPanel:=TTransparentPanel.Create(self);
  invPanel.Parent := Self;
  invPanel.Left := 72;
  invPanel.Top := 40;
  invPanel.Width:=640;
  invPanel.Height:=480;

  inventar1.FileName:='resources\books\book_d.avi';
  inventar1.Open;
  inventar1.Display:=invpanel;
  inventar1.DisplayRect:=invPanel.ClientRect;
  inventar1.play;

  book3opened:=true;
 end;
end;

procedure TPic3.Inventar1Notify(Sender: TObject);
begin
 with Sender as TMediaPlayer do
   begin
     case Mode of
      mpStopped:
        begin
         if book3open=true then
          begin
           invpanel.free;
           book_c.Picture.LoadFromFile('resources\books\2_063_b.jpeg');
           invpic.Enabled:=true;
           inventar1.Close;
          end;
        end;
      end;
   end;
end;

procedure TPic3.cloaksensorDblClick(Sender: TObject);
begin
if (status=36) and (cloak=false) then
 begin
  videoplay('resources\anim\2_263.avi');
  cloak:=true;
  firsttimecloak:=true;
  status:=39;
 end;
end;

procedure TPic3.powdersensorDblClick(Sender: TObject);
begin
if (status=39) and (powderconsumed=false) and (powder=false) then
 begin
  videoplay('resources\anim\2_264.avi');
  powder:=true;
  firsttimepowder:=true;
 end;
end;

procedure TPic3.cauldronsensorDblClick(Sender: TObject);
begin
if (status=35) and (potion2=true) then
 begin
  videoplay('resources\anim\2_232.avi');
  status:=40;
 end
else
if (status=35) and (potion2ready=true) and (golddustused=false) then
 begin
  videoplay('resources\anim\2_230.avi');
  status:=40;
 end
else
if (status=35) and (potion2ready=true) and (golddustused=true) then
 begin
  videoplay('resources\anim\2_231.avi');
  status:=40;
 end
else
if (status=35) and (powderused=false) then
 begin
  videoplay('resources\anim\2_230.avi');
  status:=40;
 end
else
if (status=35) and (powderused=true) and (potion1=false) then
 begin
  videoplay('resources\anim\2_231.avi');
  status:=40;
 end
else
if (status=35) and (powderused=true) and (potion1=true) then
 begin
  videoplay('resources\anim\2_232.avi');
  status:=40;
 end
end;

procedure TPic3.bookstandsensorDblClick(Sender: TObject);
begin
if status=35 then
 begin
  videoplay('resources\anim\2_229.avi');
  status:=41;
 end;
end;

procedure TPic3.f_pageClick(Sender: TObject);
begin
 if magicpages=0 then
  begin
   videoplay('resources\anim\2_267.avi');
   magicpages:=1;
   status:=41;
  end
else
 if magicpages=1 then
  begin
   videoplay('resources\anim\2_268.avi');
   magicpages:=2;
   status:=41;
  end
else
 if magicpages=2 then
  begin
   videoplay('resources\anim\2_269.avi');
   magicpages:=3;
   status:=41;
  end
else
 if magicpages=3 then
  begin
   videoplay('resources\anim\2_270.avi');
   magicpages:=4;
   status:=41;
  end
end;

procedure TPic3.b_pageClick(Sender: TObject);
begin
 if magicpages=4 then
  begin
   videoplay('resources\anim\2_271.avi');
   magicpages:=3;
   status:=41;
  end
else
 if magicpages=3 then
  begin
   videoplay('resources\anim\2_270.avi');
   magicpages:=2;
   status:=41;
  end
else
 if magicpages=2 then
  begin
   videoplay('resources\anim\2_269.avi');
   magicpages:=1;
   status:=41;
  end
else
 if magicpages=1 then
  begin
   videoplay('resources\anim\2_268.avi');
   magicpages:=0;
   status:=41;
  end
end;

procedure TPic3.magic1soundDblClick(Sender: TObject);
begin
 magicsound('resources\audio\magic1.avi');
 magic1sound.enabled:=false;
end;

procedure TPic3.magic2soundDblClick(Sender: TObject);
begin
 magicsound('resources\audio\magic2.avi');
 magic2sound.enabled:=false;
 if ingredients='potion2' then potion2:=true;
end;

procedure TPic3.magic3soundDblClick(Sender: TObject);
begin
 magicsound('resources\audio\magic3.avi');
 magic3sound.enabled:=false;
 if ingredients='potion1' then potion1:=true;
end;

procedure TPic3.magic4soundDblClick(Sender: TObject);
begin
 magicsound('resources\audio\magic4.avi');
 magic4sound.enabled:=false;
end;

procedure TPic3.cauldronDragOver(Sender, Source: TObject; X, Y: Integer;
  State: TDragState; var Accept: Boolean);
begin
if (Status=40) and (pic2.displayeditem='glass2') then
  begin
   if (Source = InvPic) then Accept := True;
  end
else
if (Status=40) and (pic2.displayeditem='glass1') then
  begin
   if (Source = InvPic) then Accept := True;
  end
else
if (Status=40) and (pic2.displayeditem='waterflask') then
  begin
   if (Source = InvPic) then Accept := True;
  end
else
if (Status=40) and (pic2.displayeditem='powder') then
  begin
   if (Source = InvPic) then Accept := True;
  end
else
if (Status=40) and (pic2.displayeditem='mirror') then
  begin
   if (Source = InvPic) then Accept := True;
  end
else
if (Status=40) and (pic2.displayeditem='shieldbook') then
  begin
   if (Source = InvPic) then Accept := True;
  end
else
if (Status=40) and (pic2.displayeditem='emptyflask') then
  begin
   if (Source = InvPic) then Accept := True;
  end
 else Accept:=false
end;

procedure TPic3.cauldronDragDrop(Sender, Source: TObject; X, Y: Integer);
begin
if (status=40) and (pic2.displayeditem='waterflask') and (potion2=false) and (potion1finished=true) then
  begin
   videoplay('resources\anim\2_254.avi');
   waterflask:=false;
   inv_delay.Enabled:=true;
   potion2ready:=true;
  end
else
if (status=40) and (pic2.displayeditem='glass1') and (potion2ready=true) then
  begin
   videoplay('resources\anim\2_255.avi');
   golddustused:=true;
   glass2give:=true;
   ingredients:='potion2';
  end
else
if (status=40) and (pic2.displayeditem='shieldbook') and (potion2=true) then
  begin
   videoplay('resources\anim\2_252.avi');
   shieldbook:=false;
   shieldbook2:=true;
   firsttimeshieldbook2:=true;
  end
else
if (status=40) and (pic2.displayeditem='glass2') and (potion2=true) then
  begin
   videoplay('resources\anim\2_251.avi');
   glass2:=false;
   glass3:=true;
   firsttimeglass3:=true;
  end
else
if (status=40) and (pic2.displayeditem='powder') then
  begin
   videoplay('resources\anim\2_257.avi');
   powderconsumed:=true;
   powderused:=true;
  end
else
if (status=40) and (powderused=true) and (pic2.displayeditem='mirror') then
  begin
   videoplay('resources\anim\2_248.avi');
   mirrorused:=true;
  end
else
if (status=40) and (powderused=true) and (shieldbookused=false) and (pic2.displayeditem='shieldbook') then
  begin
   videoplay('resources\anim\2_247.avi');
   shieldbookused:=true;
  end
else
if (status=40) and (potion1=true) and (potion1used=false) and (pic2.displayeditem='emptyflask') then
  begin
   videoplay('resources\anim\2_250.avi');
   yellowflask:=true;
   gotyellowflask:=true;
  end
end;

procedure TPic3.cheat5Click(Sender: TObject);
begin
 yellowflask:=true;
 pic2.emptyflask:=false;
end;

procedure TPic3.soundNotify(Sender: TObject);
begin
 with Sender as TMediaPlayer do
   begin
     case Mode of
      mpStopped:
        begin
         if status=48 then
          begin
            Panel:=TTransparentPanel.Create(self);
            Panel.Parent := Self;
            Panel.Left := 72;
            Panel.Top := 40;
            Panel.Width:=640;
            Panel.Height:=480;
            sound.FileName:='resources\anim\2_337.avi';
            sound.Open;
            sound.Display:=panel;
            sound.DisplayRect:=Panel.ClientRect;
            sound.play;

            status:=49
          end
         else
          begin
           if status=49 then
            begin
             sound.FileName:='resources\audio\mirrorseq2.avi';
             sound.Open;
             sound.play;
             image1.Picture.loadfromfile('resources\img\2_112.jpeg');
             status:=50;
            end
         else
          begin
           if status=50 then
            panel.free;
            videoplay('resources\anim\2_340.avi');
            paper:=true;
            pic2.displayeditem:='paper';
            invpic.Picture.LoadFromFile('resources\inv\paper.gif');
            levervaultopen:=true;
            status:=51;
           end;
          end;
         end;

     end;
   end;
end;

procedure TPic3.chamberexitDblClick(Sender: TObject);
begin
 if status=53 then
  begin
   videoplay('resources\anim\2_345.avi');
   status:=18;
  end
end;

procedure TPic3.lever1DblClick(Sender: TObject);
begin
if status=51 then
  begin
   videoplay('resources\anim\2_343.avi');
   woodaccess:=true;
   status:=52;
  end
end;

procedure TPic3.lever2DblClick(Sender: TObject);
begin
if status=52 then
  begin
   videoplay('resources\anim\2_341.avi');
   woodaccess:=false;
   status:=51;
  end
end;

procedure TPic3.woodaccesssensorDblClick(Sender: TObject);
begin
if (status=13) and (woodaccess=false) then
  begin
   videoplay('resources\anim\2_217.avi');
   status:=15;
  end
else
if (status=13) and (woodaccess=true) then
  begin
   videoplay('resources\anim\2_218.avi');
   status:=16;
  end
end;

procedure TPic3.woodaccesssensor2DblClick(Sender: TObject);
begin
if (status=12) and (woodaccess=false) then
  begin
   videoplay('resources\anim\2_224.avi');
   status:=15;
  end
else
if (status=12) and (woodaccess=true) then
  begin
   videoplay('resources\anim\2_225.avi');
   status:=16;
  end
end;

procedure TPic3.cheat3Click(Sender: TObject);
begin
 woodaccess:= not woodaccess;
end;

procedure TPic3.gotowoodsDblClick(Sender: TObject);
begin
if (status=16) and (woodaccess=true) then
  begin
   music1.Notify:=false;
   music1.Pause;
   videoplay('resources\anim\2_227.avi');
   enterwoods:=true;
   status:=54;
  end
end;

procedure TPic3.exitwoodssensorDblClick(Sender: TObject);
begin
if status=54 then
  begin
   music1.Notify:=false;
   music1.Pause;
   videoplay('resources\anim\2_349.avi');
   gotowoods.visible:=true;
   exitwoodssensor.visible:=false;
   exitwoods:=true;
   status:=16;
  end
end;

procedure TPic3.enterwoodsensorDblClick(Sender: TObject);
begin
if status=54 then
  begin
   videoplay('resources\anim\2_363.avi');
   status:=55;
  end
end;

procedure TPic3.guardiantimeTimer(Sender: TObject);
begin
 videoplay('resources\anim\2_356.avi');
 status:=54;
 guardiantime.enabled:=false;
end;

procedure TPic3.guardiansensorDragOver(Sender, Source: TObject; X,
  Y: Integer; State: TDragState; var Accept: Boolean);
begin
if (Status=56) and (pic2.displayeditem='cloak') then
  begin
   if (Source = InvPic) then Accept := True;
  end
 else Accept:=false;
end;

procedure TPic3.guardiansensorDragDrop(Sender, Source: TObject; X,
  Y: Integer);
begin
if status=56 then
  begin
   videoplay('resources\anim\2_348.avi');
   status:=55;
   cloakused:=true;
   guardiantime.enabled:=false;
   guardian:=true;
  end
end;

procedure TPic3.podestsensorDblClick(Sender: TObject);
begin
if status=57 then
  begin
   videoplay('resources\anim\2_351.avi');
   status:=54;
  end;
end;

procedure TPic3.altarsensorDblClick(Sender: TObject);
begin
if status=55 then
  begin
   videoplay('resources\anim\2_357.avi');
   status:=58;
  end;
end;

procedure TPic3.cheat4Click(Sender: TObject);
begin
 guardian:=true;
 stone:=true;
end;

procedure TPic3.altarswitchDblClick(Sender: TObject);
begin
if status=58 then
  begin
   videoplay('resources\anim\2_359.avi');
   status:=59;
  end;
end;

procedure TPic3.altarofferingDragOver(Sender, Source: TObject; X,
  Y: Integer; State: TDragState; var Accept: Boolean);
begin
if (Status=58) and (pic2.displayeditem='shieldbook2') then
  begin
   if (Source = InvPic) then Accept := True;
  end
else
if (Status=58) and (pic2.displayeditem='shieldbook') then
  begin
   if (Source = InvPic) then Accept := True;
  end
else
if (Status=58) and (pic2.displayeditem='glass1') then
  begin
   if (Source = InvPic) then Accept := True;
  end
else
if (Status=58) and (pic2.displayeditem='glass2') then
  begin
   if (Source = InvPic) then Accept := True;
  end
else
if (Status=58) and (pic2.displayeditem='glass3') then
  begin
   if (Source = InvPic) then Accept := True;
  end
else
if (Status=58) and (pic2.displayeditem='paper') then
  begin
   if (Source = InvPic) then Accept := True;
  end
 else Accept:=false;
end;

procedure TPic3.altarofferingDragDrop(Sender, Source: TObject; X,
  Y: Integer);
begin
if (status=58) and (pic2.displayeditem='shieldbook') then
  begin
   videoplay('resources\anim\2_352.avi');
  end
else
if (status=58) and (pic2.displayeditem='glass1') then
  begin
   videoplay('resources\anim\2_353.avi');
  end
else
if (status=58) and (pic2.displayeditem='glass2') then
  begin
   videoplay('resources\anim\2_353.avi');
  end
else
if (status=58) and (glass3=false) and (shieldbook2=false) and (pic2.displayeditem='paper') then
  begin
   videoplay('resources\anim\2_353.avi');
  end
else
if (status=58) and (glass3=true) and (shieldbook2=false) and (pic2.displayeditem='paper') then
  begin
   videoplay('resources\anim\2_353.avi');
  end
else
if (status=58) and (glass3=false) and (shieldbook2=true) and (pic2.displayeditem='paper') then
  begin
   videoplay('resources\anim\2_353.avi');
  end
else
if (status=58) and (glass3=false) and (shieldbook2=true) and (pic2.displayeditem='shieldbook2') then
  begin
   videoplay('resources\anim\2_353.avi');
  end
else
if (status=58) and (glass3=true) and (shieldbook2=false) and (pic2.displayeditem='glass3') then
  begin
   videoplay('resources\anim\2_353.avi');
  end
else
if (status=58) and (glass3=true) and (shieldbook2=true) and (pic2.displayeditem='glass3') then
  begin
   music1.Notify:=false;
   music1.pause;
   videoplay('resources\anim\2_347.avi');
   invpic.visible:=false;
   status:=63;
  end
else
if (status=58) and (glass3=true) and (shieldbook2=true) and (pic2.displayeditem='shieldbook2') then
  begin
   music1.Notify:=false;
   music1.pause;
   videoplay('resources\anim\2_347.avi');
   invpic.visible:=false;
   status:=63;
  end
else
if (status=58) and (glass3=true) and (shieldbook2=true) and (pic2.displayeditem='paper') then
  begin
   music1.Notify:=false;
   music1.pause;
   videoplay('resources\anim\2_347.avi');
   invpic.Visible:=false;
   status:=63;
  end
end;

procedure TPic3.cavernentranceDblClick(Sender: TObject);
begin
if status=59 then
  begin
   music1.Notify:=false;
   music1.Pause;
   videoplay('resources\anim\2_362.avi');
   launchcavernmusic:=true;
   status:=60;
  end
end;

procedure TPic3.cavernexitDblClick(Sender: TObject);
begin
if status=60 then
  begin
   music1.Notify:=false;
   music1.Pause;
   videoplay('resources\anim\2_366.avi');
   launchwoodmusic:=true;
   status:=59;
  end
end;

procedure TPic3.watersensorDragOver(Sender, Source: TObject; X, Y: Integer;
  State: TDragState; var Accept: Boolean);
begin
if (Status=60) and (pic2.displayeditem='emptyflask') then
  begin
   if (Source = InvPic) then Accept := True;
  end
 else Accept:=false;
end;

procedure TPic3.watersensorDragDrop(Sender, Source: TObject; X,
  Y: Integer);
begin
if (status=60) and (pic2.displayeditem='emptyflask') then
  begin
   videoplay('resources\anim\2_367.avi');
   waterflask:=true;
   firsttimewaterflask:=true;
  end
end;

procedure TPic3.drawingsensorDblClick(Sender: TObject);
begin
if status=60 then
  begin
   videoplay('resources\anim\2_371.avi');
   status:=61;
  end
end;

procedure TPic3.stonesensorDragOver(Sender, Source: TObject; X, Y: Integer;
  State: TDragState; var Accept: Boolean);
begin
if (Status=61) and (pic2.displayeditem='stone') then
  begin
   if (Source = InvPic) then Accept := True;
  end
 else Accept:=false;
end;

procedure TPic3.stonesensorDragDrop(Sender, Source: TObject; X,
  Y: Integer);
begin
if (status=61) and (pic2.displayeditem='stone') then
  begin
   videoplay('resources\anim\2_369.avi');
   status:=62;
  end
end;

procedure TPic3.cupsensorDblClick(Sender: TObject);
begin
if status=62 then
  begin
   videoplay('resources\anim\2_368.avi');
   glass1:=true;
   firsttimeglass1:=true;
   status:=60;
  end
end;

procedure TPic3.cheat1Click(Sender: TObject);
begin
 powderused:=true;
 potion1:=true;
 potion1finished:=true;
 waterflask:=true;
 glass1:=true;
 //potion1filled:=true;
end;

procedure TPic3.gamesoundNotify(Sender: TObject);
begin
 if continuemusic=true then
  begin
   music1.Notify:=true;
   music1.Play;
   continuemusic:=false;

   magic1sound.enabled:=true;
   magic2sound.enabled:=true;
   magic3sound.enabled:=true;
   magic4sound.enabled:=true;
  end;
end;

procedure TPic3.final2soundNotify(Sender: TObject);
begin
if status=63 then
  begin
   videoplay('resources\anim\2_361.avi');
   status:=64;
  end
end;

procedure TPic3.cheat2Click(Sender: TObject);
begin
 guardian:=true;
 paper:=true;
 glass3:=true;
 shieldbook2:=true;
 woodaccess:= not woodaccess;
end;

procedure TPic3.delay_vidstartTimer(Sender: TObject);
begin
 delay_vidstart.enabled:=false;
 videoplay('resources\anim\2_187.avi');
 status:=0;
end;

procedure TPic3.cheat9Click(Sender: TObject);
begin
 shieldbook:=true;
end;

end.
