forked from OpenWF/SpaceNinjaServer
lab conquest rewards
This commit is contained in:
parent
ed21f45491
commit
bff08c4767
@ -589,6 +589,74 @@ interface AddMissionRewardsReturnType {
|
|||||||
ConquestCompletedMissionsCount?: number;
|
ConquestCompletedMissionsCount?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface IConquestReward {
|
||||||
|
at: number;
|
||||||
|
pool: IRngResult[];
|
||||||
|
}
|
||||||
|
|
||||||
|
const labConquestRewards: IConquestReward[] = [
|
||||||
|
{
|
||||||
|
at: 5,
|
||||||
|
pool: ExportRewards[
|
||||||
|
"/Lotus/Types/Game/MissionDecks/EntratiLabConquestRewards/EntratiLabConquestSilverRewards"
|
||||||
|
][0] as IRngResult[]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
at: 10,
|
||||||
|
pool: ExportRewards[
|
||||||
|
"/Lotus/Types/Game/MissionDecks/EntratiLabConquestRewards/EntratiLabConquestSilverRewards"
|
||||||
|
][0] as IRngResult[]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
at: 15,
|
||||||
|
pool: [
|
||||||
|
{
|
||||||
|
type: "/Lotus/StoreItems/Types/Gameplay/EntratiLab/Resources/EntratiLanthornBundle",
|
||||||
|
itemCount: 3,
|
||||||
|
probability: 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
at: 20,
|
||||||
|
pool: ExportRewards[
|
||||||
|
"/Lotus/Types/Game/MissionDecks/EntratiLabConquestRewards/EntratiLabConquestGoldRewards"
|
||||||
|
][0] as IRngResult[]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
at: 28,
|
||||||
|
pool: [
|
||||||
|
{
|
||||||
|
type: "/Lotus/StoreItems/Types/Items/MiscItems/DistillPoints",
|
||||||
|
itemCount: 20,
|
||||||
|
probability: 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
at: 31,
|
||||||
|
pool: ExportRewards[
|
||||||
|
"/Lotus/Types/Game/MissionDecks/EntratiLabConquestRewards/EntratiLabConquestGoldRewards"
|
||||||
|
][0] as IRngResult[]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
at: 34,
|
||||||
|
pool: ExportRewards[
|
||||||
|
"/Lotus/Types/Game/MissionDecks/EntratiLabConquestRewards/EntratiLabConquestArcaneRewards"
|
||||||
|
][0] as IRngResult[]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
at: 37,
|
||||||
|
pool: [
|
||||||
|
{
|
||||||
|
type: "/Lotus/StoreItems/Types/Items/MiscItems/DistillPoints",
|
||||||
|
itemCount: 20,
|
||||||
|
probability: 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
//TODO: return type of partial missioninventoryupdate response
|
//TODO: return type of partial missioninventoryupdate response
|
||||||
export const addMissionRewards = async (
|
export const addMissionRewards = async (
|
||||||
inventory: TInventoryDatabaseDocument,
|
inventory: TInventoryDatabaseDocument,
|
||||||
@ -706,6 +774,8 @@ export const addMissionRewards = async (
|
|||||||
|
|
||||||
if (rewardInfo.ConquestCompleted == 2 && rewardInfo.ConquestHardModeActive === 1) score += 1;
|
if (rewardInfo.ConquestCompleted == 2 && rewardInfo.ConquestHardModeActive === 1) score += 1;
|
||||||
|
|
||||||
|
logger.debug(`completed conquest mission ${rewardInfo.ConquestCompleted + 1} for a score of ${score}`);
|
||||||
|
|
||||||
const conquestType = rewardInfo.ConquestType;
|
const conquestType = rewardInfo.ConquestType;
|
||||||
const conquestNode =
|
const conquestNode =
|
||||||
conquestType == "HexConquest" ? "EchoesHexConquestHardModeUnlocked" : "EntratiLabConquestHardModeUnlocked";
|
conquestType == "HexConquest" ? "EchoesHexConquestHardModeUnlocked" : "EntratiLabConquestHardModeUnlocked";
|
||||||
@ -720,6 +790,17 @@ export const addMissionRewards = async (
|
|||||||
} else {
|
} else {
|
||||||
inventory.EntratiLabConquestCacheScoreMission ??= 0;
|
inventory.EntratiLabConquestCacheScoreMission ??= 0;
|
||||||
|
|
||||||
|
for (const reward of labConquestRewards) {
|
||||||
|
if (score >= reward.at && inventory.EntratiLabConquestCacheScoreMission < reward.at) {
|
||||||
|
const rolled = getRandomReward(reward.pool)!;
|
||||||
|
logger.debug(`rolled lab conquest reward for reaching ${reward.at} points`, rolled);
|
||||||
|
MissionRewards.push({
|
||||||
|
StoreItem: rolled.type,
|
||||||
|
ItemCount: rolled.itemCount
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (score > inventory.EntratiLabConquestCacheScoreMission)
|
if (score > inventory.EntratiLabConquestCacheScoreMission)
|
||||||
inventory.EntratiLabConquestCacheScoreMission = score;
|
inventory.EntratiLabConquestCacheScoreMission = score;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user