forked from OpenWF/SpaceNinjaServer
feat: library personal target progress
This commit is contained in:
parent
0869bbfb27
commit
2b03836e15
@ -8,7 +8,7 @@ export const startLibraryPersonalTargetController: RequestHandler = async (req,
|
|||||||
inventory.LibraryPersonalTarget = req.query.target as string;
|
inventory.LibraryPersonalTarget = req.query.target as string;
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.json({
|
res.json({
|
||||||
IsQuest: false,
|
IsQuest: req.query.target == "/Lotus/Types/Game/Library/Targets/DragonframeQuestTarget",
|
||||||
Target: req.query.target
|
Target: req.query.target
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -74,7 +74,8 @@ import {
|
|||||||
IAlignment,
|
IAlignment,
|
||||||
ICollectibleEntry,
|
ICollectibleEntry,
|
||||||
IIncentiveState,
|
IIncentiveState,
|
||||||
ISongChallenge
|
ISongChallenge,
|
||||||
|
ILibraryPersonalProgress
|
||||||
} from "../../types/inventoryTypes/inventoryTypes";
|
} from "../../types/inventoryTypes/inventoryTypes";
|
||||||
import { IOid } from "../../types/commonTypes";
|
import { IOid } from "../../types/commonTypes";
|
||||||
import {
|
import {
|
||||||
@ -1005,6 +1006,15 @@ pendingCouponSchema.set("toJSON", {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const libraryPersonalProgressSchema = new Schema<ILibraryPersonalProgress>(
|
||||||
|
{
|
||||||
|
TargetType: String,
|
||||||
|
Scans: Number,
|
||||||
|
Completed: Boolean
|
||||||
|
},
|
||||||
|
{ _id: false }
|
||||||
|
);
|
||||||
|
|
||||||
const libraryDailyTaskInfoSchema = new Schema<ILibraryDailyTaskInfo>(
|
const libraryDailyTaskInfoSchema = new Schema<ILibraryDailyTaskInfo>(
|
||||||
{
|
{
|
||||||
EnemyTypes: [String],
|
EnemyTypes: [String],
|
||||||
@ -1271,7 +1281,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
|
|||||||
|
|
||||||
LibraryPersonalTarget: String,
|
LibraryPersonalTarget: String,
|
||||||
//Cephalon Simaris Entries Example:"TargetType"+"Scans"(1-10)+"Completed": true|false
|
//Cephalon Simaris Entries Example:"TargetType"+"Scans"(1-10)+"Completed": true|false
|
||||||
LibraryPersonalProgress: [Schema.Types.Mixed],
|
LibraryPersonalProgress: { type: [libraryPersonalProgressSchema], default: [] },
|
||||||
//Cephalon Simaris Daily Task
|
//Cephalon Simaris Daily Task
|
||||||
LibraryAvailableDailyTaskInfo: libraryDailyTaskInfoSchema,
|
LibraryAvailableDailyTaskInfo: libraryDailyTaskInfoSchema,
|
||||||
LibraryActiveDailyTaskInfo: libraryDailyTaskInfoSchema,
|
LibraryActiveDailyTaskInfo: libraryDailyTaskInfoSchema,
|
||||||
|
@ -191,17 +191,48 @@ export const addMissionInventoryUpdates = (
|
|||||||
break;
|
break;
|
||||||
case "LibraryScans":
|
case "LibraryScans":
|
||||||
value.forEach(scan => {
|
value.forEach(scan => {
|
||||||
if (inventory.LibraryActiveDailyTaskInfo) {
|
let synthesisIgnored = true;
|
||||||
if (inventory.LibraryActiveDailyTaskInfo.EnemyTypes.find(x => x == scan.EnemyType)) {
|
if (
|
||||||
|
inventory.LibraryPersonalTarget &&
|
||||||
|
libraryPersonalTargetToAvatar[inventory.LibraryPersonalTarget] == scan.EnemyType
|
||||||
|
) {
|
||||||
|
let progress = inventory.LibraryPersonalProgress.find(
|
||||||
|
x => x.TargetType == inventory.LibraryPersonalTarget
|
||||||
|
);
|
||||||
|
if (!progress) {
|
||||||
|
progress =
|
||||||
|
inventory.LibraryPersonalProgress[
|
||||||
|
inventory.LibraryPersonalProgress.push({
|
||||||
|
TargetType: inventory.LibraryPersonalTarget,
|
||||||
|
Scans: 0,
|
||||||
|
Completed: false
|
||||||
|
}) - 1
|
||||||
|
];
|
||||||
|
}
|
||||||
|
progress.Scans += scan.Count;
|
||||||
|
if (
|
||||||
|
progress.Scans >=
|
||||||
|
(inventory.LibraryPersonalTarget ==
|
||||||
|
"/Lotus/Types/Game/Library/Targets/DragonframeQuestTarget"
|
||||||
|
? 3
|
||||||
|
: 10)
|
||||||
|
) {
|
||||||
|
progress.Completed = true;
|
||||||
|
}
|
||||||
|
logger.debug(`synthesis of ${scan.EnemyType} added to personal target progress`);
|
||||||
|
synthesisIgnored = false;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
inventory.LibraryActiveDailyTaskInfo &&
|
||||||
|
inventory.LibraryActiveDailyTaskInfo.EnemyTypes.find(x => x == scan.EnemyType)
|
||||||
|
) {
|
||||||
inventory.LibraryActiveDailyTaskInfo.Scans ??= 0;
|
inventory.LibraryActiveDailyTaskInfo.Scans ??= 0;
|
||||||
inventory.LibraryActiveDailyTaskInfo.Scans += scan.Count;
|
inventory.LibraryActiveDailyTaskInfo.Scans += scan.Count;
|
||||||
} else {
|
logger.debug(`synthesis of ${scan.EnemyType} added to daily task progress`);
|
||||||
logger.warn(
|
synthesisIgnored = false;
|
||||||
`ignoring synthesis of ${scan.EnemyType} as it's not part of the active daily task`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} else {
|
if (synthesisIgnored) {
|
||||||
logger.warn(`no library daily task active, ignoring synthesis of ${scan.EnemyType}`);
|
logger.warn(`ignoring synthesis of ${scan.EnemyType} due to not knowing why you did that`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
@ -534,3 +565,25 @@ const corruptedMods = [
|
|||||||
"/Lotus/StoreItems/Upgrades/Mods/Rifle/DualStat/CorruptedReloadSpeedMaxClipRifle", // Depleted Reload
|
"/Lotus/StoreItems/Upgrades/Mods/Rifle/DualStat/CorruptedReloadSpeedMaxClipRifle", // Depleted Reload
|
||||||
"/Lotus/StoreItems/Upgrades/Mods/Warframe/DualStat/FixedShieldAndShieldGatingDuration" // Catalyzing Shields
|
"/Lotus/StoreItems/Upgrades/Mods/Warframe/DualStat/FixedShieldAndShieldGatingDuration" // Catalyzing Shields
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const libraryPersonalTargetToAvatar: Record<string, string> = {
|
||||||
|
"/Lotus/Types/Game/Library/Targets/DragonframeQuestTarget":
|
||||||
|
"/Lotus/Types/Enemies/Grineer/Desert/Avatars/RifleLancerAvatar",
|
||||||
|
"/Lotus/Types/Game/Library/Targets/Research1Target":
|
||||||
|
"/Lotus/Types/Enemies/Grineer/Desert/Avatars/RifleLancerAvatar",
|
||||||
|
"/Lotus/Types/Game/Library/Targets/Research2Target":
|
||||||
|
"/Lotus/Types/Enemies/Corpus/BipedRobot/AIWeek/LaserDiscBipedAvatar",
|
||||||
|
"/Lotus/Types/Game/Library/Targets/Research3Target":
|
||||||
|
"/Lotus/Types/Enemies/Grineer/Desert/Avatars/EvisceratorLancerAvatar",
|
||||||
|
"/Lotus/Types/Game/Library/Targets/Research4Target": "/Lotus/Types/Enemies/Orokin/OrokinHealingAncientAvatar",
|
||||||
|
"/Lotus/Types/Game/Library/Targets/Research5Target":
|
||||||
|
"/Lotus/Types/Enemies/Corpus/Spaceman/AIWeek/ShotgunSpacemanAvatar",
|
||||||
|
"/Lotus/Types/Game/Library/Targets/Research6Target": "/Lotus/Types/Enemies/Infested/AiWeek/Runners/RunnerAvatar",
|
||||||
|
"/Lotus/Types/Game/Library/Targets/Research7Target":
|
||||||
|
"/Lotus/Types/Enemies/Grineer/AIWeek/Avatars/GrineerMeleeStaffAvatar",
|
||||||
|
"/Lotus/Types/Game/Library/Targets/Research8Target": "/Lotus/Types/Enemies/Orokin/OrokinHeavyFemaleAvatar",
|
||||||
|
"/Lotus/Types/Game/Library/Targets/Research9Target":
|
||||||
|
"/Lotus/Types/Enemies/Infested/AiWeek/Quadrupeds/QuadrupedAvatar",
|
||||||
|
"/Lotus/Types/Game/Library/Targets/Research10Target":
|
||||||
|
"/Lotus/Types/Enemies/Corpus/Spaceman/AIWeek/NullifySpacemanAvatar"
|
||||||
|
};
|
||||||
|
@ -313,7 +313,7 @@ export interface IInventoryClient extends IDailyAffiliations, InventoryClientEqu
|
|||||||
Quests: any[];
|
Quests: any[];
|
||||||
Robotics: any[];
|
Robotics: any[];
|
||||||
UsedDailyDeals: any[];
|
UsedDailyDeals: any[];
|
||||||
LibraryPersonalTarget: string;
|
LibraryPersonalTarget?: string;
|
||||||
LibraryPersonalProgress: ILibraryPersonalProgress[];
|
LibraryPersonalProgress: ILibraryPersonalProgress[];
|
||||||
CollectibleSeries?: ICollectibleEntry[];
|
CollectibleSeries?: ICollectibleEntry[];
|
||||||
LibraryAvailableDailyTaskInfo?: ILibraryDailyTaskInfo;
|
LibraryAvailableDailyTaskInfo?: ILibraryDailyTaskInfo;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user