Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actualjbadams

Posted 04 April 2013 - 05:56 AM

My first delphi game, monopoly, wich i did 12 years ago, looking at it now, it look aaawfull haha.

Here's a "small" snipet

///////////////////////////////////////////////////////////////////////////////////////////////////////////////DECIDE QUOI FAIRE QUAND LE JOUEUR ARRIVE SUR UNE CASE////////////////////////////////////////////////////////////////////////////////////////////////////////////////FUNCTION TMASTERForm.DECISION(APLAYER: TPLAYER): TPLAYER;LABEL RESTART_PTS,JUMPER,KILL1,KILL2,THE_END;VAR CPT: TMINMAXPLAYER;BEGINRESTART_PTS:CASE APLAYER.Pos OF 2,4,7,9,10,12,14,15,17,19,20,22,24,25,27,28,30,32,33,35,38,40:  BEGIN//////////////////////////////////////////////////////////////////////////////////////////////TERRAINS A VENDRE////////////////////////////////////////////////////////////////////////////////////////////   IF TERRAINS.TERRAINS_STATE[APLAYER.POS] = NOTHING THEN BEGIN    //SI LE TERRAIN EST A PERSONNE...    IF APLAYER.KIND <> KdComputer THEN BEGIN    BUYForm := TBUYFORM.Create(SELF);    BUYForm.LABELSTREET.Caption := TERRAINS.TERRAINS_STREET[APLAYER.POS];    IF APLAYER.CASH - TERRAINS.TERRAINS_PRICE[APLAYER.POS] < 0 THEN BUYFORM.BitBtnBUY.ENABLED := FALSE;     IF BUYForm.ShowModal = MROK THEN BEGIN      //CHANGE LE FIELD PROP ET NAME DE TERRAINS ET AJUSTE LE CASH DU JOUEUR      TERRAINS.TERRAINS_PROP[APLAYER.POS] := APLAYER.PlayerName;      TERRAINS.TERRAINS_STATE[APLAYER.POS] := IN_LOC;      APLAYER.Cash := APLAYER.Cash - TERRAINS.TERRAINS_PRICE[APLAYER.POS];     END;     BUYFORM.FREE;    END ELSE BEGIN     IF APLAYER.CASH - TERRAINS.TERRAINS_PRICE[APLAYER.POS] > -1 THEN BEGIN      TERRAINS.TERRAINS_PROP[APLAYER.POS] := APLAYER.PlayerName;      TERRAINS.TERRAINS_STATE[APLAYER.POS] := IN_LOC;      APLAYER.Cash := APLAYER.Cash - TERRAINS.TERRAINS_PRICE[APLAYER.POS];     END;     DELAY(DEF_DELAY);    END;    TERRAINS.Repaint;    UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));    GOTO THE_END;   END;//////////////////////////////////////////////////////////////////////////////////////////////SI LE TERRAIN EST AU JOUEUR EN COURS...////////////////////////////////////////////////////////////////////////////////////////////   //SI LE JOUEUR A ACHETER TOUT LES TERRAINS DE LA MEME COULEUR QUE LE TERRAINS EN COURS...   IF (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[2]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[4])) AND ((APLAYER.POS = 2) OR (APLAYER.POS = 4))) OR (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[7]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[9]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[10])) AND ((APLAYER.POS = 7) OR (APLAYER.POS = 9) OR (APLAYER.POS = 10))) OR      (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[12]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[14]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[15])) AND ((APLAYER.POS = 12) OR (APLAYER.POS = 14) OR (APLAYER.POS = 15))) OR (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[17]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[19]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[20])) AND ((APLAYER.POS = 17) OR (APLAYER.POS = 19) OR (APLAYER.POS = 20))) OR      (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[22]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[24]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[25])) AND ((APLAYER.POS = 22) OR (APLAYER.POS = 24) OR (APLAYER.POS = 25))) OR (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[27]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[28]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[30])) AND ((APLAYER.POS = 27) OR (APLAYER.POS = 28) OR (APLAYER.POS = 30))) OR      (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[32]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[33]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[35])) AND ((APLAYER.POS = 32) OR (APLAYER.POS = 33) OR (APLAYER.POS = 35))) OR (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[38]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[40])) AND ((APLAYER.POS = 38) OR (APLAYER.POS = 40)))    THEN BEGIN     //SI LE TERRAINS N'EST PAS HYPOTHEQUER     IF TERRAINS.TERRAINS_MORTAGE[APLAYER.POS] = FALSE THEN      IF APLAYER.KIND <> KdComputer THEN BEGIN      BUILDFORM := TBUILDFORM.CREATE(SELF);      //ENABLE OU DISABLE LES BUTTONS DE BUILDFORM SELON L'ETAT DU TERRAINS      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) >= 1) OR (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 1) < 0) THEN BUILDFORM.BitBtn1HOUSE.Enabled := FALSE;      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) >= 2) OR (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 2) < 0) THEN BUILDFORM.BitBtn2HOUSE.Enabled := FALSE;      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) >= 3) OR (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 3) < 0) THEN BUILDFORM.BitBtn3HOUSE.Enabled := FALSE;      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) >= 4) OR (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 4) < 0) THEN BUILDFORM.BitBtn4HOUSE.Enabled := FALSE;      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) >= 5) OR (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 5) < 0) THEN BUILDFORM.BitBtn1HOTEL.Enabled := FALSE;      IF BUILDForm.ShowModal = MROK THEN BEGIN       IF BUILDFORM.BitBtn1HOUSE.Tag = 1 THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := ONE_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 1); END;       IF BUILDFORM.BitBtn2HOUSE.Tag = 1 THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := TWO_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 2) END;       IF BUILDFORM.BitBtn3HOUSE.Tag = 1 THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := THREE_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 3) END;       IF BUILDFORM.BitBtn4HOUSE.Tag = 1 THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := FOUR_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 4) END;       IF BUILDFORM.BitBtn1HOTEL.Tag = 1 THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := A_HOTEL; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 5) END;       PLANCHE.CHANGE_TERRAINS_STATE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS],TRUE);      END;      BUILDFORM.FREE;     END ELSE BEGIN      //ACHETE LE MAXIMUM POSSIBLE      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) < 5) AND (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 5) > -1) THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := A_HOTEL; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 5) END;      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) < 4) AND (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 4) > -1) THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := FOUR_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 4) END;      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) < 3) AND (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 3) > -1) THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := THREE_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 3) END;      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) < 2) AND (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 2) > -1) THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := TWO_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 2) END;      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) < 1) AND (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 1) > -1) THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := ONE_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 1) END;      DELAY(DEF_DELAY);     END;     UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));     GOTO THE_END;    END;//////////////////////////////////////////////////////////////////////////////////////////////SI LE TERRAIN EST A UN AUTRE JOUEUR...////////////////////////////////////////////////////////////////////////////////////////////   IF (TERRAINS.TERRAINS_STATE[APLAYER.POS] <> NOTHING) AND (APLAYER.PlayerName <> TERRAINS.TERRAINS_PROP[APLAYER.POS]) THEN BEGIN    //SI LE TERRAINS N'EST PAS HYPOTHEQUER    IF TERRAINS.TERRAINS_MORTAGE[APLAYER.POS] = FALSE THEN    //SI LE JOUEUR EST HUMAIN...    IF APLAYER.KIND <> KdComputer THEN BEGIN     PAIDForm := TPAIDFORM.Create(SELF);     PAIDForm.LABELPAID.Caption := TERRAINS.TERRAINS_STREET[APLAYER.POS];     //DECIDE DU COUT PAR RAPPORT AU NOMBRE DE MAISON OU HOTEL     PAIDForm.LABELPRICETOPAY.TAG := GET_TERRAINS_PRICE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS]);     PAIDForm.LABELPRICETOPAY.CAPTION := 'YOU HAVE TO PAY ' + INTTOSTR(PAIDForm.LABELPRICETOPAY.TAG) + ' $';     PAIDForm.BitBtnPAID.Caption := 'PAY ' + INTTOSTR(PAIDForm.LABELPRICETOPAY.TAG) + ' $';     //PAS LE CHOIX!     IF PAIDForm.ShowModal = MROK THEN BEGIN      IF APLAYER.Cash - GET_TERRAINS_PRICE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS]) >= 0 THEN BEGIN//SI LE JOUEUR PEUT PAYER...       APLAYER.Cash := APLAYER.Cash - GET_TERRAINS_PRICE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS]);       ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],PAIDForm.LABELPRICETOPAY.TAG);      END ELSE BEGIN //SINON...KILL THE PLAYER!       KILL1:       KILLForm := TKILLFORM.CREATE(SELF);       KILLFORM.LABELBANCKROUT.CAPTION := APLAYER.PLAYERNAME + ' IS BANCKROUT !';       IF KILLForm.SHOWMODAL = MROK THEN BEGIN        ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.CASH);        KILL_PLAYER(STRTOINT(APLAYER.NAME[7]));        NEXT_PLAYERTURN;        PAIDForm.FREE;        KILLForm.FREE;        IF APLAYER.KIND = KdCOMPUTER THEN DELAY(DEF_DELAY);        GOTO THE_END;       END;      END;     END;     PAIDForm.FREE;     END ELSE BEGIN     //SI LE JOUEUR EST UN CPU      IF APLAYER.Cash - GET_TERRAINS_PRICE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS]) > -1 THEN BEGIN//SI LE JOUEUR PEUT PAYER...       APLAYER.Cash := APLAYER.Cash - GET_TERRAINS_PRICE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS]);       ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],GET_TERRAINS_PRICE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS]));      END ELSE BEGIN //SINON...KILL THE PLAYER!       GOTO KILL1;      END;      DELAY(DEF_DELAY);     END;     //UPDATE LES PLAYERS_BOARD EN ORDRE     UPADTE_TWO_BOARD(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_PROP_POS_INDEX(APLAYER.POS));    END;   GOTO THE_END;  END;//////////////////////////////////////////////////////////////////////////////////////////////SERVICES//////////////////////////////////////////////////////////////////////////////////////////// 13,29: BEGIN  CASE APLAYER.Pos OF   13: PLAY_THIS(SD_ELECTRICITY);   29: PLAY_THIS(SD_AQUEDUC);  END;//////////////////////////////////////////////////////////////////////////////////////////////SI LE SERVICE EST A VENDRE////////////////////////////////////////////////////////////////////////////////////////////  IF TERRAINS.TERRAINS_STATE[APLAYER.POS] = NOTHING THEN BEGIN   //SI LE JOUEUR EST HUMAIN   IF APLAYER.KIND <> KdComputer THEN BEGIN    BUYForm := TBUYFORM.Create(SELF);    BUYFORM.LABELSTREET.Caption := TERRAINS.TERRAINS_STREET[APLAYER.POS];    APLAYER.FORCE_TO_PAY_10X := FALSE;    IF APLAYER.CASH - TERRAINS.TERRAINS_PRICE[APLAYER.POS] < 0 THEN BUYFORM.BitBtnBUY.ENABLED := FALSE;    IF BUYForm.ShowModal = MROK THEN BEGIN    //CHANGE LE FIELD PROP ET NAME DE TERRAINS ET AJUSTE LE CASH DU JOUEUR    TERRAINS.TERRAINS_PROP[APLAYER.POS] := APLAYER.PlayerName;    TERRAINS.TERRAINS_STATE[APLAYER.POS] := IN_LOC;    APLAYER.Cash := APLAYER.Cash - TERRAINS.TERRAINS_PRICE[APLAYER.POS];    CASE APLAYER.SERVICESCOUNT OF     0: APLAYER.SERVICESCOUNT := 1;     1: APLAYER.SERVICESCOUNT := 2;    END;    END;    BUYFORM.FREE;   END ELSE BEGIN    //SI LE JPUEUR EST UN CPU    IF APLAYER.CASH - TERRAINS.TERRAINS_PRICE[APLAYER.POS] > -1 THEN BEGIN     //CHANGE LE FIELD PROP ET NAME DE TERRAINS ET AJUSTE LE CASH DU JOUEUR     TERRAINS.TERRAINS_PROP[APLAYER.POS] := APLAYER.PlayerName;     TERRAINS.TERRAINS_STATE[APLAYER.POS] := IN_LOC;     APLAYER.Cash := APLAYER.Cash - TERRAINS.TERRAINS_PRICE[APLAYER.POS];     CASE APLAYER.SERVICESCOUNT OF      0: APLAYER.SERVICESCOUNT := 1;      1: APLAYER.SERVICESCOUNT := 2;     END;    END;    DELAY(DEF_DELAY);   END;   TERRAINS.Repaint;   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));   GOTO THE_END;  END;//////////////////////////////////////////////////////////////////////////////////////////////SI LE SERVICE EST A UN AUTRE JOUEUR////////////////////////////////////////////////////////////////////////////////////////////  IF (TERRAINS.TERRAINS_STATE[APLAYER.POS] <> NOTHING) AND (TERRAINS.TERRAINS_PROP[APLAYER.POS] <> APLAYER.PlayerName) THEN BEGIN   //SI LE TERRAINS N'EST PAS HYPOTHEQUER   IF TERRAINS.TERRAINS_MORTAGE[APLAYER.POS] = FALSE THEN BEGIN    PAIDSERVICESForm := TPAIDSERVICESForm.Create(SELF);    //SI LE JOUEUR EST UN CPU CA VA DECLENCHER LE TIMER DANS L'AUTRE FICHE    IF APLAYER.KIND = KDCOMPUTER THEN PAIDSERVICESForm.TAG := 1;    PAIDSERVICESForm.MAINLabel.Caption := TERRAINS.TERRAINS_STREET[APLAYER.POS];    //TROUVE LE MULTIPLICATEUR    IF APLAYER.FORCE_TO_PAY_10X = FALSE THEN BEGIN     CASE GET_SERVICES_NUM(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.POS) OF      1: PAIDSERVICESForm.BitBtnPAID.Caption := 'PAID 4X THE DICE RESULT';      2: PAIDSERVICESForm.BitBtnPAID.Caption := 'PAID 10X THE DICE RESULT';     END;    END ELSE BEGIN     PAIDSERVICESForm.BitBtnPAID.Caption := 'PAID 10X THE DICE RESULT';     APLAYER.FORCE_TO_PAY_10X := FALSE;    END;    IF PAIDSERVICESForm.ShowModal = MROK THEN     IF APLAYER.Cash - PAIDSERVICESForm.BitBtnPAID.TAG > -1 THEN BEGIN      APLAYER.Cash := APLAYER.Cash - PAIDSERVICESForm.BitBtnPAID.TAG;      ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],PAIDSERVICESForm.BitBtnPAID.TAG);     END ELSE BEGIN      KILLForm := TKILLFORM.CREATE(SELF);      KILLFORM.LABELBANCKROUT.CAPTION := APLAYER.PLAYERNAME + ' IS BANCKROUT !';      IF KILLForm.SHOWMODAL = MROK THEN BEGIN       ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.CASH);       KILL_PLAYER(STRTOINT(APLAYER.NAME[7]));       NEXT_PLAYERTURN;       PAIDSERVICESForm.FREE;       KILLForm.FREE;       GOTO THE_END;      END;     END;    PAIDSERVICESForm.FREE;    //UPDATE LES PLAYERS_BOARD EN ORDRE     UPADTE_TWO_BOARD(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_PROP_POS_INDEX(APLAYER.POS));    END;    GOTO THE_END;   END;  END;//////////////////////////////////////////////////////////////////////////////////////////////TRAINS//////////////////////////////////////////////////////////////////////////////////////////// 6,16,26,36: BEGIN  PLAY_THIS(SD_TRAIN);//////////////////////////////////////////////////////////////////////////////////////////////SI LE TRAIN EST A VENDRE////////////////////////////////////////////////////////////////////////////////////////////  IF TERRAINS.TERRAINS_STATE[APLAYER.POS] = NOTHING THEN BEGIN   IF APLAYER.KIND <> KdComputer THEN BEGIN    BUYForm := TBUYFORM.Create(SELF);    BUYFORM.LABELSTREET.Caption := TERRAINS.TERRAINS_STREET[APLAYER.POS];    APLAYER.FORCE_TO_PAY_DOUBLE := FALSE;    IF APLAYER.CASH - TERRAINS.TERRAINS_PRICE[APLAYER.POS] < 0 THEN BUYFORM.BitBtnBUY.ENABLED := FALSE;    IF BUYForm.ShowModal = MROK THEN BEGIN    //CHANGE LE FIELD PROP ET NAME DE TERRAINS ET AJUSTE LE CASH DU JOUEUR     TERRAINS.TERRAINS_PROP[APLAYER.POS] := APLAYER.PlayerName;     TERRAINS.TERRAINS_STATE[APLAYER.POS] := IN_LOC;     APLAYER.Cash := APLAYER.Cash - TERRAINS.TERRAINS_PRICE[APLAYER.POS];     APLAYER.TRAINSCOUNT := APLAYER.TRAINSCOUNT + 1;    END;    BUYFORM.FREE;   END ELSE BEGIN    IF APLAYER.CASH - TERRAINS.TERRAINS_PRICE[APLAYER.POS] > -1 THEN BEGIN     TERRAINS.TERRAINS_PROP[APLAYER.POS] := APLAYER.PlayerName;     TERRAINS.TERRAINS_STATE[APLAYER.POS] := IN_LOC;     APLAYER.Cash := APLAYER.Cash - TERRAINS.TERRAINS_PRICE[APLAYER.POS];     APLAYER.TRAINSCOUNT := APLAYER.TRAINSCOUNT + 1;    END;   END;   TERRAINS.Repaint;   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));   GOTO THE_END;  END;//////////////////////////////////////////////////////////////////////////////////////////////SI LE TRAINS EST A UN AUTRE JOUEUR////////////////////////////////////////////////////////////////////////////////////////////  IF (TERRAINS.TERRAINS_STATE[APLAYER.POS] <> NOTHING) AND (TERRAINS.TERRAINS_PROP[APLAYER.POS] <> APLAYER.PlayerName) THEN BEGIN   //SI LE TERRAINS N'EST PAS HYPOTHEQUER   IF TERRAINS.TERRAINS_MORTAGE[APLAYER.POS] = FALSE THEN    //SI LE JOUEUR EST HUMAIN...    IF APLAYER.KIND <> KdComputer THEN BEGIN     PAIDForm := TPAIDForm.Create(SELF);     PAIDForm.MAINPanel.Caption := TERRAINS.TERRAINS_STREET[APLAYER.POS];     //FIND THE AMOUNT TO PAY     PAIDForm.BitBtnPAID.TAG := Trains_CountToTrainsLocPrice(GET_TRAINS_NUM(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.POS));     //FORCE LE JOUEUR A PAYER LE DOUBLE DU MONTANT     IF APLAYER.FORCE_TO_PAY_DOUBLE = TRUE THEN BEGIN      PAIDForm.BitBtnPAID.TAG := PAIDForm.BitBtnPAID.TAG * 2;      APLAYER.FORCE_TO_PAY_DOUBLE := FALSE;     END;     PAIDForm.LABELPRICETOPAY.CAPTION := 'YOU HAVE TO PAY ' + INTTOSTR(PAIDForm.BitBtnPAID.TAG) + ' $';     PAIDForm.BitBtnPAID.Caption := 'PAY ' + INTTOSTR(PAIDForm.BitBtnPAID.TAG) + ' $';     IF PAIDForm.ShowModal = MROK THEN BEGIN      IF APLAYER.Cash - PAIDForm.BitBtnPAID.TAG >= 0 THEN BEGIN       APLAYER.Cash := APLAYER.Cash - PAIDForm.BitBtnPAID.TAG;       ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],PAIDForm.BitBtnPAID.TAG);      END ELSE BEGIN       KILL2:       KILLForm := TKILLFORM.CREATE(SELF);       KILLFORM.LABELBANCKROUT.CAPTION := APLAYER.PLAYERNAME + ' IS BANCKROUT !';       IF KILLForm.SHOWMODAL = MROK THEN BEGIN        ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.CASH);        KILL_PLAYER(STRTOINT(APLAYER.NAME[7]));        NEXT_PLAYERTURN;        PAIDForm.FREE;        KILLForm.FREE;        GOTO THE_END;       END;      END;     END;     PAIDForm.FREE;    END ELSE BEGIN     IF APLAYER.Cash - Trains_CountToTrainsLocPrice(GET_TRAINS_NUM(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.POS)) >= 0 THEN BEGIN      APLAYER.Cash := APLAYER.Cash - Trains_CountToTrainsLocPrice(GET_TRAINS_NUM(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.POS));      ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],Trains_CountToTrainsLocPrice(GET_TRAINS_NUM(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.POS)));     END ELSE BEGIN      GOTO KILL2;     END;    END;     UPADTE_TWO_BOARD(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_PROP_POS_INDEX(APLAYER.POS));    GOTO THE_END;   END;  END;//////////////////////////////////////////////////////////////////////////////////////////////LES IMPOTS//////////////////////////////////////////////////////////////////////////////////////////// 5:  BEGIN  IF APLAYER.KIND = KDHUMAN THEN BEGIN  IMPOTSForm := TIMPOTSForm.Create(SELF);  IF IMPOTSFORM.ShowModal = MROK THEN BEGIN   IF IMPOTSFORM.BitBtn10PCT.TAG = 1 THEN BEGIN TERRAINS.JACKPOT := TERRAINS.JACKPOT + Round(APLAYER.CASH / 10); APLAYER.CASH := Round(APLAYER.CASH - (APLAYER.CASH / 10)); END;   IF IMPOTSFORM.BitBtn200PIASTE.TAG = 1 THEN BEGIN TERRAINS.JACKPOT := TERRAINS.JACKPOT + 200; APLAYER.CASH := APLAYER.CASH - 200; END;  END;  IMPOTSForm.FREE;  END;  IF APLAYER.KIND = KDCOMPUTER THEN BEGIN   IF APLAYER.CASH < 2000 THEN BEGIN    TERRAINS.JACKPOT := TERRAINS.JACKPOT + Round(APLAYER.CASH / 10); APLAYER.CASH := Round(APLAYER.CASH - (APLAYER.CASH / 10));   END ELSE BEGIN    TERRAINS.JACKPOT := TERRAINS.JACKPOT + 200; APLAYER.CASH := 200;   END;   DELAY(DEF_DELAY);  END;  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));  GOTO THE_END; END;//////////////////////////////////////////////////////////////////////////////////////////////LES TAXES//////////////////////////////////////////////////////////////////////////////////////////// 39:  BEGIN  IF APLAYER.KIND = KDHUMAN THEN BEGIN   PAIDForm := TPAIDForm.Create(SELF);   PAIDForm.LABELPAID.Caption := 'THE FUCKING TAXES !!!';   PAIDForm.LABELPRICETOPAY.Caption := 'PAY 75 $';   PAIDForm.BitBtnPAID.Caption := 'PAY 75 $';   IF PAIDForm.ShowModal = MROK THEN BEGIN    APLAYER.CASH := APLAYER.CASH - 75;    TERRAINS.JACKPOT := TERRAINS.JACKPOT + 75;   END;   PAIDForm.FREE;  END;  IF APLAYER.KIND = KDCOMPUTER THEN BEGIN   APLAYER.CASH := APLAYER.CASH - 75;   TERRAINS.JACKPOT := TERRAINS.JACKPOT + 75;   DELAY(DEF_DELAY);  END;  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));  GOTO THE_END; END;//////////////////////////////////////////////////////////////////////////////////////////////GO//////////////////////////////////////////////////////////////////////////////////////////// 1:  BEGIN   PLAY_THIS(SD_GO);   IF APLAYER.CAN_HAVE_400_PIASS_AT_GO = TRUE THEN BEGIN    APLAYER.CASH := APLAYER.CASH + 200;    UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));   END ELSE BEGIN    APLAYER.CAN_HAVE_400_PIASS_AT_GO := TRUE;   END;   GOTO THE_END;  END;//////////////////////////////////////////////////////////////////////////////////////////////LA PRISON//////////////////////////////////////////////////////////////////////////////////////////// 11:  BEGIN   GOTO THE_END;  END;//////////////////////////////////////////////////////////////////////////////////////////////LE JACKPOT//////////////////////////////////////////////////////////////////////////////////////////// 21:  BEGIN  PLAY_THIS(SD_JACKPOT);  APLAYER.CASH := APLAYER.CASH + TERRAINS.JACKPOT;  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));  DELAY(DEF_DELAY);  TERRAINS.JACKPOT := 500;  TERRAINS.Repaint;  GOTO THE_END; END;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////LA POLICE//////////////////////////////////////////////////////////////////////////////////////////// 31:  BEGIN   PLAY_THIS(SD_GOTOJAIL);   CRISSE_THE_PLAYER_IN_JAIL(STRTOINT(APLAYER.NAME[7]));   GOTO THE_END;  END;//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////LES CARTES//////////////////////////////////////////////////////////////////////////////////////////// 3,18,34,8,23,37:  BEGIN  PLAY_THIS(SD_CARD);  JUMPER:  IF STRTOINT(MOVEFORM.NumericEditRANDOM_NUMBER.Text) = 0 THEN BEGIN   //SI LE CHECKBOXFIXEDNUM.CHECKED = FALSE   TERRAINS.RAND_CARD_NUM := RANDOM(16) + 1;  END ELSE BEGIN   //SI LE CHECKBOXFIXEDNUM.CHECKED = TRUE   TERRAINS.RAND_CARD_NUM := STRTOINT(MOVEFORM.NumericEditRANDOM_NUMBER.Text);  END;  //SI LA CARTE EST UNE CARTE DE SORTIE DE PRISON  IF TERRAINS.RAND_CARD_NUM = 15 THEN BEGIN  //CHECK SI PERSONNE N'A LA CARTE SINON GOTO JUMPER   CASE APLAYER.POS OF    3,18,34: IF (PriCdYELLOW IN PLAYER1.PRISON_CARD) OR (PriCdYELLOW IN PLAYER2.PRISON_CARD) OR (PriCdYELLOW IN PLAYER3.PRISON_CARD) OR (PriCdYELLOW IN PLAYER4.PRISON_CARD) OR (PriCdYELLOW IN PLAYER5.PRISON_CARD) OR (PriCdYELLOW IN PLAYER6.PRISON_CARD) OR (PriCdYELLOW IN PLAYER7.PRISON_CARD) OR (PriCdYELLOW IN PLAYER8.PRISON_CARD) THEN BEGIN     TERRAINS.RAND_CARD_NUM := RANDOM(16) + 1;     MOVEFORM.NumericEditRANDOM_NUMBER.Text := INTTOSTR(TERRAINS.RAND_CARD_NUM);     GOTO JUMPER;    END;    8,23,37: IF (PriCdBLUE IN PLAYER1.PRISON_CARD) OR (PriCdBLUE IN PLAYER2.PRISON_CARD) OR (PriCdBLUE IN PLAYER3.PRISON_CARD) OR (PriCdBLUE IN PLAYER4.PRISON_CARD) OR (PriCdBLUE IN PLAYER5.PRISON_CARD) OR (PriCdBLUE IN PLAYER6.PRISON_CARD) OR (PriCdBLUE IN PLAYER7.PRISON_CARD) OR (PriCdBLUE IN PLAYER8.PRISON_CARD) THEN BEGIN     TERRAINS.RAND_CARD_NUM := RANDOM(16) + 1;     MOVEFORM.NumericEditRANDOM_NUMBER.Text := INTTOSTR(TERRAINS.RAND_CARD_NUM);     GOTO JUMPER;    END;   END;  END;  TERRAINS.REPAINT; //DRAW THE CORRECT IMAGE INTO TERRAINS  DELAY(DEF_DELAY);      //PAUSE 2 SECONDS   CASE APLAYER.POS OF    3,18,34: BEGIN              CASE TERRAINS.RAND_CARD_NUM OF               1:BEGIN                  APLAYER.Cash := APLAYER.CASH - 50;                  TERRAINS.JACKPOT := TERRAINS.JACKPOT + 50;                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                 END;               2:BEGIN                  APLAYER.Cash := APLAYER.Cash - (40 * HOUSE_COUNTER(APLAYER.PLAYERNAME));                  APLAYER.Cash := APLAYER.Cash - (115 * HOTEL_COUNTER(APLAYER.PLAYERNAME));                  TERRAINS.JACKPOT := TERRAINS.JACKPOT + ((40 * HOUSE_COUNTER(APLAYER.PLAYERNAME)) + (115 * HOTEL_COUNTER(APLAYER.PLAYERNAME)));                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                 END;               3:BEGIN                  APLAYER.Cash := APLAYER.CASH - 100;                  TERRAINS.JACKPOT := TERRAINS.JACKPOT + 100;                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                 END;               4:BEGIN                  APLAYER.Cash := APLAYER.CASH - 150;                  TERRAINS.JACKPOT := TERRAINS.JACKPOT + 150;                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                 END;               5:BEGIN                  APLAYER.Cash := APLAYER.CASH + 10;                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                 END;               6:BEGIN                  APLAYER.Cash := APLAYER.CASH + 45;                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                 END;               7:BEGIN                  APLAYER.Cash := APLAYER.CASH + 200;                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                 END;               8:BEGIN                  APLAYER.Cash := APLAYER.CASH + 20;                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                 END;               9:BEGIN                  FOR CPT := 1 TO 8 DO IF (APLAYER.NAME <> TPlayer(Components[PLAYER_INDX[CPT]]).NAME) AND (TPlayer(Components[PLAYER_INDX[CPT]]).KIND <> KDNONE) THEN BEGIN APLAYER.CASH := APLAYER.CASH + 50; TPlayer(Components[PLAYER_INDX[CPT]]).CASH := TPlayer(Components[PLAYER_INDX[CPT]]).CASH - 50; UPDATE_PLAYER_BOARD(CPT); END;                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                 END;               10:BEGIN                   APLAYER.Cash := APLAYER.CASH + 100;                   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                  END;               11:BEGIN                   APLAYER.Cash := APLAYER.CASH + 100;                   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                  END;               12:BEGIN                   APLAYER.Cash := APLAYER.CASH + 100;                   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                  END;               13:BEGIN                   APLAYER.Cash := APLAYER.CASH + 25;                   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                  END;               14:BEGIN                   APLAYER.CAN_HAVE_400_PIASS_AT_GO := FALSE;                   MOVE_BY_A_CARD := TRUE;                   MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),1,DIFOWARD);                  END;               15:BEGIN                   APLAYER.PRISON_CARD := APLAYER.PRISON_CARD + [PriCdYELLOW];                   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                  END;               16:BEGIN                   APLAYER.JailTurnLeft := 3;                   MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),11,DIFOWARD);                  END;             END;    END;    8,23,37: BEGIN              CASE TERRAINS.RAND_CARD_NUM OF               1:BEGIN                  FOR CPT := 1 TO 8 DO IF (APLAYER.NAME <> TPlayer(Components[PLAYER_INDX[CPT]]).NAME) AND (TPlayer(Components[PLAYER_INDX[CPT]]).KIND <> KDNONE) THEN BEGIN APLAYER.CASH := APLAYER.CASH - 50; TERRAINS.JACKPOT := TERRAINS.JACKPOT + 50; TPlayer(Components[PLAYER_INDX[CPT]]).CASH := TPlayer(Components[PLAYER_INDX[CPT]]).CASH + 50; UPDATE_PLAYER_BOARD(CPT); END;                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                 END;               2:BEGIN                  APLAYER.Cash := APLAYER.CASH - 15;                  TERRAINS.JACKPOT := TERRAINS.JACKPOT + 15;                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                 END;               3:BEGIN                  APLAYER.Cash := APLAYER.Cash - (25 * HOUSE_COUNTER(APLAYER.PLAYERNAME));                  APLAYER.Cash := APLAYER.Cash - (100 * HOTEL_COUNTER(APLAYER.PLAYERNAME));                  TERRAINS.JACKPOT := TERRAINS.JACKPOT + ((25 * HOUSE_COUNTER(APLAYER.PLAYERNAME)) + (100 * HOTEL_COUNTER(APLAYER.PLAYERNAME)));                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                 END;               4:BEGIN                  APLAYER.Cash := APLAYER.CASH + 150;                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                 END;               5:BEGIN                  APLAYER.Cash := APLAYER.CASH + 50;                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                 END;               6:BEGIN                  APLAYER.FORCE_TO_PAY_10X := TRUE;                  CASE APLAYER.POS OF                   8,37: BEGIN                          MOVE_BY_A_CARD := TRUE;                          MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),13,DIFOWARD);                         END;                   23: BEGIN                        MOVE_BY_A_CARD := TRUE;                        MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),29,DIFOWARD);                       END;                  END;                 END;               7:BEGIN                  MOVE_BY_A_CARD := TRUE;                  MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),25,DIFOWARD);                 END;               8:BEGIN                  APLAYER.CAN_HAVE_400_PIASS_AT_GO := FALSE;                  MOVE_BY_A_CARD := TRUE;                  MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),1,DIFOWARD);                 END;               9:BEGIN                  MOVE_BY_A_CARD := TRUE;                  MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),40,DIFOWARD);                 END;               10:BEGIN                   MOVE_BY_A_CARD := TRUE;                   MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),FIND_LIMIT(GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),3,DIREVERSE),DIREVERSE);                  END;               11:BEGIN                   MOVE_BY_A_CARD := TRUE;                   MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),6,DIFOWARD);                  END;               12,14:BEGIN                  APLAYER.FORCE_TO_PAY_DOUBLE := TRUE;                   CASE APLAYER.POS OF                    8: BEGIN                        MOVE_BY_A_CARD := TRUE;                        MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),16,DIFOWARD);                       END;                    23: BEGIN                         MOVE_BY_A_CARD := TRUE;                         MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),26,DIFOWARD);                        END;                    37: BEGIN                         MOVE_BY_A_CARD := TRUE;                         MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),6,DIFOWARD);                        END;                    END;                  END;               13:BEGIN                   MOVE_BY_A_CARD := TRUE;                   MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),12,DIFOWARD);                  END;               15:BEGIN                   APLAYER.PRISON_CARD := APLAYER.PRISON_CARD + [PriCdBLUE];                   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));                  END;               16:BEGIN                   APLAYER.JailTurnLeft := 3;                   MOVE_BY_A_CARD := TRUE;                   MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),11,DIFOWARD);                  END;             END;    END;   END;END;////////////////////////////////////////////////////////////////////////////////////////////END;THE_END:RESULT := APLAYER;END;////////////////////////////////////////////////////////////////////////////////////////////////////////////////////CODE A EXECUTER QUAND LE JOUEUR EST EN PRISON///////////////////////////////////////////////////////////////////////////////////////////////////////////////////PROCEDURE TMASTERFORM.JAIL_TURN;BEGIN//SI LE JOUEUR EST HUMAINIF GET_PLAYER_KIND(PLAYERTURN) = KdHUMAN THEN BEGIN JAILForm := TJAILForm.CREATE(SELF); //SI LE JOUEUR NE PEUT PAS PAYER...LE BUTTON PAY VA ETRE DESACTIVÉE IF GET_PLAYER_CASH(PLAYERTURN) - 50 < 0 THEN JAILForm.BitBtnPAY.ENABLED := FALSE; IF JAILForm.ShowModal = MROK THEN BEGIN  //SORT LE JOUEUR DE PRISON  SET_PLAYERJAILTURNLEFT(PLAYERTURN,0);  SET_PLAYER_CASH(PLAYERTURN,GET_PLAYER_CASH(PLAYERTURN) - 50);  TERRAINS.JACKPOT := TERRAINS.JACKPOT + 50;  UPDATE_PLAYER_BOARD(PLAYERTURN); END ELSE BEGIN  //BRASSE LES DEÉ  BITBTNTROW.CLICK; END; JAILForm.FREE;END ELSE BEGIN //SI LE JOUEUR EST UN CPU IF GET_PLAYER_CASH(PLAYERTURN) - 50 > 0 THEN BEGIN  //SORT LE JOUEUR DE PRISON  SET_PLAYERJAILTURNLEFT(PLAYERTURN,0);  SET_PLAYER_CASH(PLAYERTURN,GET_PLAYER_CASH(PLAYERTURN) - 50);  TERRAINS.JACKPOT := TERRAINS.JACKPOT + 50;  UPDATE_PLAYER_BOARD(PLAYERTURN); END ELSE BEGIN  //BRASSE LES DEÉ  BITBTNTROW.CLICK; END;END;END;

 

