cheat: extraRelicRewards
This commit is contained in:
parent
f5c1b83598
commit
0796917740
@ -11,11 +11,13 @@ export const getVoidProjectionRewardsController: RequestHandler = async (req, re
|
|||||||
|
|
||||||
if (data.ParticipantInfo.QualifiesForReward && !data.ParticipantInfo.HaveRewardResponse) {
|
if (data.ParticipantInfo.QualifiesForReward && !data.ParticipantInfo.HaveRewardResponse) {
|
||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(accountId);
|
||||||
const reward = await crackRelic(inventory, data.ParticipantInfo);
|
const rewards = await crackRelic(inventory, data.ParticipantInfo);
|
||||||
if (!inventory.MissionRelicRewards || inventory.MissionRelicRewards.length >= data.CurrentWave) {
|
if (!inventory.MissionRelicRewards || inventory.MissionRelicRewards.length >= data.CurrentWave) {
|
||||||
inventory.MissionRelicRewards = [];
|
inventory.MissionRelicRewards = [];
|
||||||
}
|
}
|
||||||
inventory.MissionRelicRewards.push({ ItemType: reward.type, ItemCount: reward.itemCount });
|
rewards.forEach(reward => {
|
||||||
|
(inventory.MissionRelicRewards ??= []).push({ ItemType: reward.type, ItemCount: reward.itemCount });
|
||||||
|
});
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ export const crackRelic = async (
|
|||||||
inventory: TInventoryDatabaseDocument,
|
inventory: TInventoryDatabaseDocument,
|
||||||
participant: IVoidTearParticipantInfo,
|
participant: IVoidTearParticipantInfo,
|
||||||
inventoryChanges: IInventoryChanges = {}
|
inventoryChanges: IInventoryChanges = {}
|
||||||
): Promise<IRngResult> => {
|
): Promise<IRngResult[]> => {
|
||||||
const relic = ExportRelics[participant.VoidProjection];
|
const relic = ExportRelics[participant.VoidProjection];
|
||||||
let weights = refinementToWeights[relic.quality];
|
let weights = refinementToWeights[relic.quality];
|
||||||
if (relic.quality == "VPQ_SILVER" && inventory.exceptionalRelicsAlwaysGiveBronzeReward) {
|
if (relic.quality == "VPQ_SILVER" && inventory.exceptionalRelicsAlwaysGiveBronzeReward) {
|
||||||
@ -25,6 +25,9 @@ export const crackRelic = async (
|
|||||||
weights = { COMMON: 0, UNCOMMON: 0, RARE: 1, LEGENDARY: 0 };
|
weights = { COMMON: 0, UNCOMMON: 0, RARE: 1, LEGENDARY: 0 };
|
||||||
}
|
}
|
||||||
logger.debug(`opening a relic of quality ${relic.quality}; rarity weights are`, weights);
|
logger.debug(`opening a relic of quality ${relic.quality}; rarity weights are`, weights);
|
||||||
|
const allRewards = [];
|
||||||
|
const relicRewardCount = 1 + (inventory.extraRelicRewards ?? 0);
|
||||||
|
for (let i = 0; i < relicRewardCount; i++) {
|
||||||
let reward = getRandomWeightedReward(
|
let reward = getRandomWeightedReward(
|
||||||
ExportRewards[relic.rewardManifest][0] as { type: string; itemCount: number; rarity: TRarity }[], // rarity is nullable in PE+ typings, but always present for relics
|
ExportRewards[relic.rewardManifest][0] as { type: string; itemCount: number; rarity: TRarity }[], // rarity is nullable in PE+ typings, but always present for relics
|
||||||
weights
|
weights
|
||||||
@ -37,6 +40,13 @@ export const crackRelic = async (
|
|||||||
}
|
}
|
||||||
logger.debug(`relic rolled`, reward);
|
logger.debug(`relic rolled`, reward);
|
||||||
participant.Reward = reward.type;
|
participant.Reward = reward.type;
|
||||||
|
allRewards.push(reward);
|
||||||
|
// Give reward
|
||||||
|
combineInventoryChanges(
|
||||||
|
inventoryChanges,
|
||||||
|
(await handleStoreItemAcquisition(reward.type, inventory, reward.itemCount)).InventoryChanges
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Remove relic
|
// Remove relic
|
||||||
const miscItemChanges = [
|
const miscItemChanges = [
|
||||||
@ -48,16 +58,10 @@ export const crackRelic = async (
|
|||||||
addMiscItems(inventory, miscItemChanges);
|
addMiscItems(inventory, miscItemChanges);
|
||||||
combineInventoryChanges(inventoryChanges, { MiscItems: miscItemChanges });
|
combineInventoryChanges(inventoryChanges, { MiscItems: miscItemChanges });
|
||||||
|
|
||||||
// Give reward
|
|
||||||
combineInventoryChanges(
|
|
||||||
inventoryChanges,
|
|
||||||
(await handleStoreItemAcquisition(reward.type, inventory, reward.itemCount)).InventoryChanges
|
|
||||||
);
|
|
||||||
|
|
||||||
// Client has picked its own reward (for lack of choice)
|
// Client has picked its own reward (for lack of choice)
|
||||||
participant.ChosenRewardOwner = participant.AccountId;
|
participant.ChosenRewardOwner = participant.AccountId;
|
||||||
|
|
||||||
return reward;
|
return allRewards;
|
||||||
};
|
};
|
||||||
|
|
||||||
const refinementToWeights = {
|
const refinementToWeights = {
|
||||||
|
|||||||
@ -1468,6 +1468,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
|
|||||||
nemesisHintProgressMultiplierGrineer: Number,
|
nemesisHintProgressMultiplierGrineer: Number,
|
||||||
nemesisHintProgressMultiplierCorpus: Number,
|
nemesisHintProgressMultiplierCorpus: Number,
|
||||||
nemesisExtraWeapon: Number,
|
nemesisExtraWeapon: Number,
|
||||||
|
extraRelicRewards: Number,
|
||||||
|
|
||||||
SubscribedToEmails: { type: Number, default: 0 },
|
SubscribedToEmails: { type: Number, default: 0 },
|
||||||
SubscribedToEmailsPersonalized: { type: Number, default: 0 },
|
SubscribedToEmailsPersonalized: { type: Number, default: 0 },
|
||||||
|
|||||||
@ -1337,8 +1337,10 @@ export const addMissionRewards = async (
|
|||||||
if (voidTearWave && voidTearWave.Participants[0].QualifiesForReward) {
|
if (voidTearWave && voidTearWave.Participants[0].QualifiesForReward) {
|
||||||
if (!voidTearWave.Participants[0].HaveRewardResponse) {
|
if (!voidTearWave.Participants[0].HaveRewardResponse) {
|
||||||
// non-endless fissure; giving reward now
|
// non-endless fissure; giving reward now
|
||||||
const reward = await crackRelic(inventory, voidTearWave.Participants[0], inventoryChanges);
|
const rewards = await crackRelic(inventory, voidTearWave.Participants[0], inventoryChanges);
|
||||||
|
rewards.forEach(reward => {
|
||||||
MissionRewards.push({ StoreItem: reward.type, ItemCount: reward.itemCount });
|
MissionRewards.push({ StoreItem: reward.type, ItemCount: reward.itemCount });
|
||||||
|
});
|
||||||
} else if (inventory.MissionRelicRewards) {
|
} else if (inventory.MissionRelicRewards) {
|
||||||
// endless fissure; already gave reward(s) but should still show in EOM screen
|
// endless fissure; already gave reward(s) but should still show in EOM screen
|
||||||
for (const reward of inventory.MissionRelicRewards) {
|
for (const reward of inventory.MissionRelicRewards) {
|
||||||
|
|||||||
@ -61,6 +61,7 @@ export interface IAccountCheats {
|
|||||||
nemesisHintProgressMultiplierGrineer?: number;
|
nemesisHintProgressMultiplierGrineer?: number;
|
||||||
nemesisHintProgressMultiplierCorpus?: number;
|
nemesisHintProgressMultiplierCorpus?: number;
|
||||||
nemesisExtraWeapon?: number;
|
nemesisExtraWeapon?: number;
|
||||||
|
extraRelicRewards?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IInventoryDatabase
|
export interface IInventoryDatabase
|
||||||
|
|||||||
@ -1057,6 +1057,13 @@
|
|||||||
<button class="btn btn-secondary" type="button" data-loc="cheats_save"></button>
|
<button class="btn btn-secondary" type="button" data-loc="cheats_save"></button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
<form class="form-group mt-2">
|
||||||
|
<label class="form-label" for="extraRelicRewards" data-loc="cheats_extraRelicRewards"></label>
|
||||||
|
<div class="input-group">
|
||||||
|
<input class="form-control" id="extraRelicRewards" type="number" min="0" max="65535" data-default="0" />
|
||||||
|
<button class="btn btn-secondary" type="button" data-loc="cheats_save"></button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
<div class="mt-2 mb-2 d-flex flex-wrap gap-2">
|
<div class="mt-2 mb-2 d-flex flex-wrap gap-2">
|
||||||
<button class="btn btn-primary" onclick="debounce(doUnlockAllShipFeatures);" data-loc="cheats_unlockAllShipFeatures"></button>
|
<button class="btn btn-primary" onclick="debounce(doUnlockAllShipFeatures);" data-loc="cheats_unlockAllShipFeatures"></button>
|
||||||
<button class="btn btn-primary" onclick="debounce(unlockAllMissions);" data-loc="cheats_unlockAllMissions"></button>
|
<button class="btn btn-primary" onclick="debounce(unlockAllMissions);" data-loc="cheats_unlockAllMissions"></button>
|
||||||
|
|||||||
@ -262,6 +262,7 @@ dict = {
|
|||||||
cheats_nemesisHintProgressMultiplierGrineer: `Hint Progress Multiplier (Grineer)`,
|
cheats_nemesisHintProgressMultiplierGrineer: `Hint Progress Multiplier (Grineer)`,
|
||||||
cheats_nemesisHintProgressMultiplierCorpus: `Hint Progress Multiplier (Corpus)`,
|
cheats_nemesisHintProgressMultiplierCorpus: `Hint Progress Multiplier (Corpus)`,
|
||||||
cheats_nemesisExtraWeapon: `Extra Nemesis Weapon / Token On Vanquish (0 to disable)`,
|
cheats_nemesisExtraWeapon: `Extra Nemesis Weapon / Token On Vanquish (0 to disable)`,
|
||||||
|
cheats_extraRelicRewards: `Extra Relic Rewards`,
|
||||||
|
|
||||||
worldState: `World State`,
|
worldState: `World State`,
|
||||||
worldState_creditBoost: `Credit Boost`,
|
worldState_creditBoost: `Credit Boost`,
|
||||||
|
|||||||
@ -263,6 +263,7 @@ dict = {
|
|||||||
cheats_nemesisHintProgressMultiplierGrineer: `解密进度倍率 (Grineer)`,
|
cheats_nemesisHintProgressMultiplierGrineer: `解密进度倍率 (Grineer)`,
|
||||||
cheats_nemesisHintProgressMultiplierCorpus: `解密进度倍率 (Corpus)`,
|
cheats_nemesisHintProgressMultiplierCorpus: `解密进度倍率 (Corpus)`,
|
||||||
cheats_nemesisExtraWeapon: `额外玄骸武器/代币 (0为禁用)`,
|
cheats_nemesisExtraWeapon: `额外玄骸武器/代币 (0为禁用)`,
|
||||||
|
cheats_extraRelicRewards: `额外遗物奖励`,
|
||||||
|
|
||||||
worldState: `世界状态配置`,
|
worldState: `世界状态配置`,
|
||||||
worldState_creditBoost: `现金加成`,
|
worldState_creditBoost: `现金加成`,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user