返回提交历史
Modified
src/services/missionInventoryUpdateService.ts
+15
-1
XFEstudio/XFESpaceNinjaServer
feat: invasion additional credits (#2925)
Re #1097 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2925 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
18fafc38
代码差异
1 个文件
+15
-1
@@ -1126,7 +1126,8 @@ export const addMissionRewards = async (
1126
1126
RegularCredits: creditDrops,
1127
1127
VoidTearParticipantsCurrWave: voidTearWave,
1128
1128
StrippedItems: strippedItems,
1129
AffiliationChanges: AffiliationMods
1129
AffiliationChanges: AffiliationMods,
1130
InvasionProgress: invasionProgress
1130
1131
}: IMissionInventoryUpdateRequest,
1131
1132
firstCompletion: boolean
1132
1133
): Promise<AddMissionRewardsReturnType> => {
@@ -1176,6 +1177,19 @@ export const addMissionRewards = async (
1176
1177
1177
1178
//inventory change is what the client has not rewarded itself, also the client needs to know the credit changes for display
1178
1179
1180
if (invasionProgress) {
1181
for (const clientProgress of invasionProgress) {
1182
const dbProgress = inventory.QualifyingInvasions.find(x => x.invasionId.equals(clientProgress._id.$oid));
1183
if (dbProgress) {
1184
const run =
1185
(clientProgress.AttackerScore > clientProgress.DefenderScore
1186
? dbProgress.AttackerScore
1187
: dbProgress.DefenderScore) - 1;
1188
missionCompletionCredits += 1000 * Math.min(run, 10);
1189
}
1190
}
1191
}
1192
1179
1193
if (rewardInfo.goalId) {
1180
1194
const goal = getWorldState().Goals.find(x => x._id.$oid == rewardInfo.goalId);
1181
1195
if (goal) {