mirror of
https://bitbucket.org/grumdrig/pq.git
synced 2026-09-29 08:44:00 -06:00
Fix bug causing an error when the sum of squares of stats exceeded 0x7FFFFFFF. And:
Restore file extension pq. Bump version to 6.4 (6.3 wasn't officially released but has been used in ports.) Turbo mode for testing. Limit the number of fancy items won to keep the Invetory not too huge
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
unit Main;
|
unit Main;
|
||||||
{ copyright (c)2002 Eric Fredricksen all rights reserved }
|
{ copyright (c)2022 Eric Fredricksen all rights reserved }
|
||||||
|
|
||||||
{$DEFINE CHEATS}
|
{$DEFINE CHEATS}
|
||||||
{$UNDEF LOGGING}
|
{$UNDEF LOGGING}
|
||||||
|
{$DEFINE TURBO}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
@@ -12,14 +13,16 @@ uses
|
|||||||
|
|
||||||
const
|
const
|
||||||
// revs:
|
// revs:
|
||||||
// 5: pq 6.3
|
// 7: pq 6.4
|
||||||
|
// 6: pq-web
|
||||||
|
// 5: pq 6.3 (no official release)
|
||||||
// 4: pq 6.2
|
// 4: pq 6.2
|
||||||
// 3: pq 6.1
|
// 3: pq 6.1
|
||||||
// 2: pq 6.0
|
// 2: pq 6.0
|
||||||
// 1: pq 6.0, some early release I guess; don't remember
|
// 1: pq 6.0, some early release I guess; don't remember
|
||||||
RevString = '&rev=5';
|
RevString = '&rev=7';
|
||||||
wmIconTray = WM_USER + Ord('t');
|
wmIconTray = WM_USER + Ord('t');
|
||||||
kFileExt = '.pq3';
|
kFileExt = '.pq';
|
||||||
|
|
||||||
type
|
type
|
||||||
TMainForm = class(TForm)
|
TMainForm = class(TForm)
|
||||||
@@ -719,11 +722,13 @@ begin
|
|||||||
if SubItems.Count < 1
|
if SubItems.Count < 1
|
||||||
then SubItems.Add(value)
|
then SubItems.Add(value)
|
||||||
else SubItems[0] := value;
|
else SubItems[0] := value;
|
||||||
|
|
||||||
|
Selected := true;
|
||||||
|
MakeVisible(false);
|
||||||
end;
|
end;
|
||||||
//list.MultiSelect := true;
|
//list.MultiSelect := true;
|
||||||
//list.RowSelect := true;
|
//list.RowSelect := true;
|
||||||
//list.HideSelection := false;
|
//list.HideSelection := false;
|
||||||
list.Items[pos].Selected := true;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function LevelUpTime(level: Integer): Integer; // seconds
|
function LevelUpTime(level: Integer): Integer; // seconds
|
||||||
@@ -835,12 +840,15 @@ begin
|
|||||||
t := 0;
|
t := 0;
|
||||||
for i := 0 to 5 do Inc(t,Square(GetI(Stats,i)));
|
for i := 0 to 5 do Inc(t,Square(GetI(Stats,i)));
|
||||||
t := Random(t);
|
t := Random(t);
|
||||||
|
if t < 0 then i := Random(Stats.Items.Count)
|
||||||
|
else begin
|
||||||
i := -1;
|
i := -1;
|
||||||
while t >= 0 do begin
|
while t >= 0 do begin
|
||||||
Inc(i);
|
Inc(i);
|
||||||
Dec(t,Square(GetI(Stats,i)));
|
Dec(t,Square(GetI(Stats,i)));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
Add(Stats, Stats.Items[i].Caption, 1);
|
Add(Stats, Stats.Items[i].Caption, 1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -863,7 +871,9 @@ end;
|
|||||||
|
|
||||||
procedure TMainForm.WinItem;
|
procedure TMainForm.WinItem;
|
||||||
begin
|
begin
|
||||||
Add(Inventory, SpecialItem, 1);
|
if max(250, Random(999)) < Inventory.Items.Count
|
||||||
|
then Add(Inventory, Inventory.Items[Random(Inventory.Items.Count)].Caption, 1)
|
||||||
|
else Add(Inventory, SpecialItem, 1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.CompleteQuest;
|
procedure TMainForm.CompleteQuest;
|
||||||
@@ -1100,7 +1110,7 @@ begin
|
|||||||
else WrLn( ' ' + Indefinite(Items[i].Caption, GetI(Inventory,i)));
|
else WrLn( ' ' + Indefinite(Items[i].Caption, GetI(Inventory,i)));
|
||||||
WrLn;
|
WrLn;
|
||||||
WrLn( '-- ' + DateTimeToStr(Now));
|
WrLn( '-- ' + DateTimeToStr(Now));
|
||||||
WrLn( '-- Progress Quest 6.2 - http://progressquest.com/');
|
WrLn( '-- Progress Quest 6.4 - http://progressquest.com/');
|
||||||
Result := f;
|
Result := f;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -1226,6 +1236,9 @@ var
|
|||||||
begin
|
begin
|
||||||
gain := Pos('kill|',fTask.Caption) = 1;
|
gain := Pos('kill|',fTask.Caption) = 1;
|
||||||
with TaskBar do begin
|
with TaskBar do begin
|
||||||
|
{$IFDEF TURBO}
|
||||||
|
Position := Max;
|
||||||
|
{$ENDIF}
|
||||||
if Position >= Max then begin
|
if Position >= Max then begin
|
||||||
ClearAllSelections;
|
ClearAllSelections;
|
||||||
|
|
||||||
@@ -1337,7 +1350,7 @@ end;
|
|||||||
|
|
||||||
const
|
const
|
||||||
KUsage =
|
KUsage =
|
||||||
'Usage: pq [flags] [game.pq3]'#10 +
|
'Usage: pq [flags] [game.pq]'#10 +
|
||||||
#10 +
|
#10 +
|
||||||
'Flags:'#10 +
|
'Flags:'#10 +
|
||||||
' -no-backup Do not make a backup file when saving the game'#10 +
|
' -no-backup Do not make a backup file when saving the game'#10 +
|
||||||
@@ -1610,6 +1623,9 @@ var
|
|||||||
const
|
const
|
||||||
flat = 1;
|
flat = 1;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF TURBO}
|
||||||
|
Exit; // For testing multiplayer saves without hitting the server
|
||||||
|
{$ENDIF}
|
||||||
if FExportSheets then
|
if FExportSheets then
|
||||||
ExportCharSheet;
|
ExportCharSheet;
|
||||||
if GetPasskey = 0 then Exit; // not a online game!
|
if GetPasskey = 0 then Exit; // not a online game!
|
||||||
|
|||||||
Reference in New Issue
Block a user