1 /* ---------------------------------------------------------------------- *
2  * road.c
3  * This file is part of lincity.
4  * Lincity is copyright (c) I J Peters 1995-1997, (c) Greg Sharp 1997-2001.
5  * (c) Corey Keasling, 2004
6  * ---------------------------------------------------------------------- */
7 
8 #include "modules.h"
9 #include "../transport.h"
10 #include "road.h"
11 
12 /* ---------------------------------------------------------------------
13    For track, road and rail:
14 
15    int_1 contains the amount of food
16    int_2 contains the amount of jobs
17    int_3 contains the amount of coal
18    int_4 contains the amount of goods
19    int_5 contains the amount of ore
20    int_6 contains the amount of steel
21    int_7 contains the amount of waste
22   --------------------------------------------------------------------- */
23 
do_road(int x,int y)24 void do_road(int x, int y)
25 {
26     int *pol = &MP_POL(x, y);
27     Map_Point_Info *minfo = &MP_INFO(x, y);
28     ++transport_cost;
29     if (total_time % DAYS_PER_ROAD_POLLUTION == 0)
30         *pol += ROAD_POLLUTION;
31     if ((total_time & ROAD_GOODS_USED_MASK) == 0 && minfo->int_4 > 0) {
32         --minfo->int_4;
33         ++minfo->int_7;
34     }
35     general_transport(x, y, MAX_WASTE_ON_ROAD);
36 }
37 
mps_road(int x,int y)38 void mps_road(int x, int y)
39 {
40     int i = 0;
41 
42     mps_store_title(i++, _(main_groups[MP_GROUP(x, y)].name));
43     i++;
44 
45     mps_store_sfp(i++, _("Food"), MP_INFO(x, y).int_1 * 100.0 / MAX_FOOD_ON_ROAD);
46     mps_store_sfp(i++, _("Jobs"), MP_INFO(x, y).int_2 * 100.0 / MAX_JOBS_ON_ROAD);
47     mps_store_sfp(i++, _("Coal"), MP_INFO(x, y).int_3 * 100.0 / MAX_COAL_ON_ROAD);
48     mps_store_sfp(i++, _("Goods"), MP_INFO(x, y).int_4 * 100.0 / MAX_GOODS_ON_ROAD);
49     mps_store_sfp(i++, _("Ore"), MP_INFO(x, y).int_5 * 100.0 / MAX_ORE_ON_ROAD);
50     mps_store_sfp(i++, _("Steel"), MP_INFO(x, y).int_6 * 100.0 / MAX_STEEL_ON_ROAD);
51     mps_store_sfp(i++, _("Waste"), MP_INFO(x, y).int_7 * 100.0 / MAX_WASTE_ON_ROAD);
52 
53 }
54