Skip to content

Commit

Permalink
Fix lost sectors and cleanup home page
Browse files Browse the repository at this point in the history
  • Loading branch information
dcaslin committed Jun 30, 2024
1 parent 17d852b commit 56fc0de
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 30 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "d2-checklist",
"version": "24.3.0",
"version": "24.3.1",
"manifest": "226342.24.06.19.1730-2-bnet.56014",
"license": "MIT",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions src/app/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
</button>
</div>
</div>
<div class="warn-text simple-caption">These will be wrong until the new rotation is learned. This message will be removed once they're complete and correct.</div>
<!-- <div class="warn-text simple-caption">These will be wrong until the new rotation is learned. This message will be removed once they're complete and correct.</div> -->
</mat-card-title>
</mat-card-header>
<mat-card-content>
Expand Down Expand Up @@ -147,7 +147,8 @@
<span class="tiny" *ngIf="debugmode|async"> {{n.hash}}</span>
</div>
<div mat-line>
{{n.ll}} <span class="left simple-caption-darker-no-margin">{{n.modifiers.length}} modifiers</span>
<!-- {{n.ll}} -->
<span class="left simple-caption-darker-no-margin">{{n.modifiers.length}} modifiers</span>
</div>
</mat-list-item>
</mat-list>
Expand Down
130 changes: 116 additions & 14 deletions src/app/service/lost-sector-reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -815,23 +815,125 @@ const LS_GILDED_PRECEPT: LostSectorMeta = {
}


export const LS_LOOT = [
'Chest',
'Head',
'Legs',
'Arms',
];
const LS_BROKEN_DEEP: LostSectorMeta = {
abbrev: 'Broken',
directorLocation: 'Pale Heart',
legend: {
hash: '2875391872',
shields: ['?(?)', '?(?)'],
champions: [
{
name: '???',
count: 1
},
{
name: '???',
count: 2
}
]
},
master: {
hash: '2875391879',
shields: ['?(?)', '?(?)'],
champions: [
{
name: '???',
count: 3
},
{
name: '???',
count: 2
}
]
}
}


const LS_BLOOMING_DEEP: LostSectorMeta = {
abbrev: 'Blooming',
directorLocation: 'Pale Heart',
legend: {
hash: '3995113176',
shields: ['?(?)', '?(?)'],
champions: [
{
name: '???',
count: 1
},
{
name: '???',
count: 2
}
]
},
master: {
hash: '3995113183',
shields: ['?(?)', '?(?)'],
champions: [
{
name: '???',
count: 3
},
{
name: '???',
count: 2
}
]
}
}


const LS_FORGOTTEN_DEEP: LostSectorMeta = {
abbrev: 'Forgotten',
directorLocation: 'Pale Heart',
legend: {
hash: '699527776',
shields: ['?(?)', '?(?)'],
champions: [
{
name: '???',
count: 1
},
{
name: '???',
count: 2
}
]
},
master: {
hash: '3995113183',
shields: ['?(?)', '?(?)'],
champions: [
{
name: '???',
count: 3
},
{
name: '???',
count: 2
}
]
}
}


// export const LS_LOOT = [
// 'Chest',
// 'Head',
// 'Legs',
// 'Arms',
// ];

export const LS_ROTATION = [
LS_APHELIONS_REST,
LS_BAY_OF_DROWNED_WISHES,
LS_CHAMBER_OF_STARLIGHT,
LS_THRILLADROME,
LS_HYDROPONICS,
LS_VELES_LABYRINTH,
LS_EXODUS_GARDEN,
LS_BROKEN_DEEP,
LS_BLOOMING_DEEP,
LS_FORGOTTEN_DEEP,
LS_PERDITION,
LS_BUNKER_E15,
LS_CONCEALED_VOID,
LS_THRILLADROME,
LS_GILDED_PRECEPT,
LS_SCAVENGERS_DEN,
LS_SKYDOCK,
LS_QUARRY,
LS_CONFLUX,
];
2 changes: 1 addition & 1 deletion src/app/service/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1748,7 +1748,7 @@ export interface LostSector {
activity: LegendLostSectorActivity;
directorLocation: string;
icon: string;
soloReward: string;
// soloReward: string;
}

export interface LostSectorMeta {
Expand Down
12 changes: 6 additions & 6 deletions src/app/service/week.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { add, differenceInDays, differenceInHours, differenceInWeeks, parseISO, subHours } from 'date-fns';
import { BungieService } from './bungie.service';
import { DestinyCacheService } from './destiny-cache.service';
import { LS_LOOT, LS_ROTATION } from './lost-sector-reference';
import { LS_ROTATION } from './lost-sector-reference';
import { ItemDisplay, LegendLostSectorActivity, LostSector, LostSectorInstance, NameDesc, PublicMilestonesAndActivities } from './model';
import { ParseService } from './parse.service';

Expand Down Expand Up @@ -198,12 +198,12 @@ export class WeekService {
}
// set our reference time to 5PM UTC arbitrarily so we're consistent
referenceDate.setUTCHours(magicHour);
const lsEpoch = parseISO('2023-11-28T17:00:00.000Z'); // 2021-08-24 is our current reference date
const lsEpoch = parseISO('2024-06-19T17:00:00.000Z');
// diff in hours ignores DST
const lsDays = Math.floor(differenceInHours(referenceDate, lsEpoch) / 24);
const lsIndex = lsDays % LS_ROTATION.length;
const lsLootIndex = lsDays % LS_LOOT.length;
const loot = LS_LOOT[lsLootIndex];
// const lsLootIndex = lsDays % LS_LOOT.length;
// const loot = LS_LOOT[lsLootIndex];
// TODO #UPDATEME
const legendActivity = await this.buildLostSectorActivity(LS_ROTATION[lsIndex].legend, 1830);
const masterActivity = await this.buildLostSectorActivity(LS_ROTATION[lsIndex].master, 1840);
Expand All @@ -215,13 +215,13 @@ export class WeekService {
icon: recordDescForIcon.displayProperties.icon,
directorLocation: LS_ROTATION[lsIndex].directorLocation,
activity: legendActivity,
soloReward: loot
// soloReward: loot
},
masterLostSector: {
icon: recordDescForIcon.displayProperties.icon,
directorLocation: LS_ROTATION[lsIndex].directorLocation,
activity: masterActivity,
soloReward: loot
// soloReward: loot
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
<div mat-line class="ls-line">
{{n.ll}} PL - {{n.modifiers?.length}}<fa-icon [icon]="iconService.fasBurn" class="fa-icon"></fa-icon>
</div>
<div mat-line class="ls-line">
<!-- <div mat-line class="ls-line">
Exotic {{ls.soloReward}}
</div>
</div> -->
<div mat-line class="ls-details">
<div *ngFor="let s of n.info.shields">{{s}}</div>
<div *ngFor="let c of n.info.champions">{{c.name}} x {{c.count}}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
<ng-container *ngIf="activeLink=='Legendary LS'; else masterLostSectors">

<td>{{ls.legendaryLostSector.activity.name}}</td>
<td>{{ls.legendaryLostSector.soloReward}}
</td>
<!-- <td>{{ls.legendaryLostSector.soloReward}}</td> -->

</ng-container>
<ng-template #masterLostSectors>
<td>{{ls.masterLostSector.activity.name}}</td>
<td>{{ls.masterLostSector.soloReward}}
</td>
<!-- <td>{{ls.masterLostSector.soloReward}} </td>-->

</ng-template>
</tr>
</tbody>
Expand Down

0 comments on commit 56fc0de

Please sign in to comment.