Here's another part (or "humm, what's pointers and loops for?")

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////CREATE THE FORM////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////procedure TMASTERForm.FormCreate(Sender: TObject);begin//PUT THE CURRENT DIRECTORY(PATH) INTO APPDIRGETDIR(0,APPDIR);//FORCE THE SCREEN TO BE 800 x 600(NO TEST TO SEE IF WE CAN ???)RESSWITCHER := TRESSWITCHER.Create(SELF);//DATA TO BE USE WHEN CLOSING THE FORM AND RESIZING SCREEN TO ORIGINAL STATERESSWITCHDAT.W := SCREEN.Width;RESSWITCHDAT.H := SCREEN.Height;RESSWITCHDAT.C := GetDeviceCaps(GetDc(GetDesktopWindow),BITSPIXEL);//CHANGE THE RESOLUTIONResSwitcher.ChangeRes(800,600,RESSWITCHDAT.C);//CREATE THE FORM USED TO MOVE PLAYERS(MUST BE GLOBAL)MOVEFORM := TMOVEFORM.CREATE(SELF);//SET-UP THE MASTERPAGEMASTERFORM.BorderStyle := BSNONE;MASTERFORM.SetBounds(0,0,800,600);BITBTNMORTAGE.ENABLED := FALSE;//CREATE THE PLAYERXPLAYERX1 := CREATE_PLAYER(1,2);PLAYERX2 := CREATE_PLAYER(2,4);PLAYERX3 := CREATE_PLAYER(3,7);PLAYERX4 := CREATE_PLAYER(4,9);PLAYERX5 := CREATE_PLAYER(5,10);PLAYERX6 := CREATE_PLAYER(6,12);PLAYERX7 := CREATE_PLAYER(7,14);PLAYERX8 := CREATE_PLAYER(8,15);PLAYERX9 := CREATE_PLAYER(9,17);PLAYERX10 := CREATE_PLAYER(10,19);PLAYERX11 := CREATE_PLAYER(11,20);PLAYERX12 := CREATE_PLAYER(12,22);PLAYERX13 := CREATE_PLAYER(13,24);PLAYERX14 := CREATE_PLAYER(14,25);PLAYERX15 := CREATE_PLAYER(15,27);PLAYERX16 := CREATE_PLAYER(16,28);PLAYERX17 := CREATE_PLAYER(17,30);PLAYERX18 := CREATE_PLAYER(18,32);PLAYERX19 := CREATE_PLAYER(19,33);PLAYERX20 := CREATE_PLAYER(20,35);PLAYERX21 := CREATE_PLAYER(21,38);PLAYERX22 := CREATE_PLAYER(22,40);PLAYERX23 := CREATE_PLAYER(23,6);PLAYERX24 := CREATE_PLAYER(24,16);PLAYERX25 := CREATE_PLAYER(25,26);PLAYERX26 := CREATE_PLAYER(26,36);PLAYERX27 := CREATE_PLAYER(27,13);PLAYERX28 := CREATE_PLAYER(28,29);//INITIALISE SOME VARIABLESSET_ARRAYS;CAN_CLICK := TRUE;PLAYERTURN := 8;TERRAINS.JACKPOT := 500;//CREATE THE SET-UPFormTRY SET_UPFORM := TSET_UPFORM.Create(SELF); IF SET_UPFORM.SHOWMODAL = MROK THEN BEGIN //SI LE JOUEUR A PESSER SUR OK...  INIT_PLAYER;  PLACE_PLAYERS;  NEXT_PLAYERTURN; END ELSE BEGIN                            //SINON...CLEAN L'APP ET L'ARRETE DIRECTEMENT  SET_UPFORM.Free;  ResSwitcher.ChangeRes(RESSWITCHDAT.W,RESSWITCHDAT.H,RESSWITCHDAT.C);  PLAYERX1.FREE; PLAYERX2.FREE; PLAYERX3.FREE; PLAYERX4.FREE; PLAYERX5.FREE; PLAYERX6.FREE; PLAYERX7.FREE; PLAYERX8.FREE; PLAYERX9.FREE; PLAYERX10.FREE; PLAYERX11.FREE; PLAYERX12.FREE; PLAYERX13.FREE; PLAYERX14.FREE; PLAYERX15.FREE; PLAYERX16.FREE; PLAYERX17.FREE; PLAYERX18.FREE; PLAYERX19.FREE; PLAYERX20.FREE; PLAYERX21.FREE; PLAYERX22.FREE; PLAYERX23.FREE; PLAYERX24.FREE; PLAYERX25.FREE; PLAYERX26.FREE; PLAYERX27.FREE; PLAYERX28.FREE;  MOVEFORM.FREE;  RESSWITCHER.FREE;  HALT; END;FINALLY SET_UPFORM.FREE;END;end;

 

