From d71fb597daff63747003e35587e55153fcb61448 Mon Sep 17 00:00:00 2001 From: Eric Fredricksen Date: Sun, 4 Jul 2010 00:10:03 -0700 Subject: [PATCH] Logo and get best stats showing on roster --- logo.png | Bin 0 -> 1346 bytes main.html | 3 +++ main.js | 51 ++++++++++++++++++++++++++++++++++++--------------- newguy.html | 3 +++ roster.html | 12 ++++++++++-- roster.js | 29 +++++++++-------------------- 6 files changed, 61 insertions(+), 37 deletions(-) create mode 100644 logo.png diff --git a/logo.png b/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..03c03e4a2352197b5a0794fc77d1f01db0adcfef GIT binary patch literal 1346 zcmV-I1-<%-P)HSY=%NPRjs)(l2l~+o`pXIV#t8e^3i`|m`_c*YxCi{*3iiAR?5PIu zum|_P28DU%{2o6S+M{B0ODz_qyPW_Aaqhr zQ~&?}|NsC0|NsC0|NsC0|NsC0|NsC0|NsC0|NsC009;%f?EnA-JV``BRCwC#nvHtu zAPk1}pj)f0PMyD7ll#BRqnlbFUx2E$+d1WVHd`zWyd)t62i%v$GH~uDd($J)QBCWc z*`JS5eYfoCc&PFsKYi|)x1W;(Pr4gk#2o5Ieu<4p6<+K%e(C4+Gjl)glfGi%A%OgOY=4} z`ywB$P2Q7%sAk4|ZcLV$)pmavt(ME9F>ZS_2vt5UM|rXPGakR0i7{r+Y+idb2vu2b zO}<~fzYN!#*~g(Mx&%ekr26sFDXdlN@o+I7j=w4vi}#mP>4?);Nvv*3IwfsvIxd%9 zy1k{#ecQ0E;{E!chRU8#3yL$%^c3ly7y_uOP6%1b4}1o-j7kw7L{(K)ciJSJ1lje> zZL*4qAsiGpSU!B%T|fs=D`8kV)&P!eYorRehK65GX0$q2%V?x_p}1>sm*i zf<>bqG}}Qh=fA8LkG-acs*>hdn}8PZM8>Z)M==Z$_8hoclJZzt&nuGRUemhvP*uLr zx~cwZY4@N@eg`6`5~?LA7na>ZkxsFRvTJ|=+9K-*eZi6UMw@dwlQ^o%E>Ll9lkU_E zJYnwi)K8KxHTvkD+gb5-sHB%8+oh4P!0*Qq*N6DSZ z5(;QHC)nBZcMQXWIH^jmO$29@L(+Bs;Y916uc~~Dccig5Y@ukRH;3-a`WAZTsPUbz zxZ*G>G#IOsAgid-q_ezkY=BJ6H)@sJ9Bd>c9&xRD_9S1$J}MNYNJYBQSHU+o zKotu<&;Ole;i3R^FDeCvBc9k2|D#dGtgdBL(9nMhD$=${ir-5>#S)cf(?rRrxNB50 zR*r4nlH7UC|$*I5yz=4Ha^7jCo%Vbz<=}d(g+Qr3R?F<*P9&U?+>rqFNCmPmO{KdN4^c(4!k`v7c)dAk>5dx= zP>XWpt|*$l)mAVZSE0iQ+)p$pxaPs;)S#9Vvg$Cst{l9k&OSbdu#<@m4`%&})SqHB z`^8Jrsg^{gzBgTr2tnbI#~nwIog5`TY6Q4E9u@s3sQ6c-;vQ8KRQ!8TbxG=JsQ7WH zm^)+jEL6W7RJ*^Xdn~F>F|}O=Ptx9h3{_u(<*xt(0FF`?n7;?8GXMYp07*qoM6N<$ Ef=pwRc>n+a literal 0 HcmV?d00001 diff --git a/main.html b/main.html index da0efe6..196eaea 100644 --- a/main.html +++ b/main.html @@ -5,6 +5,9 @@ + +Progress Quest +
diff --git a/main.js b/main.js index 267ff14..91e63e6 100644 --- a/main.js +++ b/main.js @@ -12,16 +12,16 @@ var RevString = '&rev=6'; var game = {}; // queue: [] }; - +var lasttick, timerid; function timeGetTime() { return new Date().getTime(); } function StartTimer() { - if (!game.timerid) { - game.lasttick = timeGetTime(); - game.timerid = setInterval(Timer1Timer, 100); + if (!timerid) { + lasttick = timeGetTime(); + timerid = setInterval(Timer1Timer, 100); } // BS location for this, but... // MainForm.Caption = 'ProgressQuest - ' + ChangeFileExt(ExtractFileName(MainForm.GameSaveName()), ''); @@ -449,6 +449,7 @@ function ListBox(id, columns, fixedkeys) { var tr = $("" + caption + ""); tr.appendTo(this.box); tr.each(function () {this.scrollIntoView();}); + game[this.id].last = caption; return tr; }; @@ -492,14 +493,16 @@ function ListBox(id, columns, fixedkeys) { }; this.save = function (game) { - var dict = {html: this.box.html()}; + if (!game[this.id]) + game[this.id] = {}; + var dict = game[this.id]; + dict.html = this.box.html(); if (this.columns == 2) { this.rows().each(function (index) { dict[$(this).children().first().text()] = $(this).children().last().text(); }); } - game[this.id] = dict; }; this.load = function (game) { @@ -565,6 +568,16 @@ $(document).ready(FormCreate); function WinSpell() { AddR(Spells, K.Spells[RandomLow(Min(GetI(Stats,'WIS')+GetI(Traits,'Level'), K.Spells.length))], 1); + + // Now figure out which spell is best + // TODO: really only need to check the one we just ++'d + var flat = 1; // Flattening constant + var best = 0; + for (var i = 1; i < Spells.length(); ++i) + if ((i+flat) * toArabic(Get(Spells,i)) > + (best+flat) * toArabic(Get(Spells,best))) + best = i; + game.Spells.best = Spells.label(best) + ' ' + Get(Spells, best); } function LPick(list, goal) { @@ -585,7 +598,7 @@ function Abs(x) { function WinEquip() { var posn = Random(Equips.length()); - game.bestequip = posn; // remember as the "best item" + if (!posn) { stuff = K.Weapons; better = K.OffenseAttrib; @@ -615,6 +628,8 @@ function WinEquip() { if (plus > 0) name = '+' + name; Put(Equips, posn, name); + game.Equips.best = name; + if (posn > 1) game.Equips.best += ' ' + Equips.label(posn); } @@ -638,6 +653,13 @@ function WinStat() { }); } Add(Stats, $(i).find("td").first().text(), 1); + + var best = 0; + for (var i = 1; i <= 5; ++i) { + if (GetI(Stats,i) > GetI(Stats,best)) + best = i; + } + game.Stats.best = Stats.label(best) + ' ' + GetI(Stats, best); } function SpecialItem() { @@ -993,12 +1015,12 @@ function Timer1Timer() { Dequeue(); } else { - var elapsed = timeGetTime() - game.lasttick; + var elapsed = timeGetTime() - lasttick; if (elapsed > 100) elapsed = 100; if (elapsed < 0) elapsed = 0; TaskBar.increment(elapsed); } - game.lasttick = timeGetTime(); + lasttick = timeGetTime(); } function FormCreate() { @@ -1065,7 +1087,7 @@ function LoadCharacter() { function FormShow() { - if (game.timerid) return; + if (timerid) return; var done = false; var exportandexit = false; @@ -1125,9 +1147,9 @@ $(function() { }); cheat("Pause", function () { - if (game.timerid) { - clearTimeout(game.timerid); - game.timerid = null; + if (timerid) { + clearTimeout(timerid); + timerid = null; } else { StartTimer(); } @@ -1245,8 +1267,7 @@ function Brag(trigger) { with (Traits) for (i = 0; i <= Items.length()-1; ++i) url = url + '&' + LowerCase(Items[i].Caption[1]) + '=' + UrlEncode(Items[i].Subitems[0]); url = url + '&x=' + IntToStr(ExpBar.Position); - url = url + '&i=' + UrlEncode(Get(Equips, game.bestequip)); - if (game.bestequip > 1) url = url + '+' + Equips[game.bestequip].Caption; + url = url + '&i=' + UrlEncode(game.Equips.best); var best = 0; if (Spells.length() > 0) with (Spells) { for (i = 1; i <= Items.length()-1; ++i) diff --git a/newguy.html b/newguy.html index 289e843..95fd812 100644 --- a/newguy.html +++ b/newguy.html @@ -12,6 +12,9 @@ input, button { display: inline; } + +Progress Quest +
diff --git a/roster.html b/roster.html index 8c5499e..26dd482 100644 --- a/roster.html +++ b/roster.html @@ -16,13 +16,20 @@ div.rc { font: 8pt Verdana } -div.best { +div.bs { font: 7pt Verdana } + +td.brag button { + color: red; +} + +Progress Quest +
Here it goes
@@ -37,7 +44,8 @@ Here it goes