void mps_substation (int x, int y) { int i = 0; char s[12]; mps_store_title(i++,_("Substation")); i++; format_power (s, sizeof(s), MP_INFO(x,y).int_5); mps_store_title(i++,_("Local Demand")); mps_store_title(i++,s); if (MP_INFO(x,y).int_6 == 0) return; i++; mps_store_title(i++,_("Grid Status")); format_power (s, sizeof(s), grid[MP_INFO(x,y).int_6]->max_power); mps_store_ss(i++,_("T. Cap."), s); format_power (s, sizeof(s), grid[MP_INFO(x,y).int_6]->avail_power); mps_store_ss(i++,_("A. Cap."), s); format_power (s, sizeof(s), grid[MP_INFO(x,y).int_6]->demand); mps_store_ss(i++,_("Demand"), s); i++; mps_store_sd(i++,_("Grid ID"), MP_INFO(x,y).int_6); }
void mps_right (int x, int y) { int i = 0; char s[12]; const char* p; int g; snprintf(s,sizeof(s),"%d,%d",x,y); mps_store_title(i++,s); i++; mps_store_title(i++,_("Coverage")); p = (MP_INFO(x,y).flags & FLAG_FIRE_COVER) ? _("Yes") : _("No"); mps_store_ss(i++,_("Fire"),p); p = (MP_INFO(x,y).flags & FLAG_HEALTH_COVER) ? _("Yes") : _("No"); mps_store_ss(i++,_("Health"),p); p = (MP_INFO(x,y).flags & FLAG_CRICKET_COVER) ? _("Yes") : _("No"); mps_store_ss(i++,_("Sport"),p); i++; mps_store_title(i++,_("Pollution")); if (MP_POL(x,y) < 10) p = _("clear"); else if (MP_POL(x,y) < 25) p = _("good"); else if (MP_POL(x,y) < 70) p = _("fair"); else if (MP_POL(x,y) < 190) p = _("smelly"); else if (MP_POL(x,y) < 450) p = _("smokey"); else if (MP_POL(x,y) < 1000) p = _("smoggy"); else if (MP_POL(x,y) < 1700) p = _("bad"); else if (MP_POL(x,y) < 3000) p = _("very bad"); else p = _("death!"); mps_store_sd(i++,p,MP_POL(x,y)); i++; mps_store_title(i++,_("Bulldoze Cost")); g = MP_GROUP(x,y); if (g == 0) { /* Can't bulldoze grass. */ mps_store_title(i++,_("N/A")); } else { if (g < 7) g--; /* translate into button type */ mps_store_d(i++,main_groups[g].bul_cost); } }
void mps_recycle (int x, int y) { int i = 0; char * p; mps_store_title(i++,_("Recycling")); mps_store_title(i++,_("Center")); i++; mps_store_sfp(i++,_("Capacity"), MP_INFO(x,y).int_6); p = ((MP_INFO(x,y).flags & FLAG_POWERED) != 0) ? _("YES") : _("NO"); mps_store_ss(i++,_("Power"),p); mps_store_sfp(i++,_("Tech"), MP_INFO(x,y).int_4 * 100.0 / MAX_TECH_LEVEL); i++; mps_store_title(i++,_("Inventory")); mps_store_sfp(i++,_("Ore"), MP_INFO(x,y).int_1 * 100.0 / MAX_ORE_AT_RECYCLE); mps_store_sfp(i++,_("Waste"), MP_INFO(x,y).int_2 * 100.0 / MAX_WASTE_AT_RECYCLE); }
void mps_global_finance(void) { int i = 0; char s[12]; int cashflow = 0; mps_store_title(i++,_("Tax Income")); cashflow += ly_income_tax; num_to_ansi (s, 12, ly_income_tax); mps_store_ss(i++,_("Income"), s); cashflow += ly_coal_tax; num_to_ansi(s, 12, ly_coal_tax); mps_store_ss(i++,_("Coal"), s); cashflow += ly_goods_tax; num_to_ansi(s, 12, ly_goods_tax); mps_store_ss(i++,_("Goods"), s); cashflow += ly_export_tax; num_to_ansi(s, 12, ly_export_tax); mps_store_ss(i++,_("Export"), s); i++; mps_store_title(i++,_("Expenses")); cashflow -= ly_unemployment_cost; num_to_ansi(s, 12, ly_unemployment_cost); mps_store_ss(i++,_("Unemp."), s); cashflow -= ly_transport_cost; num_to_ansi(s, 12, ly_transport_cost); mps_store_ss(i++,_("Transport"), s); cashflow -= ly_import_cost; num_to_ansi(s, 12, ly_import_cost); mps_store_ss(i++,_("Imports"), s); cashflow -= ly_other_cost; num_to_ansi(s, 12, ly_other_cost); mps_store_ss(i++,_("Others"), s); i++; num_to_ansi(s, 12, cashflow); mps_store_ss(i++,_("Net"), s); }
void HealthCentre::report() { int i = 0; const char* p; mps_store_sd(i++, constructionGroup->name, ID); mps_store_sfp(i++, N_("busy"), (float) busy); i++; list_commodities(&i); p = active?_("Yes"):_("No"); mps_store_ss(i++, N_("Health Care"), p); }
void FireStation::report() { int i = 0; const char* p; mps_store_sd(i++,constructionGroup->getName(), ID); mps_store_sfp(i++, _("busy"), (float) busy); i++; list_commodities(&i); p = active?_("Yes"):_("No"); mps_store_ss(i++, _("Fire Protection"), p); }
void Cricket::report() { int i = 0; const char* p; mps_store_sd(i++,constructionGroup->name, ID); mps_store_sfp(i++, N_("busy"), busy); i++; list_commodities(&i); p = active?N_("Yes"):N_("No"); mps_store_ss(i++, N_("Public sports"), p); }
void mps_windmill (int x, int y) { int i = 0; char s[12]; mps_store_title(i++,_("Windmill")); i++; if (MP_INFO(x,y).int_2 < MODERN_WINDMILL_TECH) { mps_store_sfp(i++,_("Tech"), MP_INFO(x,y).int_2 * 100.0 / MAX_TECH_LEVEL); } else { mps_store_title(i++,_("Local Status")); format_power (s, sizeof(s), MP_INFO(x,y).int_1); mps_store_ss(i++,_("Prod."),s); format_power (s, sizeof(s), MP_INFO(x,y).int_5); mps_store_ss(i++,_("Demand"),s); mps_store_sfp(i++,_("Tech"), MP_INFO(x,y).int_2 * 100.0 / MAX_TECH_LEVEL); i++; mps_store_title(i++,_("Grid Status")); format_power (s, sizeof(s), grid[MP_INFO(x,y).int_6]->max_power); mps_store_ss(i++,_("T. Cap."), s); format_power (s, sizeof(s), grid[MP_INFO(x,y).int_6]->avail_power); mps_store_ss(i++,_("A. Cap."), s); format_power (s, sizeof(s), grid[MP_INFO(x,y).int_6]->demand); mps_store_ss(i++,_("Demand"), s); i++; mps_store_sd(i++,_("Grid ID"), MP_INFO(x,y).int_6); } }
void mps_global_other_costs (void) { int i = 0; int year; char s[12]; mps_store_title(i++,_("Other Costs")); /* Don't write year if it's negative. */ year = (total_time / NUMOF_DAYS_IN_YEAR) - 1; if (year >= 0) { mps_store_sd(i++, _("For year"), year); } i++; num_to_ansi(s,sizeof(s),ly_interest); mps_store_ss(i++,_("Interest"),s); num_to_ansi(s,sizeof(s),ly_school_cost); mps_store_ss(i++,_("Schools"),s); num_to_ansi(s,sizeof(s),ly_university_cost); mps_store_ss(i++,_("Univers."),s); num_to_ansi(s,sizeof(s),ly_deaths_cost); mps_store_ss(i++,_("Deaths"),s); num_to_ansi(s,sizeof(s),ly_windmill_cost); mps_store_ss(i++,_("Windmill"),s); num_to_ansi(s,sizeof(s),ly_health_cost); mps_store_ss(i++,_("Hospital"),s); num_to_ansi(s,sizeof(s),ly_rocket_pad_cost); mps_store_ss(i++,_("Rockets"),s); num_to_ansi(s,sizeof(s),ly_fire_cost); mps_store_ss(i++,_("Fire Stn"),s); num_to_ansi(s,sizeof(s),ly_cricket_cost); mps_store_ss(i++,_("Sport"),s); num_to_ansi(s,sizeof(s),ly_recycle_cost); mps_store_ss(i++,_("Recycle"),s); }
void Waterwell::report() { int i = 0; const char *p; mps_store_sd(i++, constructionGroup->name, ID); i++; mps_store_sddp(i++, N_("Fertility"), ugwCount, constructionGroup->size * constructionGroup->size); mps_store_sfp(i++, N_("busy"), busy); mps_store_sddp(i++, N_("Air Pollution"), world(x,y)->pollution, MAX_POLLUTION_AT_WATERWELL); p = world(x,y)->pollution>MAX_POLLUTION_AT_WATERWELL?N_("No"):N_("Yes"); mps_store_ss(i++, N_("Drinkable"), p); list_commodities(&i); }
void mps_organic_farm(int x, int y) { int i = 0; mps_store_title(i++, _("Organic Farm")); i++; mps_store_ss(i++, _("Power"), (MP_INFO(x, y).flags & FLAG_POWERED) ? _("YES") : _("NO")); mps_store_sfp(i++, _("Tech"), MP_TECH(x, y) * 100.0 / MAX_TECH_LEVEL); mps_store_sfp(i++, _("Prod"), MP_INFO(x, y).int_4 * 100.0 / 1200.0); #ifdef DEBUG if (use_waterwell) { i++; mps_store_title(i++, _("Debug info")); mps_store_sd(i++, _("max with power&water"), MP_INFO(x + 1, y).int_3); mps_store_sd(i++, _("N tiles with water"), MP_INFO(x + 1, y).int_4); mps_store_sd(i++, _("Current production"), MP_INFO(x + 1, y).int_5); } #endif }
void mps_water(int x, int y) { int i; const char *p; for(i = 0; i < MPS_PARAGRAPH_COUNT; ++i) mps_store_title( i, "" ); i = 0; mps_store_title(i++, _("Water")); i++; p = (MP_INFO(x, y).flags & FLAG_IS_RIVER) ? _("Yes") : _("No"); mps_store_ss(i++, _("Navigable"), p); #ifdef DEBUG mps_store_sd(10, "x = ", x); mps_store_sd(11, "y = ", y); mps_store_sd(12, "altitude = ", ALT(x, y)); fprintf(stderr, "water x %i, y %i, Alt %i\n", x, y, ALT(x,y)); #endif }
void mps_residence (int x, int y) { int i = 0; char * p; mps_store_title(i++,_("Residence")); i++; mps_store_sd(i++,_("People"), MP_INFO(x,y).population); p = ((MP_INFO(x,y).flags & FLAG_POWERED) != 0) ? _("YES") : _("NO"); mps_store_ss(i++, _("Power"), p); p = ((MP_INFO(x,y).flags & FLAG_FED) != 0) ? _("YES") : _("NO"); mps_store_ss(i++, _("Fed"), p); p = ((MP_INFO(x,y).flags & FLAG_EMPLOYED) != 0) ? _("YES") : _("NO"); mps_store_ss(i++, _("Employed"), p); p = ((MP_INFO(x,y).flags & FLAG_HEALTH_COVER) != 0) ? _("YES") : _("NO"); mps_store_ss(i++, _("Health Cvr"), p); p = ((MP_INFO(x,y).flags & FLAG_FIRE_COVER) != 0) ? _("YES") : _("NO"); mps_store_ss(i++, _("Fire"), p); p = ((MP_INFO(x,y).flags & FLAG_CRICKET_COVER) != 0) ? _("YES") : _("NO"); mps_store_ss(i++, _("Cricket"), p); mps_store_sd(i++, _("Pollution"), MP_POL(x,y)); p = (MP_INFO(x,y).int_1 >= 10) ? _("good") : _("poor"); mps_store_ss(i++, _("Job"), p); }