Seeing that after all those years of experience under my belt want to make me cut myself.

 

Enjoy!

: Restored post contents from history.


#3Vortez

Posted 04 April 2013 - 01:45 AM


#2Vortez

Posted 04 March 2013 - 07:47 PM

My first delphi game, monopoly, wich i did 12 years ago, looking at it now, it look aaawfull haha.

Here's a "small" snipet

////////////////////////////////////////////////////////////////////////////////////////////
///////////////////DECIDE QUOI FAIRE QUAND LE JOUEUR ARRIVE SUR UNE CASE////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
FUNCTION TMASTERForm.DECISION(APLAYER: TPLAYER): TPLAYER;
LABEL RESTART_PTS,JUMPER,KILL1,KILL2,THE_END;
VAR
 CPT: TMINMAXPLAYER;
BEGIN
RESTART_PTS:
CASE APLAYER.Pos OF
 2,4,7,9,10,12,14,15,17,19,20,22,24,25,27,28,30,32,33,35,38,40:
  BEGIN
////////////////////////////////////////////////////////////////////////////////////////////
//TERRAINS A VENDRE
////////////////////////////////////////////////////////////////////////////////////////////
   IF TERRAINS.TERRAINS_STATE[APLAYER.POS] = NOTHING THEN BEGIN
    //SI LE TERRAIN EST A PERSONNE...
    IF APLAYER.KIND <> KdComputer THEN BEGIN
    BUYForm := TBUYFORM.Create(SELF);
    BUYForm.LABELSTREET.Caption := TERRAINS.TERRAINS_STREET[APLAYER.POS];
    IF APLAYER.CASH - TERRAINS.TERRAINS_PRICE[APLAYER.POS] < 0 THEN BUYFORM.BitBtnBUY.ENABLED := FALSE;
     IF BUYForm.ShowModal = MROK THEN BEGIN
      //CHANGE LE FIELD PROP ET NAME DE TERRAINS ET AJUSTE LE CASH DU JOUEUR
      TERRAINS.TERRAINS_PROP[APLAYER.POS] := APLAYER.PlayerName;
      TERRAINS.TERRAINS_STATE[APLAYER.POS] := IN_LOC;
      APLAYER.Cash := APLAYER.Cash - TERRAINS.TERRAINS_PRICE[APLAYER.POS];
     END;
     BUYFORM.FREE;
    END ELSE BEGIN
     IF APLAYER.CASH - TERRAINS.TERRAINS_PRICE[APLAYER.POS] > -1 THEN BEGIN
      TERRAINS.TERRAINS_PROP[APLAYER.POS] := APLAYER.PlayerName;
      TERRAINS.TERRAINS_STATE[APLAYER.POS] := IN_LOC;
      APLAYER.Cash := APLAYER.Cash - TERRAINS.TERRAINS_PRICE[APLAYER.POS];
     END;
     DELAY(DEF_DELAY);
    END;
    TERRAINS.Repaint;
    UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
    GOTO THE_END;
   END;
////////////////////////////////////////////////////////////////////////////////////////////
//SI LE TERRAIN EST AU JOUEUR EN COURS...
////////////////////////////////////////////////////////////////////////////////////////////
   //SI LE JOUEUR A ACHETER TOUT LES TERRAINS DE LA MEME COULEUR QUE LE TERRAINS EN COURS...
   IF (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[2]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[4])) AND ((APLAYER.POS = 2) OR (APLAYER.POS = 4))) OR (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[7]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[9]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[10])) AND ((APLAYER.POS = 7) OR (APLAYER.POS = 9) OR (APLAYER.POS = 10))) OR
      (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[12]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[14]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[15])) AND ((APLAYER.POS = 12) OR (APLAYER.POS = 14) OR (APLAYER.POS = 15))) OR (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[17]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[19]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[20])) AND ((APLAYER.POS = 17) OR (APLAYER.POS = 19) OR (APLAYER.POS = 20))) OR
      (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[22]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[24]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[25])) AND ((APLAYER.POS = 22) OR (APLAYER.POS = 24) OR (APLAYER.POS = 25))) OR (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[27]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[28]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[30])) AND ((APLAYER.POS = 27) OR (APLAYER.POS = 28) OR (APLAYER.POS = 30))) OR
      (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[32]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[33]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[35])) AND ((APLAYER.POS = 32) OR (APLAYER.POS = 33) OR (APLAYER.POS = 35))) OR (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[38]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[40])) AND ((APLAYER.POS = 38) OR (APLAYER.POS = 40)))
    THEN BEGIN
     //SI LE TERRAINS N'EST PAS HYPOTHEQUER
     IF TERRAINS.TERRAINS_MORTAGE[APLAYER.POS] = FALSE THEN
      IF APLAYER.KIND <> KdComputer THEN BEGIN
      BUILDFORM := TBUILDFORM.CREATE(SELF);
      //ENABLE OU DISABLE LES BUTTONS DE BUILDFORM SELON L'ETAT DU TERRAINS
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) >= 1) OR (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 1) < 0) THEN BUILDFORM.BitBtn1HOUSE.Enabled := FALSE;
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) >= 2) OR (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 2) < 0) THEN BUILDFORM.BitBtn2HOUSE.Enabled := FALSE;
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) >= 3) OR (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 3) < 0) THEN BUILDFORM.BitBtn3HOUSE.Enabled := FALSE;
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) >= 4) OR (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 4) < 0) THEN BUILDFORM.BitBtn4HOUSE.Enabled := FALSE;
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) >= 5) OR (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 5) < 0) THEN BUILDFORM.BitBtn1HOTEL.Enabled := FALSE;
      IF BUILDForm.ShowModal = MROK THEN BEGIN
       IF BUILDFORM.BitBtn1HOUSE.Tag = 1 THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := ONE_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 1); END;
       IF BUILDFORM.BitBtn2HOUSE.Tag = 1 THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := TWO_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 2) END;
       IF BUILDFORM.BitBtn3HOUSE.Tag = 1 THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := THREE_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 3) END;
       IF BUILDFORM.BitBtn4HOUSE.Tag = 1 THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := FOUR_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 4) END;
       IF BUILDFORM.BitBtn1HOTEL.Tag = 1 THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := A_HOTEL; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 5) END;
       PLANCHE.CHANGE_TERRAINS_STATE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS],TRUE);
      END;
      BUILDFORM.FREE;
     END ELSE BEGIN
      //ACHETE LE MAXIMUM POSSIBLE
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) < 5) AND (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 5) > -1) THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := A_HOTEL; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 5) END;
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) < 4) AND (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 4) > -1) THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := FOUR_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 4) END;
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) < 3) AND (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 3) > -1) THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := THREE_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 3) END;
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) < 2) AND (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 2) > -1) THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := TWO_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 2) END;
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) < 1) AND (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 1) > -1) THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := ONE_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 1) END;
      DELAY(DEF_DELAY);
     END;
     UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
     GOTO THE_END;
    END;
