feat: clan xp #1100
@ -36,5 +36,6 @@
|
|||||||
"fastDojoRoomDestruction": true,
|
"fastDojoRoomDestruction": true,
|
||||||
"noDojoResearchCosts": true,
|
"noDojoResearchCosts": true,
|
||||||
"noDojoResearchTime": true,
|
"noDojoResearchTime": true,
|
||||||
|
"fastClanAscension": true,
|
||||||
"spoofMasteryRank": -1
|
"spoofMasteryRank": -1
|
||||||
}
|
}
|
||||||
|
8
package-lock.json
generated
8
package-lock.json
generated
@ -12,7 +12,7 @@
|
|||||||
"copyfiles": "^2.4.1",
|
"copyfiles": "^2.4.1",
|
||||||
"express": "^5",
|
"express": "^5",
|
||||||
"mongoose": "^8.11.0",
|
"mongoose": "^8.11.0",
|
||||||
"warframe-public-export-plus": "^0.5.39",
|
"warframe-public-export-plus": "^0.5.40",
|
||||||
"warframe-riven-info": "^0.1.2",
|
"warframe-riven-info": "^0.1.2",
|
||||||
"winston": "^3.17.0",
|
"winston": "^3.17.0",
|
||||||
"winston-daily-rotate-file": "^5.0.0"
|
"winston-daily-rotate-file": "^5.0.0"
|
||||||
@ -4083,9 +4083,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/warframe-public-export-plus": {
|
"node_modules/warframe-public-export-plus": {
|
||||||
"version": "0.5.39",
|
"version": "0.5.40",
|
||||||
"resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.39.tgz",
|
"resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.40.tgz",
|
||||||
"integrity": "sha512-sEGZedtW4I/M2ceoDs6MQ5eHD7sJgv1KRNLt8BWByXLuDa7qTR3Y9px5TGxqt/rBHKGUyPO1LUxu4bDGZi6yXw=="
|
"integrity": "sha512-/qr46LE/KqDdEkW4z52EG0vZP0Z8U26FscFJ2G5K5ewbQdlSVxtf5fpOnzRkAO7jWWKfgoqx7l5WUgaLSPDj0g=="
|
||||||
},
|
},
|
||||||
"node_modules/warframe-riven-info": {
|
"node_modules/warframe-riven-info": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.2",
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
"copyfiles": "^2.4.1",
|
"copyfiles": "^2.4.1",
|
||||||
"express": "^5",
|
"express": "^5",
|
||||||
"mongoose": "^8.11.0",
|
"mongoose": "^8.11.0",
|
||||||
"warframe-public-export-plus": "^0.5.39",
|
"warframe-public-export-plus": "^0.5.40",
|
||||||
"warframe-riven-info": "^0.1.2",
|
"warframe-riven-info": "^0.1.2",
|
||||||
"winston": "^3.17.0",
|
"winston": "^3.17.0",
|
||||||
"winston-daily-rotate-file": "^5.0.0"
|
"winston-daily-rotate-file": "^5.0.0"
|
||||||
|
66
src/controllers/api/contributeGuildClassController.ts
Normal file
66
src/controllers/api/contributeGuildClassController.ts
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
import { toMongoDate } from "@/src/helpers/inventoryHelpers";
|
||||||
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
|
import { Guild } from "@/src/models/guildModel";
|
||||||
|
import { config } from "@/src/services/configService";
|
||||||
|
import { getInventory } from "@/src/services/inventoryService";
|
||||||
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
|
import { RequestHandler } from "express";
|
||||||
|
import { Types } from "mongoose";
|
||||||
|
|
||||||
|
export const contributeGuildClassController: RequestHandler = async (req, res) => {
|
||||||
|
const accountId = await getAccountIdForRequest(req);
|
||||||
|
const payload = getJSONfromString<IContributeGuildClassRequest>(String(req.body));
|
||||||
|
const guild = (await Guild.findOne({ _id: payload.GuildId }))!;
|
||||||
|
|
||||||
|
// First contributor initiates ceremony and locks the pending class.
|
||||||
|
if (!guild.CeremonyContributors) {
|
||||||
|
guild.CeremonyContributors = [];
|
||||||
|
guild.CeremonyClass = guildXpToClass(guild.XP);
|
||||||
|
guild.CeremonyEndo = 0;
|
||||||
|
for (let i = guild.Class; i != guild.CeremonyClass; ++i) {
|
||||||
|
guild.CeremonyEndo += (i + 1) * 1000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
guild.CeremonyContributors.push(new Types.ObjectId(accountId));
|
||||||
|
|
||||||
|
// Once required contributor count is hit, the class is committed and there's 72 hours to claim endo.
|
||||||
|
if (guild.CeremonyContributors.length == payload.RequiredContributors) {
|
||||||
|
guild.Class = guild.CeremonyClass!;
|
||||||
|
guild.CeremonyClass = undefined;
|
||||||
|
guild.CeremonyResetDate = new Date(Date.now() + (config.fastClanAscension ? 5_000 : 72 * 3600_000));
|
||||||
|
}
|
||||||
|
|
||||||
|
await guild.save();
|
||||||
|
|
||||||
|
// Either way, endo is given to the contributor.
|
||||||
|
const inventory = await getInventory(accountId, "FusionPoints");
|
||||||
|
inventory.FusionPoints += guild.CeremonyEndo!;
|
||||||
|
await inventory.save();
|
||||||
|
|
||||||
|
res.json({
|
||||||
|
NumContributors: guild.CeremonyContributors.length,
|
||||||
|
FusionPointReward: guild.CeremonyEndo,
|
||||||
|
Class: guild.Class,
|
||||||
|
CeremonyResetDate: guild.CeremonyResetDate ? toMongoDate(guild.CeremonyResetDate) : undefined
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
interface IContributeGuildClassRequest {
|
||||||
|
GuildId: string;
|
||||||
|
RequiredContributors: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
const guildXpToClass = (xp: number): number => {
|
||||||
|
const cummXp = [
|
||||||
|
0, 11000, 34000, 69000, 114000, 168000, 231000, 302000, 381000, 68000, 563000, 665000, 774000, 891000
|
||||||
|
];
|
||||||
|
let highest = 0;
|
||||||
|
for (let i = 0; i != cummXp.length; ++i) {
|
||||||
|
if (xp < cummXp[i]) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
highest = i;
|
||||||
|
}
|
||||||
|
return highest;
|
||||||
|
};
|
@ -1,13 +1,18 @@
|
|||||||
import { TGuildDatabaseDocument } from "@/src/models/guildModel";
|
import { TGuildDatabaseDocument } from "@/src/models/guildModel";
|
||||||
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
|
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
|
||||||
import { getDojoClient, getGuildForRequestEx, scaleRequiredCount } from "@/src/services/guildService";
|
import {
|
||||||
|
getDojoClient,
|
||||||
|
getGuildForRequestEx,
|
||||||
|
processDojoBuildMaterialsGathered,
|
||||||
|
scaleRequiredCount
|
||||||
|
} from "@/src/services/guildService";
|
||||||
import { addMiscItems, getInventory, updateCurrency } from "@/src/services/inventoryService";
|
import { addMiscItems, getInventory, updateCurrency } from "@/src/services/inventoryService";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { IDojoContributable } from "@/src/types/guildTypes";
|
import { IDojoContributable } from "@/src/types/guildTypes";
|
||||||
import { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { ExportDojoRecipes, IDojoRecipe } from "warframe-public-export-plus";
|
import { ExportDojoRecipes, IDojoBuild } from "warframe-public-export-plus";
|
||||||
|
|
||||||
interface IContributeToDojoComponentRequest {
|
interface IContributeToDojoComponentRequest {
|
||||||
ComponentId: string;
|
ComponentId: string;
|
||||||
@ -57,7 +62,7 @@ const processContribution = (
|
|||||||
request: IContributeToDojoComponentRequest,
|
request: IContributeToDojoComponentRequest,
|
||||||
inventory: TInventoryDatabaseDocument,
|
inventory: TInventoryDatabaseDocument,
|
||||||
inventoryChanges: IInventoryChanges,
|
inventoryChanges: IInventoryChanges,
|
||||||
meta: IDojoRecipe,
|
meta: IDojoBuild,
|
||||||
component: IDojoContributable
|
component: IDojoContributable
|
||||||
): void => {
|
): void => {
|
||||||
component.RegularCredits ??= 0;
|
component.RegularCredits ??= 0;
|
||||||
@ -134,6 +139,7 @@ const processContribution = (
|
|||||||
}
|
}
|
||||||
if (fullyFunded) {
|
if (fullyFunded) {
|
||||||
component.CompletionTime = new Date(Date.now() + meta.time * 1000);
|
component.CompletionTime = new Date(Date.now() + meta.time * 1000);
|
||||||
|
processDojoBuildMaterialsGathered(guild, meta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -3,7 +3,7 @@ import { getInventory, updateCurrency } from "@/src/services/inventoryService";
|
|||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { IDojoContributable } from "@/src/types/guildTypes";
|
import { IDojoContributable } from "@/src/types/guildTypes";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { ExportDojoRecipes, IDojoRecipe } from "warframe-public-export-plus";
|
import { ExportDojoRecipes, IDojoBuild } from "warframe-public-export-plus";
|
||||||
|
|
||||||
interface IDojoComponentRushRequest {
|
interface IDojoComponentRushRequest {
|
||||||
DecoType?: string;
|
DecoType?: string;
|
||||||
@ -40,7 +40,7 @@ export const dojoComponentRushController: RequestHandler = async (req, res) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const processContribution = (component: IDojoContributable, meta: IDojoRecipe, platinumDonated: number): void => {
|
const processContribution = (component: IDojoContributable, meta: IDojoBuild, platinumDonated: number): void => {
|
||||||
const fullPlatinumCost = scaleRequiredCount(meta.skipTimePrice);
|
const fullPlatinumCost = scaleRequiredCount(meta.skipTimePrice);
|
||||||
const fullDurationSeconds = meta.time;
|
const fullDurationSeconds = meta.time;
|
||||||
const secondsPerPlatinum = fullDurationSeconds / fullPlatinumCost;
|
const secondsPerPlatinum = fullDurationSeconds / fullPlatinumCost;
|
||||||
|
@ -2,8 +2,9 @@ import { RequestHandler } from "express";
|
|||||||
import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
|
import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
|
||||||
import { Guild } from "@/src/models/guildModel";
|
import { Guild } from "@/src/models/guildModel";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { toOid } from "@/src/helpers/inventoryHelpers";
|
import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
|
||||||
import { getGuildVault } from "@/src/services/guildService";
|
import { getGuildVault } from "@/src/services/guildService";
|
||||||
|
import { logger } from "@/src/utils/logger";
|
||||||
|
|
||||||
const getGuildController: RequestHandler = async (req, res) => {
|
const getGuildController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -15,6 +16,13 @@ const getGuildController: RequestHandler = async (req, res) => {
|
|||||||
if (inventory.GuildId) {
|
if (inventory.GuildId) {
|
||||||
const guild = await Guild.findOne({ _id: inventory.GuildId });
|
const guild = await Guild.findOne({ _id: inventory.GuildId });
|
||||||
if (guild) {
|
if (guild) {
|
||||||
|
if (guild.CeremonyResetDate && Date.now() >= guild.CeremonyResetDate.getTime()) {
|
||||||
|
logger.debug(`ascension ceremony is over`);
|
||||||
|
guild.CeremonyEndo = undefined;
|
||||||
|
guild.CeremonyContributors = undefined;
|
||||||
|
guild.CeremonyResetDate = undefined;
|
||||||
|
await guild.save();
|
||||||
|
}
|
||||||
res.json({
|
res.json({
|
||||||
_id: toOid(guild._id),
|
_id: toOid(guild._id),
|
||||||
Name: guild.Name,
|
Name: guild.Name,
|
||||||
@ -64,7 +72,12 @@ const getGuildController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
Tier: 1,
|
Tier: 1,
|
||||||
Vault: getGuildVault(guild)
|
Vault: getGuildVault(guild),
|
||||||
|
Class: guild.Class,
|
||||||
|
XP: guild.XP,
|
||||||
|
IsContributor: !!guild.CeremonyContributors?.find(x => x.equals(accountId)),
|
||||||
|
NumContributors: guild.CeremonyContributors?.length ?? 0,
|
||||||
|
CeremonyResetDate: guild.CeremonyResetDate ? toMongoDate(guild.CeremonyResetDate) : undefined
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
|
|||||||
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
import { IInventoryChanges } from "@/src/types/purchaseTypes";
|
||||||
import { config } from "@/src/services/configService";
|
import { config } from "@/src/services/configService";
|
||||||
import { ITechProjectDatabase } from "@/src/types/guildTypes";
|
import { ITechProjectDatabase } from "@/src/types/guildTypes";
|
||||||
|
import { TGuildDatabaseDocument } from "@/src/models/guildModel";
|
||||||
|
|
||||||
export const guildTechController: RequestHandler = async (req, res) => {
|
export const guildTechController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -35,7 +36,7 @@ export const guildTechController: RequestHandler = async (req, res) => {
|
|||||||
}) - 1
|
}) - 1
|
||||||
];
|
];
|
||||||
if (config.noDojoResearchCosts) {
|
if (config.noDojoResearchCosts) {
|
||||||
processFundedProject(techProject, recipe);
|
processFundedProject(guild, techProject, recipe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await guild.save();
|
await guild.save();
|
||||||
@ -93,7 +94,7 @@ export const guildTechController: RequestHandler = async (req, res) => {
|
|||||||
if (techProject.ReqCredits == 0 && !techProject.ReqItems.find(x => x.ItemCount > 0)) {
|
if (techProject.ReqCredits == 0 && !techProject.ReqItems.find(x => x.ItemCount > 0)) {
|
||||||
// This research is now fully funded.
|
// This research is now fully funded.
|
||||||
const recipe = ExportDojoRecipes.research[data.RecipeType!];
|
const recipe = ExportDojoRecipes.research[data.RecipeType!];
|
||||||
processFundedProject(techProject, recipe);
|
processFundedProject(guild, techProject, recipe);
|
||||||
}
|
}
|
||||||
|
|
||||||
await guild.save();
|
await guild.save();
|
||||||
@ -131,9 +132,16 @@ export const guildTechController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const processFundedProject = (techProject: ITechProjectDatabase, recipe: IDojoResearch): void => {
|
const processFundedProject = (
|
||||||
|
guild: TGuildDatabaseDocument,
|
||||||
|
techProject: ITechProjectDatabase,
|
||||||
|
recipe: IDojoResearch
|
||||||
|
): void => {
|
||||||
techProject.State = 1;
|
techProject.State = 1;
|
||||||
techProject.CompletionDate = new Date(new Date().getTime() + (config.noDojoResearchTime ? 0 : recipe.time) * 1000);
|
techProject.CompletionDate = new Date(new Date().getTime() + (config.noDojoResearchTime ? 0 : recipe.time) * 1000);
|
||||||
|
if (recipe.guildXpValue) {
|
||||||
|
guild.XP += recipe.guildXpValue;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
type TGuildTechRequest = {
|
type TGuildTechRequest = {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { IDojoComponentClient } from "@/src/types/guildTypes";
|
import { IDojoComponentClient } from "@/src/types/guildTypes";
|
||||||
import { getDojoClient, getGuildForRequest } from "@/src/services/guildService";
|
import { getDojoClient, getGuildForRequest, processDojoBuildMaterialsGathered } from "@/src/services/guildService";
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { ExportDojoRecipes } from "warframe-public-export-plus";
|
import { ExportDojoRecipes } from "warframe-public-export-plus";
|
||||||
import { config } from "@/src/services/configService";
|
import { config } from "@/src/services/configService";
|
||||||
@ -35,6 +35,9 @@ export const startDojoRecipeController: RequestHandler = async (req, res) => {
|
|||||||
];
|
];
|
||||||
if (config.noDojoRoomBuildStage) {
|
if (config.noDojoRoomBuildStage) {
|
||||||
component.CompletionTime = new Date(Date.now());
|
component.CompletionTime = new Date(Date.now());
|
||||||
|
if (room) {
|
||||||
|
processDojoBuildMaterialsGathered(guild, room);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await guild.save();
|
await guild.save();
|
||||||
res.json(await getDojoClient(guild, 0));
|
res.json(await getDojoClient(guild, 0));
|
||||||
|
@ -70,7 +70,14 @@ const guildSchema = new Schema<IGuildDatabase>(
|
|||||||
VaultMiscItems: { type: [typeCountSchema], default: undefined },
|
VaultMiscItems: { type: [typeCountSchema], default: undefined },
|
||||||
VaultShipDecorations: { type: [typeCountSchema], default: undefined },
|
VaultShipDecorations: { type: [typeCountSchema], default: undefined },
|
||||||
VaultFusionTreasures: { type: [fusionTreasuresSchema], default: undefined },
|
VaultFusionTreasures: { type: [fusionTreasuresSchema], default: undefined },
|
||||||
TechProjects: { type: [techProjectSchema], default: undefined }
|
TechProjects: { type: [techProjectSchema], default: undefined },
|
||||||
|
Class: { type: Number, default: 0 },
|
||||||
|
XP: { type: Number, default: 0 },
|
||||||
|
ClaimedXP: { type: [String], default: undefined },
|
||||||
|
CeremonyClass: Number,
|
||||||
|
CeremonyContributors: { type: [Types.ObjectId], default: undefined },
|
||||||
|
CeremonyResetDate: Date,
|
||||||
|
CeremonyEndo: Number
|
||||||
},
|
},
|
||||||
{ id: false }
|
{ id: false }
|
||||||
);
|
);
|
||||||
|
@ -13,6 +13,7 @@ import { claimCompletedRecipeController } from "@/src/controllers/api/claimCompl
|
|||||||
import { claimLibraryDailyTaskRewardController } from "@/src/controllers/api/claimLibraryDailyTaskRewardController";
|
import { claimLibraryDailyTaskRewardController } from "@/src/controllers/api/claimLibraryDailyTaskRewardController";
|
||||||
import { clearDialogueHistoryController } from "@/src/controllers/api/clearDialogueHistoryController";
|
import { clearDialogueHistoryController } from "@/src/controllers/api/clearDialogueHistoryController";
|
||||||
import { completeRandomModChallengeController } from "@/src/controllers/api/completeRandomModChallengeController";
|
import { completeRandomModChallengeController } from "@/src/controllers/api/completeRandomModChallengeController";
|
||||||
|
import { contributeGuildClassController } from "@/src/controllers/api/contributeGuildClassController";
|
||||||
import { contributeToDojoComponentController } from "@/src/controllers/api/contributeToDojoComponentController";
|
import { contributeToDojoComponentController } from "@/src/controllers/api/contributeToDojoComponentController";
|
||||||
import { contributeToVaultController } from "@/src/controllers/api/contributeToVaultController";
|
import { contributeToVaultController } from "@/src/controllers/api/contributeToVaultController";
|
||||||
import { createGuildController } from "@/src/controllers/api/createGuildController";
|
import { createGuildController } from "@/src/controllers/api/createGuildController";
|
||||||
@ -153,6 +154,7 @@ apiRouter.post("/changeDojoRoot.php", changeDojoRootController);
|
|||||||
apiRouter.post("/claimCompletedRecipe.php", claimCompletedRecipeController);
|
apiRouter.post("/claimCompletedRecipe.php", claimCompletedRecipeController);
|
||||||
apiRouter.post("/clearDialogueHistory.php", clearDialogueHistoryController);
|
apiRouter.post("/clearDialogueHistory.php", clearDialogueHistoryController);
|
||||||
apiRouter.post("/completeRandomModChallenge.php", completeRandomModChallengeController);
|
apiRouter.post("/completeRandomModChallenge.php", completeRandomModChallengeController);
|
||||||
|
apiRouter.post("/contributeGuildClass.php", contributeGuildClassController);
|
||||||
apiRouter.post("/contributeToDojoComponent.php", contributeToDojoComponentController);
|
apiRouter.post("/contributeToDojoComponent.php", contributeToDojoComponentController);
|
||||||
apiRouter.post("/contributeToVault.php", contributeToVaultController);
|
apiRouter.post("/contributeToVault.php", contributeToVaultController);
|
||||||
apiRouter.post("/createGuild.php", createGuildController);
|
apiRouter.post("/createGuild.php", createGuildController);
|
||||||
|
@ -62,6 +62,7 @@ interface IConfig {
|
|||||||
fastDojoRoomDestruction?: boolean;
|
fastDojoRoomDestruction?: boolean;
|
||||||
noDojoResearchCosts?: boolean;
|
noDojoResearchCosts?: boolean;
|
||||||
noDojoResearchTime?: boolean;
|
noDojoResearchTime?: boolean;
|
||||||
|
fastClanAscension?: boolean;
|
||||||
spoofMasteryRank?: number;
|
spoofMasteryRank?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import {
|
|||||||
} from "@/src/types/guildTypes";
|
} from "@/src/types/guildTypes";
|
||||||
import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
|
import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { ExportDojoRecipes } from "warframe-public-export-plus";
|
import { ExportDojoRecipes, IDojoBuild } from "warframe-public-export-plus";
|
||||||
import { logger } from "../utils/logger";
|
import { logger } from "../utils/logger";
|
||||||
|
|
||||||
export const getGuildForRequest = async (req: Request): Promise<TGuildDatabaseDocument> => {
|
export const getGuildForRequest = async (req: Request): Promise<TGuildDatabaseDocument> => {
|
||||||
@ -182,3 +182,13 @@ const moveResourcesToVault = (guild: TGuildDatabaseDocument, component: IDojoCon
|
|||||||
guild.VaultPremiumCredits += component.RushPlatinum;
|
guild.VaultPremiumCredits += component.RushPlatinum;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const processDojoBuildMaterialsGathered = (guild: TGuildDatabaseDocument, build: IDojoBuild): void => {
|
||||||
|
if (build.guildXpValue) {
|
||||||
|
guild.ClaimedXP ??= [];
|
||||||
|
if (!guild.ClaimedXP.find(x => x == build.resultType)) {
|
||||||
|
guild.ClaimedXP.push(build.resultType);
|
||||||
|
guild.XP += build.guildXpValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
@ -2,21 +2,29 @@ import { Types } from "mongoose";
|
|||||||
import { IOid, IMongoDate } from "@/src/types/commonTypes";
|
import { IOid, IMongoDate } from "@/src/types/commonTypes";
|
||||||
import { IFusionTreasure, IMiscItem, ITypeCount } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { IFusionTreasure, IMiscItem, ITypeCount } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
|
|
||||||
export interface IGuild {
|
export interface IGuildDatabase {
|
||||||
Name: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IGuildDatabase extends IGuild {
|
|
||||||
_id: Types.ObjectId;
|
_id: Types.ObjectId;
|
||||||
|
Name: string;
|
||||||
|
|
||||||
DojoComponents: IDojoComponentDatabase[];
|
DojoComponents: IDojoComponentDatabase[];
|
||||||
DojoCapacity: number;
|
DojoCapacity: number;
|
||||||
DojoEnergy: number;
|
DojoEnergy: number;
|
||||||
|
|
||||||
VaultRegularCredits?: number;
|
VaultRegularCredits?: number;
|
||||||
VaultPremiumCredits?: number;
|
VaultPremiumCredits?: number;
|
||||||
VaultMiscItems?: IMiscItem[];
|
VaultMiscItems?: IMiscItem[];
|
||||||
VaultShipDecorations?: ITypeCount[];
|
VaultShipDecorations?: ITypeCount[];
|
||||||
VaultFusionTreasures?: IFusionTreasure[];
|
VaultFusionTreasures?: IFusionTreasure[];
|
||||||
|
|
||||||
TechProjects?: ITechProjectDatabase[];
|
TechProjects?: ITechProjectDatabase[];
|
||||||
|
|
||||||
|
Class: number;
|
||||||
|
XP: number;
|
||||||
|
ClaimedXP?: string[]; // track rooms and decos that have already granted XP
|
||||||
|
CeremonyClass?: number;
|
||||||
|
CeremonyEndo?: number;
|
||||||
|
CeremonyContributors?: Types.ObjectId[];
|
||||||
|
CeremonyResetDate?: Date;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IGuildVault {
|
export interface IGuildVault {
|
||||||
|
@ -537,6 +537,10 @@
|
|||||||
<input class="form-check-input" type="checkbox" id="noDojoResearchTime" />
|
<input class="form-check-input" type="checkbox" id="noDojoResearchTime" />
|
||||||
<label class="form-check-label" for="noDojoResearchTime" data-loc="cheats_noDojoResearchTime"></label>
|
<label class="form-check-label" for="noDojoResearchTime" data-loc="cheats_noDojoResearchTime"></label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" id="fastClanAscension" />
|
||||||
|
<label class="form-check-label" for="fastClanAscension" data-loc="cheats_fastClanAscension"></label>
|
||||||
|
</div>
|
||||||
<div class="form-group mt-2">
|
<div class="form-group mt-2">
|
||||||
<label class="form-label" for="spoofMasteryRank" data-loc="cheats_spoofMasteryRank"></label>
|
<label class="form-label" for="spoofMasteryRank" data-loc="cheats_spoofMasteryRank"></label>
|
||||||
<input class="form-control" id="spoofMasteryRank" type="number" min="-1" max="65535" />
|
<input class="form-control" id="spoofMasteryRank" type="number" min="-1" max="65535" />
|
||||||
|
@ -114,6 +114,7 @@ dict = {
|
|||||||
cheats_fastDojoRoomDestruction: `Fast Dojo Room Destruction`,
|
cheats_fastDojoRoomDestruction: `Fast Dojo Room Destruction`,
|
||||||
cheats_noDojoResearchCosts: `No Dojo Research Costs`,
|
cheats_noDojoResearchCosts: `No Dojo Research Costs`,
|
||||||
cheats_noDojoResearchTime: `No Dojo Research Time`,
|
cheats_noDojoResearchTime: `No Dojo Research Time`,
|
||||||
|
cheats_fastClanAscension: `Fast Clan Ascension`,
|
||||||
cheats_spoofMasteryRank: `Spoofed Mastery Rank (-1 to disable)`,
|
cheats_spoofMasteryRank: `Spoofed Mastery Rank (-1 to disable)`,
|
||||||
cheats_saveSettings: `Save Settings`,
|
cheats_saveSettings: `Save Settings`,
|
||||||
cheats_account: `Account`,
|
cheats_account: `Account`,
|
||||||
|
@ -115,6 +115,7 @@ dict = {
|
|||||||
cheats_fastDojoRoomDestruction: `[UNTRANSLATED] Fast Dojo Room Destruction`,
|
cheats_fastDojoRoomDestruction: `[UNTRANSLATED] Fast Dojo Room Destruction`,
|
||||||
cheats_noDojoResearchCosts: `Aucun coût de recherche (Dojo)`,
|
cheats_noDojoResearchCosts: `Aucun coût de recherche (Dojo)`,
|
||||||
cheats_noDojoResearchTime: `Aucun temps de recherche (Dojo)`,
|
cheats_noDojoResearchTime: `Aucun temps de recherche (Dojo)`,
|
||||||
|
cheats_fastClanAscension: `[UNTRANSLATED] Fast Clan Ascension`,
|
||||||
cheats_spoofMasteryRank: `Spoofed Mastery Rank (-1 to disable)`,
|
cheats_spoofMasteryRank: `Spoofed Mastery Rank (-1 to disable)`,
|
||||||
cheats_saveSettings: `Sauvegarder les paramètres`,
|
cheats_saveSettings: `Sauvegarder les paramètres`,
|
||||||
cheats_account: `Compte`,
|
cheats_account: `Compte`,
|
||||||
|
@ -115,6 +115,7 @@ dict = {
|
|||||||
cheats_fastDojoRoomDestruction: `Мгновенные Уничтожение Комнат Додзё`,
|
cheats_fastDojoRoomDestruction: `Мгновенные Уничтожение Комнат Додзё`,
|
||||||
cheats_noDojoResearchCosts: `Бесплатные Исследование Додзё`,
|
cheats_noDojoResearchCosts: `Бесплатные Исследование Додзё`,
|
||||||
cheats_noDojoResearchTime: `Мгновенные Исследование Додзё`,
|
cheats_noDojoResearchTime: `Мгновенные Исследование Додзё`,
|
||||||
|
cheats_fastClanAscension: `[UNTRANSLATED] Fast Clan Ascension`,
|
||||||
cheats_spoofMasteryRank: `Подделанный ранг мастерства (-1 для отключения)`,
|
cheats_spoofMasteryRank: `Подделанный ранг мастерства (-1 для отключения)`,
|
||||||
cheats_saveSettings: `Сохранить настройки`,
|
cheats_saveSettings: `Сохранить настройки`,
|
||||||
cheats_account: `Аккаунт`,
|
cheats_account: `Аккаунт`,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user