diff --git a/apps/client/src/app/core/database/services/energy.service.ts b/apps/client/src/app/core/database/services/energy.service.ts index e2d726b..0847716 100644 --- a/apps/client/src/app/core/database/services/energy.service.ts +++ b/apps/client/src/app/core/database/services/energy.service.ts @@ -86,11 +86,12 @@ export class EnergyService extends FirestoreStorage { } public getEnergyUpdate(reset: number, completionEntry: CompletionEntry, energy: Energy, task: LostarkTask, entry: { amount: number }): { amount: number } { + const energyPerEntry = task.label === 'Chaos Dungeon' ? 20 : 10 const daysWithoutDoingTheTask = Math.ceil((reset - completionEntry.updated) / 86400000); const daysWithoutEnergyUpdate = Math.ceil((reset - energy.updated) / 86400000); const firstTaskUpdateSinceLastDone = daysWithoutDoingTheTask === daysWithoutEnergyUpdate; - const baseBonus = firstTaskUpdateSinceLastDone ? (task.amount - completionEntry.amount) * 10 : 0; - const timeBonus = (daysWithoutEnergyUpdate - (firstTaskUpdateSinceLastDone ? 1 : 0)) * task.amount * 10; + const baseBonus = firstTaskUpdateSinceLastDone ? (task.amount - completionEntry.amount) * energyPerEntry : 0; + const timeBonus = (daysWithoutEnergyUpdate - (firstTaskUpdateSinceLastDone ? 1 : 0)) * task.amount * energyPerEntry; entry.amount = Math.min(entry.amount + timeBonus + baseBonus, task.label === 'Chaos Dungeon' ? 200 : 100); return entry; } diff --git a/apps/client/src/app/core/tasks.ts b/apps/client/src/app/core/tasks.ts index 419dd2f..24b9b4c 100644 --- a/apps/client/src/app/core/tasks.ts +++ b/apps/client/src/app/core/tasks.ts @@ -4,7 +4,7 @@ import { TaskScope } from "../model/task-scope"; export const tasks = [ // Daily character - createTask("Chaos Dungeon", 302, TaskFrequency.DAILY, TaskScope.CHARACTER, 2, 9999, "chaos-dungeon.webp", { + createTask("Chaos Dungeon", 302, TaskFrequency.DAILY, TaskScope.CHARACTER, 1, 9999, "chaos-dungeon.webp", { partySize: 4 }), createTask("Guardian", 302, TaskFrequency.DAILY, TaskScope.CHARACTER, 1, 9999, "guardian.png", { diff --git a/apps/client/src/app/model/lostark-task.ts b/apps/client/src/app/model/lostark-task.ts index 933805e..1311c36 100644 --- a/apps/client/src/app/model/lostark-task.ts +++ b/apps/client/src/app/model/lostark-task.ts @@ -2,7 +2,7 @@ import { TaskFrequency } from "./task-frequency"; import { TaskScope } from "./task-scope"; import { DataModel } from "../core/database/data-model"; -export const TASKS_VERSION = 53; +export const TASKS_VERSION = 54; export interface LostarkTask extends DataModel { authorId?: string; diff --git a/apps/client/src/app/pages/checklist/checklist/checklist.component.html b/apps/client/src/app/pages/checklist/checklist/checklist.component.html index 18548f7..112545c 100644 --- a/apps/client/src/app/pages/checklist/checklist/checklist.component.html +++ b/apps/client/src/app/pages/checklist/checklist/checklist.component.html @@ -181,9 +181,7 @@ nzType="primary" [disabled]="col >= row.task.amount" (click)="markAsDone(completion, energy, roster[i], row.task, roster, true, display.dailyReset, display.weeklyReset, display.biWeeklyReset, $event)"> - {{roster[i].ilvl >= 1640 && row.chaosDungeon ? col/2 : col}} - / - {{roster[i].ilvl >= 1640 && row.chaosDungeon ? 1 : row.task.amount}} + {{col}} / {{row.task.amount}}
@@ -193,30 +191,20 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/apps/client/src/app/pages/checklist/checklist/checklist.component.ts b/apps/client/src/app/pages/checklist/checklist/checklist.component.ts index 8072d68..a083be7 100644 --- a/apps/client/src/app/pages/checklist/checklist/checklist.component.ts +++ b/apps/client/src/app/pages/checklist/checklist/checklist.component.ts @@ -305,20 +305,18 @@ export class ChecklistComponent { if (existingEntry?.updated < reset) { existingEntry.amount = 0; } - let newCompletionAmount = setAllDone ? task.amount : (existingEntry?.amount || 0) + 1 - if (task.label === 'Chaos Dungeon' && character.ilvl >= 1640) { - newCompletionAmount = 2 - } + setCompletionEntry(completion.data, character, task, { ...(existingEntry || {}), - amount: newCompletionAmount, + amount: setAllDone ? task.amount : (existingEntry?.amount || 0) + 1, updated: Date.now() }); + if (task.scope === TaskScope.CHARACTER && task.frequency === TaskFrequency.DAILY && ['Chaos', 'Guardian', 'Una'].some(n => task.label?.startsWith(n))) { const energyEntry = getCompletionEntry(energy.data, character, task) || { amount: 0 }; - if (task.label === 'Chaos Dungeon' && character.ilvl >= 1640) { + if (task.label === 'Chaos Dungeon') { if (energyEntry.amount >= 40) { energyEntry.amount = Math.max(energyEntry.amount - (20 * (setAllDone ? task.amount : 2)), 0); this.energyService.updateOne(energy.$key, {