////////////////////////////////////////////////////////////////////////////////////////////
//SI LE TERRAIN EST A UN AUTRE JOUEUR...
////////////////////////////////////////////////////////////////////////////////////////////
   IF (TERRAINS.TERRAINS_STATE[APLAYER.POS] <> NOTHING) AND (APLAYER.PlayerName <> TERRAINS.TERRAINS_PROP[APLAYER.POS]) THEN BEGIN
    //SI LE TERRAINS N'EST PAS HYPOTHEQUER
    IF TERRAINS.TERRAINS_MORTAGE[APLAYER.POS] = FALSE THEN
    //SI LE JOUEUR EST HUMAIN...
    IF APLAYER.KIND <> KdComputer THEN BEGIN
     PAIDForm := TPAIDFORM.Create(SELF);
     PAIDForm.LABELPAID.Caption := TERRAINS.TERRAINS_STREET[APLAYER.POS];
     //DECIDE DU COUT PAR RAPPORT AU NOMBRE DE MAISON OU HOTEL
     PAIDForm.LABELPRICETOPAY.TAG := GET_TERRAINS_PRICE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS]);
     PAIDForm.LABELPRICETOPAY.CAPTION := 'YOU HAVE TO PAY ' + INTTOSTR(PAIDForm.LABELPRICETOPAY.TAG) + ' $';
     PAIDForm.BitBtnPAID.Caption := 'PAY ' + INTTOSTR(PAIDForm.LABELPRICETOPAY.TAG) + ' $';
     //PAS LE CHOIX!
     IF PAIDForm.ShowModal = MROK THEN BEGIN
      IF APLAYER.Cash - GET_TERRAINS_PRICE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS]) >= 0 THEN BEGIN//SI LE JOUEUR PEUT PAYER...
       APLAYER.Cash := APLAYER.Cash - GET_TERRAINS_PRICE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS]);
       ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],PAIDForm.LABELPRICETOPAY.TAG);
      END ELSE BEGIN //SINON...KILL THE PLAYER!
       KILL1:
       KILLForm := TKILLFORM.CREATE(SELF);
       KILLFORM.LABELBANCKROUT.CAPTION := APLAYER.PLAYERNAME + ' IS BANCKROUT !';
       IF KILLForm.SHOWMODAL = MROK THEN BEGIN
        ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.CASH);
        KILL_PLAYER(STRTOINT(APLAYER.NAME[7]));
        NEXT_PLAYERTURN;
        PAIDForm.FREE;
        KILLForm.FREE;
        IF APLAYER.KIND = KdCOMPUTER THEN DELAY(DEF_DELAY);
        GOTO THE_END;
       END;
      END;
     END;
     PAIDForm.FREE;
     END ELSE BEGIN
     //SI LE JOUEUR EST UN CPU
      IF APLAYER.Cash - GET_TERRAINS_PRICE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS]) > -1 THEN BEGIN//SI LE JOUEUR PEUT PAYER...
       APLAYER.Cash := APLAYER.Cash - GET_TERRAINS_PRICE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS]);
       ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],GET_TERRAINS_PRICE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS]));
      END ELSE BEGIN //SINON...KILL THE PLAYER!
       GOTO KILL1;
      END;
      DELAY(DEF_DELAY);
     END;
     //UPDATE LES PLAYERS_BOARD EN ORDRE
     UPADTE_TWO_BOARD(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_PROP_POS_INDEX(APLAYER.POS));
    END;
   GOTO THE_END;
  END;
////////////////////////////////////////////////////////////////////////////////////////////
//SERVICES
////////////////////////////////////////////////////////////////////////////////////////////
 13,29: BEGIN
  CASE APLAYER.Pos OF
   13: PLAY_THIS(SD_ELECTRICITY);
   29: PLAY_THIS(SD_AQUEDUC);
  END;
////////////////////////////////////////////////////////////////////////////////////////////
//SI LE SERVICE EST A VENDRE
////////////////////////////////////////////////////////////////////////////////////////////
  IF TERRAINS.TERRAINS_STATE[APLAYER.POS] = NOTHING THEN BEGIN
   //SI LE JOUEUR EST HUMAIN
   IF APLAYER.KIND <> KdComputer THEN BEGIN
    BUYForm := TBUYFORM.Create(SELF);
    BUYFORM.LABELSTREET.Caption := TERRAINS.TERRAINS_STREET[APLAYER.POS];
    APLAYER.FORCE_TO_PAY_10X := FALSE;
    IF APLAYER.CASH - TERRAINS.TERRAINS_PRICE[APLAYER.POS] < 0 THEN BUYFORM.BitBtnBUY.ENABLED := FALSE;
    IF BUYForm.ShowModal = MROK THEN BEGIN
    //CHANGE LE FIELD PROP ET NAME DE TERRAINS ET AJUSTE LE CASH DU JOUEUR
    TERRAINS.TERRAINS_PROP[APLAYER.POS] := APLAYER.PlayerName;
    TERRAINS.TERRAINS_STATE[APLAYER.POS] := IN_LOC;
    APLAYER.Cash := APLAYER.Cash - TERRAINS.TERRAINS_PRICE[APLAYER.POS];
    CASE APLAYER.SERVICESCOUNT OF
     0: APLAYER.SERVICESCOUNT := 1;
     1: APLAYER.SERVICESCOUNT := 2;
    END;
    END;
    BUYFORM.FREE;
   END ELSE BEGIN
    //SI LE JPUEUR EST UN CPU
    IF APLAYER.CASH - TERRAINS.TERRAINS_PRICE[APLAYER.POS] > -1 THEN BEGIN
     //CHANGE LE FIELD PROP ET NAME DE TERRAINS ET AJUSTE LE CASH DU JOUEUR
     TERRAINS.TERRAINS_PROP[APLAYER.POS] := APLAYER.PlayerName;
     TERRAINS.TERRAINS_STATE[APLAYER.POS] := IN_LOC;
     APLAYER.Cash := APLAYER.Cash - TERRAINS.TERRAINS_PRICE[APLAYER.POS];
     CASE APLAYER.SERVICESCOUNT OF
      0: APLAYER.SERVICESCOUNT := 1;
      1: APLAYER.SERVICESCOUNT := 2;
     END;
    END;
    DELAY(DEF_DELAY);
   END;
   TERRAINS.Repaint;
   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
   GOTO THE_END;
  END;
////////////////////////////////////////////////////////////////////////////////////////////
//SI LE SERVICE EST A UN AUTRE JOUEUR
////////////////////////////////////////////////////////////////////////////////////////////
  IF (TERRAINS.TERRAINS_STATE[APLAYER.POS] <> NOTHING) AND (TERRAINS.TERRAINS_PROP[APLAYER.POS] <> APLAYER.PlayerName) THEN BEGIN
   //SI LE TERRAINS N'EST PAS HYPOTHEQUER
   IF TERRAINS.TERRAINS_MORTAGE[APLAYER.POS] = FALSE THEN BEGIN
    PAIDSERVICESForm := TPAIDSERVICESForm.Create(SELF);
    //SI LE JOUEUR EST UN CPU CA VA DECLENCHER LE TIMER DANS L'AUTRE FICHE
    IF APLAYER.KIND = KDCOMPUTER THEN PAIDSERVICESForm.TAG := 1;
    PAIDSERVICESForm.MAINLabel.Caption := TERRAINS.TERRAINS_STREET[APLAYER.POS];
    //TROUVE LE MULTIPLICATEUR
    IF APLAYER.FORCE_TO_PAY_10X = FALSE THEN BEGIN
     CASE GET_SERVICES_NUM(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.POS) OF
      1: PAIDSERVICESForm.BitBtnPAID.Caption := 'PAID 4X THE DICE RESULT';
      2: PAIDSERVICESForm.BitBtnPAID.Caption := 'PAID 10X THE DICE RESULT';
     END;
    END ELSE BEGIN
     PAIDSERVICESForm.BitBtnPAID.Caption := 'PAID 10X THE DICE RESULT';
     APLAYER.FORCE_TO_PAY_10X := FALSE;
    END;
    IF PAIDSERVICESForm.ShowModal = MROK THEN
     IF APLAYER.Cash - PAIDSERVICESForm.BitBtnPAID.TAG > -1 THEN BEGIN
      APLAYER.Cash := APLAYER.Cash - PAIDSERVICESForm.BitBtnPAID.TAG;
      ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],PAIDSERVICESForm.BitBtnPAID.TAG);
     END ELSE BEGIN
      KILLForm := TKILLFORM.CREATE(SELF);
      KILLFORM.LABELBANCKROUT.CAPTION := APLAYER.PLAYERNAME + ' IS BANCKROUT !';
      IF KILLForm.SHOWMODAL = MROK THEN BEGIN
       ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.CASH);
       KILL_PLAYER(STRTOINT(APLAYER.NAME[7]));
       NEXT_PLAYERTURN;
       PAIDSERVICESForm.FREE;
       KILLForm.FREE;
       GOTO THE_END;
      END;
     END;
    PAIDSERVICESForm.FREE;
    //UPDATE LES PLAYERS_BOARD EN ORDRE
     UPADTE_TWO_BOARD(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_PROP_POS_INDEX(APLAYER.POS));
    END;
    GOTO THE_END;
   END;
  END;
////////////////////////////////////////////////////////////////////////////////////////////
//TRAINS
////////////////////////////////////////////////////////////////////////////////////////////
 6,16,26,36: BEGIN
  PLAY_THIS(SD_TRAIN);
////////////////////////////////////////////////////////////////////////////////////////////
//SI LE TRAIN EST A VENDRE
////////////////////////////////////////////////////////////////////////////////////////////
  IF TERRAINS.TERRAINS_STATE[APLAYER.POS] = NOTHING THEN BEGIN
   IF APLAYER.KIND <> KdComputer THEN BEGIN
    BUYForm := TBUYFORM.Create(SELF);
    BUYFORM.LABELSTREET.Caption := TERRAINS.TERRAINS_STREET[APLAYER.POS];
    APLAYER.FORCE_TO_PAY_DOUBLE := FALSE;
    IF APLAYER.CASH - TERRAINS.TERRAINS_PRICE[APLAYER.POS] < 0 THEN BUYFORM.BitBtnBUY.ENABLED := FALSE;
    IF BUYForm.ShowModal = MROK THEN BEGIN
    //CHANGE LE FIELD PROP ET NAME DE TERRAINS ET AJUSTE LE CASH DU JOUEUR
     TERRAINS.TERRAINS_PROP[APLAYER.POS] := APLAYER.PlayerName;
     TERRAINS.TERRAINS_STATE[APLAYER.POS] := IN_LOC;
     APLAYER.Cash := APLAYER.Cash - TERRAINS.TERRAINS_PRICE[APLAYER.POS];
     APLAYER.TRAINSCOUNT := APLAYER.TRAINSCOUNT + 1;
    END;
    BUYFORM.FREE;
   END ELSE BEGIN
    IF APLAYER.CASH - TERRAINS.TERRAINS_PRICE[APLAYER.POS] > -1 THEN BEGIN
     TERRAINS.TERRAINS_PROP[APLAYER.POS] := APLAYER.PlayerName;
     TERRAINS.TERRAINS_STATE[APLAYER.POS] := IN_LOC;
     APLAYER.Cash := APLAYER.Cash - TERRAINS.TERRAINS_PRICE[APLAYER.POS];
     APLAYER.TRAINSCOUNT := APLAYER.TRAINSCOUNT + 1;
    END;
   END;
   TERRAINS.Repaint;
   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
   GOTO THE_END;
  END;
////////////////////////////////////////////////////////////////////////////////////////////
//SI LE TRAINS EST A UN AUTRE JOUEUR
////////////////////////////////////////////////////////////////////////////////////////////
  IF (TERRAINS.TERRAINS_STATE[APLAYER.POS] <> NOTHING) AND (TERRAINS.TERRAINS_PROP[APLAYER.POS] <> APLAYER.PlayerName) THEN BEGIN
   //SI LE TERRAINS N'EST PAS HYPOTHEQUER
   IF TERRAINS.TERRAINS_MORTAGE[APLAYER.POS] = FALSE THEN
    //SI LE JOUEUR EST HUMAIN...
    IF APLAYER.KIND <> KdComputer THEN BEGIN
     PAIDForm := TPAIDForm.Create(SELF);
     PAIDForm.MAINPanel.Caption := TERRAINS.TERRAINS_STREET[APLAYER.POS];
     //FIND THE AMOUNT TO PAY
     PAIDForm.BitBtnPAID.TAG := Trains_CountToTrainsLocPrice(GET_TRAINS_NUM(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.POS));
     //FORCE LE JOUEUR A PAYER LE DOUBLE DU MONTANT
     IF APLAYER.FORCE_TO_PAY_DOUBLE = TRUE THEN BEGIN
      PAIDForm.BitBtnPAID.TAG := PAIDForm.BitBtnPAID.TAG * 2;
      APLAYER.FORCE_TO_PAY_DOUBLE := FALSE;
     END;
     PAIDForm.LABELPRICETOPAY.CAPTION := 'YOU HAVE TO PAY ' + INTTOSTR(PAIDForm.BitBtnPAID.TAG) + ' $';
     PAIDForm.BitBtnPAID.Caption := 'PAY ' + INTTOSTR(PAIDForm.BitBtnPAID.TAG) + ' $';
     IF PAIDForm.ShowModal = MROK THEN BEGIN
      IF APLAYER.Cash - PAIDForm.BitBtnPAID.TAG >= 0 THEN BEGIN
       APLAYER.Cash := APLAYER.Cash - PAIDForm.BitBtnPAID.TAG;
       ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],PAIDForm.BitBtnPAID.TAG);
      END ELSE BEGIN
       KILL2:
       KILLForm := TKILLFORM.CREATE(SELF);
       KILLFORM.LABELBANCKROUT.CAPTION := APLAYER.PLAYERNAME + ' IS BANCKROUT !';
       IF KILLForm.SHOWMODAL = MROK THEN BEGIN
        ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.CASH);
        KILL_PLAYER(STRTOINT(APLAYER.NAME[7]));
        NEXT_PLAYERTURN;
        PAIDForm.FREE;
        KILLForm.FREE;
        GOTO THE_END;
       END;
      END;
     END;
     PAIDForm.FREE;
    END ELSE BEGIN
     IF APLAYER.Cash - Trains_CountToTrainsLocPrice(GET_TRAINS_NUM(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.POS)) >= 0 THEN BEGIN
      APLAYER.Cash := APLAYER.Cash - Trains_CountToTrainsLocPrice(GET_TRAINS_NUM(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.POS));
      ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],Trains_CountToTrainsLocPrice(GET_TRAINS_NUM(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.POS)));
     END ELSE BEGIN
      GOTO KILL2;
     END;
    END;
     UPADTE_TWO_BOARD(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_PROP_POS_INDEX(APLAYER.POS));
    GOTO THE_END;
   END;
  END;
////////////////////////////////////////////////////////////////////////////////////////////
//LES IMPOTS
////////////////////////////////////////////////////////////////////////////////////////////
 5:
  BEGIN
  IF APLAYER.KIND = KDHUMAN THEN BEGIN
  IMPOTSForm := TIMPOTSForm.Create(SELF);
  IF IMPOTSFORM.ShowModal = MROK THEN BEGIN
   IF IMPOTSFORM.BitBtn10PCT.TAG = 1 THEN BEGIN TERRAINS.JACKPOT := TERRAINS.JACKPOT + Round(APLAYER.CASH / 10); APLAYER.CASH := Round(APLAYER.CASH - (APLAYER.CASH / 10)); END;
   IF IMPOTSFORM.BitBtn200PIASTE.TAG = 1 THEN BEGIN TERRAINS.JACKPOT := TERRAINS.JACKPOT + 200; APLAYER.CASH := APLAYER.CASH - 200; END;
  END;
  IMPOTSForm.FREE;
  END;
  IF APLAYER.KIND = KDCOMPUTER THEN BEGIN
   IF APLAYER.CASH < 2000 THEN BEGIN
    TERRAINS.JACKPOT := TERRAINS.JACKPOT + Round(APLAYER.CASH / 10); APLAYER.CASH := Round(APLAYER.CASH - (APLAYER.CASH / 10));
   END ELSE BEGIN
    TERRAINS.JACKPOT := TERRAINS.JACKPOT + 200; APLAYER.CASH := 200;
   END;
   DELAY(DEF_DELAY);
  END;
  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
  GOTO THE_END;
 END;
