Пример #1
0
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);


}
Пример #2
0
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);

}
Пример #3
0
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_health_centre(int x, int y)
{
    int i = 0;

    mps_store_title(i++, _("Health Centre"));
    i++;
    mps_store_title(i++, _("Inventory"));
    mps_store_sfp(i++, _("Jobs"), MP_INFO(x, y).int_1 * 100.0 / MAX_JOBS_AT_HEALTH_CENTRE);
    mps_store_sfp(i++, _("Goods"), MP_INFO(x, y).int_2 * 100.0 / MAX_GOODS_AT_HEALTH_CENTRE);

}
Пример #5
0
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);
}
Пример #6
0
void
mps_blacksmith (int x, int y)
{
  int i = 0;

  mps_store_title(i++,_("Blacksmith"));
  i++;

  mps_store_sfp(i++,_("Capacity"), MP_INFO(x,y).int_6);
  i++;
  mps_store_title(i++,_("Inventory"));
  mps_store_sfp(i++,_("Goods"),
		MP_INFO(x,y).int_1 * 100.0 / MAX_GOODS_AT_BLACKSMITH);
  mps_store_sfp(i++,_("Coal"), 
		MP_INFO(x,y).int_3 * 100.0 / MAX_COAL_AT_BLACKSMITH);
}
void mps_rocket(int x, int y)
{
    int i = 0;

    mps_store_title(i++, _("Rocket Pad"));
    i++;

    mps_store_title(i++, _("Completion"));
    mps_store_fp(i++, MP_INFO(x, y).int_4 * 100.0 / ROCKET_PAD_LAUNCH);
    i++;
    mps_store_title(i++, _("Inventory"));
    mps_store_sfp(i++, _("Jobs"), MP_INFO(x, y).int_1 * 100.0 / ROCKET_PAD_JOBS_STORE);
    mps_store_sfp(i++, _("Goods"), MP_INFO(x, y).int_2 * 100.0 / ROCKET_PAD_GOODS_STORE);
    mps_store_sfp(i++, _("Steel"), MP_INFO(x, y).int_3 * 100.0 / ROCKET_PAD_STEEL_STORE);

}
Пример #8
0
void
mps_market (int x, int y)
{
  int i = 0;

  mps_store_title(i++,_("Market"));

  i++;

  mps_store_sfp(i++,_("Food"), 
		MP_INFO(x,y).int_1 * 100.0 / MAX_FOOD_IN_MARKET);
  mps_store_sfp(i++,_("Jobs"), 
		MP_INFO(x,y).int_2 * 100.0 / MAX_JOBS_IN_MARKET);
  mps_store_sfp(i++,_("Coal"), 
		MP_INFO(x,y).int_3 * 100.0 / MAX_COAL_IN_MARKET);
  mps_store_sfp(i++,_("Goods"), 
		MP_INFO(x,y).int_4 * 100.0 / MAX_GOODS_IN_MARKET);
  mps_store_sfp(i++,_("Ore"), 
		MP_INFO(x,y).int_5 * 100.0 / MAX_ORE_IN_MARKET);
  mps_store_sfp(i++,_("Steel"), 
		MP_INFO(x,y).int_6 * 100.0 / MAX_STEEL_IN_MARKET);
  mps_store_sfp(i++,_("Waste"), 
		MP_INFO(x,y).int_7 * 100.0 / MAX_WASTE_IN_MARKET);

}
Пример #9
0
void mps_water(int x, int y)
{
    int i;
    const char *p;

    i = 0;
    mps_store_sdd(i++, waterConstructionGroup.name, x, y);
    i++;

    if ( world(x,y)->flags & FLAG_IS_LAKE )
    {   p = _("Lake");}
    else if ( world(x,y)->flags & FLAG_IS_RIVER )
    {   p = _("River");}
    else
    {   p = _("Pond");}
    mps_store_title(i++, p);
/*
#ifdef DEBUG
    mps_store_sd(10, "x", x);
    mps_store_sd(11, "y", y);
    mps_store_sd(12, "altitude", world(x,y)->ground.altitude);

    fprintf(stderr, "water x %i, y %i, Alt %i\n", x, y, world(x,y)->ground.altitude);
#endif
*/
}
Пример #10
0
void
mps_port (int x, int y)
{
    int i = 0;
    char buy[12], sell[12];

    mps_store_title(i++,_("Port"));
    i++;

    num_to_ansi(buy, sizeof(buy), MP_INFO(x,y+1).int_3 / 100);
    num_to_ansi(sell, sizeof(sell), MP_INFO(x,y+2).int_3 / 100);
    mps_store_sss(i++,_("Food"),buy,sell);

    num_to_ansi(buy, sizeof(buy), MP_INFO(x,y+1).int_4 / 100);
    num_to_ansi(sell, sizeof(sell), MP_INFO(x,y+2).int_4 / 100);
    mps_store_sss(i++,_("Coal"),buy,sell);

    num_to_ansi(buy, sizeof(buy), MP_INFO(x,y+1).int_5 / 100);
    num_to_ansi(sell, sizeof(sell), MP_INFO(x,y+2).int_5 / 100);
    mps_store_sss(i++,_("Ore"),buy,sell);

    num_to_ansi(buy, sizeof(buy), MP_INFO(x,y+1).int_6 / 100);
    num_to_ansi(sell, sizeof(sell), MP_INFO(x,y+2).int_6 / 100);
    mps_store_sss(i++,_("Goods"),buy,sell);

    num_to_ansi(buy, sizeof(buy), MP_INFO(x,y+1).int_7 / 100);
    num_to_ansi(sell, sizeof(sell), MP_INFO(x,y+2).int_7 / 100);
    mps_store_sss(i++,_("Steel"),buy,sell);

    num_to_ansi(buy, sizeof(buy), MP_INFO(x,y).int_5 / 100);
    num_to_ansi(sell, sizeof(sell), MP_INFO(x,y).int_2 / 100);
    mps_store_sss(i++,_("Total"),buy,sell);

}
Пример #11
0
void
mps_mill (int x, int y)
{
  int i = 0;
  mps_store_title(i++,_("Textile Mill"));
  i++;
  mps_store_sfp(i++,_("Capacity"), MP_INFO(x,y).int_6);
  i++;
  mps_store_title(i++,_("Inventory"));
  mps_store_sfp(i++,_("Goods"),
		MP_INFO(x,y).int_1 * 100.0 / MAX_GOODS_AT_MILL);
  mps_store_sfp(i++,_("Food"),
		MP_INFO(x,y).int_2 * 100.0 / MAX_FOOD_AT_MILL);
  mps_store_sfp(i++,_("Coal"),
		MP_INFO(x,y).int_3 * 100.0 / MAX_COAL_AT_MILL);

}
Пример #12
0
void
mps_tip (int x, int y)
{
  int i = 0;

  mps_store_title(i++,_("Landfill"));
  i++;

  mps_store_title(i++,_("Last Month"));
  mps_store_sd(i++,_("Tons"), MP_INFO(x,y).int_3);
  mps_store_sfp(i++,_("Percent"), 
	       MP_INFO(x,y).int_3 * 100.0 / MAX_WASTE_AT_TIP);
  i++;
  mps_store_title(i++,_("% Filled"));
  mps_store_fp(i++,
	       MP_INFO(x,y).int_1 * 100.0 / MAX_WASTE_AT_TIP);
}
Пример #13
0
void
mps_school (int x, int y)
{
  int i = 0;
  mps_store_title(i++,_("School"));
  i++;
  mps_store_title(i++,_("Lessons Learned"));
  mps_store_f(i++,MP_INFO(x,y).int_3 * 100.0 / MAX_TECH_LEVEL);
  i++;
  mps_store_title(i++,_("Inventory"));
  mps_store_sfp(i++,_("Jobs"),
		MP_INFO(x,y).int_1 * 100.0 / MAX_JOBS_AT_SCHOOL);
  mps_store_sfp(i++,_("Goods"),
		MP_INFO(x,y).int_2 * 100.0 / MAX_GOODS_AT_SCHOOL);

  mps_store_sfp(i++,_("Capacity"), MP_INFO(x,y).int_5 * 4);

}
Пример #14
0
void
mps_power_line (int x, int y)
{
  int i = 0;

  mps_store_title(i++,_("Power Line"));
  i++;

  mps_store_sd(i++,_("Grid ID"),MP_INFO(x,y).int_6);
}
Пример #15
0
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_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

}
Пример #17
0
void
mps_global_housing (void)
{
    int i = 0;
    int tp = housed_population + people_pool;

    mps_store_title(i++,_("Population"));
    i++;
    mps_store_sd(i++,_("Total"),tp);
    mps_store_sd(i++,_("Housed"),housed_population);
    mps_store_sd(i++,_("Homeless"),people_pool);
    mps_store_sd(i++,_("Shanties"),numof_shanties);
    mps_store_sd(i++,_("Unn Dths"),unnat_deaths);
    mps_store_title(i++,_("Unemployment"));
    mps_store_sd(i++,_("Claims"),tunemployed_population);
    mps_store_sfp(i++,_("Rate"),
                  ((tunemployed_population * 100.0) / tp));
    mps_store_title(i++,_("Starvation"));
    mps_store_sd(i++,_("Cases"),tstarving_population);

    mps_store_sfp(i++,_("Rate"),
                  ((tstarving_population * 100.0) / tp));
}
Пример #18
0
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

}
Пример #19
0
void
mps_oremine (int x, int y)
{
  int i = 0;

  mps_store_title(i++,_("Ore Mine"));
  i++;

  mps_store_sfp(i++,_("Stock"), 
		MP_INFO(x,y).int_1 * 100.0 / DIG_MORE_ORE_TRIGGER);
  i++;

  mps_store_sfp(i++,_("Reserve"),
		MP_INFO(x,y).int_2 * 100.0 / (ORE_RESERVE * 16));
}
Пример #20
0
void mps_rail(int x, int y)
{
    int i = 0;

    mps_store_title(i++, _(main_groups[MP_GROUP(x, y)].name));
    i++;

    mps_store_sfp(i++, _("Food"), MP_INFO(x, y).int_1 * 100.0 / MAX_FOOD_ON_RAIL);
    mps_store_sfp(i++, _("Jobs"), MP_INFO(x, y).int_2 * 100.0 / MAX_JOBS_ON_RAIL);
    mps_store_sfp(i++, _("Coal"), MP_INFO(x, y).int_3 * 100.0 / MAX_COAL_ON_RAIL);
    mps_store_sfp(i++, _("Goods"), MP_INFO(x, y).int_4 * 100.0 / MAX_GOODS_ON_RAIL);
    mps_store_sfp(i++, _("Ore"), MP_INFO(x, y).int_5 * 100.0 / MAX_ORE_ON_RAIL);
    mps_store_sfp(i++, _("Steel"), MP_INFO(x, y).int_6 * 100.0 / MAX_STEEL_ON_RAIL);
    mps_store_sfp(i++, _("Waste"), MP_INFO(x, y).int_7 * 100.0 / MAX_WASTE_ON_RAIL);

}
Пример #21
0
void
mps_road (int x, int y)
{
  int i = 0;

  mps_store_title(i++,_("Road"));
  i++;

  mps_store_sfp(i++,_("Food"), 
		MP_INFO(x,y).int_1 * 100.0 / MAX_FOOD_ON_ROAD);
  mps_store_sfp(i++,_("Jobs"), 
		MP_INFO(x,y).int_2 * 100.0 / MAX_JOBS_ON_ROAD);
  mps_store_sfp(i++,_("Coal"), 
		MP_INFO(x,y).int_3 * 100.0 / MAX_COAL_ON_ROAD);
  mps_store_sfp(i++,_("Goods"), 
		MP_INFO(x,y).int_4 * 100.0 / MAX_GOODS_ON_ROAD);
  mps_store_sfp(i++,_("Ore"), 
		MP_INFO(x,y).int_5 * 100.0 / MAX_ORE_ON_ROAD);
  mps_store_sfp(i++,_("Steel"), 
		MP_INFO(x,y).int_6 * 100.0 / MAX_STEEL_ON_ROAD);
  mps_store_sfp(i++,_("Waste"), 
		MP_INFO(x,y).int_7 * 100.0 / MAX_WASTE_ON_ROAD);

}
Пример #22
0
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);
}
Пример #23
0
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);

}