We're running through the Prologue!

This commit is contained in:
Eric Fredricksen
2010-06-24 21:45:02 -07:00
parent 9063f34071
commit 665148d2ba
2 changed files with 233 additions and 165 deletions
+204 -138
View File
@@ -9,24 +9,22 @@
// 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 game = {}; // queue: [] };
var timestart;
function timeGetTime() { function timeGetTime() {
return Date.getTime(); return new Date().getTime();
} }
function StartTimer() { function StartTimer() {
if (!timerid) { if (!game.timerid) {
timestart = timeGetTime(); game.lasttick = timeGetTime();
timerid = setInterval(Timer1Timer, 100); game.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), '');
} }
var game = { queue: [] };
function GetPasskey() { return game.passkey; } function GetPasskey() { return game.passkey; }
function SetPasskey(v) { game.passkey = v; } function SetPasskey(v) { game.passkey = v; }
@@ -54,7 +52,7 @@ function Q(s) {
} }
function TaskDone() { function TaskDone() {
return $("#TaskBar").attr("Position") >= $("#TaskBar").attr("Max"); return TaskBar.done();
} }
function Odds(chance, outof) { function Odds(chance, outof) {
@@ -77,6 +75,10 @@ function PickLow(s) {
return s[RandomLow(s.length)]; return s[RandomLow(s.length)];
} }
function Copy(s, b, l) {
return s.substr(b, l);
}
function Ends(s, e) { function Ends(s, e) {
return Copy(s,1+Length(s)-Length(e),Length(e)) = e; return Copy(s,1+Length(s)-Length(e),Length(e)) = e;
} }
@@ -96,19 +98,7 @@ function Plural(s) {
} }
function Split(s, field, separator) { function Split(s, field, separator) {
while (field > 0) { return s.split(separator || "|")[field];
var p = Pos(separator, s);
s = Copy(s, p+1, 10000);
--field;
}
if (Pos(separator, s) > 0)
return Copy(s, 1, Pos(separator,s) - 1)
else
return s;
}
function Split(s, field) {
return Split(s, field, '|');
} }
function Indefinite(s, qty) { function Indefinite(s, qty) {
@@ -135,15 +125,19 @@ function prefix(a, m, s, sep) {
} }
function Sick(m, s) { function Sick(m, s) {
return prefix(['dead', 'comatose', 'crippled', 'sick', 'undernourished'], m, s); m = 6 - abs(m);
return prefix(['dead','comatose','crippled','sick','undernourished'], m, s);
} }
function Young(m, s) { function Young(m, s) {
return prefix(['foetal', 'baby', 'preadolescent', 'teenage', 'underage'], m, s); m = 6 - abs(m);
return prefix(['foetal','baby','preadolescent','teenage','underage'], m, s);
} }
function Big(m, s) { function Big(m, s) {
return prefix(['greater', 'massive', 'enormous', 'giant', 'titanic'], m, s); return prefix(['greater','massive','enormous','giant','titanic'], m, s);
} }
function Special(m, s) { function Special(m, s) {
@@ -153,13 +147,13 @@ function Special(m, s) {
return prefix(['Battle-','cursed ','Were-','undead ','demon '], m, s, ''); return prefix(['Battle-','cursed ','Were-','undead ','demon '], m, s, '');
} }
function TMainForm_InterplotCinematic() { function InterplotCinematic() {
switch (Random(3)) { switch (Random(3)) {
case 0: case 0:
Q('task|1|Exhausted, you arrive at a fri}ly oasis in a hostile land'); Q('task|1|Exhausted, you arrive at a friendly oasis in a hostile land');
Q('task|2|You greet old fri}s and meet new allies'); Q('task|2|You greet old friends and meet new allies');
Q('task|2|You are privy to a council) { powerful)-gooders'); Q('task|2|You are privy to a council of powerful do-gooders');
Q('task|1|There is much to be)ne. You are chosen!'); Q('task|1|There is much to be done. You are chosen!');
break; break;
case 1: case 1:
Q('task|1|Your quarry is in sight, but a mighty enemy bars your path!'); Q('task|1|Your quarry is in sight, but a mighty enemy bars your path!');
@@ -175,7 +169,7 @@ function TMainForm_InterplotCinematic() {
} }
} }
Q('task|3|Victory! ' + nemesis + ' is slain! Exhausted, you lose conciousness'); Q('task|3|Victory! ' + nemesis + ' is slain! Exhausted, you lose conciousness');
Q('task|2|You awake in a fri}ly place, but the road awaits'); Q('task|2|You awake in a friendly place, but the road awaits');
break; break;
case 2: case 2:
var nemesis = ImpressiveGuy; var nemesis = ImpressiveGuy;
@@ -191,8 +185,12 @@ function TMainForm_InterplotCinematic() {
} }
function StrToInt(s) {
return s.valueOf();
}
function TMainForm_NamedMonster(level) { function TMainForm_NamedMonster(level) {
var lev = 0; // shut up, compiler hint var lev = 0;
var result = ''; var result = '';
for (var i = 1; i <= 5; ++i) { for (var i = 1; i <= 5; ++i) {
var m = Pick(K.Monsters.Lines); var m = Pick(K.Monsters.Lines);
@@ -229,7 +227,7 @@ function TMainForm_MonsterTask(level) {
} }
var lev = level; var lev = level;
monster = monster + '|' + IntToStr(level) + '|*'; monster = monster + '|' + IntToStr(level) + '|*';
} else if ((fQuest.Caption != '') && Odds(1,4)) { } else if ((game.questmonster != '') && Odds(1,4)) {
// Use the quest monster // Use the quest monster
var monster = k.Monsters.Lines[fQuest.Tag]; var monster = k.Monsters.Lines[fQuest.Tag];
var lev = StrToInt(Split(monster,1)); var lev = StrToInt(Split(monster,1));
@@ -246,9 +244,9 @@ function TMainForm_MonsterTask(level) {
} }
} }
fTask.Caption = monster; game.task = monster;
var result = Split(monster,0); var result = Split(monster,0);
fTask.Caption = 'kill|' + fTask.Caption; game.task = 'kill|' + game.task;
var qty = 1; var qty = 1;
if ((level-lev) > 10) { if ((level-lev) > 10) {
@@ -297,20 +295,20 @@ function TMainForm_EquipPrice() {
+ 20; + 20;
} }
function TMainForm_Dequeue() { function Dequeue() {
while (TaskDone) { while (TaskDone()) {
if (Split(fTask.Caption,0) == 'kill') { if (Split(game.task,0) == 'kill') {
if (Split(fTask.Caption,3) == '*') { if (Split(game.task,3) == '*') {
WinItem; WinItem();
} else if (Split(fTask.Caption,3) != '') { } else if (Split(game.task,3) != '') {
Add(Inventory,LowerCase(Split(fTask.Caption,1) + ' ' + ProperCase(Split(fTask.Caption,3))),1); Add(Inventory,LowerCase(Split(game.task,1) + ' ' + ProperCase(Split(game.task,3))),1);
} }
} else if (fTask.Caption == 'buying') { } else if (game.task == 'buying') {
// buy some equipment // buy some equipment
Add(Inventory,'Gold',-EquipPrice); Add(Inventory,'Gold',-EquipPrice);
WinEquip; WinEquip();
} else if ((fTask.Caption == 'market') || (fTask.Caption = 'sell')) { } else if ((game.task == 'market') || (game.task == 'sell')) {
if (fTask.Caption = 'sell') { if (game.task = '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[1].Caption) > 0) if (Pos(' of ', Inventory[1].Caption) > 0)
@@ -321,41 +319,43 @@ function TMainForm_Dequeue() {
} }
if (Items.length > 1) { if (Items.length > 1) {
Task('Selling ' + Indefinite(Inventory[1].Caption, GetI(Inventory,1)), 1 * 1000); Task('Selling ' + Indefinite(Inventory[1].Caption, GetI(Inventory,1)), 1 * 1000);
fTask.Caption = 'sell'; game.task = 'sell';
break; break;
} }
} }
var old = fTask.Caption;
fTask.Caption = ''; var old = game.task;
if (fQueue.length > 0) { game.task = '';
var a = Split(fQueue[0],0); if (game.queue.length > 0) {
var n = StrToInt(Split(fQueue[0],1)); var a = Split(game.queue[0],0);
var s = Split(fQueue[0],2); var n = StrToInt(Split(game.queue[0],1));
var s = Split(game.queue[0],2);
if (a == 'task' || a == 'plot') { if (a == 'task' || a == 'plot') {
if (a == 'plot') { if (a == 'plot') {
CompleteAct; CompleteAct();
s = 'Loading ' + Plots[Plots.length-1].Caption; s = 'Loading ' + Plots[Plots.length-1].Caption;
} }
Task(s, n * 1000); Task(s, n * 1000);
fQueue.Delete(0); game.queue.shift();
} else { } else {
throw 'bah!'; throw 'bah!' + a;
} }
} else if (Encumbar.Position >= Encumbar.Max) { } else if (EncumBar.done()) {
Task('Heading to market to sell loot',4 * 1000); Task('Heading to market to sell loot',4 * 1000);
fTask.Caption = 'market'; game.task = 'market';
} else if ((Pos('kill|',old) <= 0) && (old != 'heading')) { } else if ((Pos('kill|',old) <= 0) && (old != 'heading')) {
if (GetI(Inventory, 'Gold') > EquipPrice) { if (GetI(Inventory, 'Gold') > EquipPrice()) {
Task('Negotiating purchase of better equipment', 5 * 1000); Task('Negotiating purchase of better equipment', 5 * 1000);
fTask.Caption = 'buying'; game.task = 'buying';
} else { } else {
Task('Heading to the killing fields', 4 * 1000); Task('Heading to the killing fields', 4 * 1000);
fTask.Caption = 'heading'; game.task = 'heading';
} }
} else { } else {
var n = GetI(Traits,'Level'); var n = GetI(Traits, 'Level');
var t = MonsterTask(n); var t = MonsterTask(n);
var n = Math.floor((2 * InventoryLabelAlsoGameStyle.Tag * t.level * 1000) / n); var InventoryLabelAlsoGameStyleTag = 3;
var n = Math.floor((2 * InventoryLabelAlsoGameStyleTag * t.level * 1000) / n);
Task('Executing ' + t.description, n); Task('Executing ' + t.description, n);
} }
} }
@@ -400,13 +400,71 @@ function LevelUpTime(level) { // seconds
return 20 * level * 60; return 20 * level * 60;
} }
function TMainForm_GoButtonClick() {
ExpBar.Position = 0;
ExpBar.Max = LevelUpTime(1);
fTask.Caption = ''; function ProgressBar(id) {
fQuest.Caption = ''; this.bar = $("#"+ id + " > .bar");
fQueue.Clear();
this.reset = function (newmax) {
this.Max = newmax;
this.reposition(0);
}
this.reposition = function (newpos) {
this.Position = newpos;
this.bar.css("width", 100 * this.Position / this.Max + "%")
}
this.increment = function (inc) {
this.reposition(this.Position + inc);
}
this.done = function () {
return this.Position >= this.Max;
}
};
function ListBox(id) {
this.box = $("#"+ id);
this.Add = function (caption) {
var tr = this.box.append("<tr><td>" + caption + "</td></tr>");
return tr;
}
this.ClearSelection = function () {
// TODO
}
};
var ExpBar, PlotBar, TaskBar, QuestBar;
var Traits,Stats,Spells,Equips,Inventory,Plots,Quests;
var Kill;
function GoButtonClick() {
ExpBar = new ProgressBar("ExpBar");
PlotBar = new ProgressBar("PlotBar");
TaskBar = new ProgressBar("TaskBar");
QuestBar = new ProgressBar("QuestBar");
Traits = new ListBox("Traits");
Stats = new ListBox("Stats");
Spells = new ListBox("Spells");
Equips = new ListBox("Equips");
Inventory = new ListBox("Inventory");
Plots = new ListBox("Plots");
Quests = new ListBox("Quests");
Kill = $("#Kill");
ExpBar.reset(LevelUpTime(1));
game.task = '';
game.questmonster = '';
game.queue = [];
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,16 +473,18 @@ function TMainForm_GoButtonClick() {
Q('task|4|Drawing upon an unexpected reserve of determination, you set out on a long and dangerous journey'); Q('task|4|Drawing upon an unexpected reserve of determination, you set out on a long and dangerous journey');
Q('task|2|Loading'); Q('task|2|Loading');
PlotBar.Max = 26; PlotBar.reset(26);
var item = Plots.Add(); Plots.Add('Prologue');
item.Caption = 'Prologue';
item.StateIndex = 0;
StartTimer(); StartTimer();
SaveGame(); SaveGame();
Brag('s'); Brag('s');
} }
$(document).ready(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.length))], 1); K.Spells.Lines.length))], 1);
@@ -473,7 +533,7 @@ function TMainForm_WinEquip() {
plus -= qual; plus -= qual;
++count; ++count;
} }
if (plus != 0) name = IntToStr(plus) + ' ' + name; if (plus != 0) name = plus + ' ' + name;
if (plus > 0) name = '+' + name; if (plus > 0) name = '+' + name;
Put(Equips, posn, name); Put(Equips, posn, name);
@@ -538,26 +598,26 @@ function TMainForm_CompleteQuest() {
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)) {
var lev = l; var lev = l;
fQuest.Caption = m; game.questmonster = m;
fQuest.Tag = montag; fQuest.Tag = montag;
} }
} }
item.Caption = 'Exterminate ' + Definite(Split(fQuest.Caption,0),2); item.Caption = 'Exterminate ' + Definite(Split(game.questmonster,0),2);
break; break;
case 1: case 1:
fQuest.Caption = InterestingItem; game.questmonster = InterestingItem;
Caption = 'Seek ' + Definite(fQuest.Caption,1); Caption = 'Seek ' + Definite(game.questmonster,1);
fQuest.Caption = ''; game.questmonster = '';
break; break;
case 2: case 2:
fQuest.Caption = BoringItem; game.questmonster = BoringItem;
Caption = 'Deliver this ' + fQuest.Caption; Caption = 'Deliver this ' + game.questmonster;
fQuest.Caption = ''; game.questmonster = '';
break; break;
case 3: case 3:
fQuest.Caption = BoringItem; game.questmonster = BoringItem;
Caption = 'Fetch me ' + Indefinite(fQuest.Caption,1); Caption = 'Fetch me ' + Indefinite(game.questmonster,1);
fQuest.Caption = ''; game.questmonster = '';
break; break;
case 4: case 4:
level = GetI(Traits,'Level'); level = GetI(Traits,'Level');
@@ -567,11 +627,11 @@ function TMainForm_CompleteQuest() {
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))) {
lev = l; lev = l;
fQuest.Caption = m; game.questmonster = m;
} }
} }
Caption = 'Placate ' + Definite(Split(fQuest.Caption,0),2); Caption = 'Placate ' + Definite(Split(game.questmonster,0),2);
fQuest.Caption = ''; game.questmonster = '';
break; break;
} }
/*$IFDEF LOGGING*/ /*$IFDEF LOGGING*/
@@ -659,7 +719,8 @@ function TMainForm_CompleteAct() {
/*$IFDEF LOGGING*/ /*$IFDEF LOGGING*/
function TMainForm_Log(line) { function Log(line) {
/* TODO
if (FLogEvents) { if (FLogEvents) {
var logname = ChangeFileExt(GameSaveName, '.log'); var logname = ChangeFileExt(GameSaveName, '.log');
DateTimeToString(stamp, '[yyyy-mm-dd hh:nn:ss]', Now); DateTimeToString(stamp, '[yyyy-mm-dd hh:nn:ss]', Now);
@@ -669,6 +730,7 @@ function TMainForm_Log(line) {
Flush(log); Flush(log);
CloseFile(log); CloseFile(log);
} }
*/
} }
/*$ENDIF*/ /*$ENDIF*/
@@ -729,13 +791,13 @@ function TMainForm_CharSheet() {
return f; return f;
} }
function TMainForm_Task(caption, msec) {
Kill.SimpleText = caption + '...'; function Task(caption, msec) {
Kill.text(caption + '...');
/*$IFDEF LOGGING*/ /*$IFDEF LOGGING*/
Log(Kill.SimpleText); Log(Kill.text());
/*$ENDIF*/ /*$ENDIF*/
TaskBar.Position = 0; TaskBar.reset(msec);
TaskBar.Max = msec;
} }
function TMainForm_Add(list, key, value) { function TMainForm_Add(list, key, value) {
@@ -798,7 +860,7 @@ Number.prototype.div = function (divisor) {
return (dividend < 0 ? Math.ceil : Math.floor)(dividend); return (dividend < 0 ? Math.ceil : Math.floor)(dividend);
} }
function TMainForm_LevelUp() { function LevelUp() {
Add(Traits,'Level',1); Add(Traits,'Level',1);
Add(Stats,'HP Max', GetI(Stats,'CON').div(3) + 1 + Random(4)); Add(Stats,'HP Max', GetI(Stats,'CON').div(3) + 1 + Random(4));
Add(Stats,'MP Max', GetI(Stats,'INT').div(3) + 1 + Random(4)); Add(Stats,'MP Max', GetI(Stats,'INT').div(3) + 1 + Random(4));
@@ -813,7 +875,7 @@ function TMainForm_LevelUp() {
Brag('l'); Brag('l');
} }
function TMainForm_ClearAllSelections() { function ClearAllSelections() {
Equips.ClearSelection(); Equips.ClearSelection();
Spells.ClearSelection(); Spells.ClearSelection();
Stats.ClearSelection(); Stats.ClearSelection();
@@ -824,56 +886,60 @@ function TMainForm_ClearAllSelections() {
} }
function RoughTime(s) { function RoughTime(s) {
if (s < 120) return IntToStr(s) + ' seconds' if (s < 120) return s + ' seconds'
else if (s < 60 * 120) return IntToStr(s.div(60)) + ' minutes' else if (s < 60 * 120) return s.div(60) + ' minutes'
else if (s < 60 * 60 * 48) return IntToStr(s.div(3600)) + ' hours' else if (s < 60 * 60 * 48) return s.div(3600) + ' hours'
else return IntToStr(s.div(3600 * 24)) + ' days'; else return s.div(3600 * 24) + ' days';
} }
function TMainForm_Timer1Timer() { function Pos(haystack, needle) {
var gain = Pos('kill|',fTask.Caption) = 1; return haystack.indexOf(needle) + 1;
with (TaskBar) { }
if (Position >= Max) {
function Timer1Timer() {
var gain = Pos('kill|',game.task) == 1;
if (TaskBar.done()) {
ClearAllSelections(); ClearAllSelections();
if (Kill.SimpleText = 'Loading....') Max = 0; if (Kill.text() == 'Loading....') TaskBar.Max = 0;
// gain XP / level up // gain XP / level up
if (gain) with (ExpBar) { if (gain) {
if (Position >= Max) LevelUp(); if (ExpBar.done())
else Position = Position + TaskBar.Max.div(1000); LevelUp();
else
ExpBar.increment(TaskBar.Max / 1000);
} }
with (ExpBar) Hint = IntToStr(Max-Position) + ' XP needed for next level'; ExpBar.Hint = Math.floor(ExpBar.Max-ExpBar.Position) + ' XP needed for next level';
// advance quest // advance quest
if (gain) if (Plots.length > 1) with (QuestBar) { if (gain) {
if (Position >= Max) { if (Plots.length > 1) {
CompleteQuest; if (QuestBar.done()) {
CompleteQuest();
} else if (Quests.length > 0) { } else if (Quests.length > 0) {
Position = Position + TaskBar.Max.div(1000); QuestBar.increment(TaskBar.Max / 1000);
Hint = IntToStr(100 * Position.div(Max)) + '% complete'; QuestBar.Hint = IntToStr(100 * QuestBar.Position.div(QuestBar.Max)) + '% complete';
}
} }
} }
// advance plot // advance plot
if (gain) with (PlotBar) { if (gain) {
if (Position >= Max) InterplotCinematic(); if (PlotBar.done()) InterplotCinematic();
else Position = Position + TaskBar.Max.div(1000); else PlotBar.increment(TaskBar.Max / 1000);
}
//Time.Caption = FormatDateTime('h:mm:ss',PlotBar.Position / (24.0 * 60 * 60));
PlotBar.Hint = RoughTime(PlotBar.Max-PlotBar.Position) + ' remaining'; PlotBar.Hint = RoughTime(PlotBar.Max-PlotBar.Position) + ' remaining';
//PlotBar.Hint = FormatDateTime('h:mm:ss" remaining"',(PlotBar.Max-PlotBar.Position) / (24.0 * 60 * 60)); }
Dequeue(); Dequeue();
} else with (TaskBar) { } else {
var elapsed = LongInt(timeGetTime) - LongInt(Timer1.Tag); var elapsed = timeGetTime() - game.lasttick;
if (elapsed > 100) elapsed = 100; if (elapsed > 100) elapsed = 100;
if (elapsed < 0) elapsed = 0; if (elapsed < 0) elapsed = 0;
Position = Position + elapsed; TaskBar.increment(elapsed);
} }
} game.lasttick = timeGetTime();
Timer1.Tag = timeGetTime;
} }
function TMainForm_FormCreate() { function TMainForm_FormCreate() {
@@ -892,7 +958,7 @@ function TMainForm_FormCreate() {
function TMainForm_SpeedButton1Click() { function TMainForm_SpeedButton1Click() {
/*$IFDEF CHEATS*/ /*$IFDEF CHEATS*/
TaskBar.Position = TaskBar.Max; TaskBar.reposition(TaskBar.Max);
/*$ENDIF*/ /*$ENDIF*/
} }
@@ -931,14 +997,12 @@ function TMainForm_RollCharacter() {
Put(Stats,'MP Max',Random(8) + INT.Tag.div(6)); Put(Stats,'MP Max',Random(8) + INT.Tag.div(6));
Put(Equips,'Weapon','Sharp Stick'); Put(Equips,'Weapon','Sharp Stick');
Put(Inventory,'Gold',0); Put(Inventory,'Gold',0);
InventoryLabelAlsoGameStyle.Tag = 3;//GameStyle.Position;
ClearAllSelections; ClearAllSelections;
GoButtonClick(NewGuyForm); GoButtonClick(NewGuyForm);
} }
} }
const var KUsage =
KUsage =
'Usage: pq [flags] [game.pq3]\n' + 'Usage: pq [flags] [game.pq3]\n' +
'\n' + '\n' +
'Flags:\n' + 'Flags:\n' +
@@ -1026,22 +1090,21 @@ function TMainForm_CashInClick() {
function TMainForm_FinishQuestClick() { function TMainForm_FinishQuestClick() {
/*$IFDEF CHEATS*/ /*$IFDEF CHEATS*/
QuestBar.Position = QuestBar.Max; QuestBar.reposition(QuestBar.Max);
TaskBar.Position = TaskBar.Max; TaskBar.reposition(TaskBar.Max);
/*$ENDIF*/ /*$ENDIF*/
} }
function TMainForm_CheatPlotClick() { function TMainForm_CheatPlotClick() {
/*$IFDEF CHEATS*/ /*$IFDEF CHEATS*/
PlotBar.Position = PlotBar.Max; PlotBar.reposition(PlotBar.Max);
TaskBar.Position = TaskBar.Max; TaskBar.reposition(TaskBar.Max);
/*$ENDIF*/ /*$ENDIF*/
} }
function TMainForm_SaveGame() { function SaveGame() {
/*$IFDEF LOGGING*/ /* TODO
Log('Saving game: ' + GameSaveName); Log('Saving game: ' + GameSaveName());
/*$ENDIF*/
try { try {
if (FMakeBackups) { if (FMakeBackups) {
DeleteFile(ChangeFileExt(GameSaveName, '.bak')); DeleteFile(ChangeFileExt(GameSaveName, '.bak'));
@@ -1063,6 +1126,7 @@ function TMainForm_SaveGame() {
m.Free(); m.Free();
f.Free() f.Free()
return true;; return true;;
*/
} }
function TMainForm_LoadGame(name) { function TMainForm_LoadGame(name) {
@@ -1154,7 +1218,8 @@ function LFSR(pt, salt) {
} }
function TMainForm_Brag(trigger) { function Brag(trigger) {
/* TODO
var flat = 1; var flat = 1;
if (FExportSheets) if (FExportSheets)
ExportCharSheet; ExportCharSheet;
@@ -1190,6 +1255,7 @@ function TMainForm_Brag(trigger) {
} catch (EWebError) { } catch (EWebError) {
// 'ats okay. // 'ats okay.
} }
*/
} }
function TMainForm_AuthenticateUrl(url) { function TMainForm_AuthenticateUrl(url) {
+16 -14
View File
@@ -12,12 +12,14 @@
<span>Progress Quest/web v8.0</span> <span>Progress Quest/web v8.0</span>
</div> </div>
<script src="pq.js"></script> <script src="jquery.js"></script>
<script src="config.js"></script>
<script src="main.js"></script>
<div class="hbox" flex="1"> <div class="hbox" flex="1">
<div class="vbox" flex="5"> <div class="vbox" flex="5">
<span class="label head" >Character Sheet</span> <span class="label head" >Character Sheet</span>
<table class="listbox" rows="4" class="list" id="traits"> <table class="listbox" rows="4" class="list" id="Traits">
<tr> <tr>
<th style="width:30%">Trait</th> <th style="width:30%">Trait</th>
<th style="width:70%" >Value</th> <th style="width:70%" >Value</th>
@@ -41,7 +43,7 @@
</table> </table>
<div class="vbox" flex="4"> <div class="vbox" flex="4">
<table class="listbox" id="stats" rows="8"> <table class="listbox" id="Stats" rows="8">
<tr> <tr>
<th style="width:30%">Stat</th> <th style="width:30%">Stat</th>
<th style="width:70%">Value</th> <th style="width:70%">Value</th>
@@ -61,12 +63,12 @@
<span class="label" >Experience</span> <span class="label" >Experience</span>
<div class="progress-container" id="xpbar"> <div class="progress-container" id="ExpBar">
<div class="bar" style="width: 50%"></div> <div class="bar" style="width: 50%"></div>
</div> </div>
<span class="label head" >Spell Book</span> <span class="label head" >Spell Book</span>
<table class="listbox" id="spells" flex="1"> <table class="listbox" id="Spells" flex="1">
<tr> <tr>
<th >Spell</th> <th >Spell</th>
<th >Level</th> <th >Level</th>
@@ -85,7 +87,7 @@
<div class="vbox" flex="1"> <div class="vbox" flex="1">
<span class="label head" >Equipment</span> <span class="label head" >Equipment</span>
<table class="listbox" id="equips" rows="11"> <table class="listbox" id="Equips" rows="11">
<tr><td >Weapon</td><td >Sharpened Stick</td></tr> <tr><td >Weapon</td><td >Sharpened Stick</td></tr>
<tr><td >Shield</td><td></tr> <tr><td >Shield</td><td></tr>
<tr><td >Helm<td></tr> <tr><td >Helm<td></tr>
@@ -100,7 +102,7 @@
</table> </table>
<span class="label head" >Inventory</span> <span class="label head" >Inventory</span>
<table class="listbox" id="inventory" flex="1"> <table class="listbox" id="Inventory" flex="1">
<tr> <tr>
<th >Item</th> <th >Item</th>
<th >Qty</th> <th >Qty</th>
@@ -119,14 +121,14 @@
<tr><td>&nbsp;<td> <tr><td>&nbsp;<td>
</table> </table>
<span class="label" >Encumbrance</span> <span class="label" >Encumbrance</span>
<div class="progress-container" id="encumbar"> <div class="progress-container" id="EncumBar">
<div class="bar" style="width: 50%"></div> <div class="bar" style="width: 50%"></div>
</div> </div>
</div> </div>
<div class="vbox" flex="4"> <div class="vbox" flex="4">
<span class="label head" >Plot Development</span> <span class="label head" >Plot Development</span>
<table class="listbox" id="plots"> <table class="listbox" id="Plots">
<tr><td>Prologue <tr><td>Prologue
<tr><td>Act 1 <tr><td>Act 1
<tr><td>&nbsp; <tr><td>&nbsp;
@@ -137,12 +139,12 @@
<tr><td>&nbsp; <tr><td>&nbsp;
<tr><td>&nbsp; <tr><td>&nbsp;
</table> </table>
<div class="progress-container" id="plotbar"> <div class="progress-container" id="PlotBar">
<div class="bar" style="width: 50%"></div> <div class="bar" style="width: 50%"></div>
</div> </div>
<span class="label head" >Quests</span> <span class="label head" >Quests</span>
<table class="listbox" id="quests"> <table class="listbox" id="Quests">
<tr> <tr>
<td><input type=checkbox checked="true"> Kill all the Bads <td><input type=checkbox checked="true"> Kill all the Bads
</tr> </tr>
@@ -160,14 +162,14 @@
<tr><td>&nbsp; <tr><td>&nbsp;
<tr><td>&nbsp; <tr><td>&nbsp;
</table> </table>
<div class="progress-container" id="questbar"> <div class="progress-container" id="QuestBar">
<div class="bar" style="width: 50%"></div> <div class="bar" style="width: 50%"></div>
</div> </div>
</div> </div>
</div> </div>
<div id="tasktext" class="label">Executing a Greater Wolog</div> <div id="Kill" class="label">Executing a Greater Wolog</div>
<div class="progress-container" id="taskbar"> <div class="progress-container" id="TaskBar">
<div class="bar" style="width: 50%"></div> <div class="bar" style="width: 50%"></div>
</div> </div>