////////////////////////////////////////////////////////////////////////////////////////////
//LES TAXES
////////////////////////////////////////////////////////////////////////////////////////////
 39:
  BEGIN
  IF APLAYER.KIND = KDHUMAN THEN BEGIN
   PAIDForm := TPAIDForm.Create(SELF);
   PAIDForm.LABELPAID.Caption := 'THE FUCKING TAXES !!!';
   PAIDForm.LABELPRICETOPAY.Caption := 'PAY 75 $';
   PAIDForm.BitBtnPAID.Caption := 'PAY 75 $';
   IF PAIDForm.ShowModal = MROK THEN BEGIN
    APLAYER.CASH := APLAYER.CASH - 75;
    TERRAINS.JACKPOT := TERRAINS.JACKPOT + 75;
   END;
   PAIDForm.FREE;
  END;
  IF APLAYER.KIND = KDCOMPUTER THEN BEGIN
   APLAYER.CASH := APLAYER.CASH - 75;
   TERRAINS.JACKPOT := TERRAINS.JACKPOT + 75;
   DELAY(DEF_DELAY);
  END;
  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
  GOTO THE_END;
 END;
////////////////////////////////////////////////////////////////////////////////////////////
//GO
////////////////////////////////////////////////////////////////////////////////////////////
 1:
  BEGIN
   PLAY_THIS(SD_GO);
   IF APLAYER.CAN_HAVE_400_PIASS_AT_GO = TRUE THEN BEGIN
    APLAYER.CASH := APLAYER.CASH + 200;
    UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
   END ELSE BEGIN
    APLAYER.CAN_HAVE_400_PIASS_AT_GO := TRUE;
   END;
   GOTO THE_END;
  END;
////////////////////////////////////////////////////////////////////////////////////////////
//LA PRISON
////////////////////////////////////////////////////////////////////////////////////////////
 11:
  BEGIN
   GOTO THE_END;
  END;
////////////////////////////////////////////////////////////////////////////////////////////
//LE JACKPOT
////////////////////////////////////////////////////////////////////////////////////////////
 21:
  BEGIN
  PLAY_THIS(SD_JACKPOT);
  APLAYER.CASH := APLAYER.CASH + TERRAINS.JACKPOT;
  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
  DELAY(DEF_DELAY);
  TERRAINS.JACKPOT := 500;
  TERRAINS.Repaint;
  GOTO THE_END;
 END;
////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
//LA POLICE
////////////////////////////////////////////////////////////////////////////////////////////
 31:
  BEGIN
   PLAY_THIS(SD_GOTOJAIL);
   CRISSE_THE_PLAYER_IN_JAIL(STRTOINT(APLAYER.NAME[7]));
   GOTO THE_END;
  END;
////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
//LES CARTES
////////////////////////////////////////////////////////////////////////////////////////////
 3,18,34,8,23,37:
  BEGIN
  PLAY_THIS(SD_CARD);
  JUMPER:
  IF STRTOINT(MOVEFORM.NumericEditRANDOM_NUMBER.Text) = 0 THEN BEGIN
   //SI LE CHECKBOXFIXEDNUM.CHECKED = FALSE
   TERRAINS.RAND_CARD_NUM := RANDOM(16) + 1;
  END ELSE BEGIN
   //SI LE CHECKBOXFIXEDNUM.CHECKED = TRUE
   TERRAINS.RAND_CARD_NUM := STRTOINT(MOVEFORM.NumericEditRANDOM_NUMBER.Text);
  END;
  //SI LA CARTE EST UNE CARTE DE SORTIE DE PRISON
  IF TERRAINS.RAND_CARD_NUM = 15 THEN BEGIN
  //CHECK SI PERSONNE N'A LA CARTE SINON GOTO JUMPER
   CASE APLAYER.POS OF
    3,18,34: IF (PriCdYELLOW IN PLAYER1.PRISON_CARD) OR (PriCdYELLOW IN PLAYER2.PRISON_CARD) OR (PriCdYELLOW IN PLAYER3.PRISON_CARD) OR (PriCdYELLOW IN PLAYER4.PRISON_CARD) OR (PriCdYELLOW IN PLAYER5.PRISON_CARD) OR (PriCdYELLOW IN PLAYER6.PRISON_CARD) OR (PriCdYELLOW IN PLAYER7.PRISON_CARD) OR (PriCdYELLOW IN PLAYER8.PRISON_CARD) THEN BEGIN
     TERRAINS.RAND_CARD_NUM := RANDOM(16) + 1;
     MOVEFORM.NumericEditRANDOM_NUMBER.Text := INTTOSTR(TERRAINS.RAND_CARD_NUM);
     GOTO JUMPER;
    END;
    8,23,37: IF (PriCdBLUE IN PLAYER1.PRISON_CARD) OR (PriCdBLUE IN PLAYER2.PRISON_CARD) OR (PriCdBLUE IN PLAYER3.PRISON_CARD) OR (PriCdBLUE IN PLAYER4.PRISON_CARD) OR (PriCdBLUE IN PLAYER5.PRISON_CARD) OR (PriCdBLUE IN PLAYER6.PRISON_CARD) OR (PriCdBLUE IN PLAYER7.PRISON_CARD) OR (PriCdBLUE IN PLAYER8.PRISON_CARD) THEN BEGIN
     TERRAINS.RAND_CARD_NUM := RANDOM(16) + 1;
     MOVEFORM.NumericEditRANDOM_NUMBER.Text := INTTOSTR(TERRAINS.RAND_CARD_NUM);
     GOTO JUMPER;
    END;
   END;
  END;
  TERRAINS.REPAINT; //DRAW THE CORRECT IMAGE INTO TERRAINS
  DELAY(DEF_DELAY);      //PAUSE 2 SECONDS
   CASE APLAYER.POS OF
    3,18,34: BEGIN
              CASE TERRAINS.RAND_CARD_NUM OF
               1:BEGIN
                  APLAYER.Cash := APLAYER.CASH - 50;
                  TERRAINS.JACKPOT := TERRAINS.JACKPOT + 50;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               2:BEGIN
                  APLAYER.Cash := APLAYER.Cash - (40 * HOUSE_COUNTER(APLAYER.PLAYERNAME));
                  APLAYER.Cash := APLAYER.Cash - (115 * HOTEL_COUNTER(APLAYER.PLAYERNAME));
                  TERRAINS.JACKPOT := TERRAINS.JACKPOT + ((40 * HOUSE_COUNTER(APLAYER.PLAYERNAME)) + (115 * HOTEL_COUNTER(APLAYER.PLAYERNAME)));
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               3:BEGIN
                  APLAYER.Cash := APLAYER.CASH - 100;
                  TERRAINS.JACKPOT := TERRAINS.JACKPOT + 100;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               4:BEGIN
                  APLAYER.Cash := APLAYER.CASH - 150;
                  TERRAINS.JACKPOT := TERRAINS.JACKPOT + 150;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               5:BEGIN
                  APLAYER.Cash := APLAYER.CASH + 10;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               6:BEGIN
                  APLAYER.Cash := APLAYER.CASH + 45;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               7:BEGIN
                  APLAYER.Cash := APLAYER.CASH + 200;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               8:BEGIN
                  APLAYER.Cash := APLAYER.CASH + 20;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               9:BEGIN
                  FOR CPT := 1 TO 8 DO IF (APLAYER.NAME <> TPlayer(Components[PLAYER_INDX[CPT]]).NAME) AND (TPlayer(Components[PLAYER_INDX[CPT]]).KIND <> KDNONE) THEN BEGIN APLAYER.CASH := APLAYER.CASH + 50; TPlayer(Components[PLAYER_INDX[CPT]]).CASH := TPlayer(Components[PLAYER_INDX[CPT]]).CASH - 50; UPDATE_PLAYER_BOARD(CPT); END;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               10:BEGIN
                   APLAYER.Cash := APLAYER.CASH + 100;
                   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                  END;
               11:BEGIN
                   APLAYER.Cash := APLAYER.CASH + 100;
                   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                  END;
               12:BEGIN
                   APLAYER.Cash := APLAYER.CASH + 100;
                   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                  END;
               13:BEGIN
                   APLAYER.Cash := APLAYER.CASH + 25;
                   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                  END;
               14:BEGIN
                   APLAYER.CAN_HAVE_400_PIASS_AT_GO := FALSE;
                   MOVE_BY_A_CARD := TRUE;
                   MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),1,DIFOWARD);
                  END;
               15:BEGIN
                   APLAYER.PRISON_CARD := APLAYER.PRISON_CARD + [PriCdYELLOW];
                   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                  END;
               16:BEGIN
                   APLAYER.JailTurnLeft := 3;
                   MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),11,DIFOWARD);
                  END;
             END;
    END;
    8,23,37: BEGIN
              CASE TERRAINS.RAND_CARD_NUM OF
               1:BEGIN
                  FOR CPT := 1 TO 8 DO IF (APLAYER.NAME <> TPlayer(Components[PLAYER_INDX[CPT]]).NAME) AND (TPlayer(Components[PLAYER_INDX[CPT]]).KIND <> KDNONE) THEN BEGIN APLAYER.CASH := APLAYER.CASH - 50; TERRAINS.JACKPOT := TERRAINS.JACKPOT + 50; TPlayer(Components[PLAYER_INDX[CPT]]).CASH := TPlayer(Components[PLAYER_INDX[CPT]]).CASH + 50; UPDATE_PLAYER_BOARD(CPT); END;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               2:BEGIN
                  APLAYER.Cash := APLAYER.CASH - 15;
                  TERRAINS.JACKPOT := TERRAINS.JACKPOT + 15;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               3:BEGIN
                  APLAYER.Cash := APLAYER.Cash - (25 * HOUSE_COUNTER(APLAYER.PLAYERNAME));
                  APLAYER.Cash := APLAYER.Cash - (100 * HOTEL_COUNTER(APLAYER.PLAYERNAME));
                  TERRAINS.JACKPOT := TERRAINS.JACKPOT + ((25 * HOUSE_COUNTER(APLAYER.PLAYERNAME)) + (100 * HOTEL_COUNTER(APLAYER.PLAYERNAME)));
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               4:BEGIN
                  APLAYER.Cash := APLAYER.CASH + 150;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               5:BEGIN
                  APLAYER.Cash := APLAYER.CASH + 50;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               6:BEGIN
                  APLAYER.FORCE_TO_PAY_10X := TRUE;
                  CASE APLAYER.POS OF
                   8,37: BEGIN
                          MOVE_BY_A_CARD := TRUE;
                          MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),13,DIFOWARD);
                         END;
                   23: BEGIN
                        MOVE_BY_A_CARD := TRUE;
                        MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),29,DIFOWARD);
                       END;
                  END;
                 END;
               7:BEGIN
                  MOVE_BY_A_CARD := TRUE;
                  MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),25,DIFOWARD);
                 END;
               8:BEGIN
                  APLAYER.CAN_HAVE_400_PIASS_AT_GO := FALSE;
                  MOVE_BY_A_CARD := TRUE;
                  MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),1,DIFOWARD);
                 END;
               9:BEGIN
                  MOVE_BY_A_CARD := TRUE;
                  MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),40,DIFOWARD);
                 END;
               10:BEGIN
                   MOVE_BY_A_CARD := TRUE;
                   MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),FIND_LIMIT(GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),3,DIREVERSE),DIREVERSE);
                  END;
               11:BEGIN
                   MOVE_BY_A_CARD := TRUE;
                   MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),6,DIFOWARD);
                  END;
               12,14:BEGIN
                  APLAYER.FORCE_TO_PAY_DOUBLE := TRUE;
                   CASE APLAYER.POS OF
                    8: BEGIN
                        MOVE_BY_A_CARD := TRUE;
                        MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),16,DIFOWARD);
                       END;
                    23: BEGIN
                         MOVE_BY_A_CARD := TRUE;
                         MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),26,DIFOWARD);
                        END;
                    37: BEGIN
                         MOVE_BY_A_CARD := TRUE;
                         MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),6,DIFOWARD);
                        END;
                    END;
                  END;
               13:BEGIN
                   MOVE_BY_A_CARD := TRUE;
                   MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),12,DIFOWARD);
                  END;
               15:BEGIN
                   APLAYER.PRISON_CARD := APLAYER.PRISON_CARD + [PriCdBLUE];
                   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                  END;
               16:BEGIN
                   APLAYER.JailTurnLeft := 3;
                   MOVE_BY_A_CARD := TRUE;
                   MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),11,DIFOWARD);
                  END;
             END;
    END;
   END;
END;
////////////////////////////////////////////////////////////////////////////////////////////
END;
THE_END:
RESULT := APLAYER;
END;
////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////CODE A EXECUTER QUAND LE JOUEUR EST EN PRISON///////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
PROCEDURE TMASTERFORM.JAIL_TURN;
BEGIN
//SI LE JOUEUR EST HUMAIN
IF GET_PLAYER_KIND(PLAYERTURN) = KdHUMAN THEN BEGIN
 JAILForm := TJAILForm.CREATE(SELF);
 //SI LE JOUEUR NE PEUT PAS PAYER...LE BUTTON PAY VA ETRE DESACTIVÉE
 IF GET_PLAYER_CASH(PLAYERTURN) - 50 < 0 THEN JAILForm.BitBtnPAY.ENABLED := FALSE;
 IF JAILForm.ShowModal = MROK THEN BEGIN
  //SORT LE JOUEUR DE PRISON
  SET_PLAYERJAILTURNLEFT(PLAYERTURN,0);
  SET_PLAYER_CASH(PLAYERTURN,GET_PLAYER_CASH(PLAYERTURN) - 50);
  TERRAINS.JACKPOT := TERRAINS.JACKPOT + 50;
  UPDATE_PLAYER_BOARD(PLAYERTURN);
 END ELSE BEGIN
  //BRASSE LES DEÉ
  BITBTNTROW.CLICK;
 END;
 JAILForm.FREE;
END ELSE BEGIN
 //SI LE JOUEUR EST UN CPU
 IF GET_PLAYER_CASH(PLAYERTURN) - 50 > 0 THEN BEGIN
  //SORT LE JOUEUR DE PRISON
  SET_PLAYERJAILTURNLEFT(PLAYERTURN,0);
  SET_PLAYER_CASH(PLAYERTURN,GET_PLAYER_CASH(PLAYERTURN) - 50);
  TERRAINS.JACKPOT := TERRAINS.JACKPOT + 50;
  UPDATE_PLAYER_BOARD(PLAYERTURN);
 END ELSE BEGIN
  //BRASSE LES DEÉ
  BITBTNTROW.CLICK;
 END;
END;
END;

 

Here's another part (or "humm, what's pointers and loops for?")

