返回提交历史
Modified
config-vanilla.json
+3
-3
Modified
src/controllers/api/inboxController.ts
+3
-3
Modified
src/services/configService.ts
+3
-3
Modified
src/services/configWatcherService.ts
+3
-3
Modified
src/services/missionInventoryUpdateService.ts
+3
-3
Modified
src/services/worldStateService.ts
+6
-6
Modified
static/webui/index.html
+28
-12
Modified
static/webui/translations/de.js
+4
-3
Modified
static/webui/translations/en.js
+4
-3
Modified
static/webui/translations/es.js
+4
-3
Modified
static/webui/translations/fr.js
+4
-3
Modified
static/webui/translations/ru.js
+4
-3
Modified
static/webui/translations/uk.js
+4
-3
Modified
static/webui/translations/zh.js
+4
-3
XFEstudio/XFESpaceNinjaServer
feat: credit/affinity/resourceBoostMultiplier cheats (#4342)
Closes #4163 - Made it a little similar to spoof MR - Replaces the old credit/affinity/resourceBoost options. Use 0 to disable it or whatever number the multiplier should be - Added note in WebUI to inform user about reactants breaking at certain resource multipliers - Works in most versions Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/4342 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: Animan8000 <187183497+veniman8000@users.noreply.github.com> Co-committed-by: Animan8000 <187183497+veniman8000@users.noreply.github.com>
352a9f79
代码差异
14 个文件
+77
-54
@@ -59,9 +59,9 @@
59
59
"giveBreedingGroundsRewardsAtSum": true
60
60
},
61
61
"worldState": {
62
"creditBoost": false,
63
"affinityBoost": false,
64
"resourceBoost": false,
62
"creditBoostMultiplier": 0,
63
"affinityBoostMultiplier": 0,
64
"resourceBoostMultiplier": 0,
65
65
"tennoLiveRelay": false,
66
66
"baroTennoConRelay": false,
67
67
"baroAlwaysAvailable": false,
@@ -216,7 +216,7 @@ const createNewEventMessages = async (account: TAccountDocument): Promise<void>
216
216
});
217
217
}
218
218
219
if (config.worldState?.creditBoost && !account.receivedEventMessage_creditBoost) {
219
if (config.worldState?.creditBoostMultiplier && !account.receivedEventMessage_creditBoost) {
220
220
account.receivedEventMessage_creditBoost = true;
221
221
newEventMessages.push({
222
222
globaUpgradeId: new Types.ObjectId("5b23106f283a555109666672"),
@@ -228,7 +228,7 @@ const createNewEventMessages = async (account: TAccountDocument): Promise<void>
228
228
CrossPlatform: true
229
229
});
230
230
}
231
if (config.worldState?.affinityBoost && !account.receivedEventMessage_affinityBoost) {
231
if (config.worldState?.affinityBoostMultiplier && !account.receivedEventMessage_affinityBoost) {
232
232
account.receivedEventMessage_affinityBoost = true;
233
233
newEventMessages.push({
234
234
globaUpgradeId: new Types.ObjectId("5b23106f283a555109666673"),
@@ -240,7 +240,7 @@ const createNewEventMessages = async (account: TAccountDocument): Promise<void>
240
240
CrossPlatform: true
241
241
});
242
242
}
243
if (config.worldState?.resourceBoost && !account.receivedEventMessage_resourceBoost) {
243
if (config.worldState?.resourceBoostMultiplier && !account.receivedEventMessage_resourceBoost) {
244
244
account.receivedEventMessage_resourceBoost = true;
245
245
newEventMessages.push({
246
246
globaUpgradeId: new Types.ObjectId("5b23106f283a555109666674"),
@@ -65,9 +65,9 @@ export interface IConfig {
65
65
giveBreedingGroundsRewardsAtSum?: boolean;
66
66
};
67
67
worldState?: {
68
creditBoost?: boolean;
69
affinityBoost?: boolean;
70
resourceBoost?: boolean;
68
creditBoostMultiplier?: number;
69
affinityBoostMultiplier?: number;
70
resourceBoostMultiplier?: number;
71
71
tennoLiveRelay?: boolean;
72
72
baroTennoConRelay?: boolean;
73
73
baroAlwaysAvailable?: boolean;
@@ -235,15 +235,15 @@ export const validateConfig = (): void => {
235
235
export const syncConfigWithDatabase = (): void => {
236
236
// Event messages are deleted after endDate. Since we don't use beginDate/endDate and instead have config toggles, we need to delete the messages once those bools are false.
237
237
// Also, for some reason, I can't just do `Inbox.deleteMany(...)`; - it needs this whole circus.
238
if (!config.worldState?.creditBoost) {
238
if (!config.worldState?.creditBoostMultiplier) {
239
239
void Account.updateMany({}, { $unset: { receivedEventMessage_creditBoost: 1 } }).then(() => {});
240
240
void Inbox.deleteMany({ globaUpgradeId: "5b23106f283a555109666672" }).then(() => {});
241
241
}
242
if (!config.worldState?.affinityBoost) {
242
if (!config.worldState?.affinityBoostMultiplier) {
243
243
void Account.updateMany({}, { $unset: { receivedEventMessage_affinityBoost: 1 } }).then(() => {});
244
244
void Inbox.deleteMany({ globaUpgradeId: "5b23106f283a555109666673" }).then(() => {});
245
245
}
246
if (!config.worldState?.resourceBoost) {
246
if (!config.worldState?.resourceBoostMultiplier) {
247
247
void Account.updateMany({}, { $unset: { receivedEventMessage_resourceBoost: 1 } }).then(() => {});
248
248
void Inbox.deleteMany({ globaUpgradeId: "5b23106f283a555109666674" }).then(() => {});
249
249
}
@@ -1829,9 +1829,9 @@ const addCredits = async (
1829
1829
const totalCredits = finalCredits.MissionCredits[1] + finalCredits.CreditsBonus[1] + rngRewardCredits;
1830
1830
finalCredits.TotalCredits = [totalCredits, totalCredits];
1831
1831
1832
if (config.worldState?.creditBoost) {
1833
inventory.RegularCredits += finalCredits.TotalCredits[1];
1834
finalCredits.TotalCredits[1] += finalCredits.TotalCredits[1];
1832
if (config.worldState?.creditBoostMultiplier) {
1833
inventory.RegularCredits += finalCredits.TotalCredits[1] * (config.worldState.creditBoostMultiplier - 1);
1834
finalCredits.TotalCredits[1] *= config.worldState.creditBoostMultiplier;
1835
1835
}
1836
1836
const now = Math.trunc(Date.now() / 1000); // TOVERIFY: Should we maybe subtract mission time as to apply credit boosters that expired during mission?
1837
1837
if ((inventory.Boosters.find(x => x.ItemType == "/Lotus/Types/Boosters/CreditBooster")?.ExpiryDate ?? 0) > now) {
@@ -4342,38 +4342,38 @@ export const getWorldState = (
4342
4342
});
4343
4343
}
4344
4344
4345
if (config.worldState?.creditBoost) {
4345
if (config.worldState?.creditBoostMultiplier) {
4346
4346
worldState.GlobalUpgrades.push({
4347
4347
_id: toOid2("5b23106f283a555109666672", buildLabel),
4348
4348
Activation: toMongoDate2(1740164400000, buildLabel),
4349
4349
ExpiryDate: toMongoDate2(2000000000000, buildLabel),
4350
4350
UpgradeType: "GAMEPLAY_MONEY_REWARD_AMOUNT",
4351
4351
OperationType: "MULTIPLY",
4352
Value: 2,
4352
Value: config.worldState.creditBoostMultiplier,
4353
4353
LocalizeTag: "",
4354
4354
LocalizeDescTag: ""
4355
4355
});
4356
4356
}
4357
if (config.worldState?.affinityBoost) {
4357
if (config.worldState?.affinityBoostMultiplier) {
4358
4358
worldState.GlobalUpgrades.push({
4359
4359
_id: toOid2("5b23106f283a555109666673", buildLabel),
4360
4360
Activation: toMongoDate2(1740164400000, buildLabel),
4361
4361
ExpiryDate: toMongoDate2(2000000000000, buildLabel),
4362
4362
UpgradeType: "GAMEPLAY_KILL_XP_AMOUNT",
4363
4363
OperationType: "MULTIPLY",
4364
Value: 2,
4364
Value: config.worldState.affinityBoostMultiplier,
4365
4365
LocalizeTag: "",
4366
4366
LocalizeDescTag: ""
4367
4367
});
4368
4368
}
4369
if (config.worldState?.resourceBoost) {
4369
if (config.worldState?.resourceBoostMultiplier) {
4370
4370
worldState.GlobalUpgrades.push({
4371
4371
_id: toOid2("5b23106f283a555109666674", buildLabel),
4372
4372
Activation: toMongoDate2(1740164400000, buildLabel),
4373
4373
ExpiryDate: toMongoDate2(2000000000000, buildLabel),
4374
4374
UpgradeType: "GAMEPLAY_PICKUP_AMOUNT",
4375
4375
OperationType: "MULTIPLY",
4376
Value: 2,
4376
Value: config.worldState.resourceBoostMultiplier,
4377
4377
LocalizeTag: "",
4378
4378
LocalizeDescTag: ""
4379
4379
});
@@ -1274,18 +1274,6 @@
1274
1274
<div class="card d-none admin-show config-form">
1275
1275
<h5 class="card-header" data-loc="worldState"></h5>
1276
1276
<div class="card-body">
1277
<div class="form-check">
1278
<input class="form-check-input" type="checkbox" id="worldState.creditBoost" />
1279
<label class="form-check-label" for="worldState.creditBoost" data-loc="worldState_creditBoost"></label>
1280
</div>
1281
<div class="form-check">
1282
<input class="form-check-input" type="checkbox" id="worldState.affinityBoost" />
1283
<label class="form-check-label" for="worldState.affinityBoost" data-loc="worldState_affinityBoost"></label>
1284
</div>
1285
<div class="form-check">
1286
<input class="form-check-input" type="checkbox" id="worldState.resourceBoost" />
1287
<label class="form-check-label" for="worldState.resourceBoost" data-loc="worldState_resourceBoost"></label>
1288
</div>
1289
1277
<div class="form-check">
1290
1278
<input class="form-check-input" type="checkbox" id="worldState.tennoLiveRelay" />
1291
1279
<label class="form-check-label" for="worldState.tennoLiveRelay" data-loc="worldState_tennoLiveRelay"></label>
@@ -1426,6 +1414,34 @@
1426
1414
</div>
1427
1415
</div>
1428
1416
</div>
1417
<div class="form-group mt-2">
1418
<form class="form-group" onsubmit="doSaveConfigInt('worldState.creditBoostMultiplier'); return false;">
1419
<label class="form-label" for="worldState.creditBoostMultiplier" data-loc="worldState_creditBoostMultiplier"></label>
1420
<div class="input-group">
1421
<input id="worldState.creditBoostMultiplier" class="form-control" type="number" min="0" max="1000000" data-default="0" />
1422
<button class="btn btn-secondary" type="submit" data-loc="cheats_save"></button>
1423
</div>
1424
</form>
1425
</div>
1426
<div class="form-group mt-2">
1427
<form class="form-group" onsubmit="doSaveConfigInt('worldState.affinityBoostMultiplier'); return false;">
1428
<label class="form-label" for="worldState.affinityBoostMultiplier" data-loc="worldState_affinityBoostMultiplier"></label>
1429
<div class="input-group">
1430
<input id="worldState.affinityBoostMultiplier" class="form-control" type="number" min="0" max="1000000" data-default="0" />
1431
<button class="btn btn-secondary" type="submit" data-loc="cheats_save"></button>
1432
</div>
1433
</form>
1434
</div>
1435
<div class="form-group mt-2">
1436
<form class="form-group" onsubmit="doSaveConfigInt('worldState.resourceBoostMultiplier'); return false;">
1437
<label class="form-label" for="worldState.resourceBoostMultiplier" data-loc="worldState_resourceBoostMultiplier"></label>
1438
<abbr data-loc-title="worldState_resourceBoostMultiplierDesc"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path d="M320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM320 200C333.3 200 344 210.7 344 224L344 336C344 349.3 333.3 360 320 360C306.7 360 296 349.3 296 336L296 224C296 210.7 306.7 200 320 200zM293.3 416C292.7 406.1 297.6 396.7 306.1 391.5C314.6 386.4 325.3 386.4 333.8 391.5C342.3 396.7 347.2 406.1 346.6 416C347.2 425.9 342.3 435.3 333.8 440.5C325.3 445.6 314.6 445.6 306.1 440.5C297.6 435.3 292.7 425.9 293.3 416z"/></svg></abbr>
1439
<div class="input-group">
1440
<input id="worldState.resourceBoostMultiplier" class="form-control" type="number" min="0" max="1000000" data-default="0" />
1441
<button class="btn btn-secondary" type="submit" data-loc="cheats_save"></button>
1442
</div>
1443
</form>
1444
</div>
1429
1445
<div class="form-group mt-2">
1430
1446
<label class="form-label" for="worldState.baroRelayOverride" data-loc="worldState_baroRelayOverride"></label>
1431
1447
<select class="form-control" id="worldState.baroRelayOverride" data-default="0">
@@ -312,9 +312,10 @@ dict = {
312
312
cheats_noHubDiscrimination: `Keine Hub-Trennung`,
313
313
314
314
worldState: `Weltstatus`,
315
worldState_creditBoost: `Event Booster: Credit`,
316
worldState_affinityBoost: `Event Booster: Erfahrung`,
317
worldState_resourceBoost: `Event Booster: Ressourcen`,
315
worldState_creditBoostMultiplier: `Credit-Booster-Multiplikator (0 zum deaktivieren)`,
316
worldState_affinityBoostMultiplier: `Erfahrungs-Booster-Multiplikator (0 zum deaktivieren)`,
317
worldState_resourceBoostMultiplier: `Ressourcen-Booster-Multiplikator (0 zum deaktivieren)`,
318
worldState_resourceBoostMultiplierDesc: `Werte außer 0, 1, 2, 5 oder 10 brechen Reaktant-Drops in Void-Riss-Missionen.`,
318
319
worldState_tennoLiveRelay: `TennoLive Relais`,
319
320
worldState_baroTennoConRelay: `Baros TennoCon-Relais`,
320
321
worldState_saintPatrick: `St. Patrick’s Day`,
@@ -311,9 +311,10 @@ dict = {
311
311
cheats_noHubDiscrimination: `No Hub Discrimination`,
312
312
313
313
worldState: `World State`,
314
worldState_creditBoost: `Credit Boost`,
315
worldState_affinityBoost: `Affinity Boost`,
316
worldState_resourceBoost: `Resource Boost`,
314
worldState_creditBoostMultiplier: `Credit Boost Multiplier (0 to disable)`,
315
worldState_affinityBoostMultiplier: `Affinity Boost Multiplier (0 to disable)`,
316
worldState_resourceBoostMultiplier: `Resource Boost Multiplier (0 to disable)`,
317
worldState_resourceBoostMultiplierDesc: `Values other than 0, 1, 2, 5, or 10 break Reactant pickups in Void Fissure missions.`,
317
318
worldState_tennoLiveRelay: `TennoLive Relay`,
318
319
worldState_baroTennoConRelay: `Baro's TennoCon Relay`,
319
320
worldState_saintPatrick: `St. Patrick’s Day`,
@@ -312,9 +312,10 @@ dict = {
312
312
cheats_noHubDiscrimination: `[UNTRANSLATED] No Hub Discrimination`,
313
313
314
314
worldState: `Estado del mundo`,
315
worldState_creditBoost: `Potenciador de Créditos`,
316
worldState_affinityBoost: `Potenciador de Afinidad`,
317
worldState_resourceBoost: `Potenciador de Recursos`,
315
worldState_creditBoostMultiplier: `[UNTRANSLATED] Credit Boost Multiplier (0 to disable)`,
316
worldState_affinityBoostMultiplier: `[UNTRANSLATED] Affinity Boost Multiplier (0 to disable)`,
317
worldState_resourceBoostMultiplier: `[UNTRANSLATED] Resource Boost Multiplier (0 to disable)`,
318
worldState_resourceBoostMultiplierDesc: `[UNTRANSLATED] Values other than 0, 1, 2, 5, or 10 break Reactant pickups in Void Fissure missions.`,
318
319
worldState_tennoLiveRelay: `Repetidor de TennoLive`,
319
320
worldState_baroTennoConRelay: `Repetidor de Baro de la TennoCon`,
320
321
worldState_saintPatrick: `Día de San Patricio`,
@@ -312,9 +312,10 @@ dict = {
312
312
cheats_noHubDiscrimination: `Hubs unifiés`,
313
313
314
314
worldState: `Carte Solaire`,
315
worldState_creditBoost: `Booster de Crédit`,
316
worldState_affinityBoost: `Booster d'Affinité`,
317
worldState_resourceBoost: `Booster de Ressource`,
315
worldState_creditBoostMultiplier: `[UNTRANSLATED] Credit Boost Multiplier (0 to disable)`,
316
worldState_affinityBoostMultiplier: `[UNTRANSLATED] Affinity Boost Multiplier (0 to disable)`,
317
worldState_resourceBoostMultiplier: `[UNTRANSLATED] Resource Boost Multiplier (0 to disable)`,
318
worldState_resourceBoostMultiplierDesc: `[UNTRANSLATED] Values other than 0, 1, 2, 5, or 10 break Reactant pickups in Void Fissure missions.`,
318
319
worldState_tennoLiveRelay: `Relais TennoLive`,
319
320
worldState_baroTennoConRelay: `Relais Baro TennoCon`,
320
321
worldState_saintPatrick: `Saint-Patrick`,
@@ -312,9 +312,10 @@ dict = {
312
312
cheats_noHubDiscrimination: `Без дискриминации по хабам`,
313
313
314
314
worldState: `Состояние мира`,
315
worldState_creditBoost: `Глобальный бустер Кредитов`,
316
worldState_affinityBoost: `Глобальный бустер Синтеза`,
317
worldState_resourceBoost: `Глобальный бустер Ресурсов`,
315
worldState_creditBoostMultiplier: `[UNTRANSLATED] Credit Boost Multiplier (0 to disable)`,
316
worldState_affinityBoostMultiplier: `[UNTRANSLATED] Affinity Boost Multiplier (0 to disable)`,
317
worldState_resourceBoostMultiplier: `[UNTRANSLATED] Resource Boost Multiplier (0 to disable)`,
318
worldState_resourceBoostMultiplierDesc: `[UNTRANSLATED] Values other than 0, 1, 2, 5, or 10 break Reactant pickups in Void Fissure missions.`,
318
319
worldState_tennoLiveRelay: `Реле TennoLive`,
319
320
worldState_baroTennoConRelay: `Реле Баро TennoCon`,
320
321
worldState_saintPatrick: `День Святого Патрика`,