feat: transmutation of requiem/antivirus/potency mods #1553
@ -57,12 +57,16 @@ export const artifactTransmutationController: RequestHandler = async (req, res)
|
|||||||
payload.Consumed.forEach(upgrade => {
|
payload.Consumed.forEach(upgrade => {
|
||||||
const meta = ExportUpgrades[upgrade.ItemType];
|
const meta = ExportUpgrades[upgrade.ItemType];
|
||||||
counts[meta.rarity] += upgrade.ItemCount;
|
counts[meta.rarity] += upgrade.ItemCount;
|
||||||
|
if (upgrade.ItemId.$oid != "000000000000000000000000") {
|
||||||
|
inventory.Upgrades.pull({ _id: upgrade.ItemId.$oid });
|
||||||
|
} else {
|
||||||
addMods(inventory, [
|
addMods(inventory, [
|
||||||
{
|
{
|
||||||
ItemType: upgrade.ItemType,
|
ItemType: upgrade.ItemType,
|
||||||
ItemCount: upgrade.ItemCount * -1
|
ItemCount: upgrade.ItemCount * -1
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
}
|
||||||
if (upgrade.ItemType == "/Lotus/Upgrades/Mods/TransmuteCores/AttackTransmuteCore") {
|
if (upgrade.ItemType == "/Lotus/Upgrades/Mods/TransmuteCores/AttackTransmuteCore") {
|
||||||
forcedPolarity = "AP_ATTACK";
|
forcedPolarity = "AP_ATTACK";
|
||||||
} else if (upgrade.ItemType == "/Lotus/Upgrades/Mods/TransmuteCores/DefenseTransmuteCore") {
|
} else if (upgrade.ItemType == "/Lotus/Upgrades/Mods/TransmuteCores/DefenseTransmuteCore") {
|
||||||
@ -72,6 +76,15 @@ export const artifactTransmutationController: RequestHandler = async (req, res)
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let newModType: string | undefined;
|
||||||
|
for (const specialModSet of specialModSets) {
|
||||||
|
if (specialModSet.indexOf(payload.Consumed[0].ItemType) != -1) {
|
||||||
|
newModType = getRandomElement(specialModSet);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!newModType) {
|
||||||
// Based on the table on https://wiki.warframe.com/w/Transmutation
|
// Based on the table on https://wiki.warframe.com/w/Transmutation
|
||||||
const weights: Record<TRarity, number> = {
|
const weights: Record<TRarity, number> = {
|
||||||
COMMON: counts.COMMON * 95 + counts.UNCOMMON * 15 + counts.RARE * 4,
|
COMMON: counts.COMMON * 95 + counts.UNCOMMON * 15 + counts.RARE * 4,
|
||||||
@ -87,7 +100,9 @@ export const artifactTransmutationController: RequestHandler = async (req, res)
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const newModType = getRandomWeightedReward(options, weights)!.uniqueName;
|
newModType = getRandomWeightedReward(options, weights)!.uniqueName;
|
||||||
|
}
|
||||||
|
|
||||||
addMods(inventory, [
|
addMods(inventory, [
|
||||||
{
|
{
|
||||||
ItemType: newModType,
|
ItemType: newModType,
|
||||||
@ -130,3 +145,34 @@ interface IAgnosticUpgradeClient {
|
|||||||
ItemCount: number;
|
ItemCount: number;
|
||||||
LastAdded: IOid;
|
LastAdded: IOid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const specialModSets: string[][] = [
|
||||||
|
[
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/ImmortalOneMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/ImmortalTwoMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/ImmortalThreeMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/ImmortalFourMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/ImmortalFiveMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/ImmortalSixMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/ImmortalSevenMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/ImmortalEightMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/ImmortalWildcardMod"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/AntivirusOneMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/AntivirusTwoMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/AntivirusThreeMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/AntivirusFourMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/AntivirusFiveMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/AntivirusSixMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/AntivirusSevenMod",
|
||||||
|
"/Lotus/Upgrades/Mods/Immortal/AntivirusEightMod"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"/Lotus/Upgrades/Mods/DataSpike/Potency/GainAntivirusAndSpeedOnUseMod",
|
||||||
|
"/Lotus/Upgrades/Mods/DataSpike/Potency/GainAntivirusAndWeaponDamageOnUseMod",
|
||||||
|
"/Lotus/Upgrades/Mods/DataSpike/Potency/GainAntivirusLargeOnSingleUseMod",
|
||||||
|
"/Lotus/Upgrades/Mods/DataSpike/Potency/GainAntivirusOnUseMod",
|
||||||
|
"/Lotus/Upgrades/Mods/DataSpike/Potency/GainAntivirusSmallOnSingleUseMod"
|
||||||
|
]
|
||||||
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user