Delphi & Pascal (česká wiki)
Přejít na: navigace, hledání
Procedure ScreenRisk;
Begin
  WaitRetrace;
  {HLAVA OREL}
  Begin
    WriteSprite(252,104,100,116,131,131,Buffer[1],Buffer[4]); {RISK SVETLY}
    If Hlava.Enable=True then WriteSprite(220,120,0,140,47,179,Buffer[1],Buffer[4])
                         else WriteSprite(220,120,0,100,47,139,Buffer[1],Buffer[4]);
    If Orel.Enable=True then WriteSprite(268,120,48,140,95,179,Buffer[1],Buffer[4])
                        else WriteSprite(268,120,48,100,95,139,Buffer[1],Buffer[4]);
  End;
 
  {DISPLAY WIN + CREDIT}
  Blok(109,157,210,165,ColorBlack,Buffer[4]);
  Ramecek(108,154,211,166,ColorRedBright,Buffer[4]);
  Blok(118,152,138,156,ColorBlack,Buffer[4]);
  WriteText(Buffer[1],160,40,5,5,1,120,152,'win',Buffer[4]);
  Blok(168,152,206,156,ColorBlack,Buffer[4]);
  WriteText(Buffer[1],160,40,5,5,1,170,152,'credit',Buffer[4]);
 
  If VyhraShow=True then
  Begin
    If Vyhra.Castka<10 then WriteNumber(Buffer[1],160,96,5,7,1,130,158,Vyhra.Castka,Buffer[4]);
    If Vyhra.Castka>=100 then WriteNumber(Buffer[1],160,96,5,7,1,120,158,Vyhra.Castka,Buffer[4]);
    If ((Vyhra.Castka>=10) and (Vyhra.Castka<100)) then WriteNumber(Buffer[1],160,96,5,7,1,125,158,Vyhra.Castka,Buffer[4]);
  End;
 
  If CreditShow=True then
  Begin
    If Credit<10 then WriteNumber(Buffer[1],160,96,5,7,1,200,158,Credit,Buffer[4]);
    If ((Credit>=10) and (Credit<100)) then WriteNumber(Buffer[1],160,96,5,7,1,194,158,Credit,Buffer[4]);
    If ((Credit>=100) and (Credit<1000)) then WriteNumber(Buffer[1],160,96,5,7,1,188,158,Credit,Buffer[4]);
    If ((Credit>=1000) and (Credit<10000)) then WriteNumber(Buffer[1],160,96,5,7,1,182,158,Credit,Buffer[4]);
    If ((Credit>=10000) and (Credit<100000)) then WriteNumber(Buffer[1],160,96,5,7,1,176,158,Credit,Buffer[4]);
    If ((Credit>=100000) and (Credit<1000000)) then WriteNumber(Buffer[1],160,96,5,7,1,170,158,Credit,Buffer[4]);
    If ((Credit>=1000000) and (Credit<9999999)) then WriteNumber(Buffer[1],160,96,5,7,1,164,158,Credit,Buffer[4]);
  End;
 
  {Button HLAVA}
  If Btn[4].Phase=0 then Blok(204,185,241,199,ColorRedDark,Buffer[4])
                    else Blok(204,185,241,199,ColorYellow,Buffer[4]);
  Ramecek(204,185,241,199,ColorGreenDark,Buffer[4]);
  WriteText(Buffer[1],160,20,5,5,1,235,187,'h',Buffer[4]);
  WriteText(Buffer[1],160,20,5,5,1,206,193,'hlava',Buffer[4]);
 
  {Button OREL}
  If Btn[5].Phase=0 then Blok(243,185,278,199,ColorRedDark,Buffer[4])
                    else Blok(243,185,278,199,ColorYellow,Buffer[4]);
  Ramecek(243,185,278,199,ColorGreenDark,Buffer[4]);
  WriteText(Buffer[1],160,20,5,5,1,272,187,'o',Buffer[4]);
  WriteText(Buffer[1],160,20,5,5,1,245,193,'orel',Buffer[4]);
 
  {Button DO MULTIWINU}
  If Btn[0].Phase=0 then Blok(0,185,56,199,ColorRedDark,Buffer[4])
                    else Blok(0,185,56,199,ColorYellow,Buffer[4]);
  Ramecek(0,185,56,199,ColorGreenDark,Buffer[4]);
  WriteText(Buffer[1],160,20,5,5,1,50,187,'m',Buffer[4]);
  WriteText(Buffer[1],160,20,5,5,1,2,187,'do',Buffer[4]);
  WriteText(Buffer[1],160,20,5,5,1,2,193,'multiwinu',Buffer[4]);
 
  {HLAVA OREL BLINKING}
  If Risk.Blinking=True then
  Begin
    If Risk.Counter<DatRec.RiskSpeed
                      then Inc(Risk.Counter)
                      else Begin
                             Risk.Counter:=0;
                             If Risk.Phase=0 then Begin
                                                    Risk.Phase:=1;
                                                    Hlava.Enable:=False;
                                                    Orel.Enable:=True;
                                                    Btn[4].Phase:=0;
                                                    Btn[5].Phase:=1;
                                                    Btn[0].Phase:=1;
                                                  End
                                             else Begin
                                                    Risk.Phase:=0;
                                                    Hlava.Enable:=True;
                                                    Orel.Enable:=False;
                                                    Btn[4].Phase:=1;
                                                    Btn[5].Phase:=0;
                                                    Btn[0].Phase:=0;
                                                  End;
                           End;
 
  End;
End;