(server === "na" || server === "oce" || server === "las" || server === "lan" || server === "br" || server === "jp")
выводится одна цена, для всего остального другая. Я бы хотел сделать для одного своя цена, для другого своя цена, а для третьего все остальное.//price
if (server === "na" || server === "oce" || server === "las" || server === "lan" || server === "br" || server === "jp") {
if (current_tier_num === "0") {
pricepergame = 2.9;
}
if (current_tier_num === "1") {
pricepergame = 1.8;
}
if (current_tier_num === "2") {
pricepergame = 1.8;
}
if (current_tier_num === "3") {
pricepergame = 2.8;
}
if (current_tier_num === "4") {
pricepergame = 3.6;
}
if (current_tier_num === "5") {
pricepergame = 4.3;
}
if (current_tier_num === "6") {
pricepergame = 6;
}
if (current_tier_num === "7") {
pricepergame = 9;
}
if (current_tier_num === "8") {
pricepergame = 10;
}
if (current_tier_num === "9") {
pricepergame = 11;
}
currency = "РУБ";
currency_s = "₽";
} else {
if (current_tier_num === "0") {
pricepergame = 2;
}
if (current_tier_num === "1") {
pricepergame = 1.5;
}
if (current_tier_num === "2") {
pricepergame = 1.65;
}
if (current_tier_num === "3") {
pricepergame = 2;
}
if (current_tier_num === "4") {
pricepergame = 2.5;
}
if (current_tier_num === "5") {
pricepergame = 3;
}
if (current_tier_num === "6") {
pricepergame = 4.5;
}
if (current_tier_num === "7") {
pricepergame = 7;
}
if (current_tier_num === "8") {
pricepergame = 8;
}
if (current_tier_num === "9") {
pricepergame = 9;
}
currency = "РУБ";
currency_s = "₽";
}
//end price
const priceVariants = [
{
servers: ['na', 'oce', 'las', 'lan', 'br', 'jp'],
priceTiers: [2.9, 1.8, 1.8, 2.8, 3.6, 4.3, 6, 9, 10, 11]
},
{
servers: ['other'],
priceTiers: [2, 1.5, 1.65, 2, 2.5, 3, 4.5, 7, 8, 9]
},
];
const defaultPrice = 1000;
const pricePerGame = priceVariants.find(variant => variant.servers.includes(server))?.priceTiers[current_tier_num] ?? defaultPrice;