From 41fd454148812c2e7646a5e5d729abf4b52836a4 Mon Sep 17 00:00:00 2001 From: notV4l <122404722+notV4l@users.noreply.github.com> Date: Fri, 22 Sep 2023 19:01:24 +0200 Subject: [PATCH] fix: % (#180) --- src/constants.cairo | 6 +++--- src/systems/travel.cairo | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/constants.cairo b/src/constants.cairo index bcaed9702..cc05ebdb5 100644 --- a/src/constants.cairo +++ b/src/constants.cairo @@ -22,6 +22,6 @@ const PRICE_VAR_MIN: u8 = 1; // 1% const PRICE_VAR_MAX: u8 = 5; // 5% // market price events -const MARKET_EVENT_CHANCE: u32 = 5; // on 1000 : 1% = 0.5% up / 0.5% down -const MARKET_EVENT_MIN: u8 = 50; // 50% -const MARKET_EVENT_MAX: u8 = 100; // 100% +const MARKET_EVENT_CHANCE: u32 = 7; // on 1000 : 1.4% = 0.7% up / 0.7% down +const MARKET_EVENT_MIN: u8 = 50; // up 50% | down 25% +const MARKET_EVENT_MAX: u8 = 100; // up 100% | down 50% diff --git a/src/systems/travel.cairo b/src/systems/travel.cairo index d46f929e3..a2a9e8315 100644 --- a/src/systems/travel.cairo +++ b/src/systems/travel.cairo @@ -218,7 +218,7 @@ fn price_variation_with_drug( let target_price = if increase { market_price * (100 + percent) / 100 } else { - market_price * (100 - percent) / 100 + market_price * (100 - (percent/2)) / 100 }; let target_qty = market.cash / target_price;