diff --git a/config.js b/config.js index 5321b0c..03f3c6c 100644 --- a/config.js +++ b/config.js @@ -304,7 +304,7 @@ Number.prototype.div = function (divisor) { function LevelUpTime(level) { // seconds // 20 minutes for for level 1 // exponential increase after that - return Math.round((20 + Math.pow(1.15, level) * 60); + return Math.round((20 + Math.pow(1.15, level)) * 60); } diff --git a/main.html b/main.html index f42939c..772b17c 100644 --- a/main.html +++ b/main.html @@ -1,6 +1,7 @@ + diff --git a/main.js b/main.js index a91427d..33f110d 100644 --- a/main.js +++ b/main.js @@ -1118,7 +1118,7 @@ function FormKeyDown(e) { alert("Your character's genome is " + ToDna(game.dna + "")); } - if (game.isonline) { + if (game.online) { if (key === 'b') { Brag('brag'); //Navigate(GetHostAddr() + 'name=' + UrlEncode(Get(Traits,'Name'))); @@ -1176,7 +1176,7 @@ function LFSR(pt, salt) { function Brag(trigger) { SaveGame(); - if (game.isonline) { + if (game.online) { game.bragtrigger = trigger; $.post("webrag.php", game, function (data, textStatus, request) { if (data.alert) diff --git a/newguy.html b/newguy.html index 8c3a899..ea248fc 100644 --- a/newguy.html +++ b/newguy.html @@ -1,6 +1,7 @@ + @@ -26,13 +27,18 @@ input, button { display: inline; } Progress Quest - New Character - +
Name +
@@ -46,10 +52,10 @@ input, button { display: inline; }
Class
- +
Stats - + @@ -60,25 +66,26 @@ input, button { display: inline; }
STR 13
CON 23
 
Total 48
- +





- +


- +
- + +
- +
diff --git a/newguy.js b/newguy.js index 4289b5d..618a69e 100644 --- a/newguy.js +++ b/newguy.js @@ -27,7 +27,7 @@ function RollEm() { stats.seed = randseed(); total = 0; var best = -1; - $.each(K.PrimeStats, function () { + $.each(K.PrimeStats, function () { total += Roll(this); if (best < stats[this]) { best = stats[this]; @@ -37,7 +37,7 @@ function RollEm() { stats['HP Max'] = Random(8) + stats.CON.div(6); stats['MP Max'] = Random(8) + stats.INT.div(6); - var color = + var color = (total >= (63+18)) ? 'red' : (total > (4 * 18)) ? 'yellow' : (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) { newguy.Traits.Name = $("#Name").val(); newguy.Traits.Race = $("input:radio[name=Race]:checked").val(); diff --git a/roster.html b/roster.html index ca32966..fedc7d3 100644 --- a/roster.html +++ b/roster.html @@ -1,6 +1,7 @@ - + + Progress Quest - Roster @@ -31,6 +32,11 @@ div.bs { font-size: 7pt; } +.online { + background-color: #ddffdd; + border-color: #66eecc; +} + body { text-align: center; } @@ -40,7 +46,7 @@ p { margin-right: 10%; text-align: left; } -#newc { +#newc, #newm { text-align: center; } .brag a, .brag a:visited { @@ -85,14 +91,13 @@ img {
- New Character
+ New Character

-

diff --git a/roster.js b/roster.js index b005a7e..a19101d 100644 --- a/roster.js +++ b/roster.js @@ -1,6 +1,6 @@ - + function load() { - + if (!window.localStorage) { roster.html("Hrumph: 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; @@ -14,30 +14,30 @@ function loadGames(games) { roster.empty(); var newone = window.location.href.split('#')[1]; - + var count = 0; $.each(games, function (key, c) { var name = c.Traits.Name; - + var br = brag(c); roster.append(br); br.find("a.go").attr("href", "main.html#" + escape(name)); - + br.find("a.x").click(function () { - if (confirm("Terminate " + Pick(["faithful","noble","loyal","brave"])+ + if (confirm("Terminate " + Pick(["faithful","noble","loyal","brave"])+ " " + name + "?")) { delete games[name]; storage.storeRoster(games); load(); } }); - + br.find("a.sheet").click(function () { alert(template($("#sheet").html(), games[name])); // TODO: put in a window or whatev }); - + if (name === newone) br.addClass("lit"); @@ -49,18 +49,24 @@ function loadGames(games) { ++count; }); - if (!count) + if (!count) roster.html("Games you start can be loaded from this page, but no saved games were found. Roll up a new character to get started."); } function brag(sheet) { var brag = $(template($("#badge").html(), sheet)); - if (sheet.motto) + if (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("✿"); + } return brag; } - + function clearRoster() { storage.storeRoster({}, load); } @@ -68,14 +74,14 @@ function clearRoster() { $(document).ready(function () { load(); - + $("#roll").click(function () { window.location = "newguy.html"; }); - + $("#test").click(function () { window.location = "newguy.html?sold"; }); - + $("#clear").click(clearRoster); });