Merged in fixes (pull request #1)

Lots of fixes for the codebase

Approved-by: Eric Fredricksen
This commit is contained in:
txtsd authored and Eric Fredricksen committed 2022-11-10 19:47:32 +00:00
commit b1fa424302
10 files changed
+572 -576

No files matched your search

+6 -6
View File
@@ -302,7 +302,7 @@ Number.prototype.div = function (divisor) {
function LevelUpTime(level) { // seconds function LevelUpTime(level) { // seconds
// 20 minutes for for level 1 // 20 minutes for level 1
// exponential increase after that // exponential increase after that
return Math.round((20 + Math.pow(1.15, level)) * 60); return Math.round((20 + Math.pow(1.15, level)) * 60);
} }
@@ -342,7 +342,7 @@ K.Spells = [
"Sadness", "Sadness",
"Seasick", "Seasick",
"Shoelaces", "Shoelaces",
"Innoculate", "Inoculate",
"Cone of Annoyance", "Cone of Annoyance",
"Magnetic Orb", "Magnetic Orb",
"Invisible Hands", "Invisible Hands",
@@ -379,7 +379,7 @@ K.Spells = [
"Animate Tunic", "Animate Tunic",
"Ursine Armor", "Ursine Armor",
"Holy Roller", "Holy Roller",
"Tonsilectomy", "Tonsillectomy",
"Curse Family", "Curse Family",
"Infinite Confusion"]; "Infinite Confusion"];
@@ -717,9 +717,9 @@ K.Monsters = [
"Pentasaurus|12|head", "Pentasaurus|12|head",
"Stegosaurus|18|plate", "Stegosaurus|18|plate",
"Triceratops|16|horn", "Triceratops|16|horn",
"Tyranosauraus Rex|18|forearm", "Tyrannosaurus Rex|18|forearm",
"Djinn|7|lamp", "Djinn|7|lamp",
"Doppleganger|4|face", "Doppelganger|4|face",
"Black Dragon|7|*", "Black Dragon|7|*",
"Plaid Dragon|7|sporrin", "Plaid Dragon|7|sporrin",
"Blue Dragon|9|*", "Blue Dragon|9|*",
@@ -788,7 +788,7 @@ K.Monsters = [
"Hippocampus|4|mane", "Hippocampus|4|mane",
"Hippogriff|3|egg", "Hippogriff|3|egg",
"Hobgoblin|1|patella", "Hobgoblin|1|patella",
"Homonculus|2|fluid", "Homunculus|2|fluid",
"Hydra|8|gyrum", "Hydra|8|gyrum",
"Imp|2|tail", "Imp|2|tail",
"Invisible Stalker|8|*", "Invisible Stalker|8|*",
+3 -7
View File
@@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="en">
<head> <head>
<link rel="shortcut icon" type="image/x-icon" href="http://progressquest.com/favicon.ico"> <link rel="shortcut icon" type="image/x-icon" href="http://progressquest.com/favicon.ico">
<title>Play Progress Quest</title> <title>Play Progress Quest</title>
@@ -22,9 +22,6 @@ p {
color: #808080; color: #808080;
text-decoration: none; text-decoration: none;
} }
.banter {
font-size: 11pt;
}
#go { #go {
font-size: 30pt; font-size: 30pt;
} }
@@ -33,7 +30,6 @@ img {
} }
th, td { text-align: left; padding-right: 2em; } th, td { text-align: left; padding-right: 2em; }
.good { color: #2a2; } .good { color: #2a2; }
.bad { color: #a22; }
.ugly { color: #c82; } .ugly { color: #c82; }
</style> </style>
</head> </head>
@@ -57,12 +53,12 @@ or install anything to play Progress Quest; just hit the button:
<p> <p>
Does that sound easy to you? Well it wasn't; we started with hardware Does that sound easy to you? Well it wasn't; we started with hardware
emulation of a 80386-equipped PC clone running a novel Windows XP emulation of a 80386-equipped PC clone running a novel Windows XP
compatable operating system called ProgrOS, implemented in a clean compatible operating system called ProgrOS, implemented in a clean
room in the Seychelles by a team of people who had never programmed room in the Seychelles by a team of people who had never programmed
before (to keep the lawyers at bay). before (to keep the lawyers at bay).
<p> <p>
Unfortuantely that wan't fast enough (there was too much lag death), Unfortunately that wasn't fast enough (there was too much lag death),
so we instead emulated the much faster Cray-2 supercomputer and ran so we instead emulated the much faster Cray-2 supercomputer and ran
the 80386 emulator in that. But the 80386 kept getting hot, so we the 80386 emulator in that. But the 80386 kept getting hot, so we
switched to a 6502 overclocked at 120GHz with emulated liquid helium switched to a 6502 overclocked at 120GHz with emulated liquid helium
+1 -1
View File
@@ -210,7 +210,7 @@ if (!this.JSON) {
// If the string contains no control characters, no quote characters, and no // If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it. // backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe escape // Otherwise, we must also replace the offending characters with safe escape
// sequences. // sequences.
escapable.lastIndex = 0; escapable.lastIndex = 0;
+207 -207
View File
@@ -1,207 +1,207 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="en">
<head> <head>
<meta charset="utf-8"/> <meta charset="utf-8"/>
<link rel="shortcut icon" type="image/x-icon" href="http://progressquest.com/favicon.ico"> <link rel="shortcut icon" type="image/x-icon" href="http://progressquest.com/favicon.ico">
<link rel="stylesheet" href="progros.css" type="text/css"> <link rel="stylesheet" href="progros.css" type="text/css">
<link rel="stylesheet" href="main.css" type="text/css"> <link rel="stylesheet" href="main.css" type="text/css">
<title>Progress Quest</title> <title>Progress Quest</title>
<meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" <meta name="viewport"
content="initial-scale=1.0, content="initial-scale=1.0,
maximum-scale=1.0, maximum-scale=1.0,
minimum-scale=1.0, minimum-scale=1.0,
user-scalable=0" /> user-scalable=0" />
<meta names="apple-mobile-web-app-status-bar-style" content="black" /> <meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="touch-icon.png" /> <link rel="apple-touch-icon" href="touch-icon.png" />
</head> </head>
<body> <body>
<br> <br>
<div class="vbox window" id="main"> <div class="vbox window" id="main">
<div id="titlebar"> <div id="titlebar">
<img src="swords.gif"> <img src="swords.gif" alt="Progress Quest Logo">
<span id="title">Progress Quest</span> <span id="title">Progress Quest</span>
<a id="quit"><img src="closeup.png"></a> <a id="quit"><img src="closeup.png" alt="Close button"></a>
</div> </div>
<script src="json2.js"></script> <script src="json2.js"></script>
<script src="jquery-3.6.0.js"></script> <script src="jquery-3.6.0.js"></script>
<script src="config.js"></script> <script src="config.js"></script>
<script src="main.js"></script> <script src="main.js"></script>
<div class="hbox"> <div class="hbox">
<div class="vbox" id="Izquierda"> <div class="vbox" id="Izquierda">
<span class="label head" >Character Sheet</span> <span class="label head" >Character Sheet</span>
<table class="listbox" id="Trats"> <table class="listbox" id="Trats">
<thead> <thead>
<tr> <tr>
<th>Trait</th> <th>Trait</th>
<th>Value</th> <th>Value</th>
</tr> </tr>
</thead> </thead>
<tbody id="Traits"> <tbody id="Traits">
<tr> <tr>
<td>Name</td> <td>Name</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>Race</td> <td>Race</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>Class</td> <td>Class</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>Level</td> <td>Level</td>
<td>1</td> <td>1</td>
</tr> </tr>
</tbody> </tbody>
<thead class="mid"> <thead class="mid">
<tr> <tr>
<th>Stat</th> <th>Stat</th>
<th>Value</th> <th>Value</th>
</tr> </tr>
</thead> </thead>
<tbody id="Stats"> <tbody id="Stats">
<tr><td>STR</td><td></td></tr> <tr><td>STR</td><td></td></tr>
<tr><td>CON</td><td></td></tr> <tr><td>CON</td><td></td></tr>
<tr><td>DEX</td><td></td></tr> <tr><td>DEX</td><td></td></tr>
<tr><td>INT</td><td></td></tr> <tr><td>INT</td><td></td></tr>
<tr><td>WIS</td><td></td></tr> <tr><td>WIS</td><td></td></tr>
<tr><td>CHA</td><td></td></tr> <tr><td>CHA</td><td></td></tr>
<tr><td>HP Max</td><td></td></tr> <tr><td>HP Max</td><td></td></tr>
<tr><td>MP Max</td><td></td></tr> <tr><td>MP Max</td><td></td></tr>
</tbody> </tbody>
</table> </table>
<div class="label">Experience</div> <div class="label">Experience</div>
<div class="progress-container" id="ExpBar"> <div class="progress-container" id="ExpBar">
<div class="hint"></div> <div class="hint"></div>
<div class="bar"></div> <div class="bar"></div>
</div> </div>
<span class="label head" >Spell Book</span> <span class="label head" >Spell Book</span>
<div id="Spells" class="scroll listbox"> <div id="Spells" class="scroll listbox">
<table> <table>
<thead> <thead>
<tr> <tr>
<th class="key">Spell</th> <th class="key">Spell</th>
<th class="value">Level</th> <th class="value">Level</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<div class="vbox" id="Centro"> <div class="vbox" id="Centro">
<span class="label head">Equipment</span> <span class="label head">Equipment</span>
<table id="Equips" class="listbox"> <table id="Equips" class="listbox">
<tbody> <tbody>
<tr><td>Weapon</td><td></td></tr> <tr><td>Weapon</td><td></td></tr>
<tr><td>Shield</td><td></tr> <tr><td>Shield</td><td></tr>
<tr><td>Helm<td></tr> <tr><td>Helm<td></tr>
<tr><td>Hauberk<td></tr> <tr><td>Hauberk<td></tr>
<tr><td>Brassairts<td></tr> <tr><td>Brassairts<td></tr>
<tr><td>Vambraces<td></td></tr> <tr><td>Vambraces<td></td></tr>
<tr><td>Gauntlets<td></tr> <tr><td>Gauntlets<td></tr>
<tr><td>Gambeson<td></tr> <tr><td>Gambeson<td></tr>
<tr><td>Cuisses<td></tr> <tr><td>Cuisses<td></tr>
<tr><td>Greaves<td></tr> <tr><td>Greaves<td></tr>
<tr><td>Sollerets<td></tr> <tr><td>Sollerets<td></tr>
</tbody> </tbody>
</table> </table>
<span class="label head" >Inventory</span> <span class="label head" >Inventory</span>
<div id="Inventory" class="scroll listbox"> <div id="Inventory" class="scroll listbox">
<table > <table >
<thead> <thead>
<tr> <tr>
<th class="key">Item</th> <th class="key">Item</th>
<th class="value">Qty</th> <th class="value">Qty</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="label">Encumbrance</div> <div class="label">Encumbrance</div>
<div class="progress-container" id="EncumBar"> <div class="progress-container" id="EncumBar">
<div class="hint"></div> <div class="hint"></div>
<div class="bar"></div> <div class="bar"></div>
</div> </div>
</div> </div>
<div class="vbox" id="Derecha"> <div class="vbox" id="Derecha">
<span class="label head">Plot Development</span> <span class="label head">Plot Development</span>
<div id="Plots" class="scroll listbox"> <div id="Plots" class="scroll listbox">
<table> <table>
<tbody> <tbody>
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="progress-container" id="PlotBar"> <div class="progress-container" id="PlotBar">
<div class="hint"></div> <div class="hint"></div>
<div class="bar"></div> <div class="bar"></div>
</div> </div>
<span class="label head">Quests</span> <span class="label head">Quests</span>
<div id="Quests" class="scroll listbox"> <div id="Quests" class="scroll listbox">
<table> <table>
<tbody> <tbody>
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="progress-container" id="QuestBar"> <div class="progress-container" id="QuestBar">
<div class="hint"></div> <div class="hint"></div>
<div class="bar"></div> <div class="bar"></div>
</div> </div>
</div> </div>
</div> </div>
<div id="Kill" class="label"></div> <div id="Kill" class="label"></div>
<div class="progress-container" id="TaskBar"> <div class="progress-container" id="TaskBar">
<div class="hint"></div> <div class="hint"></div>
<div class="bar"></div> <div class="bar"></div>
</div> </div>
</div> </div>
<div id=bsodmom> <div id=bsodmom>
<div id=bsod> <div id=bsod>
<p class=c><span>&nbsp;Progress Quest&nbsp;</span> <p class=c><span>&nbsp;Progress Quest&nbsp;</span>
<p>&nbsp; <p>&nbsp;
<p>An error has occurred. <p>An error has occurred.
<p>Error: <p>Error:
<p id=bsod_message> <p id=bsod_message>
<p>In <span id=bsod_source></span> at <span id=bsod_lineno></span>:<span id=bsod_colno></span> <p>In <span id=bsod_source></span> at <span id=bsod_lineno></span>:<span id=bsod_colno></span>
<p id=bsod_error> <p id=bsod_error>
<p class=c>Press any key to continue...</p> <p class=c>Press any key to continue...</p>
</div> </div>
</div> </div>
<div id="paused"><br>PAUSED</div> <div id="paused"><br>PAUSED</div>
</body> </body>
</html> </html>
+5 -5
View File
@@ -90,7 +90,7 @@ function Split(s, field, separator) {
function Indefinite(s, qty) { function Indefinite(s, qty) {
if (qty == 1) { if (qty == 1) {
if (Pos(s.charAt(0), 'AEIOUÜaeiouü') > 0) if (Pos(s.charAt(0), 'AEIOUÜaeiouü') > 0)
return 'an ' + s; return 'an ' + s;
else else
return 'a ' + s; return 'a ' + s;
@@ -156,13 +156,13 @@ function InterplotCinematic() {
case 2: Q('task|2|You seem to gain the advantage over ' + nemesis); break; case 2: Q('task|2|You seem to gain the advantage over ' + nemesis); break;
} }
} }
Q('task|3|Victory! ' + nemesis + ' is slain! Exhausted, you lose conciousness'); Q('task|3|Victory! ' + nemesis + ' is slain! Exhausted, you lose consciousness');
Q('task|2|You awake in a friendly 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 nemesis2 = ImpressiveGuy(); var nemesis2 = ImpressiveGuy();
Q("task|2|Oh sweet relief! You've reached the kind protection of " + nemesis2); Q("task|2|Oh sweet relief! You've reached the kind protection of " + nemesis2);
Q('task|3|There is rejoicing, and an unnerving encouter with ' + nemesis2 + ' in private'); Q('task|3|There is rejoicing, and an unnerving encounter with ' + nemesis2 + ' in private');
Q('task|2|You forget your ' + BoringItem() + ' and go back to get it'); Q('task|2|You forget your ' + BoringItem() + ' and go back to get it');
Q("task|2|What's this!? You overhear something shocking!"); Q("task|2|What's this!? You overhear something shocking!");
Q('task|2|Could ' + nemesis2 + ' be a dirty double-dealer?'); Q('task|2|Could ' + nemesis2 + ' be a dirty double-dealer?');
@@ -1195,7 +1195,7 @@ function FormKeyDown(e) {
} }
if (e.key === 'g') { if (e.key === 'g') {
Guildify(InputBox('Choose a guild.\n\nMake sure you undestand the guild rules before you join one. To learn more about guilds, visit http://progressquest.com/guilds.php\n', game.guild)); Guildify(InputBox('Choose a guild.\n\nMake sure you understand the guild rules before you join one. To learn more about guilds, visit http://progressquest.com/guilds.php\n', game.guild));
} }
if (e.key === 'm') { if (e.key === 'm') {
@@ -1336,4 +1336,4 @@ function Guildify(guild) {
s = parts.shift(); s = parts.shift();
if (s) Navigate(s); if (s) Navigate(s);
}); });
} }
+1 -1
View File
@@ -18,7 +18,7 @@ fieldset {
fieldset table { fieldset table {
width: 100px; width: 100px;
border: none 0px black; border: none 0 black;
border-right: none !IMPORTANT; border-right: none !IMPORTANT;
border-spacing: 10px; border-spacing: 10px;
border-collapse: separate; border-collapse: separate;
+4 -4
View File
@@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="en">
<head> <head>
<meta charset="utf-8"/> <meta charset="utf-8"/>
<link rel="shortcut icon" type="image/x-icon" href="http://progressquest.com/favicon.ico"> <link rel="shortcut icon" type="image/x-icon" href="http://progressquest.com/favicon.ico">
@@ -24,14 +24,14 @@ input, button { display: inline; }
<div class="vbox window" id="newguy"> <div class="vbox window" id="newguy">
<div id="titlebar"> <div id="titlebar">
<img src="swords.gif"> <img src="swords.gif" alt="Progress Quest Logo">
<span>Progress Quest - New Character</span> <span>Progress Quest - New Character</span>
<a id="quit"><img src="closeup.png"></a> <a id="quit"><img src="closeup.png" alt="Close button"></a>
</div> </div>
<div class="client"> <div class="client">
<div class="hbox"> <div class="hbox">
Name <label for="Name">Name</label>
<input id="Name" spellcheck="false"> <input id="Name" spellcheck="false">
<button id="RandomName">?</button> <button id="RandomName">?</button>
</div> </div>
+209 -209
View File
@@ -1,209 +1,209 @@
/* copyright (c)2002-2010 Eric Fredricksen all rights reserved */ /* copyright (c)2002-2010 Eric Fredricksen all rights reserved */
function Roll(stat) { function Roll(stat) {
stats[stat] = 3 + Random(6) + Random(6) + Random(6); stats[stat] = 3 + Random(6) + Random(6) + Random(6);
if (document) if (document)
$("#"+stat).text(stats[stat]); $("#"+stat).text(stats[stat]);
return stats[stat]; return stats[stat];
} }
function Choose(n, k) { function Choose(n, k) {
var result = n; var result = n;
var d = 1; var d = 1;
for (var i = 2; i <= k; ++i) { for (var i = 2; i <= k; ++i) {
result *= (1+n-i); result *= (1+n-i);
d = d * i; d = d * i;
} }
return result / d; return result / d;
} }
var stats = {}; var stats = {};
var traits = {}; var traits = {};
var total = 0; var total = 0;
var seedHistory = []; var seedHistory = [];
function RollEm() { function RollEm() {
stats.seed = randseed(); stats.seed = randseed();
total = 0; total = 0;
var best = -1; var best = -1;
$.each(K.PrimeStats, function () { $.each(K.PrimeStats, function () {
total += Roll(this); total += Roll(this);
if (best < stats[this]) { if (best < stats[this]) {
best = stats[this]; best = stats[this];
stats.best = this; stats.best = this;
} }
}); });
stats['HP Max'] = Random(8) + stats.CON.div(6); stats['HP Max'] = Random(8) + stats.CON.div(6);
stats['MP Max'] = Random(8) + stats.INT.div(6); stats['MP Max'] = Random(8) + stats.INT.div(6);
var color = var color =
(total >= (63+18)) ? 'red' : (total >= (63+18)) ? 'red' :
(total > (4 * 18)) ? 'yellow' : (total > (4 * 18)) ? 'yellow' :
(total <= (63-18)) ? 'grey' : (total <= (63-18)) ? 'grey' :
(total < (3 * 18)) ? 'silver' : (total < (3 * 18)) ? 'silver' :
'white'; 'white';
if (document) { if (document) {
var Total = $("#Total"); var Total = $("#Total");
Total.text(total); Total.text(total);
Total.css("background-color", color); Total.css("background-color", color);
$("#Unroll").attr("disabled", !seedHistory.length); $("#Unroll").attr("disabled", !seedHistory.length);
} }
} }
function RerollClick() { function RerollClick() {
seedHistory.push(stats.seed); seedHistory.push(stats.seed);
RollEm(); RollEm();
} }
function UnrollClick() { function UnrollClick() {
randseed(seedHistory.pop()); randseed(seedHistory.pop());
RollEm(); RollEm();
} }
function fill(e, a, n) { function fill(e, a, n) {
var def = Random(a.length); var def = Random(a.length);
for (var i = 0; i < a.length; ++i) { for (var i = 0; i < a.length; ++i) {
var v = a[i].split("|")[0]; var v = a[i].split("|")[0];
var check = (def == i) ? " checked " : " "; var check = (def == i) ? " checked " : " ";
if (def == i) traits[n] = v; if (def == i) traits[n] = v;
if (document) { if (document) {
$("<div><input type=radio id='" + v + "' name=\"" + n + "\" value=\"" + v + "\" " + $("<div><input type=radio id='" + v + "' name=\"" + n + "\" value=\"" + v + "\" " +
check +"><label for='" + v + "'>" + v + "</label></div>").appendTo(e); check +"><label for='" + v + "'>" + v + "</label></div>").appendTo(e);
} }
} }
} }
function NewGuyFormLoad() { function NewGuyFormLoad() {
seed = new Alea(); seed = new Alea();
RollEm(); RollEm();
GenClick(); GenClick();
fill("#races", K.Races, "Race"); fill("#races", K.Races, "Race");
fill("#classes", K.Klasses, "Class"); fill("#classes", K.Klasses, "Class");
if (document) { if (document) {
$("#Reroll").click(RerollClick); $("#Reroll").click(RerollClick);
$("#Unroll").click(UnrollClick); $("#Unroll").click(UnrollClick);
$("#RandomName").click(GenClick); $("#RandomName").click(GenClick);
$('#Sold').click(sold); $('#Sold').click(sold);
$('#quit').click(cancel); $('#quit').click(cancel);
//var caption = 'Progress Quest - New Character'; //var caption = 'Progress Quest - New Character';
//if (MainForm.GetHostName != '') //if (MainForm.GetHostName != '')
// caption = caption + ' [' + MainForm.GetHostName + ']'; // caption = caption + ' [' + MainForm.GetHostName + ']';
$("#Name").focus(); $("#Name").focus();
$("#Name").select(); $("#Name").select();
} }
if (window.location.href.indexOf("?sold") > 0) if (window.location.href.indexOf("?sold") > 0)
sold(); // TODO: cheesy sold(); // TODO: cheesy
} }
if (document) if (document)
$(document).ready(NewGuyFormLoad); $(document).ready(NewGuyFormLoad);
function sold() { function sold() {
var newguy = { var newguy = {
Traits: traits, Traits: traits,
dna: stats.seed, dna: stats.seed,
seed: stats.seed, seed: stats.seed,
birthday: ''+new Date(), birthday: ''+new Date(),
birthstamp: +new Date(), birthstamp: +new Date(),
Stats: stats, Stats: stats,
beststat: stats.best + " " + stats[stats.best], beststat: stats.best + " " + stats[stats.best],
task: "", task: "",
tasks: 0, tasks: 0,
elapsed: 0, elapsed: 0,
bestequip: "Sharp Rock", bestequip: "Sharp Rock",
Equips: {}, Equips: {},
Inventory: [['Gold', 0]], Inventory: [['Gold', 0]],
Spells: [], Spells: [],
act: 0, act: 0,
bestplot: "Prologue", bestplot: "Prologue",
Quests: [], Quests: [],
questmonster: "", questmonster: "",
kill: "Loading....", kill: "Loading....",
ExpBar: { position: 0, max: LevelUpTime(1) }, ExpBar: { position: 0, max: LevelUpTime(1) },
EncumBar: { position: 0, max: stats.STR + 10 }, EncumBar: { position: 0, max: stats.STR + 10 },
PlotBar: { position: 0, max: 26 }, PlotBar: { position: 0, max: 26 },
QuestBar: { position: 0, max: 1 }, QuestBar: { position: 0, max: 1 },
TaskBar: { position: 0, max: 2000 }, TaskBar: { position: 0, max: 2000 },
queue: [ queue: [
'task|10|Experiencing an enigmatic and foreboding night vision', 'task|10|Experiencing an enigmatic and foreboding night vision',
"task|6|Much is revealed about that wise old bastard you'd underestimated", "task|6|Much is revealed about that wise old bastard you'd underestimated",
'task|6|A shocking series of events leaves you alone and bewildered, but resolute', 'task|6|A shocking series of events leaves you alone and bewildered, but resolute',
'task|4|Drawing upon an unrealized reserve of determination, you set out on a long and dangerous journey', 'task|4|Drawing upon an unrealized reserve of determination, you set out on a long and dangerous journey',
'plot|2|Loading' 'plot|2|Loading'
] ]
}; };
if (document) { if (document) {
newguy.Traits.Name = $("#Name").val(); newguy.Traits.Name = $("#Name").val();
newguy.Traits.Race = $("input:radio[name=Race]:checked").val(); newguy.Traits.Race = $("input:radio[name=Race]:checked").val();
newguy.Traits.Class = $("input:radio[name=Class]:checked").val(); newguy.Traits.Class = $("input:radio[name=Class]:checked").val();
} }
newguy.Traits.Level = 1; newguy.Traits.Level = 1;
newguy.date = newguy.birthday; newguy.date = newguy.birthday;
newguy.stamp = newguy.birthstamp; newguy.stamp = newguy.birthstamp;
$.each(K.Equips, function (i,equip) { newguy.Equips[equip] = ''; }); $.each(K.Equips, function (i,equip) { newguy.Equips[equip] = ''; });
newguy.Equips.Weapon = newguy.bestequip; newguy.Equips.Weapon = newguy.bestequip;
newguy.Equips.Hauberk = "-3 Burlap"; newguy.Equips.Hauberk = "-3 Burlap";
if ($("#multiplayer:checked").length > 0) { if ($("#multiplayer:checked").length > 0) {
newguy.online = { newguy.online = {
realm: "Alpaquil", realm: "Alpaquil",
host: "http://progressquest.com/alpaquil.php?", host: "http://progressquest.com/alpaquil.php?",
// host: "http://localhost:9001/alpaquil.php?", // host: "http://localhost:9001/alpaquil.php?",
} }
$("#sold").prop("disabled", true); $("#sold").prop("disabled", true);
$("body").css("cursor", "progress"); $("body").css("cursor", "progress");
let url = newguy.online.host; let url = newguy.online.host;
url += 'cmd=create' + url += 'cmd=create' +
'&name=' + UrlEncode(newguy.Traits.Name) + '&name=' + UrlEncode(newguy.Traits.Name) +
'&realm=' + UrlEncode(newguy.online.realm) + '&realm=' + UrlEncode(newguy.online.realm) +
RevString; RevString;
$.ajax(url) $.ajax(url)
.done(body => { .done(body => {
if (body.split('|')[0].toLowerCase() == 'ok') { if (body.split('|')[0].toLowerCase() == 'ok') {
newguy.online.passkey = parseInt(body.split('|')[1]); newguy.online.passkey = parseInt(body.split('|')[1]);
charIsBorn(newguy); charIsBorn(newguy);
} else { } else {
$("#sold").prop("disabled", false); $("#sold").prop("disabled", false);
$("body").css("cursor", "default"); $("body").css("cursor", "default");
alert(body); alert(body);
} }
}); });
} else { } else {
charIsBorn(newguy); charIsBorn(newguy);
} }
} }
function charIsBorn(newguy) { function charIsBorn(newguy) {
storage.addToRoster(newguy, function () { storage.addToRoster(newguy, function () {
window.location.href = "main.html#" + escape(newguy.Traits.Name); window.location.href = "main.html#" + escape(newguy.Traits.Name);
}); });
} }
function cancel() { function cancel() {
window.location.href = "roster.html"; window.location.href = "roster.html";
} }
function GenClick() { function GenClick() {
traits.Name = GenerateName(); traits.Name = GenerateName();
if (document) if (document)
$("#Name").attr("value", traits.Name); $("#Name").attr("value", traits.Name);
} }
+133 -133
View File
@@ -1,133 +1,133 @@
/* RESET (via Boilerplate via Eric Meyer) */ /* RESET (via Boilerplate via Eric Meyer) */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, html, body, div, span, applet, object, iframe, h1, h2, h3, h4,
h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite,
code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small,
strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd,
ol, ul, li, fieldset, form, label, legend, table, caption, tbody, ol, ul, li, fieldset, form, label, legend, table, caption, tbody,
tfoot, thead, tr, th, td { tfoot, thead, tr, th, td {
margin: 0; margin: 0;
padding: 0; padding: 0;
border: 0; border: 0;
outline: 0; outline: 0;
font-size: 100%; font-size: 100%;
vertical-align: baseline; vertical-align: baseline;
background: transparent; background: transparent;
} }
body { line-height: 1; } body { line-height: 1; }
ol, ul { list-style: none; } ol, ul { list-style: none; }
blockquote, q { quotes: none; } blockquote, q { quotes: none; }
blockquote:before, blockquote:after, q:before, q:after { blockquote:before, blockquote:after, q:before, q:after {
content: ''; content: none; content: ''; content: none;
} }
:focus { outline: 0; } :focus { outline: 0; }
ins { text-decoration: none; } ins { text-decoration: none; }
del { text-decoration: line-through; } del { text-decoration: line-through; }
table { border-collapse: collapse; border-spacing: 0; } table { border-collapse: collapse; border-spacing: 0; }
/* XULish */ /* XULish */
.hbox > * { .hbox > * {
vertical-align: middle; vertical-align: middle;
} }
.vbox > * { .vbox > * {
display: block; display: block;
} }
.hbox > *, .horizontal > *, td > * { .hbox > *, .horizontal > *, td > * {
display: inline-block; display: inline-block;
} }
.vbox { .vbox {
vertical-align: top; vertical-align: top;
} }
td, th, .label, tr input, #titlebar, div { td, th, .label, tr input, #titlebar, div {
font-family: Tahoma, Helvetica, sans-serif; font-family: Tahoma, Helvetica, sans-serif;
font-size: 8pt; font-size: 8pt;
} }
td, th { td, th {
padding-left: 1ex; padding-left: 1ex;
} }
th { th {
border-bottom: solid 1px grey; border-bottom: solid 1px grey;
text-align: left; text-align: left;
font-weight: normal; font-weight: normal;
} }
th:first-child { th:first-child {
border-right: solid 1px grey; border-right: solid 1px grey;
} }
#titlebar { #titlebar {
background-color: #008; background-color: #008;
color: white; color: white;
font-weight: bold; font-weight: bold;
font-size: 9pt; font-size: 9pt;
padding-bottom: 4px; padding-bottom: 4px;
margin-bottom: 1ex; margin-bottom: 1ex;
} }
#titlebar > img { #titlebar > img {
vertical-align: bottom; vertical-align: bottom;
margin: 2 0 0 2; margin: 2px 0 0 2px;
} }
#quit { #quit {
float: right; float: right;
background: url(closedown.png); background: url(closedown.png);
text-decoration: none; text-decoration: none;
margin: 2px 2px 0 0; margin: 2px 2px 0 0;
width: 16px; width: 16px;
padding: 0; padding: 0;
} }
#quit:active img { #quit:active img {
aopacity: 0; opacity: 0;
} }
.window { .window {
background-color: #e7e7e7; background-color: #e7e7e7;
border: outset 2px silver; border: outset 2px silver;
padding: 2px; padding: 2px;
text-align: left; text-align: left;
display: inline-block; display: inline-block;
} }
body { body {
background: url(back.jpg) no-repeat; background: url(back.jpg) no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
-webkit-background-size: 100% 100%; -webkit-background-size: 100% 100%;
-o-background-size: 100% 100%; -o-background-size: 100% 100%;
-moz-background-size: 100% 100%; -moz-background-size: 100% 100%;
background-attachment: fixed; background-attachment: fixed;
text-align: center; text-align: center;
margin-top: 1em; margin-top: 1em;
} }
body.bare { body.bare {
background: silver; background: silver;
} }
div.scroll { div.scroll {
overflow: scroll; overflow: scroll;
height: 100px; height: 100px;
width: 250px; width: 250px;
overflow-x: hidden; overflow-x: hidden;
} }
div.scroll > table { div.scroll > table {
width: 234px; width: 234px;
} }
.selected { .selected {
background-color: yellow; background-color: yellow;
} }
+3 -3
View File
@@ -1,5 +1,5 @@
<!doctype html> <!doctype html>
<html> <html lang="en">
<head> <head>
<meta charset="utf-8"/> <meta charset="utf-8"/>
<link rel="shortcut icon" type="image/x-icon" href="http://progressquest.com/favicon.ico"> <link rel="shortcut icon" type="image/x-icon" href="http://progressquest.com/favicon.ico">
@@ -46,7 +46,7 @@ p {
margin-right: 10%; margin-right: 10%;
text-align: left; text-align: left;
} }
#newc, #newm { #newc {
text-align: center; text-align: center;
} }
.brag a, .brag a:visited { .brag a, .brag a:visited {
@@ -101,7 +101,7 @@ img {
<tr> <tr>
<td id="newc"> <td id="newc">
<b>New Character</b><br> <b>New Character</b><br>
<img src="dicebar.jpg"><br> <img src="dicebar.jpg" alt="four dice"><br>
<button id="roll">Roll One Up</button> <button id="roll">Roll One Up</button>
</td> </td>
</tr> </tr>