decord/source/modules/quests/utils/QuestRewardUtils.tsx

521 lines
20 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 10547
// Function ID: 10548
2026-07-29 08:29:29 +00:00
// Name: _getDefaultRewardName
2026-08-25 06:04:03 +00:00
// Dependencies: [7148, 10548, 7310, 7303, 3622, 1236, 10549, 10550, 10551, 10552, 10553, 5271, 2]
2026-07-29 08:29:29 +00:00
// Exports: getCollectibleQuestRewardDuration, getCollectibleQuestRewardExtendableExpirationDate, getCollectiblesQuestReward, getCollectiblesQuestRewardItem, getDefaultPlatform, getDefaultRewardName, getDefaultRewardNameWithArticle, getInGameQuestReward, getPlatformString, getQuestOrbMultiplier, getQuestOrbMultiplierForUser, getQuestOrbRewardQuantityForUser, getQuestPrimaryReward, getRewardCodeQuestReward, getVirtualCurrencyRewardOrbQuantity, getVirtualCurrencyRewardPremiumOrbQuantity, hasCollectiblesQuestReward, hasFractionalPremiumQuestReward, hasInGameQuestReward, hasPremiumOrbQuantity, hasQuestRewardCode, hasVirtualCurrencyReward, isCollectibleQuestRewardPermanentWithPremiumSubscription, isCollectibleQuestRewardPremiumExtendable, isTieredRewardCodeQuest
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 10547 (_getDefaultRewardName)
2026-08-24 06:08:38 +00:00
import getSystemLocale from "getSystemLocale" /* 1236 */;
2026-08-25 06:04:03 +00:00
import QuestsVisibleMessagesChangedSource from "QuestsVisibleMessagesChangedSource" /* 5271 */;
import getQuestDeliveryDataForPlacement from "getQuestDeliveryDataForPlacement" /* 7303 */;
import QuestRewardTypes from "QuestRewardTypes" /* 7310 */;
import getQuestOrbMultiplierEligibilityForUser from "getQuestOrbMultiplierEligibilityForUser" /* 10549 */;
import getDurationStringOfFractionalPremium from "getDurationStringOfFractionalPremium" /* 10551 */;
import getContextualEntrypointHeading from "getContextualEntrypointHeading" /* 10552 */;
import QuestRewardAssignmentMethods from "QuestRewardAssignmentMethods" /* 10553 */;
import closure_2 from "updateCategoriesAndProducts" /* 7148 */;
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
function _getDefaultRewardName(rewardsConfig, stateFromStores, arg2) {
let rewards = rewardsConfig.rewardsConfig.rewards;
2026-08-25 06:04:03 +00:00
if (rewards.some((type) => type.type === callback(7310).QuestRewardTypes.FRACTIONAL_PREMIUM)) {
2026-08-24 06:08:38 +00:00
return getDurationStringOfFractionalPremium.getFractionalPremiumQuestRewardName(rewardsConfig);
2026-07-29 08:29:29 +00:00
} else {
let rewards2 = rewardsConfig.rewardsConfig.rewards;
2026-08-25 06:04:03 +00:00
if (rewards2.some((type) => type.type === callback(7310).QuestRewardTypes.VIRTUAL_CURRENCY)) {
2026-07-29 08:29:29 +00:00
rewards = rewardsConfig.rewardsConfig.rewards;
2026-08-25 06:04:03 +00:00
const found = rewards.find((type) => type.type === callback(7310).QuestRewardTypes.VIRTUAL_CURRENCY);
2026-07-29 08:29:29 +00:00
let num = null;
if (null != found) {
if (null == stateFromStores) {
num = found.orbQuantity;
} else {
const rewards1 = rewardsConfig.rewardsConfig.rewards;
2026-08-24 06:08:38 +00:00
const questOrbMultiplierEligibilityForUser = getQuestOrbMultiplierEligibilityForUser.getQuestOrbMultiplierEligibilityForUser(stateFromStores);
2026-08-25 06:04:03 +00:00
const found1 = rewards1.find((type) => type.type === callback(7310).QuestRewardTypes.VIRTUAL_CURRENCY);
2026-07-29 08:29:29 +00:00
let premiumOrbQuantity;
if (found1 != null) {
premiumOrbQuantity = found1.premiumOrbQuantity;
}
let tmp8 = null != premiumOrbQuantity;
if (tmp8) {
tmp8 = premiumOrbQuantity > 0;
}
if (tmp8) {
if (tmp15Result.shouldReceiveQuestOrbMultiplier(questOrbMultiplierEligibilityForUser)) {
let orbQuantity2 = found.premiumOrbQuantity;
if (orbQuantity2 == null) {
orbQuantity2 = found.orbQuantity;
}
let orbQuantity = orbQuantity2;
}
num = orbQuantity;
2026-08-25 06:04:03 +00:00
tmp15Result = tmp15(10550);
2026-07-29 08:29:29 +00:00
}
orbQuantity = found.orbQuantity;
2026-08-24 06:08:38 +00:00
const obj5 = getQuestOrbMultiplierEligibilityForUser;
2026-07-29 08:29:29 +00:00
tmp15 = require;
}
}
if (num == null) {
rewards2 = rewardsConfig.rewardsConfig.rewards;
2026-08-25 06:04:03 +00:00
const found2 = rewards2.find((type) => type.type === callback(7310).QuestRewardTypes.VIRTUAL_CURRENCY);
2026-07-29 08:29:29 +00:00
orbQuantity = undefined;
if (found2 != null) {
orbQuantity = found2.orbQuantity;
}
num = orbQuantity;
}
if (num == null) {
num = 0;
}
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale.intl;
2026-07-29 08:29:29 +00:00
let obj = { orbAmount: null };
obj[0] = num;
2026-08-24 06:08:38 +00:00
return intl.formatToPlainString(getSystemLocale.t["nLXlh+"], obj);
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
obj = getContextualEntrypointHeading;
2026-07-29 08:29:29 +00:00
const messages = obj.getDefaultReward(rewardsConfig).messages;
return arg2 ? messages.nameWithArticle : messages.name;
}
}
}
let items = [require("QuestRewardExpirationMode").QuestRewardExpirationMode.PREMIUM_EXTENSION, require("QuestRewardExpirationMode").QuestRewardExpirationMode.PREMIUM_PERMANENT];
let set = new Set(items);
let result = set.fileFinishedImporting("modules/quests/utils/QuestRewardUtils.tsx");
export const getCollectiblesQuestReward = function getCollectiblesQuestReward(rewardsConfig) {
2026-07-20 16:05:17 +00:00
const rewards = rewardsConfig.rewardsConfig.rewards;
2026-07-29 08:29:29 +00:00
const found = rewards.find((type) => type.type === callback(table[2]).QuestRewardTypes.COLLECTIBLE);
2026-07-20 16:05:17 +00:00
let type;
2026-07-29 08:29:29 +00:00
if (found != null) {
2026-07-20 16:05:17 +00:00
type = found.type;
}
let tmp3 = null;
2026-08-24 06:08:38 +00:00
if (type === QuestRewardTypes.QuestRewardTypes.COLLECTIBLE) {
2026-07-20 16:05:17 +00:00
tmp3 = found;
}
return tmp3;
2026-07-29 08:29:29 +00:00
};
export const getCollectibleQuestRewardExtendableExpirationDate = function getCollectibleQuestRewardExtendableExpirationDate(rewardsConfig) {
2026-07-20 16:05:17 +00:00
const rewards = rewardsConfig.rewardsConfig.rewards;
2026-07-29 08:29:29 +00:00
const found = rewards.find((type) => type.type === callback(table[2]).QuestRewardTypes.COLLECTIBLE);
2026-07-20 16:05:17 +00:00
let type;
2026-07-29 08:29:29 +00:00
if (found != null) {
2026-07-20 16:05:17 +00:00
type = found.type;
}
2026-07-29 08:29:29 +00:00
let tmp5 = null;
2026-08-24 06:08:38 +00:00
if (type === QuestRewardTypes.QuestRewardTypes.COLLECTIBLE) {
2026-07-29 08:29:29 +00:00
tmp5 = found;
2026-07-20 16:05:17 +00:00
}
let questFormattedDate = null;
2026-07-29 08:29:29 +00:00
if (null != tmp5) {
2026-07-20 16:05:17 +00:00
questFormattedDate = null;
2026-07-29 08:29:29 +00:00
if ("expiresAtPremium" in tmp5) {
2026-07-20 16:05:17 +00:00
questFormattedDate = null;
2026-07-29 08:29:29 +00:00
if (null != tmp5.expiresAtPremium) {
2026-08-24 06:08:38 +00:00
questFormattedDate = getQuestDeliveryDataForPlacement.getQuestFormattedDate(tmp5.expiresAtPremium);
const tmp3Result = getQuestDeliveryDataForPlacement;
2026-07-20 16:05:17 +00:00
}
}
}
return questFormattedDate;
};
export const getCollectibleQuestRewardDuration = function getCollectibleQuestRewardDuration(config) {
2026-07-29 08:29:29 +00:00
const rewards = config.rewardsConfig.rewards;
const found = rewards.find((type) => type.type === callback(table[2]).QuestRewardTypes.COLLECTIBLE);
let type;
if (found != null) {
type = found.type;
}
let tmp5 = null;
2026-08-24 06:08:38 +00:00
if (type === QuestRewardTypes.QuestRewardTypes.COLLECTIBLE) {
2026-07-29 08:29:29 +00:00
tmp5 = found;
}
if (null != tmp5) {
if ("expiresAt" in tmp5) {
if (null != tmp5.expiresAt) {
2026-07-20 16:05:17 +00:00
const _Date = Date;
const date = new Date(config.expiresAt);
const _Date2 = Date;
2026-07-29 08:29:29 +00:00
const date1 = new Date(tmp5.expiresAt);
2026-08-25 06:04:03 +00:00
let tmp3Result = tmp3(3622);
2026-07-29 08:29:29 +00:00
const differenceInDaysResult = tmp3Result.differenceInDays(date1, date);
2026-07-20 16:05:17 +00:00
const _Math3 = Math;
let num = 0;
const rounded = Math.floor(differenceInDaysResult / 30);
2026-07-29 08:29:29 +00:00
if (25 <= differenceInDaysResult % 30) {
2026-07-20 16:05:17 +00:00
num = 1;
}
const sum = rounded + num;
if (sum >= 12) {
const _Math2 = Math;
const rounded1 = Math.floor(sum / 12);
2026-07-29 08:29:29 +00:00
const intl4 = tmp3(1236).intl;
let obj = { years: null };
obj[0] = rounded1;
return intl4.formatToPlainString(tmp3(1236).t.PClsrw, obj);
2026-07-20 16:05:17 +00:00
} else if (sum > 0) {
2026-07-29 08:29:29 +00:00
const intl3 = tmp3(1236).intl;
obj = { months: null };
obj[0] = sum;
return intl3.formatToPlainString(tmp3(1236).t.kridzK, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-08-25 06:04:03 +00:00
tmp3Result = tmp3(3622);
2026-07-29 08:29:29 +00:00
const differenceInDaysResult1 = tmp3Result.differenceInDays(date1, date);
2026-07-20 16:05:17 +00:00
if (differenceInDaysResult1 >= 7) {
const _Math = Math;
const rounded2 = Math.ceil(differenceInDaysResult1 / 7);
2026-07-29 08:29:29 +00:00
const intl2 = tmp3(1236).intl;
2026-08-24 06:08:38 +00:00
obj1 = { weeks: null };
2026-07-29 08:29:29 +00:00
obj1[0] = rounded2;
return intl2.formatToPlainString(tmp3(1236).t.EmoBD2, obj1);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const intl = tmp3(1236).intl;
obj = { days: null };
obj[0] = differenceInDaysResult1;
return intl.formatToPlainString(tmp3(1236).t["k2UNz+"], obj);
2026-07-20 16:05:17 +00:00
}
}
}
}
}
return null;
};
2026-07-29 08:29:29 +00:00
export const hasFractionalPremiumQuestReward = function hasFractionalPremiumQuestReward(rewardsConfig) {
const rewards = rewardsConfig.rewardsConfig.rewards;
2026-08-25 06:04:03 +00:00
return rewards.some((type) => type.type === callback(7310).QuestRewardTypes.FRACTIONAL_PREMIUM);
2026-07-29 08:29:29 +00:00
};
export const hasVirtualCurrencyReward = function hasVirtualCurrencyReward(config) {
const rewards = config.rewardsConfig.rewards;
2026-08-25 06:04:03 +00:00
return rewards.some((type) => type.type === callback(7310).QuestRewardTypes.VIRTUAL_CURRENCY);
2026-07-29 08:29:29 +00:00
};
export const hasPremiumOrbQuantity = function hasPremiumOrbQuantity(config) {
const rewards = config.rewardsConfig.rewards;
2026-08-25 06:04:03 +00:00
const found = rewards.find((type) => type.type === callback(7310).QuestRewardTypes.VIRTUAL_CURRENCY);
2026-07-29 08:29:29 +00:00
let premiumOrbQuantity;
if (found != null) {
premiumOrbQuantity = found.premiumOrbQuantity;
}
let tmp3 = null != premiumOrbQuantity;
if (tmp3) {
tmp3 = premiumOrbQuantity > 0;
}
return tmp3;
};
2026-07-20 16:05:17 +00:00
export const hasCollectiblesQuestReward = function hasCollectiblesQuestReward(config) {
2026-07-29 08:29:29 +00:00
const rewards = config.rewardsConfig.rewards;
const found = rewards.find((type) => type.type === callback(table[2]).QuestRewardTypes.COLLECTIBLE);
let type;
if (found != null) {
type = found.type;
}
let tmp3 = null;
2026-08-24 06:08:38 +00:00
if (type === QuestRewardTypes.QuestRewardTypes.COLLECTIBLE) {
2026-07-29 08:29:29 +00:00
tmp3 = found;
}
return null != tmp3;
2026-07-20 16:05:17 +00:00
};
export const hasInGameQuestReward = function hasInGameQuestReward(config) {
const rewards = config.rewardsConfig.rewards;
2026-07-29 08:29:29 +00:00
return rewards.some((type) => type.type === callback(table[2]).QuestRewardTypes.IN_GAME);
2026-07-20 16:05:17 +00:00
};
export const hasQuestRewardCode = function hasQuestRewardCode(config) {
const rewards = config.rewardsConfig.rewards;
2026-07-29 08:29:29 +00:00
return rewards.some((type) => type.type === callback(table[2]).QuestRewardTypes.REWARD_CODE);
2026-07-20 16:05:17 +00:00
};
export const getInGameQuestReward = function getInGameQuestReward(rewardsConfig) {
const rewards = rewardsConfig.rewardsConfig.rewards;
2026-07-29 08:29:29 +00:00
let found = rewards.find((type) => type.type === callback(table[2]).QuestRewardTypes.IN_GAME);
if (found == null) {
found = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return found;
2026-07-20 16:05:17 +00:00
};
export const getCollectiblesQuestRewardItem = function getCollectiblesQuestRewardItem(rewardsConfig) {
2026-07-29 08:29:29 +00:00
const rewards = rewardsConfig.rewardsConfig.rewards;
const found = rewards.find((type) => type.type === callback(table[2]).QuestRewardTypes.COLLECTIBLE);
let type;
if (found != null) {
type = found.type;
}
let tmp3 = null;
2026-08-24 06:08:38 +00:00
if (type === QuestRewardTypes.QuestRewardTypes.COLLECTIBLE) {
2026-07-29 08:29:29 +00:00
tmp3 = found;
}
2026-07-20 16:05:17 +00:00
let skuId;
2026-07-29 08:29:29 +00:00
if (tmp3 != null) {
skuId = tmp3.skuId;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
product = product.getProduct(skuId);
2026-07-20 16:05:17 +00:00
let first;
2026-07-29 08:29:29 +00:00
if (product != null) {
2026-07-20 16:05:17 +00:00
const items = product.items;
2026-07-29 08:29:29 +00:00
if (items != null) {
2026-07-20 16:05:17 +00:00
first = items[0];
}
}
2026-07-29 08:29:29 +00:00
if (first == null) {
first = null;
}
return first;
};
export const getVirtualCurrencyRewardOrbQuantity = function getVirtualCurrencyRewardOrbQuantity(config) {
const rewards = config.rewardsConfig.rewards;
2026-08-25 06:04:03 +00:00
const found = rewards.find((type) => type.type === callback(7310).QuestRewardTypes.VIRTUAL_CURRENCY);
2026-07-29 08:29:29 +00:00
let orbQuantity;
if (found != null) {
orbQuantity = found.orbQuantity;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return orbQuantity;
2026-07-20 16:05:17 +00:00
};
export const getVirtualCurrencyRewardPremiumOrbQuantity = function getVirtualCurrencyRewardPremiumOrbQuantity(rewardsConfig) {
const rewards = rewardsConfig.rewardsConfig.rewards;
2026-07-29 08:29:29 +00:00
const found = rewards.find((type) => type.type === callback(table[2]).QuestRewardTypes.VIRTUAL_CURRENCY);
2026-07-20 16:05:17 +00:00
let type;
2026-07-29 08:29:29 +00:00
if (found != null) {
2026-07-20 16:05:17 +00:00
type = found.type;
}
2026-08-24 06:08:38 +00:00
if (type === QuestRewardTypes.QuestRewardTypes.VIRTUAL_CURRENCY) {
2026-07-20 16:05:17 +00:00
return found.premiumOrbQuantity;
}
};
2026-07-29 08:29:29 +00:00
export const isCollectibleQuestRewardPremiumExtendable = function isCollectibleQuestRewardPremiumExtendable(config) {
const rewards = config.rewardsConfig.rewards;
const found = rewards.find((type) => type.type === callback(table[2]).QuestRewardTypes.COLLECTIBLE);
let type;
if (found != null) {
type = found.type;
}
let tmp3 = null;
2026-08-24 06:08:38 +00:00
if (type === QuestRewardTypes.QuestRewardTypes.COLLECTIBLE) {
2026-07-29 08:29:29 +00:00
tmp3 = found;
}
let expirationMode;
if (tmp3 != null) {
expirationMode = tmp3.expirationMode;
}
let hasItem = null != expirationMode;
if (hasItem) {
hasItem = set.has(expirationMode);
}
return hasItem;
};
2026-07-20 16:05:17 +00:00
export const isCollectibleQuestRewardPermanentWithPremiumSubscription = function isCollectibleQuestRewardPermanentWithPremiumSubscription(config) {
2026-07-29 08:29:29 +00:00
const rewards = config.rewardsConfig.rewards;
const found = rewards.find((type) => type.type === callback(table[2]).QuestRewardTypes.COLLECTIBLE);
let type;
if (found != null) {
type = found.type;
}
let tmp5 = null;
2026-08-24 06:08:38 +00:00
if (type === QuestRewardTypes.QuestRewardTypes.COLLECTIBLE) {
2026-07-29 08:29:29 +00:00
tmp5 = found;
}
let expirationMode;
if (tmp5 != null) {
expirationMode = tmp5.expirationMode;
}
let hasItem = null != expirationMode;
if (hasItem) {
hasItem = set.has(expirationMode);
}
if (hasItem) {
const rewards1 = config.rewardsConfig.rewards;
const found1 = rewards1.find((type) => type.type === callback(table[2]).QuestRewardTypes.COLLECTIBLE);
let type1;
if (found1 != null) {
type1 = found1.type;
}
let tmp11 = null;
2026-08-25 06:04:03 +00:00
if (type1 === tmp3(7310).QuestRewardTypes.COLLECTIBLE) {
2026-07-29 08:29:29 +00:00
tmp11 = found1;
}
let expirationMode1;
if (tmp11 != null) {
expirationMode1 = tmp11.expirationMode;
2026-07-20 16:05:17 +00:00
}
2026-08-25 06:04:03 +00:00
hasItem = expirationMode1 === tmp3(10548).QuestRewardExpirationMode.PREMIUM_PERMANENT;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return hasItem;
2026-07-20 16:05:17 +00:00
};
export const getQuestPrimaryReward = function getQuestPrimaryReward(quest) {
const userStatus = quest.userStatus;
2026-07-29 08:29:29 +00:00
let num;
if (userStatus != null) {
num = userStatus.claimedTier;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
const config = quest.config;
if ("rewardsConfig" in quest.config) {
2026-07-29 08:29:29 +00:00
let tmp = config.rewardsConfig.rewards[num];
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp = config.rewards[num];
}
return tmp;
};
export const getQuestOrbMultiplier = function getQuestOrbMultiplier(config) {
const rewards = config.rewardsConfig.rewards;
2026-08-25 06:04:03 +00:00
const found = rewards.find((type) => type.type === callback(7310).QuestRewardTypes.VIRTUAL_CURRENCY);
2026-07-29 08:29:29 +00:00
let type;
if (found != null) {
type = found.type;
}
2026-08-24 06:08:38 +00:00
if (type !== QuestRewardTypes.QuestRewardTypes.VIRTUAL_CURRENCY) {
2026-07-29 08:29:29 +00:00
return null;
} else {
({ premiumOrbQuantity, orbQuantity } = found);
let result = null;
if (null != premiumOrbQuantity) {
result = null;
if (0 !== orbQuantity) {
const _Math = Math;
result = Math.round(premiumOrbQuantity / orbQuantity * 100) / 100;
}
}
return result;
2026-07-20 16:05:17 +00:00
}
};
2026-07-29 08:29:29 +00:00
export const getQuestOrbMultiplierForUser = function getQuestOrbMultiplierForUser(rewardsConfig, isFractionalPremiumWithNoStandardSub) {
2026-07-20 16:05:17 +00:00
if (null == isFractionalPremiumWithNoStandardSub) {
return 1;
} else {
2026-07-29 08:29:29 +00:00
const rewards = rewardsConfig.rewardsConfig.rewards;
2026-08-25 06:04:03 +00:00
const found = rewards.find((type) => type.type === callback(7310).QuestRewardTypes.VIRTUAL_CURRENCY);
2026-07-29 08:29:29 +00:00
let type;
if (found != null) {
type = found.type;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let num = null;
2026-08-24 06:08:38 +00:00
if (type === QuestRewardTypes.QuestRewardTypes.VIRTUAL_CURRENCY) {
2026-07-29 08:29:29 +00:00
({ premiumOrbQuantity, orbQuantity } = found);
let result = null;
if (null != premiumOrbQuantity) {
result = null;
if (0 !== orbQuantity) {
const _Math = Math;
result = Math.round(premiumOrbQuantity / orbQuantity * 100) / 100;
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
num = result;
}
if (num == null) {
num = 1;
}
2026-08-25 06:04:03 +00:00
let tmp2Result = tmp2(10549);
2026-07-29 08:29:29 +00:00
const rewards1 = rewardsConfig.rewardsConfig.rewards;
const questOrbMultiplierEligibilityForUser = tmp2Result.getQuestOrbMultiplierEligibilityForUser(isFractionalPremiumWithNoStandardSub);
2026-08-25 06:04:03 +00:00
const found1 = rewards1.find((type) => type.type === callback(7310).QuestRewardTypes.VIRTUAL_CURRENCY);
2026-07-29 08:29:29 +00:00
premiumOrbQuantity = undefined;
if (found1 != null) {
premiumOrbQuantity = found1.premiumOrbQuantity;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp9 = null != premiumOrbQuantity;
if (tmp9) {
tmp9 = premiumOrbQuantity > 0;
}
let num6 = 1;
if (tmp9) {
2026-08-25 06:04:03 +00:00
tmp2Result = tmp2(10550);
2026-07-29 08:29:29 +00:00
num6 = 1;
if (tmp2Result.shouldReceiveQuestOrbMultiplier(questOrbMultiplierEligibilityForUser)) {
num6 = num;
}
}
return num6;
}
};
export const getQuestOrbRewardQuantityForUser = function getQuestOrbRewardQuantityForUser(config, stateFromStores) {
const rewards = config.rewardsConfig.rewards;
2026-08-25 06:04:03 +00:00
const found = rewards.find((type) => type.type === callback(7310).QuestRewardTypes.VIRTUAL_CURRENCY);
2026-07-29 08:29:29 +00:00
if (null == found) {
return null;
} else if (null == stateFromStores) {
return found.orbQuantity;
} else {
const rewards1 = config.rewardsConfig.rewards;
2026-08-24 06:08:38 +00:00
const questOrbMultiplierEligibilityForUser = getQuestOrbMultiplierEligibilityForUser.getQuestOrbMultiplierEligibilityForUser(stateFromStores);
2026-08-25 06:04:03 +00:00
const found1 = rewards1.find((type) => type.type === callback(7310).QuestRewardTypes.VIRTUAL_CURRENCY);
2026-07-29 08:29:29 +00:00
let premiumOrbQuantity;
if (found1 != null) {
premiumOrbQuantity = found1.premiumOrbQuantity;
}
let tmp3 = null != premiumOrbQuantity;
if (tmp3) {
tmp3 = premiumOrbQuantity > 0;
}
if (tmp3) {
if (tmp5Result.shouldReceiveQuestOrbMultiplier(questOrbMultiplierEligibilityForUser)) {
let orbQuantity2 = found.premiumOrbQuantity;
if (orbQuantity2 == null) {
orbQuantity2 = found.orbQuantity;
}
let orbQuantity = orbQuantity2;
}
return orbQuantity;
}
orbQuantity = found.orbQuantity;
2026-08-24 06:08:38 +00:00
const obj2 = getQuestOrbMultiplierEligibilityForUser;
2026-07-29 08:29:29 +00:00
const tmp5 = require;
2026-07-20 16:05:17 +00:00
}
};
export const getDefaultRewardName = function getDefaultRewardName(config, stateFromStores) {
return _getDefaultRewardName(config, stateFromStores, false);
};
export const getDefaultRewardNameWithArticle = function getDefaultRewardNameWithArticle(config, stateFromStores) {
return _getDefaultRewardName(config, stateFromStores, true);
};
export const getRewardCodeQuestReward = function getRewardCodeQuestReward(idx) {
if (null == idx.idx) {
return null;
} else {
let tmp5 = null;
2026-08-24 06:08:38 +00:00
if (tmp.config.rewardsConfig.rewards[idx].type === QuestRewardTypes.QuestRewardTypes.REWARD_CODE) {
2026-07-20 16:05:17 +00:00
tmp5 = tmp2;
}
return tmp5;
}
};
export const isTieredRewardCodeQuest = function isTieredRewardCodeQuest(quest) {
const rewardsConfig = quest.quest.config.rewardsConfig;
2026-08-24 06:08:38 +00:00
let everyResult = rewardsConfig.assignmentMethod === QuestRewardAssignmentMethods.QuestRewardAssignmentMethods.TIERED;
2026-07-20 16:05:17 +00:00
if (everyResult) {
everyResult = rewardsConfig.rewards.length > 0;
}
if (everyResult) {
const rewards = rewardsConfig.rewards;
2026-07-29 08:29:29 +00:00
everyResult = rewards.every((type) => type.type === callback(table[2]).QuestRewardTypes.REWARD_CODE);
2026-07-20 16:05:17 +00:00
}
return everyResult;
};
export const getDefaultPlatform = function getDefaultPlatform(config) {
const platforms = config.rewardsConfig.platforms;
if (platforms.length > 0) {
let CROSS_PLATFORM = platforms[0];
} else {
2026-08-24 06:08:38 +00:00
CROSS_PLATFORM = QuestsVisibleMessagesChangedSource.QuestRewardCodePlatforms.CROSS_PLATFORM;
2026-07-20 16:05:17 +00:00
}
return CROSS_PLATFORM;
};
export const getPlatformString = function getPlatformString(arg0) {
2026-08-24 06:08:38 +00:00
if (QuestsVisibleMessagesChangedSource.QuestRewardCodePlatforms.XBOX === arg0) {
2026-07-29 08:29:29 +00:00
const intl5 = tmp(1236).intl;
return intl5.string(tmp(1236).t.G84UWZ);
2026-08-25 06:04:03 +00:00
} else if (tmp(5271).QuestRewardCodePlatforms.PLAYSTATION === arg0) {
2026-07-29 08:29:29 +00:00
const intl4 = tmp(1236).intl;
return intl4.string(tmp(1236).t["6IeKx2"]);
2026-08-25 06:04:03 +00:00
} else if (tmp(5271).QuestRewardCodePlatforms.SWITCH === arg0) {
2026-07-29 08:29:29 +00:00
const intl3 = tmp(1236).intl;
return intl3.string(tmp(1236).t["1pp0su"]);
2026-08-25 06:04:03 +00:00
} else if (tmp(5271).QuestRewardCodePlatforms.PC === arg0) {
2026-07-29 08:29:29 +00:00
const intl2 = tmp(1236).intl;
return intl2.string(tmp(1236).t["YK+wUg"]);
2026-08-25 06:04:03 +00:00
} else if (tmp(5271).QuestRewardCodePlatforms.CROSS_PLATFORM === arg0) {
2026-07-29 08:29:29 +00:00
const intl = tmp(1236).intl;
return intl.string(tmp(1236).t.UWVbzV);
2026-07-20 16:05:17 +00:00
}
};