////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////CREATE THE FORM////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
procedure TMASTERForm.FormCreate(Sender: TObject);
begin
//PUT THE CURRENT DIRECTORY(PATH) INTO APPDIR
GETDIR(0,APPDIR);
//FORCE THE SCREEN TO BE 800 x 600(NO TEST TO SEE IF WE CAN ???)
RESSWITCHER := TRESSWITCHER.Create(SELF);
//DATA TO BE USE WHEN CLOSING THE FORM AND RESIZING SCREEN TO ORIGINAL STATE
RESSWITCHDAT.W := SCREEN.Width;
RESSWITCHDAT.H := SCREEN.Height;
RESSWITCHDAT.C := GetDeviceCaps(GetDc(GetDesktopWindow),BITSPIXEL);
//CHANGE THE RESOLUTION
ResSwitcher.ChangeRes(800,600,RESSWITCHDAT.C);
//CREATE THE FORM USED TO MOVE PLAYERS(MUST BE GLOBAL)
MOVEFORM := TMOVEFORM.CREATE(SELF);
//SET-UP THE MASTERPAGE
MASTERFORM.BorderStyle := BSNONE;
MASTERFORM.SetBounds(0,0,800,600);
BITBTNMORTAGE.ENABLED := FALSE;
//CREATE THE PLAYERX
PLAYERX1 := CREATE_PLAYER(1,2);
PLAYERX2 := CREATE_PLAYER(2,4);
PLAYERX3 := CREATE_PLAYER(3,7);
PLAYERX4 := CREATE_PLAYER(4,9);
PLAYERX5 := CREATE_PLAYER(5,10);
PLAYERX6 := CREATE_PLAYER(6,12);
PLAYERX7 := CREATE_PLAYER(7,14);
PLAYERX8 := CREATE_PLAYER(8,15);
PLAYERX9 := CREATE_PLAYER(9,17);
PLAYERX10 := CREATE_PLAYER(10,19);
PLAYERX11 := CREATE_PLAYER(11,20);
PLAYERX12 := CREATE_PLAYER(12,22);
PLAYERX13 := CREATE_PLAYER(13,24);
PLAYERX14 := CREATE_PLAYER(14,25);
PLAYERX15 := CREATE_PLAYER(15,27);
PLAYERX16 := CREATE_PLAYER(16,28);
PLAYERX17 := CREATE_PLAYER(17,30);
PLAYERX18 := CREATE_PLAYER(18,32);
PLAYERX19 := CREATE_PLAYER(19,33);
PLAYERX20 := CREATE_PLAYER(20,35);
PLAYERX21 := CREATE_PLAYER(21,38);
PLAYERX22 := CREATE_PLAYER(22,40);
PLAYERX23 := CREATE_PLAYER(23,6);
PLAYERX24 := CREATE_PLAYER(24,16);
PLAYERX25 := CREATE_PLAYER(25,26);
PLAYERX26 := CREATE_PLAYER(26,36);
PLAYERX27 := CREATE_PLAYER(27,13);
PLAYERX28 := CREATE_PLAYER(28,29);
//INITIALISE SOME VARIABLES
SET_ARRAYS;
CAN_CLICK := TRUE;
PLAYERTURN := 8;
TERRAINS.JACKPOT := 500;
//CREATE THE SET-UPForm
TRY
 SET_UPFORM := TSET_UPFORM.Create(SELF);
 IF SET_UPFORM.SHOWMODAL = MROK THEN BEGIN //SI LE JOUEUR A PESSER SUR OK...
  INIT_PLAYER;
  PLACE_PLAYERS;
  NEXT_PLAYERTURN;
 END ELSE BEGIN                            //SINON...CLEAN L'APP ET L'ARRETE DIRECTEMENT
  SET_UPFORM.Free;
  ResSwitcher.ChangeRes(RESSWITCHDAT.W,RESSWITCHDAT.H,RESSWITCHDAT.C);
  PLAYERX1.FREE; PLAYERX2.FREE; PLAYERX3.FREE; PLAYERX4.FREE; PLAYERX5.FREE; PLAYERX6.FREE; PLAYERX7.FREE; PLAYERX8.FREE; PLAYERX9.FREE; PLAYERX10.FREE; PLAYERX11.FREE; PLAYERX12.FREE; PLAYERX13.FREE; PLAYERX14.FREE; PLAYERX15.FREE; PLAYERX16.FREE; PLAYERX17.FREE; PLAYERX18.FREE; PLAYERX19.FREE; PLAYERX20.FREE; PLAYERX21.FREE; PLAYERX22.FREE; PLAYERX23.FREE; PLAYERX24.FREE; PLAYERX25.FREE; PLAYERX26.FREE; PLAYERX27.FREE; PLAYERX28.FREE;
  MOVEFORM.FREE;
  RESSWITCHER.FREE;
  HALT;
 END;
FINALLY
 SET_UPFORM.FREE;
END;
end;

 

Seeing that after all those years of experience under my belt want to make me cut myself.

 

Enjoy!


#1Vortez

Posted 04 March 2013 - 07:45 PM

My first delphi game, monopoly, wich i did 12 years ago, looking at it now, it look aaawfull haha.

Here's a "small" snipet

////////////////////////////////////////////////////////////////////////////////////////////
///////////////////DECIDE QUOI FAIRE QUAND LE JOUEUR ARRIVE SUR UNE CASE////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
FUNCTION TMASTERForm.DECISION(APLAYER: TPLAYER): TPLAYER;
LABEL RESTART_PTS,JUMPER,KILL1,KILL2,THE_END;
VAR
 CPT: TMINMAXPLAYER;
BEGIN
RESTART_PTS:
CASE APLAYER.Pos OF
 2,4,7,9,10,12,14,15,17,19,20,22,24,25,27,28,30,32,33,35,38,40:
  BEGIN
////////////////////////////////////////////////////////////////////////////////////////////
//TERRAINS A VENDRE
////////////////////////////////////////////////////////////////////////////////////////////
   IF TERRAINS.TERRAINS_STATE[APLAYER.POS] = NOTHING THEN BEGIN
    //SI LE TERRAIN EST A PERSONNE...
    IF APLAYER.KIND <> KdComputer THEN BEGIN
    BUYForm := TBUYFORM.Create(SELF);
    BUYForm.LABELSTREET.Caption := TERRAINS.TERRAINS_STREET[APLAYER.POS];
    IF APLAYER.CASH - TERRAINS.TERRAINS_PRICE[APLAYER.POS] < 0 THEN BUYFORM.BitBtnBUY.ENABLED := FALSE;
     IF BUYForm.ShowModal = MROK THEN BEGIN
      //CHANGE LE FIELD PROP ET NAME DE TERRAINS ET AJUSTE LE CASH DU JOUEUR
      TERRAINS.TERRAINS_PROP[APLAYER.POS] := APLAYER.PlayerName;
      TERRAINS.TERRAINS_STATE[APLAYER.POS] := IN_LOC;
      APLAYER.Cash := APLAYER.Cash - TERRAINS.TERRAINS_PRICE[APLAYER.POS];
     END;
     BUYFORM.FREE;
    END ELSE BEGIN
     IF APLAYER.CASH - TERRAINS.TERRAINS_PRICE[APLAYER.POS] > -1 THEN BEGIN
      TERRAINS.TERRAINS_PROP[APLAYER.POS] := APLAYER.PlayerName;
      TERRAINS.TERRAINS_STATE[APLAYER.POS] := IN_LOC;
      APLAYER.Cash := APLAYER.Cash - TERRAINS.TERRAINS_PRICE[APLAYER.POS];
     END;
     DELAY(DEF_DELAY);
    END;
    TERRAINS.Repaint;
    UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
    GOTO THE_END;
   END;
////////////////////////////////////////////////////////////////////////////////////////////
//SI LE TERRAIN EST AU JOUEUR EN COURS...
////////////////////////////////////////////////////////////////////////////////////////////
   //SI LE JOUEUR A ACHETER TOUT LES TERRAINS DE LA MEME COULEUR QUE LE TERRAINS EN COURS...
   IF (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[2]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[4])) AND ((APLAYER.POS = 2) OR (APLAYER.POS = 4))) OR (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[7]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[9]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[10])) AND ((APLAYER.POS = 7) OR (APLAYER.POS = 9) OR (APLAYER.POS = 10))) OR
      (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[12]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[14]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[15])) AND ((APLAYER.POS = 12) OR (APLAYER.POS = 14) OR (APLAYER.POS = 15))) OR (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[17]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[19]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[20])) AND ((APLAYER.POS = 17) OR (APLAYER.POS = 19) OR (APLAYER.POS = 20))) OR
      (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[22]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[24]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[25])) AND ((APLAYER.POS = 22) OR (APLAYER.POS = 24) OR (APLAYER.POS = 25))) OR (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[27]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[28]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[30])) AND ((APLAYER.POS = 27) OR (APLAYER.POS = 28) OR (APLAYER.POS = 30))) OR
      (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[32]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[33]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[35])) AND ((APLAYER.POS = 32) OR (APLAYER.POS = 33) OR (APLAYER.POS = 35))) OR (((APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[38]) AND (APLAYER.PlayerName = TERRAINS.TERRAINS_PROP[40])) AND ((APLAYER.POS = 38) OR (APLAYER.POS = 40)))
    THEN BEGIN
     //SI LE TERRAINS N'EST PAS HYPOTHEQUER
     IF TERRAINS.TERRAINS_MORTAGE[APLAYER.POS] = FALSE THEN
      IF APLAYER.KIND <> KdComputer THEN BEGIN
      BUILDFORM := TBUILDFORM.CREATE(SELF);
      //ENABLE OU DISABLE LES BUTTONS DE BUILDFORM SELON L'ETAT DU TERRAINS
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) >= 1) OR (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 1) < 0) THEN BUILDFORM.BitBtn1HOUSE.Enabled := FALSE;
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) >= 2) OR (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 2) < 0) THEN BUILDFORM.BitBtn2HOUSE.Enabled := FALSE;
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) >= 3) OR (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 3) < 0) THEN BUILDFORM.BitBtn3HOUSE.Enabled := FALSE;
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) >= 4) OR (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 4) < 0) THEN BUILDFORM.BitBtn4HOUSE.Enabled := FALSE;
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) >= 5) OR (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 5) < 0) THEN BUILDFORM.BitBtn1HOTEL.Enabled := FALSE;
      IF BUILDForm.ShowModal = MROK THEN BEGIN
       IF BUILDFORM.BitBtn1HOUSE.Tag = 1 THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := ONE_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 1); END;
       IF BUILDFORM.BitBtn2HOUSE.Tag = 1 THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := TWO_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 2) END;
       IF BUILDFORM.BitBtn3HOUSE.Tag = 1 THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := THREE_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 3) END;
       IF BUILDFORM.BitBtn4HOUSE.Tag = 1 THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := FOUR_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 4) END;
       IF BUILDFORM.BitBtn1HOTEL.Tag = 1 THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := A_HOTEL; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 5) END;
       PLANCHE.CHANGE_TERRAINS_STATE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS],TRUE);
      END;
      BUILDFORM.FREE;
     END ELSE BEGIN
      //ACHETE LE MAXIMUM POSSIBLE
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) < 5) AND (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 5) > -1) THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := A_HOTEL; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 5) END;
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) < 4) AND (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 4) > -1) THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := FOUR_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 4) END;
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) < 3) AND (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 3) > -1) THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := THREE_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 3) END;
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) < 2) AND (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 2) > -1) THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := TWO_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 2) END;
      IF (STATETOBYTE(TERRAINS.TERRAINS_STATE[APLAYER.POS]) < 1) AND (APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 1) > -1) THEN BEGIN TERRAINS.TERRAINS_STATE[APLAYER.POS] := ONE_HOUSE; APLAYER.CASH := APLAYER.CASH - ((TERRAINS.TERRAINS_HOUSEPRICE[APLAYER.POS])* 1) END;
      DELAY(DEF_DELAY);
     END;
     UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
     GOTO THE_END;
    END;
////////////////////////////////////////////////////////////////////////////////////////////
//SI LE TERRAIN EST A UN AUTRE JOUEUR...
////////////////////////////////////////////////////////////////////////////////////////////
   IF (TERRAINS.TERRAINS_STATE[APLAYER.POS] <> NOTHING) AND (APLAYER.PlayerName <> TERRAINS.TERRAINS_PROP[APLAYER.POS]) THEN BEGIN
    //SI LE TERRAINS N'EST PAS HYPOTHEQUER
    IF TERRAINS.TERRAINS_MORTAGE[APLAYER.POS] = FALSE THEN
    //SI LE JOUEUR EST HUMAIN...
    IF APLAYER.KIND <> KdComputer THEN BEGIN
     PAIDForm := TPAIDFORM.Create(SELF);
     PAIDForm.LABELPAID.Caption := TERRAINS.TERRAINS_STREET[APLAYER.POS];
     //DECIDE DU COUT PAR RAPPORT AU NOMBRE DE MAISON OU HOTEL
     PAIDForm.LABELPRICETOPAY.TAG := GET_TERRAINS_PRICE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS]);
     PAIDForm.LABELPRICETOPAY.CAPTION := 'YOU HAVE TO PAY ' + INTTOSTR(PAIDForm.LABELPRICETOPAY.TAG) + ' $';
     PAIDForm.BitBtnPAID.Caption := 'PAY ' + INTTOSTR(PAIDForm.LABELPRICETOPAY.TAG) + ' $';
     //PAS LE CHOIX!
     IF PAIDForm.ShowModal = MROK THEN BEGIN
      IF APLAYER.Cash - GET_TERRAINS_PRICE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS]) >= 0 THEN BEGIN//SI LE JOUEUR PEUT PAYER...
       APLAYER.Cash := APLAYER.Cash - GET_TERRAINS_PRICE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS]);
       ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],PAIDForm.LABELPRICETOPAY.TAG);
      END ELSE BEGIN //SINON...KILL THE PLAYER!
       KILL1:
       KILLForm := TKILLFORM.CREATE(SELF);
       KILLFORM.LABELBANCKROUT.CAPTION := APLAYER.PLAYERNAME + ' IS BANCKROUT !';
       IF KILLForm.SHOWMODAL = MROK THEN BEGIN
        ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.CASH);
        KILL_PLAYER(STRTOINT(APLAYER.NAME[7]));
        NEXT_PLAYERTURN;
        PAIDForm.FREE;
        KILLForm.FREE;
        IF APLAYER.KIND = KdCOMPUTER THEN DELAY(DEF_DELAY);
        GOTO THE_END;
       END;
      END;
     END;
     PAIDForm.FREE;
     END ELSE BEGIN
     //SI LE JOUEUR EST UN CPU
      IF APLAYER.Cash - GET_TERRAINS_PRICE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS]) > -1 THEN BEGIN//SI LE JOUEUR PEUT PAYER...
       APLAYER.Cash := APLAYER.Cash - GET_TERRAINS_PRICE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS]);
       ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],GET_TERRAINS_PRICE(APLAYER.POS,TERRAINS.TERRAINS_STATE[APLAYER.POS]));
      END ELSE BEGIN //SINON...KILL THE PLAYER!
       GOTO KILL1;
      END;
      DELAY(DEF_DELAY);
     END;
     //UPDATE LES PLAYERS_BOARD EN ORDRE
     UPADTE_TWO_BOARD(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_PROP_POS_INDEX(APLAYER.POS));
    END;
   GOTO THE_END;
  END;
////////////////////////////////////////////////////////////////////////////////////////////
//SERVICES
////////////////////////////////////////////////////////////////////////////////////////////
 13,29: BEGIN
  CASE APLAYER.Pos OF
   13: PLAY_THIS(SD_ELECTRICITY);
   29: PLAY_THIS(SD_AQUEDUC);
  END;
