handle CollectibleScans in missionInventoryUpdate
All checks were successful
Build / build (18) (push) Successful in 50s
Build / build (20) (push) Successful in 50s
Build / build (18) (pull_request) Successful in 46s
Build / build (22) (push) Successful in 54s
Build / build (20) (pull_request) Successful in 51s
Build / build (22) (pull_request) Successful in 41s
All checks were successful
Build / build (18) (push) Successful in 50s
Build / build (20) (push) Successful in 50s
Build / build (18) (pull_request) Successful in 46s
Build / build (22) (push) Successful in 54s
Build / build (20) (pull_request) Successful in 51s
Build / build (22) (pull_request) Successful in 41s
This commit is contained in:
parent
1fdaf5696a
commit
6b7b8a69d8
@ -34,6 +34,10 @@ import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryType
|
|||||||
import { handleStoreItemAcquisition } from "./purchaseService";
|
import { handleStoreItemAcquisition } from "./purchaseService";
|
||||||
import { IMissionReward } from "../types/missionTypes";
|
import { IMissionReward } from "../types/missionTypes";
|
||||||
import { crackRelic } from "@/src/helpers/relicHelper";
|
import { crackRelic } from "@/src/helpers/relicHelper";
|
||||||
|
import { createMessage } from "./inboxService";
|
||||||
|
import kuriaMessage50 from "@/static/fixed_responses/kuriaMessages/fiftyPercent.json";
|
||||||
|
import kuriaMessage75 from "@/static/fixed_responses/kuriaMessages/seventyFivePercent.json";
|
||||||
|
import kuriaMessage100 from "@/static/fixed_responses/kuriaMessages/oneHundredPercent.json";
|
||||||
|
|
||||||
const getRotations = (rotationCount: number): number[] => {
|
const getRotations = (rotationCount: number): number[] => {
|
||||||
if (rotationCount === 0) return [0];
|
if (rotationCount === 0) return [0];
|
||||||
@ -201,6 +205,34 @@ export const addMissionInventoryUpdates = (
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case "CollectibleScans":
|
||||||
|
value.forEach(scan => {
|
||||||
|
const entry = inventory.CollectibleSeries?.find(x => x.CollectibleType == scan.CollectibleType);
|
||||||
|
if (entry) {
|
||||||
|
entry.Count = scan.Count;
|
||||||
|
entry.Tracking = scan.Tracking;
|
||||||
|
if (entry.CollectibleType == "/Lotus/Objects/Orokin/Props/CollectibleSeriesOne") {
|
||||||
|
const progress = entry.Count / entry.ReqScans;
|
||||||
|
entry.IncentiveStates.forEach(gate => {
|
||||||
|
gate.complete = progress >= gate.threshold;
|
||||||
|
if (gate.complete && !gate.sent) {
|
||||||
|
gate.sent = true;
|
||||||
|
if (gate.threshold == 0.5) {
|
||||||
|
void createMessage(inventory.accountOwnerId.toString(), [kuriaMessage50]);
|
||||||
|
} else {
|
||||||
|
void createMessage(inventory.accountOwnerId.toString(), [kuriaMessage75]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (progress >= 1.0) {
|
||||||
|
void createMessage(inventory.accountOwnerId.toString(), [kuriaMessage100]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
logger.warn(`${scan.CollectibleType} was not found in inventory, ignoring scans`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
case "Upgrades":
|
case "Upgrades":
|
||||||
value.forEach(clientUpgrade => {
|
value.forEach(clientUpgrade => {
|
||||||
const upgrade = inventory.Upgrades.id(clientUpgrade.ItemId.$oid)!;
|
const upgrade = inventory.Upgrades.id(clientUpgrade.ItemId.$oid)!;
|
||||||
|
@ -15,7 +15,8 @@ import {
|
|||||||
IPlayerSkills,
|
IPlayerSkills,
|
||||||
IQuestKeyDatabase,
|
IQuestKeyDatabase,
|
||||||
ILoreFragmentScan,
|
ILoreFragmentScan,
|
||||||
IUpgradeClient
|
IUpgradeClient,
|
||||||
|
ICollectibleEntry
|
||||||
} from "./inventoryTypes/inventoryTypes";
|
} from "./inventoryTypes/inventoryTypes";
|
||||||
|
|
||||||
export interface IThemeUpdateRequest {
|
export interface IThemeUpdateRequest {
|
||||||
@ -99,6 +100,7 @@ export type IMissionInventoryUpdateRequest = {
|
|||||||
CodexScanCount: number;
|
CodexScanCount: number;
|
||||||
Standing: number;
|
Standing: number;
|
||||||
}[];
|
}[];
|
||||||
|
CollectibleScans?: ICollectibleEntry[];
|
||||||
Upgrades?: IUpgradeClient[]; // riven challenge progress
|
Upgrades?: IUpgradeClient[]; // riven challenge progress
|
||||||
} & {
|
} & {
|
||||||
[K in TEquipmentKey]?: IEquipmentClient[];
|
[K in TEquipmentKey]?: IEquipmentClient[];
|
||||||
|
7
static/fixed_responses/kuriaMessages/fiftyPercent.json
Normal file
7
static/fixed_responses/kuriaMessages/fiftyPercent.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"sub": "/Lotus/Language/Oddities/SeriesOne50PercentInboxMessageSubject",
|
||||||
|
"sndr": "/Lotus/Language/Menu/ScribeName",
|
||||||
|
"msg": "/Lotus/Language/Oddities/SeriesOne50PercentInboxMessage",
|
||||||
|
"icon": "/Lotus/Interface/Icons/Syndicates/FactionOddityGold.png",
|
||||||
|
"att": ["/Lotus/Upgrades/Skins/Clan/OrokittyBadgeItem"]
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"sub": "/Lotus/Language/Oddities/SeriesOneRewardSubject",
|
||||||
|
"sndr": "/Lotus/Language/Menu/ScribeName",
|
||||||
|
"msg": "/Lotus/Language/Oddities/SeriesOneRewardInboxMessage",
|
||||||
|
"icon": "/Lotus/Interface/Icons/Syndicates/FactionOddityGold.png",
|
||||||
|
"att": ["/Lotus/Types/Items/ShipDecos/OrokinFelisBobbleHead"],
|
||||||
|
"highPriority": true
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"sub": "/Lotus/Language/Oddities/SeriesOne75PercentInboxMessageSubject",
|
||||||
|
"sndr": "/Lotus/Language/Menu/ScribeName",
|
||||||
|
"msg": "/Lotus/Language/Oddities/SeriesOne75PercentInboxMessage",
|
||||||
|
"icon": "/Lotus/Interface/Icons/Syndicates/FactionOddityGold.png",
|
||||||
|
"att": ["/Lotus/Types/StoreItems/AvatarImages/AvatarImageOroKitty"]
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user