Fixed the Encumberance bar

This commit is contained in:
Eric Fredricksen
2010-06-26 13:40:07 -07:00
parent 353adaf11e
commit a848e97d2c
2 changed files with 20 additions and 10 deletions
+2 -2
View File
@@ -121,7 +121,7 @@
</table> </table>
</div> </div>
<span class="label" >Encumbrance</span> <span class="label">Encumbrance</span>
<div class="progress-container" id="EncumBar"> <div class="progress-container" id="EncumBar">
<div class="bar" style="width: 50%"></div> <div class="bar" style="width: 50%"></div>
</div> </div>
@@ -130,7 +130,7 @@
<div class="vbox"> <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">
<table> <table>
<tbody id="Plots"> <tbody id="Plots">
+18 -8
View File
@@ -196,7 +196,7 @@ function InterplotCinematic() {
function StrToInt(s) { function StrToInt(s) {
return s.valueOf(); return parseInt(s);
} }
function IntToStr(i) { function IntToStr(i) {
@@ -520,12 +520,18 @@ function GoButtonClick() {
Q("task|6|Much is revealed about that wise old bastard you'd underestimated"); Q("task|6|Much is revealed about that wise old bastard you'd underestimated");
Q('task|6|A shocking series of events leaves you alone and bewildered, but resolute'); Q('task|6|A shocking series of events leaves you alone and bewildered, but resolute');
Q('task|4|Drawing upon an unexpected reserve of determination, you set out on a long and dangerous journey'); Q('task|4|Drawing upon an unexpected reserve of determination, you set out on a long and dangerous journey');
Q('task|2|Loading'); Q('plot|2|Loading');
PlotBar.reset(26); PlotBar.reset(26);
Plots.Add('Prologue'); Plots.Add('Prologue');
QuestBar.reset(1);
EncumBar.reset(GetI(Stats, "STR") + 10);
Put(Inventory, "Gold", 0); Put(Inventory, "Gold", 0);
Put(Inventory, "Moon Mead", 2);
Put(Equips, "Hauberk", "-3 Burlap"); Put(Equips, "Hauberk", "-3 Burlap");
StartTimer(); StartTimer();
@@ -894,8 +900,10 @@ function Min(a,b) {
function Sum(list) { function Sum(list) {
var result = 0; var result = 0;
for (var i = 0; i <= list.length - 1; ++i) list.rows().each(function (index) {
Result += GetI(list,i); result += StrToInt($(this).children().last().text());
});
return result;
} }
Number.prototype.div = function (divisor) { Number.prototype.div = function (divisor) {
@@ -941,13 +949,13 @@ function Pos(haystack, needle) {
} }
function Timer1Timer() { function Timer1Timer() {
var gain = Pos('kill|',game.task) == 1;
if (TaskBar.done()) { if (TaskBar.done()) {
ClearAllSelections(); ClearAllSelections();
if (Kill.text() == 'Loading....') TaskBar.Max = 0; if (Kill.text() == 'Loading....') TaskBar.Max = 0;
// gain XP / level up // gain XP / level up
var gain = Pos('kill|',game.task) == 1;
if (gain) { if (gain) {
if (ExpBar.done()) if (ExpBar.done())
LevelUp(); LevelUp();
@@ -970,8 +978,10 @@ function Timer1Timer() {
// advance plot // advance plot
if (gain) { if (gain) {
if (PlotBar.done()) InterplotCinematic(); if (PlotBar.done())
else PlotBar.increment(TaskBar.Max / 1000); InterplotCinematic();
else
PlotBar.increment(TaskBar.Max / 1000);
PlotBar.Hint = RoughTime(PlotBar.Max-PlotBar.Position) + ' remaining'; PlotBar.Hint = RoughTime(PlotBar.Max-PlotBar.Position) + ' remaining';
} }
@@ -991,7 +1001,7 @@ function FormCreate() {
PlotBar = new ProgressBar("PlotBar"); PlotBar = new ProgressBar("PlotBar");
TaskBar = new ProgressBar("TaskBar"); TaskBar = new ProgressBar("TaskBar");
QuestBar = new ProgressBar("QuestBar"); QuestBar = new ProgressBar("QuestBar");
EncumBar = new ProgressBar("QuestBar"); EncumBar = new ProgressBar("EncumBar");
Traits = new ListBox("Traits"); Traits = new ListBox("Traits");
Stats = new ListBox("Stats"); Stats = new ListBox("Stats");