add amount and max counting for extended completion
This commit is contained in:
parent
82a47fe2f7
commit
c9d1bab31f
3 changed files with 49 additions and 1 deletions
21
build/app.js
21
build/app.js
|
|
@ -413,6 +413,8 @@ function CheckExtendedCompletion(db) {
|
|||
var entries = {};
|
||||
var gameCompletionExtended = db.sections.intro.entries.gameCompletionExtended;
|
||||
var intro = db.sections.intro;
|
||||
var amount = 0;
|
||||
var max = 0;
|
||||
|
||||
for (var section in sections) {
|
||||
entries = sections[section].entries;
|
||||
|
|
@ -454,6 +456,25 @@ function CheckExtendedCompletion(db) {
|
|||
|
||||
if (entries[entry].hasOwnProperty("disabled") && entries[entry].disabled === true) {
|
||||
intro.extendedCompletionTotal--;
|
||||
} else if (entries[entry].hasOwnProperty("amount") && entries[entry].hasOwnProperty("max")) {
|
||||
/* Skip counting 3000 Fountain Geo, too much */
|
||||
if (entry === "fountainGeo") {
|
||||
break;
|
||||
}
|
||||
|
||||
amount = entries[entry].amount;
|
||||
max = entries[entry].max;
|
||||
/* Prevent overflowing the counter */
|
||||
|
||||
if (amount > max) {
|
||||
amount = max;
|
||||
}
|
||||
|
||||
intro.extendedCompletionDone += amount;
|
||||
intro.extendedCompletionTotal += max;
|
||||
console.info("Adding amount/max: ".concat(amount, "/").concat(max), entries[entry].name);
|
||||
amount = 0;
|
||||
max = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -490,6 +490,9 @@ function CheckExtendedCompletion(db) {
|
|||
let gameCompletionExtended = db.sections.intro.entries.gameCompletionExtended;
|
||||
let intro = db.sections.intro;
|
||||
|
||||
let amount = 0;
|
||||
let max = 0;
|
||||
|
||||
for (let section in sections) {
|
||||
|
||||
entries = sections[section].entries;
|
||||
|
|
@ -537,8 +540,32 @@ function CheckExtendedCompletion(db) {
|
|||
}
|
||||
|
||||
if (entries[entry].hasOwnProperty("disabled") && entries[entry].disabled === true) {
|
||||
|
||||
intro.extendedCompletionTotal--;
|
||||
}
|
||||
else if (entries[entry].hasOwnProperty("amount") && entries[entry].hasOwnProperty("max")) {
|
||||
|
||||
/* Skip counting 3000 Fountain Geo, too much */
|
||||
if (entry === "fountainGeo") {
|
||||
break;
|
||||
}
|
||||
|
||||
amount = entries[entry].amount;
|
||||
max = entries[entry].max;
|
||||
|
||||
/* Prevent overflowing the counter */
|
||||
if (amount > max) {
|
||||
amount = max;
|
||||
}
|
||||
|
||||
intro.extendedCompletionDone += amount;
|
||||
intro.extendedCompletionTotal += max;
|
||||
|
||||
console.info(`Adding amount/max: ${amount}/${max}`, entries[entry].name);
|
||||
|
||||
amount = 0;
|
||||
max = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue