Restore the pq6.2 levelling schedule. Some half-baked online game support from 2018 that's now commented out.

This commit is contained in:
Eric Fredricksen
2021-11-16 19:41:38 -08:00
committed by Eric Fredricksen
parent 40df70eac4
commit 60c28cd79b
7 changed files with 59 additions and 31 deletions
+1 -1
View File
@@ -304,7 +304,7 @@ Number.prototype.div = function (divisor) {
function LevelUpTime(level) { // seconds function LevelUpTime(level) { // seconds
// 20 minutes for for level 1 // 20 minutes for 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);
} }
+1
View File
@@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<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">
+2 -2
View File
@@ -1118,7 +1118,7 @@ function FormKeyDown(e) {
alert("Your character's genome is " + ToDna(game.dna + "")); alert("Your character's genome is " + ToDna(game.dna + ""));
} }
if (game.isonline) { if (game.online) {
if (key === 'b') { if (key === 'b') {
Brag('brag'); Brag('brag');
//Navigate(GetHostAddr() + 'name=' + UrlEncode(Get(Traits,'Name'))); //Navigate(GetHostAddr() + 'name=' + UrlEncode(Get(Traits,'Name')));
@@ -1176,7 +1176,7 @@ function LFSR(pt, salt) {
function Brag(trigger) { function Brag(trigger) {
SaveGame(); SaveGame();
if (game.isonline) { if (game.online) {
game.bragtrigger = trigger; game.bragtrigger = trigger;
$.post("webrag.php", game, function (data, textStatus, request) { $.post("webrag.php", game, function (data, textStatus, request) {
if (data.alert) if (data.alert)
+15 -8
View File
@@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<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="newguy.css" type="text/css"> <link rel="stylesheet" href="newguy.css" type="text/css">
@@ -26,13 +27,18 @@ input, button { display: inline; }
<img src="swords.gif"> <img src="swords.gif">
<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"></a>
</div> </div>
<div class="client"> <div class="client">
<div class="hbox"> <div class="hbox">
Name Name
<input id="Name" spellcheck="false"> <input id="Name" spellcheck="false">
<button id="RandomName">?</button> <button id="RandomName">?</button>
<!--
<span style="float:right;padding-right:20px">
<input type="checkbox" checked id="multiplayer"/><label for="multiplayer">Play online</label>
</span>
-->
</div> </div>
<div class=hbox> <div class=hbox>
@@ -46,10 +52,10 @@ input, button { display: inline; }
<fieldset class="vbox groupbox" id="classes"> <fieldset class="vbox groupbox" id="classes">
<legend>Class</legend> <legend>Class</legend>
</fieldset> </fieldset>
<fieldset class="vbox groupbox" id="stats"> <fieldset class="vbox groupbox" id="stats">
<legend>Stats</legend> <legend>Stats</legend>
<table> <table>
<tr> <th> STR <td id="STR">13</tr> <tr> <th> STR <td id="STR">13</tr>
<tr> <th> CON <td id="CON">23</tr> <tr> <th> CON <td id="CON">23</tr>
@@ -60,25 +66,26 @@ input, button { display: inline; }
<tr> <th colspan=2> &nbsp; </tr> <tr> <th colspan=2> &nbsp; </tr>
<tr> <th> Total <td id="Total">48</tr> <tr> <th> Total <td id="Total">48</tr>
</table> </table>
<br> <br>
<br> <br>
<br> <br>
<br> <br>
<br> <br>
<br> <br>
<center> <center>
<button id="Reroll">Roll</button> <br> <button id="Reroll">Roll</button> <br>
<button id="Unroll" disabled>Unroll</button> <button id="Unroll" disabled>Unroll</button>
</center> </center>
<br> <br>
</fieldset> </fieldset>
</div> </div>
<div class=hbox style="text-align:right;padding-top:15px"> <div class=hbox style="text-align:right;padding-top:15px">
<button id=Sold>Sold!</button> <button id=Sold>Sold!</button>
</div> </div>
</div> </div>
</div> </div>
+11 -2
View File
@@ -27,7 +27,7 @@ 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];
@@ -37,7 +37,7 @@ function RollEm() {
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' :
@@ -191,6 +191,15 @@ function sold() {
] ]
}; };
/*
if ($("#multiplayer:checked").length > 0) {
newguy.online = {
realm: "Alpaquil",
host: "http://progressquest.com/alpa.php",
}
}
*/
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();
+9 -4
View File
@@ -1,6 +1,7 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<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">
<title>Progress Quest - Roster</title> <title>Progress Quest - Roster</title>
<script src="json2.js"></script> <script src="json2.js"></script>
@@ -31,6 +32,11 @@ div.bs {
font-size: 7pt; font-size: 7pt;
} }
.online {
background-color: #ddffdd;
border-color: #66eecc;
}
body { body {
text-align: center; text-align: center;
} }
@@ -40,7 +46,7 @@ p {
margin-right: 10%; margin-right: 10%;
text-align: left; text-align: left;
} }
#newc { #newc, #newm {
text-align: center; text-align: center;
} }
.brag a, .brag a:visited { .brag a, .brag a:visited {
@@ -85,14 +91,13 @@ img {
<table class="brag"> <table class="brag">
<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"><br>
<button id="roll">Roll One Up</button> <button id="roll">Roll One Up</button>
</td> </td>
</tr> </tr>
</table> </table>
<br> <br>
<br> <br>
<div align="center" id="nabar"> <div align="center" id="nabar">
+20 -14
View File
@@ -1,6 +1,6 @@
function load() { function load() {
if (!window.localStorage) { if (!window.localStorage) {
roster.html("<b>Hrumph:</b> This browser does not support local storage. You can still play fast and loose: your character will live only as long as the game stays running in your browser."); roster.html("<b>Hrumph:</b> This browser does not support local storage. You can still play fast and loose: your character will live only as long as the game stays running in your browser.");
return; return;
@@ -14,30 +14,30 @@ function loadGames(games) {
roster.empty(); roster.empty();
var newone = window.location.href.split('#')[1]; var newone = window.location.href.split('#')[1];
var count = 0; var count = 0;
$.each(games, function (key, c) { $.each(games, function (key, c) {
var name = c.Traits.Name; var name = c.Traits.Name;
var br = brag(c); var br = brag(c);
roster.append(br); roster.append(br);
br.find("a.go").attr("href", "main.html#" + escape(name)); br.find("a.go").attr("href", "main.html#" + escape(name));
br.find("a.x").click(function () { br.find("a.x").click(function () {
if (confirm("Terminate " + Pick(["faithful","noble","loyal","brave"])+ if (confirm("Terminate " + Pick(["faithful","noble","loyal","brave"])+
" " + name + "?")) { " " + name + "?")) {
delete games[name]; delete games[name];
storage.storeRoster(games); storage.storeRoster(games);
load(); load();
} }
}); });
br.find("a.sheet").click(function () { br.find("a.sheet").click(function () {
alert(template($("#sheet").html(), games[name])); alert(template($("#sheet").html(), games[name]));
// TODO: put in a window or whatev // TODO: put in a window or whatev
}); });
if (name === newone) if (name === newone)
br.addClass("lit"); br.addClass("lit");
@@ -49,18 +49,24 @@ function loadGames(games) {
++count; ++count;
}); });
if (!count) if (!count)
roster.html("<i>Games you start can be loaded from this page, but no saved games were found. Roll up a new character to get started.</i>"); roster.html("<i>Games you start can be loaded from this page, but no saved games were found. Roll up a new character to get started.</i>");
} }
function brag(sheet) { function brag(sheet) {
var brag = $(template($("#badge").html(), sheet)); var brag = $(template($("#badge").html(), sheet));
if (sheet.motto) if (sheet.motto) {
brag.find(".bs").text('"' + sheet.motto + '"'); brag.find(".bs").text('"' + sheet.motto + '"');
}
if (sheet.online) {
brag.addClass("online");
brag.find(".bs").text("Realm of " + sheet.online.realm);
brag.find(".icon.go").html("&#x273F;");
}
return brag; return brag;
} }
function clearRoster() { function clearRoster() {
storage.storeRoster({}, load); storage.storeRoster({}, load);
} }
@@ -68,14 +74,14 @@ function clearRoster() {
$(document).ready(function () { $(document).ready(function () {
load(); load();
$("#roll").click(function () { $("#roll").click(function () {
window.location = "newguy.html"; window.location = "newguy.html";
}); });
$("#test").click(function () { $("#test").click(function () {
window.location = "newguy.html?sold"; window.location = "newguy.html?sold";
}); });
$("#clear").click(clearRoster); $("#clear").click(clearRoster);
}); });