unit egg;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, jpeg;

type
  TfrmEgg = class(TForm)
    Button1: TButton;
    Image1: TImage;
    procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
  private
    ClickCounter: Integer;
  public
    function Execute(): boolean;
  end;

var
  frmEgg: TfrmEgg;

implementation

uses utils;

{$R *.dfm}

{ TfrmEgg }

function TfrmEgg.Execute: boolean;
begin
  ClickCounter:=0;
  Result:=ShowModal=mrOK;
end;

procedure TfrmEgg.Image1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  Disketto: TRect;
const
  TAUNTS: array [0..3] of string = ('PIECE02','IMGOOD12','JONES04','SSNORM02');
begin
  Disketto := Rect(188,195,203,210);
  if PointIntoRect(Point(X,Y), Disketto)  then
  begin
    Randomize();
    case ClickCounter of
     0: PlayResource(TAUNTS[Round(Random(Length(TAUNTS)))]);
     7: PlayResource('PISSES01');
    end;
    Inc(ClickCounter);
  end;
end;

end.
