From eeb4fea58c3423ebc8a300793b07ac0a24e6707c Mon Sep 17 00:00:00 2001 From: Degradin <42292046+Degradin@users.noreply.github.com> Date: Wed, 8 Jan 2025 09:06:40 +0300 Subject: [PATCH] v.0.4.2-fix Inflation and Recovery fix --- bot.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bot.js b/bot.js index 47f82f4..3f2068d 100644 --- a/bot.js +++ b/bot.js @@ -1001,7 +1001,7 @@ const recoverResourcePrices = async () => { for (const resource of resources) { // Определяем случайное колебание в диапазоне [-maxFluctuation, maxFluctuation] - const maxFluctuation = resource.basePrice * 0.03; // 3% от базовой цены + const maxFluctuation = resource.basePrice * 0.3; // 30% от базовой цены const priceFluctuation = (Math.random() * 2 - 1) * maxFluctuation; // Применяем колебание @@ -1009,7 +1009,7 @@ const recoverResourcePrices = async () => { // Если цена выше базовой, шанс на её снижение if (resource.price > resource.basePrice) { - const chanceToDrop = 0.6; // 60% шанс на снижение + const chanceToDrop = 0.5; // 50% шанс на снижение if (Math.random() < chanceToDrop) { resource.price -= Math.round(resource.basePrice * 0.01); // Снижение на 1% базовой цены } @@ -1419,6 +1419,11 @@ bot.command('force_hour', async (ctx) => { return await ctx.reply(`Принудительный час.`) }) +bot.command('force_recover', async (ctx) => { + recoverResourcePrices() + updateResourcePricesMessage() + return await ctx.reply(`Принудительно.`) +}) bot.command('force_mat', async (ctx) => { utils.matPriceUpdate() return await ctx.reply(`Принудительный материал.`) @@ -1444,7 +1449,7 @@ const spinSlots = async (ctx, bet, user) => { console.log(`Win: ${winnings}`) resultMessage += `🎉 Вы выиграли ₽${spaces(winnings)}! Множитель: x${winMultiplier}`; } else { - utils.giveExp(user, 10) + utils.giveExp(user, 2) user.money -= bet; await user.save(); resultMessage += `💔 Вы проиграли ₽${spaces(bet)}. Попробуйте ещё раз!`; @@ -1750,7 +1755,7 @@ setInterval(() => { let hours = today.getHours(); if (hours == "0" || hours == "12") { //weaponShopUpdate() - matPriceUpdate() + utils.matPriceUpdate() } /*if (hours == "9" || hours == "18" || hours == "12") { generatePromo()