返回提交历史
Modified
src/models/inventoryModels/inventoryModel.ts
+27
-2
Modified
src/services/missionInventoryUpdateService.ts
+14
-0
Modified
src/types/inventoryTypes/inventoryTypes.ts
+11
-2
Modified
src/types/requestTypes.ts
+3
-0
XFEstudio/XFESpaceNinjaServer
feat: sortie reward (#1692)
May work somewhat for lite sorties, didn't test that. They'd also need some extra handling with regards to the archon shards with their dynamic probabilities. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1692 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
e38d52fb
代码差异
4 个文件
+55
-4
@@ -86,7 +86,9 @@ import {
86
86
IWeeklyMission,
87
87
ILockedWeaponGroupDatabase,
88
88
IPersonalTechProjectDatabase,
89
IPersonalTechProjectClient
89
IPersonalTechProjectClient,
90
ILastSortieRewardDatabase,
91
ILastSortieRewardClient
90
92
} from "../../types/inventoryTypes/inventoryTypes";
91
93
import { IOid } from "../../types/commonTypes";
92
94
import {
@@ -1202,6 +1204,28 @@ const alignmentSchema = new Schema<IAlignment>(
1202
1204
{ _id: false }
1203
1205
);
1204
1206
1207
const lastSortieRewardSchema = new Schema<ILastSortieRewardDatabase>(
1208
{
1209
SortieId: Schema.Types.ObjectId,
1210
StoreItem: String,
1211
Manifest: String
1212
},
1213
{ _id: false }
1214
);
1215
1216
lastSortieRewardSchema.set("toJSON", {
1217
virtuals: true,
1218
transform(_doc, obj) {
1219
const db = obj as ILastSortieRewardDatabase;
1220
const client = obj as ILastSortieRewardClient;
1221
1222
client.SortieId = toOid(db.SortieId);
1223
1224
delete obj._id;
1225
delete obj.__v;
1226
}
1227
});
1228
1205
1229
const lockedWeaponGroupSchema = new Schema<ILockedWeaponGroupDatabase>(
1206
1230
{
1207
1231
s: Schema.Types.ObjectId,
@@ -1419,7 +1443,8 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
1419
1443
1420
1444
//https://warframe.fandom.com/wiki/Sortie
1421
1445
CompletedSorties: [String],
1422
LastSortieReward: [Schema.Types.Mixed],
1446
LastSortieReward: { type: [lastSortieRewardSchema], default: undefined },
1447
LastLiteSortieReward: { type: [lastSortieRewardSchema], default: undefined },
1423
1448
1424
1449
// Resource Extractor Drones
1425
1450
Drones: [droneSchema],
@@ -584,6 +584,16 @@ export const addMissionRewards = async (
584
584
const AffiliationMods: IAffiliationMods[] = [];
585
585
let SyndicateXPItemReward;
586
586
587
if (rewardInfo.sortieTag == "Final") {
588
inventory.LastSortieReward = [
589
{
590
SortieId: new Types.ObjectId(rewardInfo.sortieId!.split("_")[1]),
591
StoreItem: MissionRewards[0].StoreItem,
592
Manifest: "/Lotus/Types/Game/MissionDecks/SortieRewards"
593
}
594
];
595
}
596
587
597
let missionCompletionCredits = 0;
588
598
//inventory change is what the client has not rewarded itself, also the client needs to know the credit changes for display
589
599
if (levelKeyName) {
@@ -943,6 +953,10 @@ function getLevelCreditRewards(node: IRegion): number {
943
953
944
954
function getRandomMissionDrops(RewardInfo: IRewardInfo, tierOverride: number | undefined): IMissionReward[] {
945
955
const drops: IMissionReward[] = [];
956
if (RewardInfo.sortieTag == "Final") {
957
const drop = getRandomRewardByChance(ExportRewards["/Lotus/Types/Game/MissionDecks/SortieRewards"][0])!;
958
drops.push({ StoreItem: drop.type, ItemCount: drop.itemCount });
959
}
946
960
if (RewardInfo.periodicMissionTag?.startsWith("HardDaily")) {
947
961
drops.push({
948
962
StoreItem: "/Lotus/StoreItems/Types/Items/MiscItems/SteelEssence",
@@ -47,6 +47,8 @@ export interface IInventoryDatabase
47
47
| "BrandedSuits"
48
48
| "LockedWeaponGroup"
49
49
| "PersonalTechProjects"
50
| "LastSortieReward"
51
| "LastLiteSortieReward"
50
52
| TEquipmentKey
51
53
>,
52
54
InventoryDatabaseEquipment {
@@ -79,6 +81,8 @@ export interface IInventoryDatabase
79
81
BrandedSuits?: Types.ObjectId[];
80
82
LockedWeaponGroup?: ILockedWeaponGroupDatabase;
81
83
PersonalTechProjects: IPersonalTechProjectDatabase[];
84
LastSortieReward?: ILastSortieRewardDatabase[];
85
LastLiteSortieReward?: ILastSortieRewardDatabase[];
82
86
}
83
87
84
88
export interface IQuestKeyDatabase {
@@ -277,7 +281,8 @@ export interface IInventoryClient extends IDailyAffiliations, InventoryClientEqu
277
281
Wishlist: string[];
278
282
Alignment?: IAlignment;
279
283
CompletedSorties: string[];
280
LastSortieReward: ILastSortieReward[];
284
LastSortieReward?: ILastSortieRewardClient[];
285
LastLiteSortieReward?: ILastSortieRewardClient[];
281
286
Drones: IDroneClient[];
282
287
StepSequencers: IStepSequencer[];
283
288
ActiveAvatarImageType: string;
@@ -724,12 +729,16 @@ export enum Status {
724
729
StatusStasis = "STATUS_STASIS"
725
730
}
726
731
727
export interface ILastSortieReward {
732
export interface ILastSortieRewardClient {
728
733
SortieId: IOid;
729
734
StoreItem: string;
730
735
Manifest: string;
731
736
}
732
737
738
export interface ILastSortieRewardDatabase extends Omit<ILastSortieRewardClient, "SortieId"> {
739
SortieId: Types.ObjectId;
740
}
741
733
742
export interface ILibraryDailyTaskInfo {
734
743
EnemyTypes: string[];
735
744
EnemyLocTag: string;
@@ -129,6 +129,9 @@ export type IMissionInventoryUpdateRequest = {
129
129
130
130
export interface IRewardInfo {
131
131
node: string;
132
sortieId?: string;
133
sortieTag?: string;
134
sortiePrereqs?: string[];
132
135
VaultsCracked?: number; // for Spy missions
133
136
rewardTier?: number;
134
137
nightmareMode?: boolean;