mirror of
https://bitbucket.org/grumdrig/pq-web.git
synced 2026-09-29 08:44:00 -06:00
Some few edits
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c)2002-2010 Eric Fredricksen <e@fredricksen.net> all rights reserved
|
// Copyright (c)2002-2010 Eric Fredricksen <e@fredricksen.net> all rights reserved
|
||||||
|
|
||||||
// revs:
|
// revs:
|
||||||
// 6: pq 6.3.web
|
// 6: pq 6.3/web
|
||||||
// 5: pq 6.3
|
// 5: pq 6.3
|
||||||
// 4: pq 6.2
|
// 4: pq 6.2
|
||||||
// 3: pq 6.1
|
// 3: pq 6.1
|
||||||
@@ -9,51 +9,52 @@
|
|||||||
// 1: pq 6.0, some early release I guess;)n't remember
|
// 1: pq 6.0, some early release I guess;)n't remember
|
||||||
var RevString = '&rev=6';
|
var RevString = '&rev=6';
|
||||||
|
|
||||||
|
var timerid;
|
||||||
|
var timestart;
|
||||||
|
|
||||||
|
function timeGetTime() {
|
||||||
|
return Date.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
function StartTimer() {
|
function StartTimer() {
|
||||||
if (! MainForm.Timer1.Enabled)
|
if (!timerid) {
|
||||||
MainForm.Timer1.Tag = timeGetTime();
|
timestart = timeGetTime();
|
||||||
MainForm.Timer1.Enabled = True;
|
timerid = setInterval(Timer1Timer, 100);
|
||||||
|
}
|
||||||
// BS location for this, but...
|
// BS location for this, but...
|
||||||
MainForm.Caption = 'ProgressQuest - ' + ChangeFileExt(ExtractFileName(MainForm.GameSaveName), '');
|
// MainForm.Caption = 'ProgressQuest - ' + ChangeFileExt(ExtractFileName(MainForm.GameSaveName), '');
|
||||||
}
|
}
|
||||||
|
|
||||||
function TMainForm_GetPasskey() { return Traits.Tag; }
|
var game = { queue: [] };
|
||||||
function TMainForm_SetPasskey(v) {
|
|
||||||
Traits.Hint = v;
|
|
||||||
Traits.Tag = StrToIntDef(Traits.Hint,0);
|
|
||||||
}
|
|
||||||
|
|
||||||
function TMainForm_GetMotto() { return Stats.Hint; }
|
function GetPasskey() { return game.passkey; }
|
||||||
function TMainForm_SetMotto(v) { Stats.Hint = v; }
|
function SetPasskey(v) { game.passkey = v; }
|
||||||
|
|
||||||
function TMainForm_GetHostName() { return Spells.Hint; }
|
function GetMotto() { return game.motto; }
|
||||||
function TMainForm_SetHostName(v) { Spells.Hint = v; }
|
function SetMotto(v) { game.motto = v; }
|
||||||
|
|
||||||
function TMainForm_GetHostAddr() {
|
function GetHostName() { return game.hostname; }
|
||||||
if (Equips.Hint == '' && GetPasskey() != 0)
|
function SetHostName(v) { game.hostname = v; }
|
||||||
return 'http://www.progressquest.com/knoram.php?';
|
|
||||||
else
|
|
||||||
return Equips.Hint;
|
|
||||||
}
|
|
||||||
|
|
||||||
function TMainForm_SetHostAddr(v) { Equips.Hint = v; }
|
function GetHostAddr() { return game.hostaddr; }
|
||||||
|
function SetHostAddr(v) { game.hostaddr = v; }
|
||||||
|
|
||||||
function TMainForm_GetLogin() { return Inventory.Hint; }
|
function GetLogin() { return game.login; }
|
||||||
function TMainForm_SetLogin(v) { Inventory.Hint = v; }
|
function SetLogin(v) { game.login = v; }
|
||||||
|
|
||||||
function TMainForm_GetPassword() { return Plots.Hint; }
|
function GetPassword() { return game.password; }
|
||||||
function TMainForm_SetPassword(v) { Plots.Hint = v; }
|
function SetPassword(v) { game.password = v; }
|
||||||
|
|
||||||
function TMainForm_GetGuild() { return Label1.Hint; }
|
function GetGuild() { return game.guild; }
|
||||||
function TMainForm_SetGuild(v) { Label1.Hint = v; }
|
function SetGuild(v) { game.guild = v; }
|
||||||
|
|
||||||
function TMainForm_Q(s) {
|
function Q(s) {
|
||||||
fQueue.Items.Add(s);
|
game.queue.push(s);
|
||||||
Dequeue();
|
Dequeue();
|
||||||
}
|
}
|
||||||
|
|
||||||
function TMainForm_TaskDone() {
|
function TaskDone() {
|
||||||
return TaskBar.Position >= TaskBar.Max;
|
return $("#TaskBar").attr("Position") >= $("#TaskBar").attr("Max");
|
||||||
}
|
}
|
||||||
|
|
||||||
function Odds(chance, outof) {
|
function Odds(chance, outof) {
|
||||||
@@ -65,7 +66,7 @@ function RandSign() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Pick(s) {
|
function Pick(s) {
|
||||||
return s[Random(s.Count)];
|
return s[Random(s.length)];
|
||||||
}
|
}
|
||||||
|
|
||||||
function RandomLow(below) {
|
function RandomLow(below) {
|
||||||
@@ -73,7 +74,7 @@ function RandomLow(below) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function PickLow(s) {
|
function PickLow(s) {
|
||||||
return s[RandomLow(s.Count)];
|
return s[RandomLow(s.length)];
|
||||||
}
|
}
|
||||||
|
|
||||||
function Ends(s, e) {
|
function Ends(s, e) {
|
||||||
@@ -165,7 +166,7 @@ function TMainForm_InterplotCinematic() {
|
|||||||
var nemesis = NamedMonster(GetI(Traits,'Level')+3);
|
var nemesis = NamedMonster(GetI(Traits,'Level')+3);
|
||||||
Q('task|4|A desperate struggle commences with ' + nemesis);
|
Q('task|4|A desperate struggle commences with ' + nemesis);
|
||||||
var s = Random(3);
|
var s = Random(3);
|
||||||
for (var i = 1; i <= Random(1 + Plots.Items.Count); ++i) {
|
for (var i = 1; i <= Random(1 + Plots.length); ++i) {
|
||||||
s += 1 + Random(2);
|
s += 1 + Random(2);
|
||||||
switch (s % 3) {
|
switch (s % 3) {
|
||||||
case 0: Q('task|2|Locked in grim combat with ' + nemesis); break;
|
case 0: Q('task|2|Locked in grim combat with ' + nemesis); break;
|
||||||
@@ -219,9 +220,9 @@ function TMainForm_MonsterTask(level) {
|
|||||||
|
|
||||||
if (Odds(1,25)) {
|
if (Odds(1,25)) {
|
||||||
// Use an NPC every once in a while
|
// Use an NPC every once in a while
|
||||||
var monster = ' ' + Pick(NewGuyForm.Race.Items);
|
var monster = ' ' + Pick(NewGuyForm.Race);
|
||||||
if (Odds(1,2)) {
|
if (Odds(1,2)) {
|
||||||
monster = 'passing' + monster + ' ' + Pick(NewGuyForm.Klass.Items);
|
monster = 'passing' + monster + ' ' + Pick(NewGuyForm.Klass);
|
||||||
} else {
|
} else {
|
||||||
monster = PickLow(K.Titles.Lines) + ' ' + GenerateName + ' the' + monster;
|
monster = PickLow(K.Titles.Lines) + ' ' + GenerateName + ' the' + monster;
|
||||||
definite = true;
|
definite = true;
|
||||||
@@ -312,31 +313,31 @@ function TMainForm_Dequeue() {
|
|||||||
if (fTask.Caption = 'sell') {
|
if (fTask.Caption = 'sell') {
|
||||||
Inventory.Tag = GetI(Inventory.Inventory,1);
|
Inventory.Tag = GetI(Inventory.Inventory,1);
|
||||||
Inventory.Tag = Inventory.Tag * GetI(Traits,'Level');
|
Inventory.Tag = Inventory.Tag * GetI(Traits,'Level');
|
||||||
if (Pos(' of ', Inventory.Items[1].Caption) > 0)
|
if (Pos(' of ', Inventory[1].Caption) > 0)
|
||||||
Inventory.Tag = Inventory.Tag * (1+RandomLow(10)) * (1+RandomLow(GetI(Traits,'Level')));
|
Inventory.Tag = Inventory.Tag * (1+RandomLow(10)) * (1+RandomLow(GetI(Traits,'Level')));
|
||||||
Inventory.Items[0].MakeVisible(false);
|
Inventory[0].MakeVisible(false);
|
||||||
Inventory.Items.Delete(1);
|
Inventory.Delete(1);
|
||||||
Add(Inventory, 'Gold', Inventory.Tag);
|
Add(Inventory, 'Gold', Inventory.Tag);
|
||||||
}
|
}
|
||||||
if (Items.Count > 1) {
|
if (Items.length > 1) {
|
||||||
Task('Selling ' + Indefinite(Inventory.Items[1].Caption, GetI(Inventory,1)), 1 * 1000);
|
Task('Selling ' + Indefinite(Inventory[1].Caption, GetI(Inventory,1)), 1 * 1000);
|
||||||
fTask.Caption = 'sell';
|
fTask.Caption = 'sell';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var old = fTask.Caption;
|
var old = fTask.Caption;
|
||||||
fTask.Caption = '';
|
fTask.Caption = '';
|
||||||
if (fQueue.Items.Count > 0) {
|
if (fQueue.length > 0) {
|
||||||
var a = Split(fQueue.Items[0],0);
|
var a = Split(fQueue[0],0);
|
||||||
var n = StrToInt(Split(fQueue.Items[0],1));
|
var n = StrToInt(Split(fQueue[0],1));
|
||||||
var s = Split(fQueue.Items[0],2);
|
var s = Split(fQueue[0],2);
|
||||||
if (a == 'task' || a == 'plot') {
|
if (a == 'task' || a == 'plot') {
|
||||||
if (a == 'plot') {
|
if (a == 'plot') {
|
||||||
CompleteAct;
|
CompleteAct;
|
||||||
s = 'Loading ' + Plots.Items[Plots.Items.Count-1].Caption;
|
s = 'Loading ' + Plots[Plots.length-1].Caption;
|
||||||
}
|
}
|
||||||
Task(s, n * 1000);
|
Task(s, n * 1000);
|
||||||
fQueue.Items.Delete(0);
|
fQueue.Delete(0);
|
||||||
} else {
|
} else {
|
||||||
throw 'bah!';
|
throw 'bah!';
|
||||||
}
|
}
|
||||||
@@ -361,10 +362,10 @@ function TMainForm_Dequeue() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function IndexOf(list, key) {
|
function IndexOf(list, key) {
|
||||||
for (var i = 0; i < list.Items.Count; ++i)
|
for (var i = 0; i < list.length; ++i)
|
||||||
if (list.Items.Item[i].Caption == key)
|
if (list.Item[i].Caption == key)
|
||||||
return i;
|
return i;
|
||||||
var item = list.Items.Add;
|
var item = list.Add;
|
||||||
item.Caption = key;
|
item.Caption = key;
|
||||||
item.MakeVisible(false);
|
item.MakeVisible(false);
|
||||||
list.Width = list.Width - 1; // trigger an autosize
|
list.Width = list.Width - 1; // trigger an autosize
|
||||||
@@ -386,12 +387,12 @@ function TMainForm_Put(list, key, value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function TMainForm_Put(list, pos, value) {
|
function TMainForm_Put(list, pos, value) {
|
||||||
var item = list.Items.Item[pos];
|
var item = list.Item[pos];
|
||||||
if (item.SubItems.Count < 1)
|
if (item.SubItems.length < 1)
|
||||||
item.SubItems.Add(value);
|
item.SubItems.Add(value);
|
||||||
else
|
else
|
||||||
item.SubItems[0] = value;
|
item.SubItems[0] = value;
|
||||||
list.Items[pos].Selected = true;
|
list[pos].Selected = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function LevelUpTime(level) { // seconds
|
function LevelUpTime(level) { // seconds
|
||||||
@@ -405,7 +406,7 @@ function TMainForm_GoButtonClick() {
|
|||||||
|
|
||||||
fTask.Caption = '';
|
fTask.Caption = '';
|
||||||
fQuest.Caption = '';
|
fQuest.Caption = '';
|
||||||
fQueue.Items.Clear();
|
fQueue.Clear();
|
||||||
|
|
||||||
Task('Loading.',2000); // that dot is spotted for later...
|
Task('Loading.',2000); // that dot is spotted for later...
|
||||||
Q('task|10|Experiencing an enigmatic and foreboding night vision');
|
Q('task|10|Experiencing an enigmatic and foreboding night vision');
|
||||||
@@ -415,7 +416,7 @@ function TMainForm_GoButtonClick() {
|
|||||||
Q('task|2|Loading');
|
Q('task|2|Loading');
|
||||||
|
|
||||||
PlotBar.Max = 26;
|
PlotBar.Max = 26;
|
||||||
var item = Plots.Items.Add();
|
var item = Plots.Add();
|
||||||
item.Caption = 'Prologue';
|
item.Caption = 'Prologue';
|
||||||
item.StateIndex = 0;
|
item.StateIndex = 0;
|
||||||
|
|
||||||
@@ -426,7 +427,7 @@ function TMainForm_GoButtonClick() {
|
|||||||
|
|
||||||
function TMainForm_WinSpell() {
|
function TMainForm_WinSpell() {
|
||||||
AddR(Spells, K.Spells.Lines[RandomLow(Min(GetI(Stats,'WIS')+GetI(Traits,'Level'),
|
AddR(Spells, K.Spells.Lines[RandomLow(Min(GetI(Stats,'WIS')+GetI(Traits,'Level'),
|
||||||
K.Spells.Lines.Count))], 1);
|
K.Spells.Lines.length))], 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function LPick(list, goal) {
|
function LPick(list, goal) {
|
||||||
@@ -442,7 +443,7 @@ function LPick(list, goal) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function TMainForm_WinEquip() {
|
function TMainForm_WinEquip() {
|
||||||
var posn = Random(Equips.Items.Count);
|
var posn = Random(Equips.length);
|
||||||
Equips.Tag = posn; // remember as the "best item"
|
Equips.Tag = posn; // remember as the "best item"
|
||||||
if (posn == 0) {
|
if (posn == 0) {
|
||||||
stuff = K.Weapons.Lines;
|
stuff = K.Weapons.Lines;
|
||||||
@@ -484,7 +485,7 @@ function Square(x) { return x * x; }
|
|||||||
function TMainForm_WinStat() {
|
function TMainForm_WinStat() {
|
||||||
var i;
|
var i;
|
||||||
if (Odds(1,2)) {
|
if (Odds(1,2)) {
|
||||||
i = Random(Stats.Items.Count)
|
i = Random(Stats.length)
|
||||||
} else {
|
} else {
|
||||||
// Favor the best stat so it will tend to clump
|
// Favor the best stat so it will tend to clump
|
||||||
var t = 0;
|
var t = 0;
|
||||||
@@ -496,7 +497,7 @@ function TMainForm_WinStat() {
|
|||||||
t -= Square(GetI(Stats,i));
|
t -= Square(GetI(Stats,i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Add(Stats, Stats.Items[index].Caption, 1);
|
Add(Stats, Stats[index].Caption, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function TMainForm_SpecialItem() {
|
function TMainForm_SpecialItem() {
|
||||||
@@ -519,20 +520,20 @@ function TMainForm_CompleteQuest() {
|
|||||||
var lev = 0; // Quell stupid compiler warning
|
var lev = 0; // Quell stupid compiler warning
|
||||||
QuestBar.Position = 0;
|
QuestBar.Position = 0;
|
||||||
QuestBar.Max = 50 + Random(100);
|
QuestBar.Max = 50 + Random(100);
|
||||||
if (Quests.Items.Count > 0) {
|
if (Quests.length > 0) {
|
||||||
/*$IFDEF LOGGING*/
|
/*$IFDEF LOGGING*/
|
||||||
Log('Quest completed: ' + Quests.Items[Quests.Items.Count-1].Caption);
|
Log('Quest completed: ' + Quests[Quests.length-1].Caption);
|
||||||
/*$ENDIF*/
|
/*$ENDIF*/
|
||||||
Quests.Items[Quests.Items.Count-1].StateIndex = 1;
|
Quests[Quests.length-1].StateIndex = 1;
|
||||||
[WinSpell,WinEquip,WinStat,WinItem][Random(4)]();
|
[WinSpell,WinEquip,WinStat,WinItem][Random(4)]();
|
||||||
while (Quest.Items.Count > 99) Quest.Items.Delete(0);
|
while (Quest.length > 99) Quest.Delete(0);
|
||||||
|
|
||||||
var item = Quest.Items.Add;
|
var item = Quest.Add;
|
||||||
switch (Random(5)) {
|
switch (Random(5)) {
|
||||||
case 0:
|
case 0:
|
||||||
var level = GetI(Traits,'Level');
|
var level = GetI(Traits,'Level');
|
||||||
for (var i = 1; i <= 4; ++i) {
|
for (var i = 1; i <= 4; ++i) {
|
||||||
var montag = Random(K.Monsters.Lines.Count);
|
var montag = Random(K.Monsters.Lines.length);
|
||||||
var m = K.Monsters.Lines[montag];
|
var m = K.Monsters.Lines[montag];
|
||||||
var l = StrToInt(Split(m,1));
|
var l = StrToInt(Split(m,1));
|
||||||
if (i == 1 || abs(l - level) < abs(lev - level)) {
|
if (i == 1 || abs(l - level) < abs(lev - level)) {
|
||||||
@@ -561,7 +562,7 @@ function TMainForm_CompleteQuest() {
|
|||||||
case 4:
|
case 4:
|
||||||
level = GetI(Traits,'Level');
|
level = GetI(Traits,'Level');
|
||||||
for (var i = 1; i <= 2; ++i) {
|
for (var i = 1; i <= 2; ++i) {
|
||||||
montag = Random(K.Monsters.Lines.Count);
|
montag = Random(K.Monsters.Lines.length);
|
||||||
m = K.Monsters.Lines[montag];
|
m = K.Monsters.Lines[montag];
|
||||||
l = StrToInt(Split(m,1));
|
l = StrToInt(Split(m,1));
|
||||||
if ((i == 1) || (abs(l - level) < abs(lev - level))) {
|
if ((i == 1) || (abs(l - level) < abs(lev - level))) {
|
||||||
@@ -641,11 +642,11 @@ String.prototype.toArabic = function() {
|
|||||||
|
|
||||||
function TMainForm_CompleteAct() {
|
function TMainForm_CompleteAct() {
|
||||||
PlotBar.Position = 0;
|
PlotBar.Position = 0;
|
||||||
Plots.Items[Plots.Items.Count-1].StateIndex = 1;
|
Plots[Plots.length-1].StateIndex = 1;
|
||||||
PlotBar.Max = 60 * 60 * (1 + 5 * Plots.Items.Count); // 1 hr + 5/act
|
PlotBar.Max = 60 * 60 * (1 + 5 * Plots.length); // 1 hr + 5/act
|
||||||
PlotBar.Hint = 'Cutscene omitted';
|
PlotBar.Hint = 'Cutscene omitted';
|
||||||
var item = Plots.Items.Add;
|
var item = Plots.Add;
|
||||||
item.Caption = 'Act ' + (PlotsItems.Count-1).toRoman();
|
item.Caption = 'Act ' + (PlotsItems.length-1).toRoman();
|
||||||
item.MakeVisible(false);
|
item.MakeVisible(false);
|
||||||
item.StateIndex = 0;
|
item.StateIndex = 0;
|
||||||
item.Width = item.Width-1;
|
item.Width = item.Width-1;
|
||||||
@@ -692,10 +693,10 @@ function TMainForm_CharSheet() {
|
|||||||
WrLn(Format('Level %d (exp. %d/%d)', [GetI(Traits,'Level'), ExpBar.Position, ExpBar.Max]));
|
WrLn(Format('Level %d (exp. %d/%d)', [GetI(Traits,'Level'), ExpBar.Position, ExpBar.Max]));
|
||||||
//WrLn('Level ' + Get(Traits,'Level') + ' (' + ExpBar.Hint + ')');
|
//WrLn('Level ' + Get(Traits,'Level') + ' (' + ExpBar.Hint + ')');
|
||||||
WrLn;
|
WrLn;
|
||||||
if (Plots.Items.Count > 0)
|
if (Plots.length > 0)
|
||||||
WrLn('Plot stage: ' + Plots.Items[Plots.Items.Count-1].Caption + ' (' + PlotBar.Hint + ')');
|
WrLn('Plot stage: ' + Plots[Plots.length-1].Caption + ' (' + PlotBar.Hint + ')');
|
||||||
if (Quests.Items.Count > 0)
|
if (Quests.length > 0)
|
||||||
WrLn('Quest: ' + Quests.Items[Quests.Items.Count-1].Caption + ' (' + QuestBar.Hint + ')');
|
WrLn('Quest: ' + Quests[Quests.length-1].Caption + ' (' + QuestBar.Hint + ')');
|
||||||
WrLn();
|
WrLn();
|
||||||
WrLn( 'Stats:');
|
WrLn( 'Stats:');
|
||||||
WrLn( Format(' STR%7d', [GetI(Stats,'STR')]));
|
WrLn( Format(' STR%7d', [GetI(Stats,'STR')]));
|
||||||
@@ -706,19 +707,19 @@ function TMainForm_CharSheet() {
|
|||||||
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 (var i = 1; i <= Equips.Items.Count-1; ++i)
|
for (var i = 1; i <= Equips.length-1; ++i)
|
||||||
if (Get(Equips,i) != '')
|
if (Get(Equips,i) != '')
|
||||||
WrLn( ' ' + LeftStr(Equips.Items[i].Caption + ' ', 12) + Get(Equips,i));
|
WrLn( ' ' + LeftStr(Equips[i].Caption + ' ', 12) + Get(Equips,i));
|
||||||
WrLn();
|
WrLn();
|
||||||
WrLn( 'Spell Book:');
|
WrLn( 'Spell Book:');
|
||||||
for (var i = 1; i <= Items.Count-1; ++i)
|
for (var i = 1; i <= Items.length-1; ++i)
|
||||||
WrLn( ' ' + Spells.Items[i].Caption + ' ' + Get(Spells,i));
|
WrLn( ' ' + Spells[i].Caption + ' ' + Get(Spells,i));
|
||||||
WrLn();
|
WrLn();
|
||||||
WrLn( 'Inventory (' + EncumBar.Hint + '):');
|
WrLn( 'Inventory (' + EncumBar.Hint + '):');
|
||||||
WrLn( ' ' + Indefinite('gold piece', GetI(Inventory, 'Gold')));
|
WrLn( ' ' + Indefinite('gold piece', GetI(Inventory, 'Gold')));
|
||||||
for (var i = 2; i <= Items.Count-1; ++i) {
|
for (var i = 2; i <= Items.length-1; ++i) {
|
||||||
if (Pos(' of ', Inventory.Items[i].Caption) > 0)
|
if (Pos(' of ', Inventory[i].Caption) > 0)
|
||||||
WrLn( ' ' + Definite(Inventory.Items[i].Caption, GetI(Inventory,i)));
|
WrLn( ' ' + Definite(Inventory[i].Caption, GetI(Inventory,i)));
|
||||||
else
|
else
|
||||||
WrLn( ' ' + Indefinite(Items[i].Caption, GetI(Inventory,i)));
|
WrLn( ' ' + Indefinite(Items[i].Caption, GetI(Inventory,i)));
|
||||||
}
|
}
|
||||||
@@ -762,8 +763,8 @@ function TMainForm_Get(list, key) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function TMainForm_Get(list, index) {
|
function TMainForm_Get(list, index) {
|
||||||
var item = list.Items.Item[index];
|
var item = list.Item[index];
|
||||||
return (item.SubItems.Count < 1) ? '' : item.SubItems[0];
|
return (item.SubItems.length < 1) ? '' : item.SubItems[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
function TMainForm_GetI(list, key) {
|
function TMainForm_GetI(list, key) {
|
||||||
@@ -776,14 +777,14 @@ function TMainForm_GetI(list, index) {
|
|||||||
|
|
||||||
function TMainForm_Sum(list) {
|
function TMainForm_Sum(list) {
|
||||||
var result = 0;
|
var result = 0;
|
||||||
for (var i = 0; i <= list.Items.Count - 1; ++i)
|
for (var i = 0; i <= list.length - 1; ++i)
|
||||||
Result += GetI(list,i);
|
Result += GetI(list,i);
|
||||||
}
|
}
|
||||||
|
|
||||||
function PutLast(list, value) {
|
function PutLast(list, value) {
|
||||||
if (list.Items.Count > 0) {
|
if (list.length > 0) {
|
||||||
with (list.Items.Item[list.Items.Count-1]) {
|
with (list.Item[list.length-1]) {
|
||||||
if (SubItems.Count < 1)
|
if (SubItems.length < 1)
|
||||||
SubItems.Add(value);
|
SubItems.Add(value);
|
||||||
else
|
else
|
||||||
SubItems[0] = value;
|
SubItems[0] = value;
|
||||||
@@ -845,10 +846,10 @@ function TMainForm_Timer1Timer() {
|
|||||||
with (ExpBar) Hint = IntToStr(Max-Position) + ' XP needed for next level';
|
with (ExpBar) Hint = IntToStr(Max-Position) + ' XP needed for next level';
|
||||||
|
|
||||||
// advance quest
|
// advance quest
|
||||||
if (gain) if (Plots.Items.Count > 1) with (QuestBar) {
|
if (gain) if (Plots.length > 1) with (QuestBar) {
|
||||||
if (Position >= Max) {
|
if (Position >= Max) {
|
||||||
CompleteQuest;
|
CompleteQuest;
|
||||||
} else if (Quests.Items.Count > 0) {
|
} else if (Quests.length > 0) {
|
||||||
Position = Position + TaskBar.Max.div(1000);
|
Position = Position + TaskBar.Max.div(1000);
|
||||||
Hint = IntToStr(100 * Position.div(Max)) + '% complete';
|
Hint = IntToStr(100 * Position.div(Max)) + '% complete';
|
||||||
}
|
}
|
||||||
@@ -917,8 +918,8 @@ function TMainForm_RollCharacter() {
|
|||||||
|
|
||||||
with (NewGuyForm) {
|
with (NewGuyForm) {
|
||||||
Put(Traits,'Name',Name.Text);
|
Put(Traits,'Name',Name.Text);
|
||||||
Put(Traits,'Race',Race.Items[Race.ItemIndex]);
|
Put(Traits,'Race',Race[Race.ItemIndex]);
|
||||||
Put(Traits,'Class',Klass.Items[Klass.ItemIndex]);
|
Put(Traits,'Class',Klass[Klass.ItemIndex]);
|
||||||
Put(Traits,'Level',1);
|
Put(Traits,'Level',1);
|
||||||
Put(Stats,'STR',STR.Tag);
|
Put(Stats,'STR',STR.Tag);
|
||||||
Put(Stats,'CON',CON.Tag);
|
Put(Stats,'CON',CON.Tag);
|
||||||
@@ -1068,9 +1069,9 @@ function TMainForm_LoadGame(name) {
|
|||||||
FSaveFileName = name;
|
FSaveFileName = name;
|
||||||
var m = TMemoryStream.Create;
|
var m = TMemoryStream.Create;
|
||||||
var f = TFileStream.Create(name, fmOpenRead);
|
var f = TFileStream.Create(name, fmOpenRead);
|
||||||
Traits.Items.Clear();
|
Traits.Clear();
|
||||||
Stats.Items.Clear();
|
Stats.Clear();
|
||||||
Equips.Items.Clear();
|
Equips.Clear();
|
||||||
m.Seek(0, soFromBeginning);
|
m.Seek(0, soFromBeginning);
|
||||||
for (i = 0; i <= ComponentCount-1; ++i)
|
for (i = 0; i <= ComponentCount-1; ++i)
|
||||||
m.ReadComponent(Components[i]);
|
m.ReadComponent(Components[i]);
|
||||||
@@ -1159,14 +1160,14 @@ function TMainForm_Brag(trigger) {
|
|||||||
ExportCharSheet;
|
ExportCharSheet;
|
||||||
if (GetPasskey = 0) return; // not a online game!
|
if (GetPasskey = 0) return; // not a online game!
|
||||||
var url = 'cmd=b&t=' + trigger;
|
var url = 'cmd=b&t=' + trigger;
|
||||||
with (Traits) for (i = 0; i <= Items.Count-1; ++i)
|
with (Traits) for (i = 0; i <= Items.length-1; ++i)
|
||||||
url = url + '&' + LowerCase(Items[i].Caption[1]) + '=' + UrlEncode(Items[i].Subitems[0]);
|
url = url + '&' + LowerCase(Items[i].Caption[1]) + '=' + UrlEncode(Items[i].Subitems[0]);
|
||||||
url = url + '&x=' + IntToStr(ExpBar.Position);
|
url = url + '&x=' + IntToStr(ExpBar.Position);
|
||||||
url = url + '&i=' + UrlEncode(Get(Equips,Equips.Tag));
|
url = url + '&i=' + UrlEncode(Get(Equips,Equips.Tag));
|
||||||
if (Equips.Tag > 1) url = url + '+' + Equips.Items[Equips.Tag].Caption;
|
if (Equips.Tag > 1) url = url + '+' + Equips[Equips.Tag].Caption;
|
||||||
var best = 0;
|
var best = 0;
|
||||||
if (Spells.Items.Count > 0) with (Spells) {
|
if (Spells.length > 0) with (Spells) {
|
||||||
for (i = 1; i <= Items.Count-1; ++i)
|
for (i = 1; i <= Items.length-1; ++i)
|
||||||
if ((i+flat) * RomanToInt(Get(Spells,i)) >
|
if ((i+flat) * RomanToInt(Get(Spells,i)) >
|
||||||
(best+flat) * RomanToInt(Get(Spells,best)))
|
(best+flat) * RomanToInt(Get(Spells,best)))
|
||||||
best = i;
|
best = i;
|
||||||
@@ -1175,8 +1176,8 @@ function TMainForm_Brag(trigger) {
|
|||||||
best = 0;
|
best = 0;
|
||||||
for (var i = 1; i <= 5; ++i)
|
for (var i = 1; i <= 5; ++i)
|
||||||
if (GetI(Stats,i) > GetI(Stats,best)) best = i;
|
if (GetI(Stats,i) > GetI(Stats,best)) best = i;
|
||||||
url = url + '&k=' + Stats.Items[best].Caption + '+' + Get(Stats,best);
|
url = url + '&k=' + Stats[best].Caption + '+' + Get(Stats,best);
|
||||||
url = url + '&a=' + UrlEncode(Plots.Items[Plots.Items.Count-1].Caption);
|
url = url + '&a=' + UrlEncode(Plots[Plots.length-1].Caption);
|
||||||
url = url + '&h=' + UrlEncode(GetHostName);
|
url = url + '&h=' + UrlEncode(GetHostName);
|
||||||
url = url + RevString;
|
url = url + RevString;
|
||||||
url = url + '&p=' + IntToStr(LFSR(url, GetPasskey));
|
url = url + '&p=' + IntToStr(LFSR(url, GetPasskey));
|
||||||
@@ -1201,7 +1202,7 @@ function TMainForm_AuthenticateUrl(url) {
|
|||||||
function TMainForm_Guildify() {
|
function TMainForm_Guildify() {
|
||||||
if (GetPasskey = 0) return; // not a online game!
|
if (GetPasskey = 0) return; // not a online game!
|
||||||
var url = 'cmd=guild';
|
var url = 'cmd=guild';
|
||||||
with (Traits) for (i = 0; i <= Items.Count-1; ++i)
|
with (Traits) for (i = 0; i <= Items.length-1; ++i)
|
||||||
url = url + '&' + LowerCase(Items[i].Caption[1]) + '=' + UrlEncode(Items[i].Subitems[0]);
|
url = url + '&' + LowerCase(Items[i].Caption[1]) + '=' + UrlEncode(Items[i].Subitems[0]);
|
||||||
url = url + '&h=' + UrlEncode(GetHostName);
|
url = url + '&h=' + UrlEncode(GetHostName);
|
||||||
url = url + RevString;
|
url = url + RevString;
|
||||||
|
|||||||
Reference in New Issue
Block a user