Fixed the Encumberance bar

This commit is contained in:
Eric Fredricksen committed 2010-06-26 13:40:07 -07:00
1 parent 353adaf11e
commit a848e97d2c
1 file changed
+18 -8
+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");