mirror of
https://bitbucket.org/grumdrig/pq-web.git
synced 2026-09-29 00:34:00 -06:00
Remove some trailing whitespace
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
<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;
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
<img src="swords.gif">
|
<img src="swords.gif">
|
||||||
<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"></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="jquery.js"></script>
|
<script src="jquery.js"></script>
|
||||||
<script src="config.js"></script>
|
<script src="config.js"></script>
|
||||||
@@ -35,9 +35,9 @@
|
|||||||
|
|
||||||
<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>
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
<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">
|
||||||
|
|||||||
@@ -61,15 +61,15 @@ function Ends(s, e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Plural(s) {
|
function Plural(s) {
|
||||||
if (Ends(s,'y'))
|
if (Ends(s,'y'))
|
||||||
return Copy(s,1,Length(s)-1) + 'ies';
|
return Copy(s,1,Length(s)-1) + 'ies';
|
||||||
else if (Ends(s,'us'))
|
else if (Ends(s,'us'))
|
||||||
return Copy(s,1,Length(s)-2) + 'i';
|
return Copy(s,1,Length(s)-2) + 'i';
|
||||||
else if (Ends(s,'ch') || Ends(s,'x') || Ends(s,'s') || Ends(s, 'sh'))
|
else if (Ends(s,'ch') || Ends(s,'x') || Ends(s,'s') || Ends(s, 'sh'))
|
||||||
return s + 'es';
|
return s + 'es';
|
||||||
else if (Ends(s,'f'))
|
else if (Ends(s,'f'))
|
||||||
return Copy(s,1,Length(s)-1) + 'ves';
|
return Copy(s,1,Length(s)-1) + 'ves';
|
||||||
else if (Ends(s,'man') || Ends(s,'Man'))
|
else if (Ends(s,'man') || Ends(s,'Man'))
|
||||||
return Copy(s,1,Length(s)-2) + 'en';
|
return Copy(s,1,Length(s)-2) + 'en';
|
||||||
else return s + 's';
|
else return s + 's';
|
||||||
}
|
}
|
||||||
@@ -80,9 +80,9 @@ 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;
|
||||||
} else {
|
} else {
|
||||||
return IntToStr(qty) + ' ' + Plural(s);
|
return IntToStr(qty) + ' ' + Plural(s);
|
||||||
@@ -127,13 +127,13 @@ function Special(m, s) {
|
|||||||
|
|
||||||
function InterplotCinematic() {
|
function InterplotCinematic() {
|
||||||
switch (Random(3)) {
|
switch (Random(3)) {
|
||||||
case 0:
|
case 0:
|
||||||
Q('task|1|Exhausted, you arrive at a friendly 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 friends and meet new allies');
|
Q('task|2|You greet old friends and meet new allies');
|
||||||
Q('task|2|You are privy to a council of powerful do-gooders');
|
Q('task|2|You are privy to a council of powerful do-gooders');
|
||||||
Q('task|1|There is much to be done. 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!');
|
||||||
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);
|
||||||
@@ -149,7 +149,7 @@ function 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 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 protection of the good " + nemesis2);
|
Q("task|2|Oh sweet relief! You've reached the protection of the good " + nemesis2);
|
||||||
Q('task|3|There is rejoicing, and an unnerving encouter with ' + nemesis2 + ' in private');
|
Q('task|3|There is rejoicing, and an unnerving encouter with ' + nemesis2 + ' in private');
|
||||||
@@ -185,7 +185,7 @@ function NamedMonster(level) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function ImpressiveGuy() {
|
function ImpressiveGuy() {
|
||||||
return Pick(K.ImpressiveTitles) +
|
return Pick(K.ImpressiveTitles) +
|
||||||
(Random(2) ? ' of the ' + Pick(K.Races) : ' of ' + GenerateName());
|
(Random(2) ? ' of the ' + Pick(K.Races) : ' of ' + GenerateName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,8 +276,8 @@ function ProperCase(s) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function EquipPrice() {
|
function EquipPrice() {
|
||||||
return 5 * GetI(Traits,'Level') * GetI(Traits,'Level') +
|
return 5 * GetI(Traits,'Level') * GetI(Traits,'Level') +
|
||||||
10 * GetI(Traits,'Level') +
|
10 * GetI(Traits,'Level') +
|
||||||
20;
|
20;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,7 +287,7 @@ function Dequeue() {
|
|||||||
if (Split(game.task,3) == '*') {
|
if (Split(game.task,3) == '*') {
|
||||||
WinItem();
|
WinItem();
|
||||||
} else if (Split(game.task,3)) {
|
} else if (Split(game.task,3)) {
|
||||||
Add(Inventory,LowerCase(Split(game.task,1) + ' ' +
|
Add(Inventory,LowerCase(Split(game.task,1) + ' ' +
|
||||||
ProperCase(Split(game.task,3))),1);
|
ProperCase(Split(game.task,3))),1);
|
||||||
}
|
}
|
||||||
} else if (game.task == 'buying') {
|
} else if (game.task == 'buying') {
|
||||||
@@ -304,13 +304,13 @@ function Dequeue() {
|
|||||||
}
|
}
|
||||||
if (Inventory.length() > 1) {
|
if (Inventory.length() > 1) {
|
||||||
Inventory.scrollToTop();
|
Inventory.scrollToTop();
|
||||||
Task('Selling ' + Indefinite(Inventory.label(1), GetI(Inventory,1)),
|
Task('Selling ' + Indefinite(Inventory.label(1), GetI(Inventory,1)),
|
||||||
1 * 1000);
|
1 * 1000);
|
||||||
game.task = 'sell';
|
game.task = 'sell';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var old = game.task;
|
var old = game.task;
|
||||||
game.task = '';
|
game.task = '';
|
||||||
if (game.queue.length > 0) {
|
if (game.queue.length > 0) {
|
||||||
@@ -444,7 +444,7 @@ function ListBox(id, columns, fixedkeys) {
|
|||||||
|
|
||||||
this.AddUI = function (caption) {
|
this.AddUI = function (caption) {
|
||||||
if (!this.box) return;
|
if (!this.box) return;
|
||||||
var tr = $("<tr><td><input type=checkbox disabled> " +
|
var tr = $("<tr><td><input type=checkbox disabled> " +
|
||||||
caption + "</td></tr>");
|
caption + "</td></tr>");
|
||||||
tr.appendTo(this.box);
|
tr.appendTo(this.box);
|
||||||
tr.each(function () {this.scrollIntoView();});
|
tr.each(function () {this.scrollIntoView();});
|
||||||
@@ -484,7 +484,7 @@ function ListBox(id, columns, fixedkeys) {
|
|||||||
if (this.box) {
|
if (this.box) {
|
||||||
if (butlast)
|
if (butlast)
|
||||||
this.rows().find("input:checkbox").not(':last').attr("checked","true");
|
this.rows().find("input:checkbox").not(':last').attr("checked","true");
|
||||||
else
|
else
|
||||||
this.rows().find("input:checkbox").attr("checked","true");
|
this.rows().find("input:checkbox").attr("checked","true");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -518,7 +518,7 @@ function ListBox(id, columns, fixedkeys) {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$.each(dict, function (index, row) {
|
$.each(dict, function (index, row) {
|
||||||
if (that.columns == 2)
|
if (that.columns == 2)
|
||||||
that.PutUI(row[0], row[1]);
|
that.PutUI(row[0], row[1]);
|
||||||
else
|
else
|
||||||
that.AddUI(row);
|
that.AddUI(row);
|
||||||
@@ -537,8 +537,8 @@ var ExpBar, PlotBar, TaskBar, QuestBar, EncumBar;
|
|||||||
var Traits,Stats,Spells,Equips,Inventory,Plots,Quests;
|
var Traits,Stats,Spells,Equips,Inventory,Plots,Quests;
|
||||||
var Kill;
|
var Kill;
|
||||||
var AllBars, AllLists;
|
var AllBars, AllLists;
|
||||||
|
|
||||||
|
|
||||||
function StrToIntDef(s, def) {
|
function StrToIntDef(s, def) {
|
||||||
var result = parseInt(s, 10);
|
var result = parseInt(s, 10);
|
||||||
return isNaN(result) ? def : result;
|
return isNaN(result) ? def : result;
|
||||||
@@ -658,7 +658,7 @@ function CompleteQuest() {
|
|||||||
game.questmonster = '';
|
game.questmonster = '';
|
||||||
var caption;
|
var caption;
|
||||||
switch (Random(5)) {
|
switch (Random(5)) {
|
||||||
case 0:
|
case 0:
|
||||||
var level = GetI(Traits,'Level');
|
var level = GetI(Traits,'Level');
|
||||||
var lev = 0;
|
var lev = 0;
|
||||||
for (var i = 1; i <= 4; ++i) {
|
for (var i = 1; i <= 4; ++i) {
|
||||||
@@ -676,13 +676,13 @@ function CompleteQuest() {
|
|||||||
case 1:
|
case 1:
|
||||||
caption = 'Seek ' + Definite(InterestingItem(), 1);
|
caption = 'Seek ' + Definite(InterestingItem(), 1);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
caption = 'Deliver this ' + BoringItem();
|
caption = 'Deliver this ' + BoringItem();
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
caption = 'Fetch me ' + Indefinite(BoringItem(), 1);
|
caption = 'Fetch me ' + Indefinite(BoringItem(), 1);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
var mlev = 0;
|
var mlev = 0;
|
||||||
level = GetI(Traits,'Level');
|
level = GetI(Traits,'Level');
|
||||||
for (var ii = 1; ii <= 2; ++ii) {
|
for (var ii = 1; ii <= 2; ++ii) {
|
||||||
@@ -703,8 +703,8 @@ function CompleteQuest() {
|
|||||||
game.Quests.push(caption);
|
game.Quests.push(caption);
|
||||||
game.bestquest = caption;
|
game.bestquest = caption;
|
||||||
Quests.AddUI(caption);
|
Quests.AddUI(caption);
|
||||||
|
|
||||||
|
|
||||||
Log('Commencing quest: ' + caption);
|
Log('Commencing quest: ' + caption);
|
||||||
|
|
||||||
SaveGame();
|
SaveGame();
|
||||||
@@ -816,13 +816,13 @@ function AddR(list, key, value) {
|
|||||||
|
|
||||||
function Get(list, key) {
|
function Get(list, key) {
|
||||||
if (list.fixedkeys) {
|
if (list.fixedkeys) {
|
||||||
if (typeof key === typeof 1)
|
if (typeof key === typeof 1)
|
||||||
key = list.fixedkeys[key];
|
key = list.fixedkeys[key];
|
||||||
return game[list.id][key];
|
return game[list.id][key];
|
||||||
} else if (typeof key === typeof 1) {
|
} else if (typeof key === typeof 1) {
|
||||||
if (key < game[list.id].length)
|
if (key < game[list.id].length)
|
||||||
return game[list.id][key][1];
|
return game[list.id][key][1];
|
||||||
else
|
else
|
||||||
return "";
|
return "";
|
||||||
} else {
|
} else {
|
||||||
for (var i = 0; i < game[list.id].length; ++i) {
|
for (var i = 0; i < game[list.id].length; ++i) {
|
||||||
@@ -880,16 +880,16 @@ function Timer1Timer() {
|
|||||||
game.elapsed += TaskBar.Max().div(1000);
|
game.elapsed += TaskBar.Max().div(1000);
|
||||||
|
|
||||||
ClearAllSelections();
|
ClearAllSelections();
|
||||||
|
|
||||||
if (game.kill == 'Loading....')
|
if (game.kill == 'Loading....')
|
||||||
TaskBar.reset(0); // Not sure if this is still the ticket
|
TaskBar.reset(0); // Not sure if this is still the ticket
|
||||||
|
|
||||||
// gain XP / level up
|
// gain XP / level up
|
||||||
var gain = Pos('kill|', game.task) == 1;
|
var gain = Pos('kill|', game.task) == 1;
|
||||||
if (gain) {
|
if (gain) {
|
||||||
if (ExpBar.done())
|
if (ExpBar.done())
|
||||||
LevelUp();
|
LevelUp();
|
||||||
else
|
else
|
||||||
ExpBar.increment(TaskBar.Max() / 1000);
|
ExpBar.increment(TaskBar.Max() / 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -901,15 +901,15 @@ function Timer1Timer() {
|
|||||||
QuestBar.increment(TaskBar.Max() / 1000);
|
QuestBar.increment(TaskBar.Max() / 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// advance plot
|
// advance plot
|
||||||
if (gain || !game.act) {
|
if (gain || !game.act) {
|
||||||
if (PlotBar.done())
|
if (PlotBar.done())
|
||||||
InterplotCinematic();
|
InterplotCinematic();
|
||||||
else
|
else
|
||||||
PlotBar.increment(TaskBar.Max() / 1000);
|
PlotBar.increment(TaskBar.Max() / 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
Dequeue();
|
Dequeue();
|
||||||
} else {
|
} else {
|
||||||
var elapsed = timeGetTime() - lasttick;
|
var elapsed = timeGetTime() - lasttick;
|
||||||
@@ -947,16 +947,16 @@ function FormCreate() {
|
|||||||
|
|
||||||
if (document) {
|
if (document) {
|
||||||
Kill = $("#Kill");
|
Kill = $("#Kill");
|
||||||
|
|
||||||
$("#quit").click(quit);
|
$("#quit").click(quit);
|
||||||
|
|
||||||
$(document).keypress(FormKeyDown);
|
$(document).keypress(FormKeyDown);
|
||||||
|
|
||||||
$(document).bind('beforeunload', function () {
|
$(document).bind('beforeunload', function () {
|
||||||
if (!storage)
|
if (!storage)
|
||||||
return "Are you sure you want to quit? All your progress will be lost!";
|
return "Are you sure you want to quit? All your progress will be lost!";
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).unload(function (event) {
|
$(window).unload(function (event) {
|
||||||
StopTimer();
|
StopTimer();
|
||||||
SaveGame();
|
SaveGame();
|
||||||
@@ -1049,7 +1049,7 @@ function Cheats() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
cheat("Clear items", function () {
|
cheat("Clear items", function () {
|
||||||
while (Inventory.length() > 1)
|
while (Inventory.length() > 1)
|
||||||
Inventory.remove1();
|
Inventory.remove1();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1092,7 +1092,7 @@ function HotOrNot() {
|
|||||||
/// And which stat is best?
|
/// And which stat is best?
|
||||||
best = 0;
|
best = 0;
|
||||||
for (i = 1; i <= 5; ++i) {
|
for (i = 1; i <= 5; ++i) {
|
||||||
if (GetI(Stats,i) > GetI(Stats,best))
|
if (GetI(Stats,i) > GetI(Stats,best))
|
||||||
best = i;
|
best = i;
|
||||||
}
|
}
|
||||||
game.beststat = Stats.label(best) + ' ' + GetI(Stats, best);
|
game.beststat = Stats.label(best) + ' ' + GetI(Stats, best);
|
||||||
@@ -1149,20 +1149,20 @@ function FormKeyDown(e) {
|
|||||||
Brag('brag');
|
Brag('brag');
|
||||||
//Navigate(GetHostAddr() + 'name=' + UrlEncode(Get(Traits,'Name')));
|
//Navigate(GetHostAddr() + 'name=' + UrlEncode(Get(Traits,'Name')));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.which == 3) { // ^C
|
if (e.which == 3) { // ^C
|
||||||
Cheats();
|
Cheats();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.which == 7) { // ^G
|
if (e.which == 7) { // ^G
|
||||||
game.guild = InputBox('Choose a guild.\r\rMake sure you undestand the guild rules before you join one. To learn more about guilds, visit http://progressquest.com/guilds.php', game.guild);
|
game.guild = InputBox('Choose a guild.\r\rMake sure you undestand the guild rules before you join one. To learn more about guilds, visit http://progressquest.com/guilds.php', game.guild);
|
||||||
Brag("guild");
|
Brag("guild");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.which == 16) { // ^P
|
if (e.which == 16) { // ^P
|
||||||
if (timerid)
|
if (timerid)
|
||||||
StopTimer();
|
StopTimer();
|
||||||
else
|
else
|
||||||
StartTimer();
|
StartTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1190,9 +1190,9 @@ function Brag(trigger) {
|
|||||||
if (game.isonline) {
|
if (game.isonline) {
|
||||||
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)
|
||||||
alert(data.alert);
|
alert(data.alert);
|
||||||
}, "json");
|
}, "json");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user