@@ -8,8 +8,8 @@ interface
8
8
type
9
9
TSceneEnum = (scTitle, scLoad, scHelp, scGame, scQuit, scWin, scDef, scInv,
10
10
scDrop, scItems, scAmount, scPlayer, scMessages, scStatistics, scDialog,
11
- scSell, scRepair, scBuy, scCalendar, scDifficulty);
12
- // scSpells, scIdentification, scRest
11
+ scSell, scRepair, scBuy, scCalendar, scDifficulty, scRest );
12
+ // scSpells, scIdentification
13
13
14
14
type
15
15
TScene = class (TObject)
@@ -78,6 +78,13 @@ TSceneCalendar = class(TScene)
78
78
procedure Update (var Key: Word); override;
79
79
end ;
80
80
81
+ type
82
+ TSceneRest = class (TScene)
83
+ public
84
+ procedure Render ; override;
85
+ procedure Update (var Key: Word); override;
86
+ end ;
87
+
81
88
type
82
89
TSceneDialog = class (TScene)
83
90
public
@@ -316,6 +323,8 @@ constructor TScenes.Create;
316
323
FScene[I] := TSceneCalendar.Create;
317
324
scDifficulty:
318
325
FScene[I] := TSceneDifficulty.Create;
326
+ scRest:
327
+ FScene[I] := TSceneRest.Create;
319
328
end ;
320
329
end ;
321
330
@@ -741,7 +750,10 @@ procedure TSceneGame.Update(var Key: Word);
741
750
TK_K:
742
751
Scenes.SetScene(scCalendar);
743
752
TK_R:
744
- Player.Rest(100 );
753
+ begin
754
+ Game.Timer := High(Byte);
755
+ Scenes.SetScene(scRest);
756
+ end ;
745
757
TK_G:
746
758
Player.Pickup;
747
759
TK_I:
@@ -1629,6 +1641,36 @@ procedure TSceneDifficulty.Update(var Key: Word);
1629
1641
end ;
1630
1642
end ;
1631
1643
1644
+ { TSceneRest }
1645
+
1646
+ procedure TSceneRest.Render ;
1647
+ var
1648
+ Y: Byte;
1649
+ begin
1650
+ Self.Title(_(' Rest' ));
1651
+
1652
+ Self.FromAToZ;
1653
+ Y := 1 ;
1654
+
1655
+ Inc(Y); Terminal.Print(1 , Y, KeyStr(Chr(Y + 95 )) + ' ' + _(' Rest 10 turns' ), TK_ALIGN_LEFT);
1656
+ Inc(Y); Terminal.Print(1 , Y, KeyStr(Chr(Y + 95 )) + ' ' + _(' Rest 100 turns' ), TK_ALIGN_LEFT);
1657
+ Inc(Y); Terminal.Print(1 , Y, KeyStr(Chr(Y + 95 )) + ' ' + _(' Rest 1000 turns' ), TK_ALIGN_LEFT);
1658
+
1659
+ MsgLog.Render(2 , True);
1660
+
1661
+ AddKey(' Esc' , _(' Back' ), True, True);
1662
+ end ;
1663
+
1664
+ procedure TSceneRest.Update (var Key: Word);
1665
+ begin
1666
+ case Key of
1667
+ TK_A, TK_B, TK_C:
1668
+ Player.Rest(StrToInt(' 1' + StringOfChar(' 0' , Key - TK_A + 1 )));
1669
+ TK_ESCAPE:
1670
+ Scenes.SetScene(scGame);
1671
+ end
1672
+ end ;
1673
+
1632
1674
initialization
1633
1675
1634
1676
Scenes := TScenes.Create;
0 commit comments