Spruced up cheat buttons. Sorted out scrollers.

This commit is contained in:
Eric Fredricksen
2010-06-25 22:48:22 -07:00
parent 30f55290b0
commit 9060ccba84
3 changed files with 110 additions and 100 deletions
+72 -80
View File
@@ -1,7 +1,7 @@
<html> <html>
<head> <head>
<link rel="stylesheet" href="pq.css" type="text/css"> <link rel="stylesheet" href="pq.css" type="text/css">
<title>Progress Qwest</title> <title>Progress Quest</title>
</head> </head>
<body> <body>
@@ -16,10 +16,12 @@
<script src="config.js"></script> <script src="config.js"></script>
<script src="main.js"></script> <script src="main.js"></script>
<div class="hbox" flex="1"> <div class="hbox">
<div class="vbox" flex="5"> <div class="vbox">
<span class="label head" >Character Sheet</span> <span class="label head" >Character Sheet</span>
<table class="listbox" rows="4" class="list">
<table class="listbox">
<thead> <thead>
<tr> <tr>
<th style="width:30%">Trait</th> <th style="width:30%">Trait</th>
@@ -46,7 +48,7 @@
</tbody> </tbody>
</table> </table>
<div class="vbox" flex="4"> <div class="vbox">
<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>
@@ -72,67 +74,55 @@
</div> </div>
<span class="label head" >Spell Book</span> <span class="label head" >Spell Book</span>
<table class="listbox"> <div class="scroll listbox">
<thead> <table>
<tr> <thead>
<th >Spell</th> <tr>
<th >Level</th> <th>Spell</th>
</tr> <th style="width:10ex">Level</th>
</thead> </tr>
<tbody id="Spells"> </thead>
<tr><td>Black Idaho<td>LXI</tr> <tbody id="Spells">
<tr><td>&nbsp;<td></tr> <tr><td>Black Idaho<td>LXI</tr>
<tr><td>&nbsp;<td></tr> </tbody>
<tr><td>&nbsp;<td></tr> </table>
<tr><td>&nbsp;<td></tr> </div>
<tr><td>&nbsp;<td></tr>
<tr><td>&nbsp;<td></tr>
<tr><td>&nbsp;<td></tr>
</tbody>
</table>
</div> </div>
<div class="vbox" flex="1"> <div class="vbox">
<span class="label head" >Equipment</span> <span class="label head">Equipment</span>
<table class="listbox" rows="11">
<table class="listbox">
<tbody id="Equips"> <tbody id="Equips">
<tr><td >Weapon</td><td >Sharpened Stick</td></tr> <tr><td style="width:12ex">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>
<tr><td >Hauberk<td></tr> <tr><td>Hauberk<td></tr>
<tr><td >Brassairts<td></tr> <tr><td>Brassairts<td></tr>
<tr><td >Vambraces<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>
<table class="listbox"> <div class="scroll listbox">
<thead> <table >
<tr> <thead>
<th >Item</th> <tr>
<th >Qty</th> <th >Item</th>
</tr> <th style="width:6ex">Qty</th>
</thead> </tr>
<tbody id="Inventory"> </thead>
<tr><td>Cruzle brass<td>15</tr> <tbody id="Inventory">
<tr><td>&nbsp;<td></tr> <tr><td>Gold<td>0</tr>
<tr><td>&nbsp;<td></tr> <tr><td>Cruzle brass<td>15</tr>
<tr><td>&nbsp;<td></tr> </tbody>
<tr><td>&nbsp;<td></tr> </table>
<tr><td>&nbsp;<td></tr> </div>
<tr><td>&nbsp;<td></tr>
<tr><td>&nbsp;<td></tr>
<tr><td>&nbsp;<td></tr>
<tr><td>&nbsp;<td></tr>
<tr><td>&nbsp;<td></tr>
<tr><td>&nbsp;<td></tr>
</tbody>
</table>
<span class="label" >Encumbrance</span> <span class="label" >Encumbrance</span>
<div class="progress-container" id="EncumBar"> <div class="progress-container" id="EncumBar">
@@ -141,7 +131,7 @@
</div> </div>
<div class="vbox" flex="4"> <div class="vbox">
<span class="label head" >Plot Development</span> <span class="label head" >Plot Development</span>
<div class="scroll listbox"> <div class="scroll listbox">
@@ -156,26 +146,28 @@
</div> </div>
<span class="label head" >Quests</span> <span class="label head" >Quests</span>
<table class="listbox"> <div class="scroll listbox">
<tbody id="Quests"> <table>
<tr> <tbody id="Quests">
<td><input type=checkbox checked="true"> Kill all the Bads <tr>
</tr> <td><input type=checkbox checked="true"> Kill all the Bads
<tr><td> &#9745; Kill all the Bads</tr> </tr>
<tr><td> &#9746; Kill all the Bads</tr> <tr><td> &#9745; Kill all the Bads</tr>
<tr><td> &#9744; Kill all the Bads</tr> <tr><td> &#9746; Kill all the Bads</tr>
<tr><td> &#x2713; Kill all the Bads</tr> <tr><td> &#9744; Kill all the Bads</tr>
<tr><td> &#x2714; Kill all the Bads</tr> <tr><td> &#x2713; Kill all the Bads</tr>
<tr><td> <s>Kill all the Bads</s></tr> <tr><td> &#x2714; Kill all the Bads</tr>
<tr><td>&nbsp;</tr> <tr><td> <s>Kill all the Bads</s></tr>
<tr><td>&nbsp;</tr> <tr><td>&nbsp;</tr>
<tr><td>&nbsp;</tr> <tr><td>&nbsp;</tr>
<tr><td>&nbsp;</tr> <tr><td>&nbsp;</tr>
<tr><td>&nbsp;</tr> <tr><td>&nbsp;</tr>
<tr><td>&nbsp;</tr> <tr><td>&nbsp;</tr>
<tr><td>&nbsp;</tr> <tr><td>&nbsp;</tr>
</tbody> <tr><td>&nbsp;</tr>
</table> </tbody>
</table>
</div>
<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>
+32 -17
View File
@@ -525,12 +525,15 @@ function GoButtonClick() {
PlotBar.reset(26); PlotBar.reset(26);
Plots.Add('Prologue'); Plots.Add('Prologue');
Put(Inventory, "Gold", 0);
Put(Equips, "Hauberk", "-3 Burlap");
StartTimer(); StartTimer();
SaveGame(); SaveGame();
Brag('s'); Brag('s');
AddR(Spells, "Lasers", 3); //AddR(Spells, "Lasers", 3);
alert("DEBUG " + GetI(Stats, 3)); //alert("DEBUG " + GetI(Stats, 3));
} }
@@ -566,7 +569,7 @@ function Abs(x) {
} }
function WinEquip() { function WinEquip() {
var posn = Random(Equips.box.find("tr").length); var posn = Random(Equips.length());
game.bestequip = posn; // remember as the "best item" game.bestequip = posn; // remember as the "best item"
if (posn == 0) { if (posn == 0) {
stuff = K.Weapons; stuff = K.Weapons;
@@ -575,12 +578,9 @@ function WinEquip() {
} else { } else {
better = K.DefenseAttrib; better = K.DefenseAttrib;
worse = K.DefenseBad; worse = K.DefenseBad;
if (posn == 1) stuff = (posn == 1) ? K.Shields: K.Armors;
stuff = K.Shields
else
stuff = K.Armors;
} }
var name = LPick(stuff,GetI(Traits,'Level')); var name = LPick(stuff, GetI(Traits,'Level'));
var qual = StrToInt(Split(name,1)); var qual = StrToInt(Split(name,1));
name = Split(name,0); name = Split(name,0);
var plus = GetI(Traits,'Level') - qual; var plus = GetI(Traits,'Level') - qual;
@@ -762,7 +762,6 @@ function toArabic(s) {
} }
function CompleteAct() { function CompleteAct() {
PlotBar.reposition(0);
Plots.last().wrap("<s/>"); Plots.last().wrap("<s/>");
PlotBar.reset(60 * 60 * (1 + 5 * Plots.length())); // 1 hr + 5/act PlotBar.reset(60 * 60 * (1 + 5 * Plots.length())); // 1 hr + 5/act
PlotBar.Hint = 'Cutscene omitted'; PlotBar.Hint = 'Cutscene omitted';
@@ -1103,14 +1102,6 @@ $(function() {
LevelUp(); LevelUp();
}); });
cheat("$$$", function () {
WinEquip();
WinItem();
WinSpell();
WinStat();
Add(Inventory,'Gold',Random(100));
});
cheat("Quest", function () { cheat("Quest", function () {
QuestBar.reposition(QuestBar.Max); QuestBar.reposition(QuestBar.Max);
TaskBar.reposition(TaskBar.Max); TaskBar.reposition(TaskBar.Max);
@@ -1130,6 +1121,30 @@ $(function() {
} }
}); });
cheat("Equip", function () {
WinEquip();
});
cheat("Item", function () {
WinItem();
});
cheat("Spell", function () {
WinSpell();
});
cheat("Stat", function () {
WinStat();
});
cheat("$$$", function () {
Add(Inventory,'Gold',Random(100));
});
cheat("ad hoc", function () {
Put(Equips, "Vambraces", "Holy shittles");
});
}); });
/*$ENDIF*/ /*$ENDIF*/
+5 -2
View File
@@ -101,6 +101,7 @@ fieldset table td {
.head { .head {
font-weight: bold; font-weight: bold;
font-size: 9pt; font-size: 9pt;
margin: 2px 0 2px 0;
} }
div.progress-container { div.progress-container {
@@ -131,7 +132,7 @@ div.progress-container > div.bar {
.window { .window {
background-color: #eee; background-color: #eee;
width: 800px; width: 820px;
border: outset 2px silver; border: outset 2px silver;
padding: 2px; padding: 2px;
margin: 1em; margin: 1em;
@@ -142,9 +143,10 @@ div.progress-container > div.bar {
} }
div.scroll { div.scroll {
overflow: auto; overflow: scroll;
height: 100px; height: 100px;
width: 250px; width: 250px;
overflow-x: hidden;
} }
div.scroll > table { div.scroll > table {
@@ -154,3 +156,4 @@ div.scroll > table {
.selected { .selected {
background-color: yellow; background-color: yellow;
} }