Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_payment(cargo, ticks, amount, distance, cargo_aging_period) {
- const transit_days = Math.min((ticks / cargo_aging_period) | 0, 255);
- const days_over_days1 = Math.max(transit_days - cargo.transit_days_1, 0)
- const days_over_days2 = Math.max(days_over_days1 - cargo.transit_days_2, 0)
- const time_factor = Math.max(255 - days_over_days1 - days_over_days2, 31)
- return (distance * amount * time_factor * cargo.initial_payment) / (1 << 21)
- // return (Math.sqrt(distance) * 20 * amount * time_factor * cargo.initial_payment) / (1 << 21)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement