Skip to content

Commit

Permalink
Merge pull request #1 from dsiekiera/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
troll31 committed Jan 20, 2020
2 parents c0c379b + d12082f commit 7480717
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 24 deletions.
13 changes: 4 additions & 9 deletions js/web/_main/js/_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -996,15 +996,10 @@ const FoEproxy = (function () {
});

// --------------------------------------------------------------------------------------------------
// HiddenReward

FoEproxy.addHandler('HiddenRewardService','getOverview', (data, postData) => {
// console.log("AKTUELLE ZEIT: "+ CurrentTime)
// data.responseData.hiddenRewards.forEach(rewards => {
// if(rewards.startTime < CurrentTime < rewards.expireTime){
// console.log("ES GIBT EIN "+rewards.rarity+" REWARD IN DER STADT: "+rewards.position.context + " --- ZEIT: " + rewards.startTime + " - "+ rewards.expireTime);
// }
// });
// Quests

FoEproxy.addHandler('QuestService', 'getUpdates', (data, PostData) => {
MainParser.Quests = data.responseData;
});

})();
Expand Down
41 changes: 27 additions & 14 deletions js/web/calculator/js/calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,20 +270,7 @@ let Calculator = {

h.push('<div class="text-center" style="margin-top:5px;margin-bottom:5px;"><em>' + i18n['Boxes']['Calculator']['Up2LevelUp'] + ': <span id="up-to-level-up" style="color:#FFB539">' + HTML.Format(rest) + '</span> ' + i18n['Boxes']['Calculator']['FP'] + '</em></div>');

// Schleifenquest für "Benutze FP" suchen
for (let i in EventQuest.Quests) {
let Quest = EventQuest.Quests[i];

if (Quest.questGiver.id === 'scientist' && Quest.type === 'generic' && Quest.abortable === true) {
for (let j in Quest.successConditions) {
let CurrentProgress = Quest.successConditions[j].currentProgress !== undefined ? Quest.successConditions[j].currentProgress : 0;
let MaxProgress = Quest.successConditions[j].maxProgress;
if (CurrentEraID <= 3 || MaxProgress > 20) { // Unterscheidung Buyquests von UseQuests: Bronze/Eiszeit haben nur UseQuests, Rest hat Anzahl immer >15, Buyquests immer <=15
h.push('<div class="text-center" style="margin-top:5px;margin-bottom:5px;"><em>' + i18n['Boxes']['Calculator']['ActiveRecurringQuest'] + ': <span id="up-to-level-up" style="color:#FFB539">' + (MaxProgress - CurrentProgress !== 0 ? HTML.Format(MaxProgress - CurrentProgress) : i18n['Boxes']['Calculator']['Done']) + '</span> ' + i18n['Boxes']['Calculator']['FP'] + '</em></div>');
}
}
}
}
h.push(Calculator.GetRecurringQuestsLine());

// in die bereits vorhandene Box drücken
$('#costCalculator').find('#costCalculatorBody').html(h.join(''));
Expand Down Expand Up @@ -331,6 +318,32 @@ let Calculator = {
});
}
},


/**
* Zeile für Schleifenquests generieren
* *
* */
GetRecurringQuestsLine: () => {
let h = [];

// Schleifenquest für "Benutze FP" suchen
for (let i in MainParser.Quests) {
let Quest = MainParser.Quests[i];

if (Quest.questGiver.id === 'scientist' && Quest.type === 'generic' && Quest.abortable === true) {
for (let j in Quest.successConditions) {
let CurrentProgress = Quest.successConditions[j].currentProgress !== undefined ? Quest.successConditions[j].currentProgress : 0;
let MaxProgress = Quest.successConditions[j].maxProgress;
if (CurrentEraID <= 3 || MaxProgress > 20) { // Unterscheidung Buyquests von UseQuests: Bronze/Eiszeit haben nur UseQuests, Rest hat Anzahl immer >15, Buyquests immer <=15
h.push('<div class="text-center" style="margin-top:5px;margin-bottom:5px;"><em>' + i18n['Boxes']['Calculator']['ActiveRecurringQuest'] + ': <span id="recurringquests" style="color:#FFB539">' + (MaxProgress - CurrentProgress !== 0 ? HTML.Format(MaxProgress - CurrentProgress) : i18n['Boxes']['Calculator']['Done']) + '</span> ' + i18n['Boxes']['Calculator']['FP'] + '</em></div>');
}
}
}
}

return h.join();
},


/**
Expand Down
2 changes: 1 addition & 1 deletion js/web/citymap/js/citymap.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ let CityMap = {
let MinX = 0,
MinY = 0,
MaxX = 63,
MaxY = 59;
MaxY = 63;

for(let b in MapDataSorted)
{
Expand Down
2 changes: 2 additions & 0 deletions js/web/part-calc/js/part-calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,8 @@ let Parts = {
h.push('<div class="text-center" style="margin-top:5px;margin-bottom:5px;"><em>' + i18n['Boxes']['Calculator']['Up2LevelUp'] + ': <span id="up-to-level-up" style="color:#FFB539">' + HTML.Format(rest) + '</span> ' + i18n['Boxes']['Calculator']['FP'] + '</em></div>');
}

h.push(Calculator.GetRecurringQuestsLine());

$('#OwnPartBoxBody').html( h.join('') );
},

Expand Down

0 comments on commit 7480717

Please sign in to comment.