mirror of
https://bitbucket.org/grumdrig/pq.git
synced 2026-09-29 08:44:00 -06:00
Bump version to 6.4.4. Re-fix the too-big stats WinStat problem by holding the sum of squares in an Int64 (thanks, Phazer). And remove old fixes - we should be okay for several tens of billions of years. Correct a typo in the join-a-guild dialog (thanks again, Phazer). Fix equipment output bug in exported sheets (thanks Jennifer Sires).
This commit is contained in:
@@ -105,7 +105,7 @@ object FrontForm: TFrontForm
|
|||||||
Height = 13
|
Height = 13
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
Alignment = taCenter
|
Alignment = taCenter
|
||||||
Caption = #169' 2002-2022 Eric Fredricksen - v6.4.3'
|
Caption = #169' 2002-2022 Eric Fredricksen - v6.4.4'
|
||||||
Color = clWhite
|
Color = clWhite
|
||||||
Font.Charset = DEFAULT_CHARSET
|
Font.Charset = DEFAULT_CHARSET
|
||||||
Font.Color = 11382189
|
Font.Color = 11382189
|
||||||
|
|||||||
@@ -831,29 +831,28 @@ end;
|
|||||||
|
|
||||||
procedure TMainForm.WinStat;
|
procedure TMainForm.WinStat;
|
||||||
var
|
var
|
||||||
i,t: Integer;
|
i: Integer;
|
||||||
function Square(x: Integer): Integer; begin Result := x * x; end;
|
t: Int64;
|
||||||
|
function Square(x: Int64): Int64; begin Result := x * x; end;
|
||||||
|
|
||||||
|
function Random64(below: Int64): Int64;
|
||||||
|
begin
|
||||||
|
Int64Rec(Result).Hi := Random($7FFFFFFF);
|
||||||
|
Int64Rec(Result).Lo := Random($FFFFFFFF);
|
||||||
|
Result := Result mod below;
|
||||||
|
end;
|
||||||
begin
|
begin
|
||||||
if Odds(1,2)
|
if Odds(1,2)
|
||||||
then i := Random(Stats.Items.Count)
|
then i := Random(Stats.Items.Count)
|
||||||
else begin
|
else begin
|
||||||
// favor the best stat so it will tend to clump
|
// Favor the best stats so they will tend to clump
|
||||||
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 := Random64(t);
|
||||||
// High stats cause int overflow
|
|
||||||
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);
|
||||||
if i >= Stats.Items.Count then begin
|
Dec(t, Square(GetI(Stats,i)));
|
||||||
// This happens with high stats due to integer overflow
|
|
||||||
i := Random(Stats.Items.Count);
|
|
||||||
break;
|
|
||||||
end;
|
|
||||||
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);
|
||||||
@@ -1109,7 +1108,7 @@ begin
|
|||||||
WrLn( Format(' CHA%7d MP Max%7d', [GetI(Stats,'CHA'), GetI(Stats,'MP Max')]));
|
WrLn( Format(' CHA%7d MP Max%7d', [GetI(Stats,'CHA'), GetI(Stats,'MP Max')]));
|
||||||
WrLn;
|
WrLn;
|
||||||
WrLn( 'Equipment:');
|
WrLn( 'Equipment:');
|
||||||
for i := 1 to Equips.Items.Count-1 do
|
for i := 0 to Equips.Items.Count-1 do
|
||||||
if Get(Equips,i) <> '' then
|
if Get(Equips,i) <> '' then
|
||||||
WrLn( ' ' + LeftStr(Equips.Items[i].Caption + ' ', 12) + Get(Equips,i));
|
WrLn( ' ' + LeftStr(Equips.Items[i].Caption + ' ', 12) + Get(Equips,i));
|
||||||
WrLn;
|
WrLn;
|
||||||
@@ -1607,7 +1606,7 @@ begin
|
|||||||
Navigate(GetHostAddr + 'name=' + UrlEncode(Get(Traits,'Name')));
|
Navigate(GetHostAddr + 'name=' + UrlEncode(Get(Traits,'Name')));
|
||||||
end;
|
end;
|
||||||
if (ssCtrl in Shift) and (Key = ord('G')) then begin
|
if (ssCtrl in Shift) and (Key = ord('G')) then begin
|
||||||
SetGuild(InputBox('Progress Quest', 'Choose a guild.'#13#13'Make sure you undestand the guild rules before you join one. To learn more about guilds, visit http://progressquest.com/guilds.php', GetGuild));
|
SetGuild(InputBox('Progress Quest', 'Choose a guild.'#13#13'Make sure you understand the guild rules before you join one. To learn more about guilds, visit http://progressquest.com/guilds.php', GetGuild));
|
||||||
Guildify;
|
Guildify;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|||||||
Reference in New Issue
Block a user