////////////////////////////////////////////////////////////////////////////////////////////
//SI LE SERVICE EST A VENDRE
////////////////////////////////////////////////////////////////////////////////////////////
  IF TERRAINS.TERRAINS_STATE[APLAYER.POS] = NOTHING THEN BEGIN
   //SI LE JOUEUR EST HUMAIN
   IF APLAYER.KIND <> KdComputer THEN BEGIN
    BUYForm := TBUYFORM.Create(SELF);
    BUYFORM.LABELSTREET.Caption := TERRAINS.TERRAINS_STREET[APLAYER.POS];
    APLAYER.FORCE_TO_PAY_10X := FALSE;
    IF APLAYER.CASH - TERRAINS.TERRAINS_PRICE[APLAYER.POS] < 0 THEN BUYFORM.BitBtnBUY.ENABLED := FALSE;
    IF BUYForm.ShowModal = MROK THEN BEGIN
    //CHANGE LE FIELD PROP ET NAME DE TERRAINS ET AJUSTE LE CASH DU JOUEUR
    TERRAINS.TERRAINS_PROP[APLAYER.POS] := APLAYER.PlayerName;
    TERRAINS.TERRAINS_STATE[APLAYER.POS] := IN_LOC;
    APLAYER.Cash := APLAYER.Cash - TERRAINS.TERRAINS_PRICE[APLAYER.POS];
    CASE APLAYER.SERVICESCOUNT OF
     0: APLAYER.SERVICESCOUNT := 1;
     1: APLAYER.SERVICESCOUNT := 2;
    END;
    END;
    BUYFORM.FREE;
   END ELSE BEGIN
    //SI LE JPUEUR EST UN CPU
    IF APLAYER.CASH - TERRAINS.TERRAINS_PRICE[APLAYER.POS] > -1 THEN BEGIN
     //CHANGE LE FIELD PROP ET NAME DE TERRAINS ET AJUSTE LE CASH DU JOUEUR
     TERRAINS.TERRAINS_PROP[APLAYER.POS] := APLAYER.PlayerName;
     TERRAINS.TERRAINS_STATE[APLAYER.POS] := IN_LOC;
     APLAYER.Cash := APLAYER.Cash - TERRAINS.TERRAINS_PRICE[APLAYER.POS];
     CASE APLAYER.SERVICESCOUNT OF
      0: APLAYER.SERVICESCOUNT := 1;
      1: APLAYER.SERVICESCOUNT := 2;
     END;
    END;
    DELAY(DEF_DELAY);
   END;
   TERRAINS.Repaint;
   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
   GOTO THE_END;
  END;
////////////////////////////////////////////////////////////////////////////////////////////
//SI LE SERVICE EST A UN AUTRE JOUEUR
////////////////////////////////////////////////////////////////////////////////////////////
  IF (TERRAINS.TERRAINS_STATE[APLAYER.POS] <> NOTHING) AND (TERRAINS.TERRAINS_PROP[APLAYER.POS] <> APLAYER.PlayerName) THEN BEGIN
   //SI LE TERRAINS N'EST PAS HYPOTHEQUER
   IF TERRAINS.TERRAINS_MORTAGE[APLAYER.POS] = FALSE THEN BEGIN
    PAIDSERVICESForm := TPAIDSERVICESForm.Create(SELF);
    //SI LE JOUEUR EST UN CPU CA VA DECLENCHER LE TIMER DANS L'AUTRE FICHE
    IF APLAYER.KIND = KDCOMPUTER THEN PAIDSERVICESForm.TAG := 1;
    PAIDSERVICESForm.MAINLabel.Caption := TERRAINS.TERRAINS_STREET[APLAYER.POS];
    //TROUVE LE MULTIPLICATEUR
    IF APLAYER.FORCE_TO_PAY_10X = FALSE THEN BEGIN
     CASE GET_SERVICES_NUM(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.POS) OF
      1: PAIDSERVICESForm.BitBtnPAID.Caption := 'PAID 4X THE DICE RESULT';
      2: PAIDSERVICESForm.BitBtnPAID.Caption := 'PAID 10X THE DICE RESULT';
     END;
    END ELSE BEGIN
     PAIDSERVICESForm.BitBtnPAID.Caption := 'PAID 10X THE DICE RESULT';
     APLAYER.FORCE_TO_PAY_10X := FALSE;
    END;
    IF PAIDSERVICESForm.ShowModal = MROK THEN
     IF APLAYER.Cash - PAIDSERVICESForm.BitBtnPAID.TAG > -1 THEN BEGIN
      APLAYER.Cash := APLAYER.Cash - PAIDSERVICESForm.BitBtnPAID.TAG;
      ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],PAIDSERVICESForm.BitBtnPAID.TAG);
     END ELSE BEGIN
      KILLForm := TKILLFORM.CREATE(SELF);
      KILLFORM.LABELBANCKROUT.CAPTION := APLAYER.PLAYERNAME + ' IS BANCKROUT !';
      IF KILLForm.SHOWMODAL = MROK THEN BEGIN
       ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.CASH);
       KILL_PLAYER(STRTOINT(APLAYER.NAME[7]));
       NEXT_PLAYERTURN;
       PAIDSERVICESForm.FREE;
       KILLForm.FREE;
       GOTO THE_END;
      END;
     END;
    PAIDSERVICESForm.FREE;
    //UPDATE LES PLAYERS_BOARD EN ORDRE
     UPADTE_TWO_BOARD(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_PROP_POS_INDEX(APLAYER.POS));
    END;
    GOTO THE_END;
   END;
  END;
////////////////////////////////////////////////////////////////////////////////////////////
//TRAINS
////////////////////////////////////////////////////////////////////////////////////////////
 6,16,26,36: BEGIN
  PLAY_THIS(SD_TRAIN);
////////////////////////////////////////////////////////////////////////////////////////////
//SI LE TRAIN EST A VENDRE
////////////////////////////////////////////////////////////////////////////////////////////
  IF TERRAINS.TERRAINS_STATE[APLAYER.POS] = NOTHING THEN BEGIN
   IF APLAYER.KIND <> KdComputer THEN BEGIN
    BUYForm := TBUYFORM.Create(SELF);
    BUYFORM.LABELSTREET.Caption := TERRAINS.TERRAINS_STREET[APLAYER.POS];
    APLAYER.FORCE_TO_PAY_DOUBLE := FALSE;
    IF APLAYER.CASH - TERRAINS.TERRAINS_PRICE[APLAYER.POS] < 0 THEN BUYFORM.BitBtnBUY.ENABLED := FALSE;
    IF BUYForm.ShowModal = MROK THEN BEGIN
    //CHANGE LE FIELD PROP ET NAME DE TERRAINS ET AJUSTE LE CASH DU JOUEUR
     TERRAINS.TERRAINS_PROP[APLAYER.POS] := APLAYER.PlayerName;
     TERRAINS.TERRAINS_STATE[APLAYER.POS] := IN_LOC;
     APLAYER.Cash := APLAYER.Cash - TERRAINS.TERRAINS_PRICE[APLAYER.POS];
     APLAYER.TRAINSCOUNT := APLAYER.TRAINSCOUNT + 1;
    END;
    BUYFORM.FREE;
   END ELSE BEGIN
    IF APLAYER.CASH - TERRAINS.TERRAINS_PRICE[APLAYER.POS] > -1 THEN BEGIN
     TERRAINS.TERRAINS_PROP[APLAYER.POS] := APLAYER.PlayerName;
     TERRAINS.TERRAINS_STATE[APLAYER.POS] := IN_LOC;
     APLAYER.Cash := APLAYER.Cash - TERRAINS.TERRAINS_PRICE[APLAYER.POS];
     APLAYER.TRAINSCOUNT := APLAYER.TRAINSCOUNT + 1;
    END;
   END;
   TERRAINS.Repaint;
   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
   GOTO THE_END;
  END;
////////////////////////////////////////////////////////////////////////////////////////////
//SI LE TRAINS EST A UN AUTRE JOUEUR
////////////////////////////////////////////////////////////////////////////////////////////
  IF (TERRAINS.TERRAINS_STATE[APLAYER.POS] <> NOTHING) AND (TERRAINS.TERRAINS_PROP[APLAYER.POS] <> APLAYER.PlayerName) THEN BEGIN
   //SI LE TERRAINS N'EST PAS HYPOTHEQUER
   IF TERRAINS.TERRAINS_MORTAGE[APLAYER.POS] = FALSE THEN
    //SI LE JOUEUR EST HUMAIN...
    IF APLAYER.KIND <> KdComputer THEN BEGIN
     PAIDForm := TPAIDForm.Create(SELF);
     PAIDForm.MAINPanel.Caption := TERRAINS.TERRAINS_STREET[APLAYER.POS];
     //FIND THE AMOUNT TO PAY
     PAIDForm.BitBtnPAID.TAG := Trains_CountToTrainsLocPrice(GET_TRAINS_NUM(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.POS));
     //FORCE LE JOUEUR A PAYER LE DOUBLE DU MONTANT
     IF APLAYER.FORCE_TO_PAY_DOUBLE = TRUE THEN BEGIN
      PAIDForm.BitBtnPAID.TAG := PAIDForm.BitBtnPAID.TAG * 2;
      APLAYER.FORCE_TO_PAY_DOUBLE := FALSE;
     END;
     PAIDForm.LABELPRICETOPAY.CAPTION := 'YOU HAVE TO PAY ' + INTTOSTR(PAIDForm.BitBtnPAID.TAG) + ' $';
     PAIDForm.BitBtnPAID.Caption := 'PAY ' + INTTOSTR(PAIDForm.BitBtnPAID.TAG) + ' $';
     IF PAIDForm.ShowModal = MROK THEN BEGIN
      IF APLAYER.Cash - PAIDForm.BitBtnPAID.TAG >= 0 THEN BEGIN
       APLAYER.Cash := APLAYER.Cash - PAIDForm.BitBtnPAID.TAG;
       ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],PAIDForm.BitBtnPAID.TAG);
      END ELSE BEGIN
       KILL2:
       KILLForm := TKILLFORM.CREATE(SELF);
       KILLFORM.LABELBANCKROUT.CAPTION := APLAYER.PLAYERNAME + ' IS BANCKROUT !';
       IF KILLForm.SHOWMODAL = MROK THEN BEGIN
        ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.CASH);
        KILL_PLAYER(STRTOINT(APLAYER.NAME[7]));
        NEXT_PLAYERTURN;
        PAIDForm.FREE;
        KILLForm.FREE;
        GOTO THE_END;
       END;
      END;
     END;
     PAIDForm.FREE;
    END ELSE BEGIN
     IF APLAYER.Cash - Trains_CountToTrainsLocPrice(GET_TRAINS_NUM(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.POS)) >= 0 THEN BEGIN
      APLAYER.Cash := APLAYER.Cash - Trains_CountToTrainsLocPrice(GET_TRAINS_NUM(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.POS));
      ADD_PLAYERCASH(TERRAINS.TERRAINS_PROP[APLAYER.POS],Trains_CountToTrainsLocPrice(GET_TRAINS_NUM(TERRAINS.TERRAINS_PROP[APLAYER.POS],APLAYER.POS)));
     END ELSE BEGIN
      GOTO KILL2;
     END;
    END;
     UPADTE_TWO_BOARD(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_PROP_POS_INDEX(APLAYER.POS));
    GOTO THE_END;
   END;
  END;
////////////////////////////////////////////////////////////////////////////////////////////
//LES IMPOTS
////////////////////////////////////////////////////////////////////////////////////////////
 5:
  BEGIN
  IF APLAYER.KIND = KDHUMAN THEN BEGIN
  IMPOTSForm := TIMPOTSForm.Create(SELF);
  IF IMPOTSFORM.ShowModal = MROK THEN BEGIN
   IF IMPOTSFORM.BitBtn10PCT.TAG = 1 THEN BEGIN TERRAINS.JACKPOT := TERRAINS.JACKPOT + Round(APLAYER.CASH / 10); APLAYER.CASH := Round(APLAYER.CASH - (APLAYER.CASH / 10)); END;
   IF IMPOTSFORM.BitBtn200PIASTE.TAG = 1 THEN BEGIN TERRAINS.JACKPOT := TERRAINS.JACKPOT + 200; APLAYER.CASH := APLAYER.CASH - 200; END;
  END;
  IMPOTSForm.FREE;
  END;
  IF APLAYER.KIND = KDCOMPUTER THEN BEGIN
   IF APLAYER.CASH < 2000 THEN BEGIN
    TERRAINS.JACKPOT := TERRAINS.JACKPOT + Round(APLAYER.CASH / 10); APLAYER.CASH := Round(APLAYER.CASH - (APLAYER.CASH / 10));
   END ELSE BEGIN
    TERRAINS.JACKPOT := TERRAINS.JACKPOT + 200; APLAYER.CASH := 200;
   END;
   DELAY(DEF_DELAY);
  END;
  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
  GOTO THE_END;
 END;
////////////////////////////////////////////////////////////////////////////////////////////
//LES TAXES
////////////////////////////////////////////////////////////////////////////////////////////
 39:
  BEGIN
  IF APLAYER.KIND = KDHUMAN THEN BEGIN
   PAIDForm := TPAIDForm.Create(SELF);
   PAIDForm.LABELPAID.Caption := 'THE FUCKING TAXES !!!';
   PAIDForm.LABELPRICETOPAY.Caption := 'PAY 75 $';
   PAIDForm.BitBtnPAID.Caption := 'PAY 75 $';
   IF PAIDForm.ShowModal = MROK THEN BEGIN
    APLAYER.CASH := APLAYER.CASH - 75;
    TERRAINS.JACKPOT := TERRAINS.JACKPOT + 75;
   END;
   PAIDForm.FREE;
  END;
  IF APLAYER.KIND = KDCOMPUTER THEN BEGIN
   APLAYER.CASH := APLAYER.CASH - 75;
   TERRAINS.JACKPOT := TERRAINS.JACKPOT + 75;
   DELAY(DEF_DELAY);
  END;
  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
  GOTO THE_END;
 END;
////////////////////////////////////////////////////////////////////////////////////////////
//GO
////////////////////////////////////////////////////////////////////////////////////////////
 1:
  BEGIN
   PLAY_THIS(SD_GO);
   IF APLAYER.CAN_HAVE_400_PIASS_AT_GO = TRUE THEN BEGIN
    APLAYER.CASH := APLAYER.CASH + 200;
    UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
   END ELSE BEGIN
    APLAYER.CAN_HAVE_400_PIASS_AT_GO := TRUE;
   END;
   GOTO THE_END;
  END;
////////////////////////////////////////////////////////////////////////////////////////////
//LA PRISON
////////////////////////////////////////////////////////////////////////////////////////////
 11:
  BEGIN
   GOTO THE_END;
  END;
////////////////////////////////////////////////////////////////////////////////////////////
//LE JACKPOT
////////////////////////////////////////////////////////////////////////////////////////////
 21:
  BEGIN
  PLAY_THIS(SD_JACKPOT);
  APLAYER.CASH := APLAYER.CASH + TERRAINS.JACKPOT;
  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
  DELAY(DEF_DELAY);
  TERRAINS.JACKPOT := 500;
  TERRAINS.Repaint;
  GOTO THE_END;
 END;
////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
//LA POLICE
////////////////////////////////////////////////////////////////////////////////////////////
 31:
  BEGIN
   PLAY_THIS(SD_GOTOJAIL);
   CRISSE_THE_PLAYER_IN_JAIL(STRTOINT(APLAYER.NAME[7]));
   GOTO THE_END;
  END;
