diff options
Diffstat (limited to 'src/world.c')
| -rw-r--r-- | src/world.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/world.c b/src/world.c index 7da1d2d..963568a 100644 --- a/src/world.c +++ b/src/world.c @@ -1234,12 +1234,20 @@ static void end_contract_with_random_job(world* world) array_remove_by(&location->schedule.jobs, scheduled_job);
}
+static float get_fine_multiplier(world* world)
+{
+ // $100 = 1% off of fine.
+ float multiplier = 1.0f;
+ multiplier -= (world->investments.legal / 100.0f) * 0.01f;
+ return multiplier;
+}
+
static void give_random_fine(world* world)
{
world_location* location = get_random_owned_location(world);
employee* emp = *(employee**)array_at(&location->employees, get_random_number(0, location->employees.length));
- s32 fine = get_random_number(world->money / 20, world->money / 10); // fine is between 5% and 10% of current money. minimum 2k.
+ s32 fine = get_random_number(world->money / 20, world->money / 10) * get_fine_multiplier(world); // fine is between 5% and 10% of current money. minimum 2k.
if (fine < 2000) fine = 2000;
char error_msg[MAX_EVENT_MESSAGE_LENGTH];
@@ -1290,7 +1298,7 @@ static void do_random_inspection(world* world) world_report_event(world, error_msg, EVENT_TYPE_INFO,location);
}
else {
- s32 fine = total_employees_overworking * 1000;
+ s32 fine = total_employees_overworking * 1000 * get_fine_multiplier(world);
char error_msg[MAX_EVENT_MESSAGE_LENGTH];
snprintf(error_msg, MAX_EVENT_MESSAGE_LENGTH, "A random inspection was performed in %s and %d employees were found to be working more hours than allowed. Fine: $%d.", location->name, total_employees_overworking, fine);
|
