mirror of
https://bitbucket.org/grumdrig/pq-web.git
synced 2026-09-29 00:34:00 -06:00
Dont use UI in WinStat
This commit is contained in:
@@ -601,21 +601,21 @@ function Square(x) { return x * x; }
|
|||||||
function WinStat() {
|
function WinStat() {
|
||||||
var i;
|
var i;
|
||||||
if (Odds(1,2)) {
|
if (Odds(1,2)) {
|
||||||
i = Stats.rows().eq(Random(Stats.length()));
|
i = Pick(K.Stats);
|
||||||
} else {
|
} else {
|
||||||
// Favor the best stat so it will tend to clump
|
// Favor the best stat so it will tend to clump
|
||||||
var t = 0;
|
var t = 0;
|
||||||
Stats.rows().each(function (index,elt) {
|
$.each(K.Stats, function (index, key) {
|
||||||
t += Square(StrToInt(Value(this)));
|
t += Square(GetI(Stats, key));
|
||||||
});
|
});
|
||||||
t = Random(t);
|
t = Random(t);
|
||||||
Stats.rows().each(function (index,elt) {
|
$.each(K.Stats, function (index, key) {
|
||||||
i = this;
|
i = key;
|
||||||
t -= Square(StrToInt(Value(this)));
|
t -= Square(GetI(Stats, key));
|
||||||
return t < 0;
|
if (t < 0) return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Add(Stats, Key(i), 1);
|
Add(Stats, i, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function SpecialItem() {
|
function SpecialItem() {
|
||||||
|
|||||||
Reference in New Issue
Block a user