////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
//LES CARTES
////////////////////////////////////////////////////////////////////////////////////////////
 3,18,34,8,23,37:
  BEGIN
  PLAY_THIS(SD_CARD);
  JUMPER:
  IF STRTOINT(MOVEFORM.NumericEditRANDOM_NUMBER.Text) = 0 THEN BEGIN
   //SI LE CHECKBOXFIXEDNUM.CHECKED = FALSE
   TERRAINS.RAND_CARD_NUM := RANDOM(16) + 1;
  END ELSE BEGIN
   //SI LE CHECKBOXFIXEDNUM.CHECKED = TRUE
   TERRAINS.RAND_CARD_NUM := STRTOINT(MOVEFORM.NumericEditRANDOM_NUMBER.Text);
  END;
  //SI LA CARTE EST UNE CARTE DE SORTIE DE PRISON
  IF TERRAINS.RAND_CARD_NUM = 15 THEN BEGIN
  //CHECK SI PERSONNE N'A LA CARTE SINON GOTO JUMPER
   CASE APLAYER.POS OF
    3,18,34: IF (PriCdYELLOW IN PLAYER1.PRISON_CARD) OR (PriCdYELLOW IN PLAYER2.PRISON_CARD) OR (PriCdYELLOW IN PLAYER3.PRISON_CARD) OR (PriCdYELLOW IN PLAYER4.PRISON_CARD) OR (PriCdYELLOW IN PLAYER5.PRISON_CARD) OR (PriCdYELLOW IN PLAYER6.PRISON_CARD) OR (PriCdYELLOW IN PLAYER7.PRISON_CARD) OR (PriCdYELLOW IN PLAYER8.PRISON_CARD) THEN BEGIN
     TERRAINS.RAND_CARD_NUM := RANDOM(16) + 1;
     MOVEFORM.NumericEditRANDOM_NUMBER.Text := INTTOSTR(TERRAINS.RAND_CARD_NUM);
     GOTO JUMPER;
    END;
    8,23,37: IF (PriCdBLUE IN PLAYER1.PRISON_CARD) OR (PriCdBLUE IN PLAYER2.PRISON_CARD) OR (PriCdBLUE IN PLAYER3.PRISON_CARD) OR (PriCdBLUE IN PLAYER4.PRISON_CARD) OR (PriCdBLUE IN PLAYER5.PRISON_CARD) OR (PriCdBLUE IN PLAYER6.PRISON_CARD) OR (PriCdBLUE IN PLAYER7.PRISON_CARD) OR (PriCdBLUE IN PLAYER8.PRISON_CARD) THEN BEGIN
     TERRAINS.RAND_CARD_NUM := RANDOM(16) + 1;
     MOVEFORM.NumericEditRANDOM_NUMBER.Text := INTTOSTR(TERRAINS.RAND_CARD_NUM);
     GOTO JUMPER;
    END;
   END;
  END;
  TERRAINS.REPAINT; //DRAW THE CORRECT IMAGE INTO TERRAINS
  DELAY(DEF_DELAY);      //PAUSE 2 SECONDS
   CASE APLAYER.POS OF
    3,18,34: BEGIN
              CASE TERRAINS.RAND_CARD_NUM OF
               1:BEGIN
                  APLAYER.Cash := APLAYER.CASH - 50;
                  TERRAINS.JACKPOT := TERRAINS.JACKPOT + 50;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               2:BEGIN
                  APLAYER.Cash := APLAYER.Cash - (40 * HOUSE_COUNTER(APLAYER.PLAYERNAME));
                  APLAYER.Cash := APLAYER.Cash - (115 * HOTEL_COUNTER(APLAYER.PLAYERNAME));
                  TERRAINS.JACKPOT := TERRAINS.JACKPOT + ((40 * HOUSE_COUNTER(APLAYER.PLAYERNAME)) + (115 * HOTEL_COUNTER(APLAYER.PLAYERNAME)));
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               3:BEGIN
                  APLAYER.Cash := APLAYER.CASH - 100;
                  TERRAINS.JACKPOT := TERRAINS.JACKPOT + 100;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               4:BEGIN
                  APLAYER.Cash := APLAYER.CASH - 150;
                  TERRAINS.JACKPOT := TERRAINS.JACKPOT + 150;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               5:BEGIN
                  APLAYER.Cash := APLAYER.CASH + 10;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               6:BEGIN
                  APLAYER.Cash := APLAYER.CASH + 45;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               7:BEGIN
                  APLAYER.Cash := APLAYER.CASH + 200;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               8:BEGIN
                  APLAYER.Cash := APLAYER.CASH + 20;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               9:BEGIN
                  FOR CPT := 1 TO 8 DO IF (APLAYER.NAME <> TPlayer(Components[PLAYER_INDX[CPT]]).NAME) AND (TPlayer(Components[PLAYER_INDX[CPT]]).KIND <> KDNONE) THEN BEGIN APLAYER.CASH := APLAYER.CASH + 50; TPlayer(Components[PLAYER_INDX[CPT]]).CASH := TPlayer(Components[PLAYER_INDX[CPT]]).CASH - 50; UPDATE_PLAYER_BOARD(CPT); END;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               10:BEGIN
                   APLAYER.Cash := APLAYER.CASH + 100;
                   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                  END;
               11:BEGIN
                   APLAYER.Cash := APLAYER.CASH + 100;
                   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                  END;
               12:BEGIN
                   APLAYER.Cash := APLAYER.CASH + 100;
                   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                  END;
               13:BEGIN
                   APLAYER.Cash := APLAYER.CASH + 25;
                   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                  END;
               14:BEGIN
                   APLAYER.CAN_HAVE_400_PIASS_AT_GO := FALSE;
                   MOVE_BY_A_CARD := TRUE;
                   MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),1,DIFOWARD);
                  END;
               15:BEGIN
                   APLAYER.PRISON_CARD := APLAYER.PRISON_CARD + [PriCdYELLOW];
                   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                  END;
               16:BEGIN
                   APLAYER.JailTurnLeft := 3;
                   MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),11,DIFOWARD);
                  END;
             END;
    END;
    8,23,37: BEGIN
              CASE TERRAINS.RAND_CARD_NUM OF
               1:BEGIN
                  FOR CPT := 1 TO 8 DO IF (APLAYER.NAME <> TPlayer(Components[PLAYER_INDX[CPT]]).NAME) AND (TPlayer(Components[PLAYER_INDX[CPT]]).KIND <> KDNONE) THEN BEGIN APLAYER.CASH := APLAYER.CASH - 50; TERRAINS.JACKPOT := TERRAINS.JACKPOT + 50; TPlayer(Components[PLAYER_INDX[CPT]]).CASH := TPlayer(Components[PLAYER_INDX[CPT]]).CASH + 50; UPDATE_PLAYER_BOARD(CPT); END;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               2:BEGIN
                  APLAYER.Cash := APLAYER.CASH - 15;
                  TERRAINS.JACKPOT := TERRAINS.JACKPOT + 15;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               3:BEGIN
                  APLAYER.Cash := APLAYER.Cash - (25 * HOUSE_COUNTER(APLAYER.PLAYERNAME));
                  APLAYER.Cash := APLAYER.Cash - (100 * HOTEL_COUNTER(APLAYER.PLAYERNAME));
                  TERRAINS.JACKPOT := TERRAINS.JACKPOT + ((25 * HOUSE_COUNTER(APLAYER.PLAYERNAME)) + (100 * HOTEL_COUNTER(APLAYER.PLAYERNAME)));
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               4:BEGIN
                  APLAYER.Cash := APLAYER.CASH + 150;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               5:BEGIN
                  APLAYER.Cash := APLAYER.CASH + 50;
                  UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                 END;
               6:BEGIN
                  APLAYER.FORCE_TO_PAY_10X := TRUE;
                  CASE APLAYER.POS OF
                   8,37: BEGIN
                          MOVE_BY_A_CARD := TRUE;
                          MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),13,DIFOWARD);
                         END;
                   23: BEGIN
                        MOVE_BY_A_CARD := TRUE;
                        MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),29,DIFOWARD);
                       END;
                  END;
                 END;
               7:BEGIN
                  MOVE_BY_A_CARD := TRUE;
                  MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),25,DIFOWARD);
                 END;
               8:BEGIN
                  APLAYER.CAN_HAVE_400_PIASS_AT_GO := FALSE;
                  MOVE_BY_A_CARD := TRUE;
                  MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),1,DIFOWARD);
                 END;
               9:BEGIN
                  MOVE_BY_A_CARD := TRUE;
                  MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),40,DIFOWARD);
                 END;
               10:BEGIN
                   MOVE_BY_A_CARD := TRUE;
                   MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),FIND_LIMIT(GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),3,DIREVERSE),DIREVERSE);
                  END;
               11:BEGIN
                   MOVE_BY_A_CARD := TRUE;
                   MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),6,DIFOWARD);
                  END;
               12,14:BEGIN
                  APLAYER.FORCE_TO_PAY_DOUBLE := TRUE;
                   CASE APLAYER.POS OF
                    8: BEGIN
                        MOVE_BY_A_CARD := TRUE;
                        MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),16,DIFOWARD);
                       END;
                    23: BEGIN
                         MOVE_BY_A_CARD := TRUE;
                         MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),26,DIFOWARD);
                        END;
                    37: BEGIN
                         MOVE_BY_A_CARD := TRUE;
                         MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),6,DIFOWARD);
                        END;
                    END;
                  END;
               13:BEGIN
                   MOVE_BY_A_CARD := TRUE;
                   MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),12,DIFOWARD);
                  END;
               15:BEGIN
                   APLAYER.PRISON_CARD := APLAYER.PRISON_CARD + [PriCdBLUE];
                   UPDATE_PLAYER_BOARD(STRTOINT(APLAYER.NAME[7]));
                  END;
               16:BEGIN
                   APLAYER.JailTurnLeft := 3;
                   MOVE_BY_A_CARD := TRUE;
                   MOVE_PLAYER(STRTOINT(APLAYER.NAME[7]),GET_PLAYER_POS(STRTOINT(APLAYER.NAME[7])),11,DIFOWARD);
                  END;
             END;
    END;
   END;
END;
////////////////////////////////////////////////////////////////////////////////////////////
END;
THE_END:
RESULT := APLAYER;
END;
////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////CODE A EXECUTER QUAND LE JOUEUR EST EN PRISON///////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
PROCEDURE TMASTERFORM.JAIL_TURN;
BEGIN
//SI LE JOUEUR EST HUMAIN
IF GET_PLAYER_KIND(PLAYERTURN) = KdHUMAN THEN BEGIN
 JAILForm := TJAILForm.CREATE(SELF);
 //SI LE JOUEUR NE PEUT PAS PAYER...LE BUTTON PAY VA ETRE DESACTIVÉE
 IF GET_PLAYER_CASH(PLAYERTURN) - 50 < 0 THEN JAILForm.BitBtnPAY.ENABLED := FALSE;
 IF JAILForm.ShowModal = MROK THEN BEGIN
  //SORT LE JOUEUR DE PRISON
  SET_PLAYERJAILTURNLEFT(PLAYERTURN,0);
  SET_PLAYER_CASH(PLAYERTURN,GET_PLAYER_CASH(PLAYERTURN) - 50);
  TERRAINS.JACKPOT := TERRAINS.JACKPOT + 50;
  UPDATE_PLAYER_BOARD(PLAYERTURN);
 END ELSE BEGIN
  //BRASSE LES DEÉ
  BITBTNTROW.CLICK;
 END;
 JAILForm.FREE;
END ELSE BEGIN
 //SI LE JOUEUR EST UN CPU
 IF GET_PLAYER_CASH(PLAYERTURN) - 50 > 0 THEN BEGIN
  //SORT LE JOUEUR DE PRISON
  SET_PLAYERJAILTURNLEFT(PLAYERTURN,0);
  SET_PLAYER_CASH(PLAYERTURN,GET_PLAYER_CASH(PLAYERTURN) - 50);
  TERRAINS.JACKPOT := TERRAINS.JACKPOT + 50;
  UPDATE_PLAYER_BOARD(PLAYERTURN);
 END ELSE BEGIN
  //BRASSE LES DEÉ
  BITBTNTROW.CLICK;
 END;
END;
END;

 

Here's another part (or "humm, what's pointers and loops for?")

////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////CREATE THE FORM////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
procedure TMASTERForm.FormCreate(Sender: TObject);
begin
//PUT THE CURRENT DIRECTORY(PATH) INTO APPDIR
GETDIR(0,APPDIR);
//FORCE THE SCREEN TO BE 800 x 600(NO TEST TO SEE IF WE CAN ???)
RESSWITCHER := TRESSWITCHER.Create(SELF);
//DATA TO BE USE WHEN CLOSING THE FORM AND RESIZING SCREEN TO ORIGINAL STATE
RESSWITCHDAT.W := SCREEN.Width;
RESSWITCHDAT.H := SCREEN.Height;
RESSWITCHDAT.C := GetDeviceCaps(GetDc(GetDesktopWindow),BITSPIXEL);
//CHANGE THE RESOLUTION
ResSwitcher.ChangeRes(800,600,RESSWITCHDAT.C);
//CREATE THE FORM USED TO MOVE PLAYERS(MUST BE GLOBAL)
MOVEFORM := TMOVEFORM.CREATE(SELF);
//SET-UP THE MASTERPAGE
MASTERFORM.BorderStyle := BSNONE;
MASTERFORM.SetBounds(0,0,800,600);
BITBTNMORTAGE.ENABLED := FALSE;
//CREATE THE PLAYERX
PLAYERX1 := CREATE_PLAYER(1,2);
PLAYERX2 := CREATE_PLAYER(2,4);
PLAYERX3 := CREATE_PLAYER(3,7);
PLAYERX4 := CREATE_PLAYER(4,9);
PLAYERX5 := CREATE_PLAYER(5,10);
PLAYERX6 := CREATE_PLAYER(6,12);
PLAYERX7 := CREATE_PLAYER(7,14);
PLAYERX8 := CREATE_PLAYER(8,15);
PLAYERX9 := CREATE_PLAYER(9,17);
PLAYERX10 := CREATE_PLAYER(10,19);
PLAYERX11 := CREATE_PLAYER(11,20);
PLAYERX12 := CREATE_PLAYER(12,22);
PLAYERX13 := CREATE_PLAYER(13,24);
PLAYERX14 := CREATE_PLAYER(14,25);
PLAYERX15 := CREATE_PLAYER(15,27);
PLAYERX16 := CREATE_PLAYER(16,28);
PLAYERX17 := CREATE_PLAYER(17,30);
PLAYERX18 := CREATE_PLAYER(18,32);
PLAYERX19 := CREATE_PLAYER(19,33);
PLAYERX20 := CREATE_PLAYER(20,35);
PLAYERX21 := CREATE_PLAYER(21,38);
PLAYERX22 := CREATE_PLAYER(22,40);
PLAYERX23 := CREATE_PLAYER(23,6);
PLAYERX24 := CREATE_PLAYER(24,16);
PLAYERX25 := CREATE_PLAYER(25,26);
PLAYERX26 := CREATE_PLAYER(26,36);
PLAYERX27 := CREATE_PLAYER(27,13);
PLAYERX28 := CREATE_PLAYER(28,29);
//INITIALISE SOME VARIABLES
SET_ARRAYS;
CAN_CLICK := TRUE;
PLAYERTURN := 8;
TERRAINS.JACKPOT := 500;
//CREATE THE SET-UPForm
TRY
 SET_UPFORM := TSET_UPFORM.Create(SELF);
 IF SET_UPFORM.SHOWMODAL = MROK THEN BEGIN //SI LE JOUEUR A PESSER SUR OK...
  INIT_PLAYER;
  PLACE_PLAYERS;
  NEXT_PLAYERTURN;
 END ELSE BEGIN                            //SINON...CLEAN L'APP ET L'ARRETE DIRECTEMENT
  SET_UPFORM.Free;
  ResSwitcher.ChangeRes(RESSWITCHDAT.W,RESSWITCHDAT.H,RESSWITCHDAT.C);
  PLAYERX1.FREE; PLAYERX2.FREE; PLAYERX3.FREE; PLAYERX4.FREE; PLAYERX5.FREE; PLAYERX6.FREE; PLAYERX7.FREE; PLAYERX8.FREE; PLAYERX9.FREE; PLAYERX10.FREE; PLAYERX11.FREE; PLAYERX12.FREE; PLAYERX13.FREE; PLAYERX14.FREE; PLAYERX15.FREE; PLAYERX16.FREE; PLAYERX17.FREE; PLAYERX18.FREE; PLAYERX19.FREE; PLAYERX20.FREE; PLAYERX21.FREE; PLAYERX22.FREE; PLAYERX23.FREE; PLAYERX24.FREE; PLAYERX25.FREE; PLAYERX26.FREE; PLAYERX27.FREE; PLAYERX28.FREE;
  MOVEFORM.FREE;
  RESSWITCHER.FREE;
  HALT;
 END;
FINALLY
 SET_UPFORM.FREE;
END;
end;

 

Seeing that after all those years of experience under my belt want to make me cut myself and bleed to death.

 

Enjoy!


PARTNERS