first commit
This commit is contained in:
commit
0cb536b42b
38 changed files with 9044 additions and 0 deletions
15
src/commands/eco/mod.rs
Normal file
15
src/commands/eco/mod.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
use crate::submods;
|
||||
|
||||
submods!(balance, fish, farm, shop, inv, cf);
|
||||
|
||||
pub fn calculate_fish_value(weight: f64, price: u32) -> i32 {
|
||||
let min_weight = 0.1;
|
||||
let max_weight = 50.0;
|
||||
let min_multiplier = 1.0;
|
||||
let max_multiplier = 2.5;
|
||||
|
||||
let normalized_weight = ((weight - min_weight) / (max_weight - min_weight)).clamp(0.0, 1.0);
|
||||
let multiplier = min_multiplier + (max_multiplier - min_multiplier) * normalized_weight;
|
||||
|
||||
(price as f64 * multiplier).round() as i32
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue