Compare commits

...

5 Commits

Author SHA1 Message Date
ny
8895b5c9ef Remove the machine-generated translations 2025-06-11 12:14:29 +08:00
nyaoouo
66ef5c2b9f add nightwave standing multiplier configuration 2025-06-11 12:12:32 +08:00
60236a1154 chore: update PE+ (#2142)
Closes #2141

Reviewed-on: OpenWF/SpaceNinjaServer#2142
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
2025-06-10 09:48:13 -07:00
1979b20f8c fix: handle multiple syndicate title increases at once (#2139)
Only really possible with nightwave afaik. Bug reported via #2138.

Reviewed-on: OpenWF/SpaceNinjaServer#2139
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
2025-06-10 05:49:43 -07:00
c736310ff3 feat: send clan search message when reaching MR 2 (#2136)
Closes #1960

Reviewed-on: OpenWF/SpaceNinjaServer#2136
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
2025-06-09 11:03:56 -07:00
13 changed files with 101 additions and 71 deletions

8
package-lock.json generated
View File

@ -18,7 +18,7 @@
"morgan": "^1.10.0",
"ncp": "^2.0.0",
"typescript": "^5.5",
"warframe-public-export-plus": "^0.5.65",
"warframe-public-export-plus": "^0.5.66",
"warframe-riven-info": "^0.1.2",
"winston": "^3.17.0",
"winston-daily-rotate-file": "^5.0.0"
@ -3814,9 +3814,9 @@
}
},
"node_modules/warframe-public-export-plus": {
"version": "0.5.65",
"resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.65.tgz",
"integrity": "sha512-y/HN61lE5g8gx0Giutdl/jzQnQmw1u2uI0BiwKVW341nf42sKWQPsKsCVTL5x9MIDYyRCbFsMU+PazKC7byMdg=="
"version": "0.5.66",
"resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.66.tgz",
"integrity": "sha512-AU7XQA96OfYrLm2RioCwDjjdI3IrsmUiqebXyE+bpM0iST+4x/NHu8LTRT4Oygfo/2OBtDYhib7G6re0EeAe5g=="
},
"node_modules/warframe-riven-info": {
"version": "0.1.2",

View File

@ -25,7 +25,7 @@
"morgan": "^1.10.0",
"ncp": "^2.0.0",
"typescript": "^5.5",
"warframe-public-export-plus": "^0.5.65",
"warframe-public-export-plus": "^0.5.66",
"warframe-riven-info": "^0.1.2",
"winston": "^3.17.0",
"winston-daily-rotate-file": "^5.0.0"

View File

@ -3,7 +3,7 @@ import { RequestHandler } from "express";
import { getAccountIdForRequest } from "@/src/services/loginService";
import { ExportSyndicates, ISyndicateSacrifice } from "warframe-public-export-plus";
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
import { addMiscItems, combineInventoryChanges, getInventory, updateCurrency } from "@/src/services/inventoryService";
import { addMiscItem, combineInventoryChanges, getInventory, updateCurrency } from "@/src/services/inventoryService";
import { IInventoryChanges } from "@/src/types/purchaseTypes";
import { toStoreItem } from "@/src/services/itemDataService";
import { logger } from "@/src/utils/logger";
@ -18,80 +18,83 @@ export const syndicateSacrificeController: RequestHandler = async (request, resp
syndicate = inventory.Affiliations[inventory.Affiliations.push({ Tag: data.AffiliationTag, Standing: 0 }) - 1];
}
const level = data.SacrificeLevel - (syndicate.Title ?? 0);
const oldLevel = syndicate.Title ?? 0;
const levelIncrease = data.SacrificeLevel - oldLevel;
if (levelIncrease < 1) {
throw new Error(`syndicate sacrifice needs an increase of at least 1`);
}
if (levelIncrease > 1 && !data.AllowMultiple) {
throw new Error(`desired syndicate level is an increase of ${levelIncrease}, max. allowed increase is 1`);
}
const res: ISyndicateSacrificeResponse = {
AffiliationTag: data.AffiliationTag,
InventoryChanges: {},
Level: data.SacrificeLevel,
LevelIncrease: level <= 0 ? 1 : level,
LevelIncrease: levelIncrease,
NewEpisodeReward: false
};
// Process sacrifices and rewards for every level we're reaching
const manifest = ExportSyndicates[data.AffiliationTag];
let sacrifice: ISyndicateSacrifice | undefined;
let reward: string | undefined;
if (data.SacrificeLevel == 0) {
sacrifice = manifest.initiationSacrifice;
reward = manifest.initiationReward;
syndicate.Initiated = true;
} else {
sacrifice = manifest.titles?.find(x => x.level == data.SacrificeLevel)?.sacrifice;
}
if (sacrifice) {
res.InventoryChanges = { ...updateCurrency(inventory, sacrifice.credits, false) };
const miscItemChanges = sacrifice.items.map(x => ({
ItemType: x.ItemType,
ItemCount: x.ItemCount * -1
}));
addMiscItems(inventory, miscItemChanges);
res.InventoryChanges.MiscItems = miscItemChanges;
}
syndicate.Title ??= 0;
syndicate.Title += 1;
if (reward) {
combineInventoryChanges(
res.InventoryChanges,
(await handleStoreItemAcquisition(reward, inventory)).InventoryChanges
);
}
// Quacks like a nightwave syndicate?
if (manifest.dailyChallenges) {
const title = manifest.titles!.find(x => x.level == syndicate.Title);
if (title) {
res.NewEpisodeReward = true;
let rewardType: string;
let rewardCount: number;
if (title.storeItemReward) {
rewardType = title.storeItemReward;
rewardCount = 1;
} else {
rewardType = toStoreItem(title.reward!.ItemType);
rewardCount = title.reward!.ItemCount;
for (let level = oldLevel + 1; level <= data.SacrificeLevel; ++level) {
let sacrifice: ISyndicateSacrifice | undefined;
if (level == 0) {
sacrifice = manifest.initiationSacrifice;
if (manifest.initiationReward) {
combineInventoryChanges(
res.InventoryChanges,
(await handleStoreItemAcquisition(manifest.initiationReward, inventory)).InventoryChanges
);
}
const rewardInventoryChanges = (await handleStoreItemAcquisition(rewardType, inventory, rewardCount))
.InventoryChanges;
if (Object.keys(rewardInventoryChanges).length == 0) {
logger.debug(`nightwave rank up reward did not seem to get added, giving 50 creds instead`);
const nightwaveCredsItemType = manifest.titles![0].reward!.ItemType;
rewardInventoryChanges.MiscItems = [{ ItemType: nightwaveCredsItemType, ItemCount: 50 }];
addMiscItems(inventory, rewardInventoryChanges.MiscItems);
}
combineInventoryChanges(res.InventoryChanges, rewardInventoryChanges);
syndicate.Initiated = true;
} else {
sacrifice = manifest.titles?.find(x => x.level == level)?.sacrifice;
}
} else {
if (syndicate.Title > 0 && manifest.favours.find(x => x.rankUpReward && x.requiredLevel == syndicate.Title)) {
syndicate.FreeFavorsEarned ??= [];
if (!syndicate.FreeFavorsEarned.includes(syndicate.Title)) {
syndicate.FreeFavorsEarned.push(syndicate.Title);
if (sacrifice) {
updateCurrency(inventory, sacrifice.credits, false, res.InventoryChanges);
for (const item of sacrifice.items) {
addMiscItem(inventory, item.ItemType, item.ItemCount * -1, res.InventoryChanges);
}
}
// Quacks like a nightwave syndicate?
if (manifest.dailyChallenges) {
const title = manifest.titles!.find(x => x.level == level);
if (title) {
res.NewEpisodeReward = true;
let rewardType: string;
let rewardCount: number;
if (title.storeItemReward) {
rewardType = title.storeItemReward;
rewardCount = 1;
} else {
rewardType = toStoreItem(title.reward!.ItemType);
rewardCount = title.reward!.ItemCount;
}
const rewardInventoryChanges = (await handleStoreItemAcquisition(rewardType, inventory, rewardCount))
.InventoryChanges;
if (Object.keys(rewardInventoryChanges).length == 0) {
logger.debug(`nightwave rank up reward did not seem to get added, giving 50 creds instead`);
const nightwaveCredsItemType = manifest.titles![0].reward!.ItemType;
addMiscItem(inventory, nightwaveCredsItemType, 50, rewardInventoryChanges);
}
combineInventoryChanges(res.InventoryChanges, rewardInventoryChanges);
}
} else {
if (level > 0 && manifest.favours.find(x => x.rankUpReward && x.requiredLevel == level)) {
syndicate.FreeFavorsEarned ??= [];
if (!syndicate.FreeFavorsEarned.includes(level)) {
syndicate.FreeFavorsEarned.push(level);
}
}
}
}
// Commit
syndicate.Title = data.SacrificeLevel;
await inventory.save();
response.json(res);

View File

@ -35,6 +35,17 @@ const trainingResultController: RequestHandler = async (req, res): Promise<void>
inventory.PlayerLevel += 1;
inventory.TradesRemaining += 1;
if (inventory.PlayerLevel == 2) {
await createMessage(accountId, [
{
sndr: "/Lotus/Language/Game/Maroo",
msg: "/Lotus/Language/Clan/MarooClanSearchDesc",
sub: "/Lotus/Language/Clan/MarooClanSearchTitle",
icon: "/Lotus/Interface/Icons/Npcs/Maroo.png"
}
]);
}
await createMessage(accountId, [
{
sndr: "/Lotus/Language/Menu/Mailbox_WarframeSender",

View File

@ -65,6 +65,7 @@ interface IConfig {
vallisOverride?: string;
nightwaveOverride?: string;
};
nightwaveStandingMultliplier?: number;
}
export const configPath = path.join(repoDir, "config.json");

View File

@ -1772,13 +1772,18 @@ export const addChallenges = (
}) - 1
];
}
affiliation.Standing += meta.standing!;
if (affiliationMods.length == 0) {
affiliationMods.push({ Tag: nightwaveSyndicateTag });
let standingToAdd = meta.standing ?? 0;
if (standingToAdd >= 0) {
standingToAdd *= config.nightwaveStandingMultliplier ?? 1;
affiliation.Standing += standingToAdd;
if (affiliationMods.length == 0) {
affiliationMods.push({ Tag: nightwaveSyndicateTag });
}
affiliationMods[0].Standing ??= 0;
affiliationMods[0].Standing += standingToAdd;
}
affiliationMods[0].Standing ??= 0;
affiliationMods[0].Standing += meta.standing!;
}
}
}

View File

@ -722,6 +722,10 @@
<label class="form-label" for="spoofMasteryRank" data-loc="cheats_spoofMasteryRank"></label>
<input class="form-control" id="spoofMasteryRank" type="number" min="-1" max="65535" />
</div>
<div class="form-group mt-2">
<label class="form-label" for="nightwaveStandingMultliplier" data-loc="cheats_nightwaveStandingMultliplier"></label>
<input class="form-control" id="nightwaveStandingMultliplier" type="number" min="1" max="1000000" value="1" />
</div>
<button class="btn btn-primary mt-3" type="submit" data-loc="cheats_saveSettings"></button>
</form>
</div>

View File

@ -163,6 +163,7 @@ dict = {
cheats_noDojoResearchTime: `Keine Dojo-Forschungszeit`,
cheats_fastClanAscension: `Schneller Clan-Aufstieg`,
cheats_spoofMasteryRank: `Gefälschter Meisterschaftsrang (-1 zum deaktivieren)`,
cheats_nightwaveStandingMultliplier: `[UNTRANSLATED] Nightwave Standing Multiplier`,
cheats_saveSettings: `Einstellungen speichern`,
cheats_account: `Account`,
cheats_unlockAllFocusSchools: `Alle Fokus-Schulen freischalten`,

View File

@ -162,6 +162,7 @@ dict = {
cheats_noDojoResearchTime: `No Dojo Research Time`,
cheats_fastClanAscension: `Fast Clan Ascension`,
cheats_spoofMasteryRank: `Spoofed Mastery Rank (-1 to disable)`,
cheats_nightwaveStandingMultliplier: `Nightwave Standing Multiplier`,
cheats_saveSettings: `Save Settings`,
cheats_account: `Account`,
cheats_unlockAllFocusSchools: `Unlock All Focus Schools`,

View File

@ -163,6 +163,7 @@ dict = {
cheats_noDojoResearchTime: `Sin tiempo de investigación del dojo`,
cheats_fastClanAscension: `Ascenso rápido del clan`,
cheats_spoofMasteryRank: `Rango de maestría simulado (-1 para desactivar)`,
cheats_nightwaveStandingMultliplier: `[UNTRANSLATED] Nightwave Standing Multiplier`,
cheats_saveSettings: `Guardar configuración`,
cheats_account: `Cuenta`,
cheats_unlockAllFocusSchools: `Desbloquear todas las escuelas de enfoque`,

View File

@ -163,6 +163,7 @@ dict = {
cheats_noDojoResearchTime: `Aucun temps de recherche (Dojo)`,
cheats_fastClanAscension: `Ascension de clan rapide`,
cheats_spoofMasteryRank: `Rang de maîtrise personnalisé (-1 pour désactiver)`,
cheats_nightwaveStandingMultliplier: `[UNTRANSLATED] Nightwave Standing Multiplier`,
cheats_saveSettings: `Sauvegarder les paramètres`,
cheats_account: `Compte`,
cheats_unlockAllFocusSchools: `Débloquer toutes les écoles de focus`,

View File

@ -163,6 +163,7 @@ dict = {
cheats_noDojoResearchTime: `Мгновенные Исследование Додзё`,
cheats_fastClanAscension: `Мгновенное Вознесение Клана`,
cheats_spoofMasteryRank: `Подделанный ранг мастерства (-1 для отключения)`,
cheats_nightwaveStandingMultliplier: `[UNTRANSLATED] Nightwave Standing Multiplier`,
cheats_saveSettings: `Сохранить настройки`,
cheats_account: `Аккаунт`,
cheats_unlockAllFocusSchools: `Разблокировать все школы фокуса`,

View File

@ -163,6 +163,7 @@ dict = {
cheats_noDojoResearchTime: `无视道场研究时间`,
cheats_fastClanAscension: `快速升级氏族`,
cheats_spoofMasteryRank: `伪造精通段位(-1为禁用)`,
cheats_nightwaveStandingMultliplier: `午夜电波声望倍率`,
cheats_saveSettings: `保存设置`,
cheats_account: `账户`,
cheats_unlockAllFocusSchools: `解锁所有专精学派`,