diff -N -u -r --exclude-from ../.diff_ignore freeciv-cvs/client/gui-gtk/citydlg.c freeciv/client/gui-gtk/citydlg.c --- freeciv-cvs/client/gui-gtk/citydlg.c Fri Jun 4 23:09:27 1999 +++ freeciv/client/gui-gtk/citydlg.c Sat Jun 5 09:58:04 1999 @@ -1174,9 +1174,7 @@ gtk_clear_pixmap(pdialog->support_unit_pixmaps[i]); /* STG */ put_unit_gpixmap(punit, GTK_PIXMAP(pdialog->support_unit_pixmaps[i]), 0, 0); - put_unit_gpixmap_city_overlays(punit, - GTK_PIXMAP(pdialog->support_unit_pixmaps[i]), - punit->unhappiness, punit->upkeep); + put_unit_gpixmap_city_overlays(punit, GTK_PIXMAP(pdialog->support_unit_pixmaps[i])); gtk_changed_pixmap(pdialog->support_unit_pixmaps[i]); @@ -1229,9 +1227,7 @@ gtk_clear_pixmap(pdialog->present_unit_pixmaps[i]); /* STG */ put_unit_gpixmap(punit, GTK_PIXMAP(pdialog->present_unit_pixmaps[i]), 0, 0); - put_unit_gpixmap_city_overlays(punit, - GTK_PIXMAP(pdialog->present_unit_pixmaps[i]), - 0, 0); + put_unit_gpixmap_city_overlays(punit, GTK_PIXMAP(pdialog->present_unit_pixmaps[i])); gtk_changed_pixmap(pdialog->present_unit_pixmaps[i]); pdialog->present_unit_ids[i]=punit->id; diff -N -u -r --exclude-from ../.diff_ignore freeciv-cvs/client/gui-gtk/mapview.c freeciv/client/gui-gtk/mapview.c --- freeciv-cvs/client/gui-gtk/mapview.c Sat Jun 5 08:35:39 1999 +++ freeciv/client/gui-gtk/mapview.c Sat Jun 5 11:34:47 1999 @@ -1111,23 +1111,20 @@ /************************************************************************** ... **************************************************************************/ -void put_unit_gpixmap_city_overlays(struct unit *punit, GtkPixmap *p, - int unhappiness, int upkeep) +void put_unit_gpixmap_city_overlays(struct unit *punit, GtkPixmap *p) { + /* wipe the slate clean */ gdk_draw_rectangle(GTK_PIXMAP(p)->mask, mask_bg_gc, TRUE, 0, NORMAL_TILE_WIDTH, NORMAL_TILE_HEIGHT, NORMAL_TILE_HEIGHT+SMALL_TILE_HEIGHT); - if(upkeep) { - if(unit_flag(punit->type, F_SETTLERS)) { - put_overlay_tile_gpixmap(p, 0, 1, CITY_FOOD_TILES+upkeep-1); - } - else - put_overlay_tile_gpixmap(p, 0, 1, CITY_SHIELD_TILE); - } - - if(unhappiness) - put_overlay_tile_gpixmap(p, 0, 1, CITY_MASK_TILES+unhappiness-1); + /* draw overlay pixmaps */ + if (punit->upkeep_food > 0) + put_overlay_tile_gpixmap (p, 0, 1, CITY_FOOD_TILES + (punit->upkeep_food > 1 ? 1 : 0)); + if (punit->upkeep > 0) + put_overlay_tile_gpixmap (p, 0, 1, CITY_SHIELD_TILE); + if (punit->unhappiness > 0) + put_overlay_tile_gpixmap (p, 0, 1, CITY_MASK_TILES + (punit->unhappiness > 1 ? 1 : 0)); } diff -N -u -r --exclude-from ../.diff_ignore freeciv-cvs/client/gui-gtk/mapview.h freeciv/client/gui-gtk/mapview.h --- freeciv-cvs/client/gui-gtk/mapview.h Tue Apr 13 14:14:40 1999 +++ freeciv/client/gui-gtk/mapview.h Fri Jun 4 22:02:48 1999 @@ -145,8 +145,7 @@ void put_unit_pixmap(struct unit *punit, GdkPixmap *pm, int xtile, int ytile); void put_unit_gpixmap(struct unit *punit, GtkPixmap *p, int xtile, int ytile); -void put_unit_gpixmap_city_overlays(struct unit *punit, GtkPixmap *p, - int unhappiness, int upkeep); +void put_unit_gpixmap_city_overlays(struct unit *punit, GtkPixmap *p); void put_nuke_mushroom_pixmaps(int abs_x0, int abs_y0); void pixmap_put_black_tile(GdkDrawable *pm, int x, int y); void pixmap_frame_tile_red(GdkDrawable *pm, int x, int y); diff -N -u -r --exclude-from ../.diff_ignore freeciv-cvs/client/gui-xaw/citydlg.c freeciv/client/gui-xaw/citydlg.c --- freeciv-cvs/client/gui-xaw/citydlg.c Mon May 24 18:56:13 1999 +++ freeciv/client/gui-xaw/citydlg.c Sat Jun 5 11:22:31 1999 @@ -1219,9 +1219,7 @@ 0, 0); - put_unit_pixmap_city_overlays(punit, - XawPixcommPixmap(pdialog->support_unit_pixcomms[i]), - punit->unhappiness, punit->upkeep); + put_unit_pixmap_city_overlays(punit, XawPixcommPixmap(pdialog->support_unit_pixcomms[i])); xaw_expose_now(pdialog->support_unit_pixcomms[i]); pdialog->support_unit_ids[i]=punit->id; @@ -1269,9 +1267,7 @@ put_unit_pixmap(punit, XawPixcommPixmap(pdialog->present_unit_pixcomms[i]), 0, 0); - put_unit_pixmap_city_overlays(punit, - XawPixcommPixmap(pdialog->present_unit_pixcomms[i]), - 0,0); + put_unit_pixmap_city_overlays(punit, XawPixcommPixmap(pdialog->present_unit_pixcomms[i])); xaw_expose_now(pdialog->present_unit_pixcomms[i]); pdialog->present_unit_ids[i]=punit->id; diff -N -u -r --exclude-from ../.diff_ignore freeciv-cvs/client/gui-xaw/mapview.c freeciv/client/gui-xaw/mapview.c --- freeciv-cvs/client/gui-xaw/mapview.c Sat Jun 5 08:35:39 1999 +++ freeciv/client/gui-xaw/mapview.c Sat Jun 5 11:34:48 1999 @@ -976,23 +976,20 @@ /************************************************************************** ... **************************************************************************/ -void put_unit_pixmap_city_overlays(struct unit *punit, Pixmap pm, - int unhappiness, int upkeep) +void put_unit_pixmap_city_overlays(struct unit *punit, Pixmap pm) { + /* wipe the slate clean */ XSetForeground(display, fill_bg_gc, colors_standard[COLOR_STD_WHITE]); XFillRectangle(display, pm, fill_bg_gc, 0, NORMAL_TILE_WIDTH, NORMAL_TILE_HEIGHT, NORMAL_TILE_HEIGHT+SMALL_TILE_HEIGHT); - if(upkeep) { - if(unit_flag(punit->type, F_SETTLERS)) { - pixmap_put_overlay_tile(pm, 0, 1, CITY_FOOD_TILES+upkeep-1); - } - else - pixmap_put_overlay_tile(pm, 0, 1, CITY_SHIELD_TILE); - } - - if(unhappiness) - pixmap_put_overlay_tile(pm, 0, 1, CITY_MASK_TILES+unhappiness-1); + /* draw overlay pixmaps */ + if (punit->upkeep_food > 0) + pixmap_put_overlay_tile (pm, 0, 1, CITY_FOOD_TILES + (punit->upkeep_food > 1 ? 1 : 0)); + if (punit->upkeep > 0) + pixmap_put_overlay_tile (pm, 0, 1, CITY_SHIELD_TILE); + if (punit->unhappiness > 0) + pixmap_put_overlay_tile (pm, 0, 1, CITY_MASK_TILES + (punit->unhappiness > 1 ? 1 : 0)); } diff -N -u -r --exclude-from ../.diff_ignore freeciv-cvs/client/gui-xaw/mapview.h freeciv/client/gui-xaw/mapview.h --- freeciv-cvs/client/gui-xaw/mapview.h Tue Apr 13 12:53:13 1999 +++ freeciv/client/gui-xaw/mapview.h Sat Jun 5 11:20:53 1999 @@ -130,8 +130,7 @@ void put_unit_pixmap(struct unit *punit, Pixmap pm, int xtile, int ytile); -void put_unit_pixmap_city_overlays(struct unit *punit, Pixmap pm, - int unhappiness, int upkeep); +void put_unit_pixmap_city_overlays(struct unit *punit, Pixmap pm); void put_city_pixmap(struct city *pcity, Pixmap pm, int xtile, int ytile); void put_city_tile_output(Pixmap pm, int x, int y, diff -N -u -r --exclude-from ../.diff_ignore freeciv-cvs/client/packhand.c freeciv/client/packhand.c --- freeciv-cvs/client/packhand.c Tue May 18 14:48:09 1999 +++ freeciv/client/packhand.c Fri Jun 4 22:38:15 1999 @@ -473,6 +473,14 @@ punit->upkeep=packet->upkeep; repaint_city=1; } + if (punit->upkeep_food!=packet->upkeep_food) { + punit->upkeep_food=packet->upkeep_food; + repaint_city=1; + } + if (punit->upkeep_gold!=packet->upkeep_gold) { + punit->upkeep_gold=packet->upkeep_gold; + repaint_city=1; + } if (repaint_city) { if((pcity=find_city_by_id(punit->homecity))) { refresh_city_dialog(pcity); @@ -502,6 +510,8 @@ punit->unhappiness=packet->unhappiness; punit->activity=packet->activity; punit->upkeep=packet->upkeep; + punit->upkeep_food=packet->upkeep_food; + punit->upkeep_gold=packet->upkeep_gold; punit->fuel=packet->fuel; punit->goto_dest_x=packet->goto_dest_x; punit->goto_dest_y=packet->goto_dest_y; @@ -1004,6 +1014,10 @@ u->fuel = p->fuel; u->flags = p->flags; u->roles = p->roles; + u->happy_cost = p->happy_cost; + u->shield_cost = p->shield_cost; + u->food_cost = p->food_cost; + u->gold_cost = p->gold_cost; } /************************************************************************** diff -N -u -r --exclude-from ../.diff_ignore freeciv-cvs/common/packets.c freeciv/common/packets.c --- freeciv-cvs/common/packets.c Sun May 23 20:50:52 1999 +++ freeciv/common/packets.c Sat Jun 5 10:05:11 1999 @@ -1076,8 +1076,11 @@ cptr=put_int8(cptr, req->type); cptr=put_int8(cptr, req->movesleft); cptr=put_int8(cptr, req->hp); - pack=(req->upkeep&0x3)|((req->unhappiness&0x3)<<2)|((req->activity&0xf)<<4); - cptr=put_int8(cptr, pack); + cptr=put_int8(cptr, req->upkeep); + cptr=put_int8(cptr, req->upkeep_food); + cptr=put_int8(cptr, req->upkeep_gold); + cptr=put_int8(cptr, req->unhappiness); + cptr=put_int8(cptr, req->activity); cptr=put_int8(cptr, req->activity_count); cptr=put_int8(cptr, req->goto_dest_x); cptr=put_int8(cptr, req->goto_dest_y); @@ -1247,9 +1250,11 @@ cptr=get_int8(cptr, &packet->type); cptr=get_int8(cptr, &packet->movesleft); cptr=get_int8(cptr, &packet->hp); - cptr=get_int8(cptr, &pack); - packet->activity=pack>>4; packet->upkeep=pack&0x3; - packet->unhappiness=(pack>>2)&0x3; + cptr=get_int8(cptr, &packet->upkeep); + cptr=get_int8(cptr, &packet->upkeep_food); + cptr=get_int8(cptr, &packet->upkeep_gold); + cptr=get_int8(cptr, &packet->unhappiness); + cptr=get_int8(cptr, &packet->activity); cptr=get_int8(cptr, &packet->activity_count); cptr=get_int8(cptr, &packet->goto_dest_x); cptr=get_int8(cptr, &packet->goto_dest_y); @@ -1591,6 +1596,10 @@ cptr=put_int8(cptr, packet->fuel); cptr=put_int32(cptr, packet->flags); cptr=put_int32(cptr, packet->roles); + cptr=put_int8(cptr, packet->happy_cost); /* unit upkeep -- SKi */ + cptr=put_int8(cptr, packet->shield_cost); + cptr=put_int8(cptr, packet->food_cost); + cptr=put_int8(cptr, packet->gold_cost); cptr=put_string(cptr, packet->name); put_int16(buffer, cptr-buffer); @@ -1627,6 +1636,10 @@ cptr=get_int8(cptr, &packet->fuel); cptr=get_int32(cptr, &packet->flags); cptr=get_int32(cptr, &packet->roles); + cptr=get_int8(cptr, &packet->happy_cost); /* unit upkeep -- SKi */ + cptr=get_int8(cptr, &packet->shield_cost); + cptr=get_int8(cptr, &packet->food_cost); + cptr=get_int8(cptr, &packet->gold_cost); cptr=get_string(cptr, packet->name); remove_packet_from_buffer(&pc->buffer); diff -N -u -r --exclude-from ../.diff_ignore freeciv-cvs/common/packets.h freeciv/common/packets.h --- freeciv-cvs/common/packets.h Sun May 23 20:50:53 1999 +++ freeciv/common/packets.h Fri Jun 4 22:18:30 1999 @@ -248,6 +248,8 @@ int activity_count; int unhappiness; int upkeep; + int upkeep_food; + int upkeep_gold; int ai; int fuel; int goto_dest_x, goto_dest_y; @@ -432,6 +434,11 @@ int fuel; int flags; int roles; /* a client-side-ai might be interested */ + + int happy_cost; /* unhappy people in home city */ + int shield_cost; /* normal upkeep cost */ + int food_cost; /* settler food cost */ + int gold_cost; /* gold upkeep (n/a now, maybe later) */ }; struct packet_ruleset_tech { diff -N -u -r --exclude-from ../.diff_ignore freeciv-cvs/common/shared.h freeciv/common/shared.h --- freeciv-cvs/common/shared.h Wed Jun 2 22:23:08 1999 +++ freeciv/common/shared.h Fri Jun 4 20:28:35 1999 @@ -73,7 +73,7 @@ */ /* The default string is really simple */ -#define CAPABILITY "+1.8 caravan1 nuke" +#define CAPABILITY "+1.8 caravan1 nuke +unit_upkeep" /* caravan1 means to server automatically established a traderoute when a caravan type unit moves into an enemy city. For older servers the client has to explicitly ask for a trade route. @@ -81,6 +81,10 @@ "nuke" means that it is possible to explode nuclear at a tile without enemy units. Maybe it should be mandatory because it improves player's fighting capabilities. + + unit_upkeep means that unit costs are specified in + units.ruleset, instead of being figured out from unit + attributes. */ #define CITY_NAMES_FONT "10x20" diff -N -u -r --exclude-from ../.diff_ignore freeciv-cvs/common/unit.h freeciv/common/unit.h --- freeciv-cvs/common/unit.h Sun May 2 20:21:08 1999 +++ freeciv/common/unit.h Fri Jun 4 20:41:54 1999 @@ -116,6 +116,8 @@ int hp; int unhappiness; int upkeep; + int upkeep_food; + int upkeep_gold; int foul; int fuel; int bribe_cost; @@ -200,8 +202,14 @@ int firepower; int obsoleted_by; int fuel; + unsigned int flags; unsigned int roles; + + int happy_cost; /* unhappy people in home city */ + int shield_cost; /* normal upkeep cost */ + int food_cost; /* settler food cost */ + int gold_cost; /* gold upkeep (n/a now, maybe later) */ }; diff -N -u -r --exclude-from ../.diff_ignore freeciv-cvs/data/civ1/units.ruleset freeciv/data/civ1/units.ruleset --- freeciv-cvs/data/civ1/units.ruleset Sat Jan 30 03:57:53 1999 +++ freeciv/data/civ1/units.ruleset Fri Jun 4 08:46:40 1999 @@ -97,7 +97,7 @@ } ; Second table: -u2={ "name","graphics","move_type","build_cost","attack_strength","defense_strength","move_rate","vision_range","transport_capacity","hitpoints","firepower","fuel" +u2={ "name","graphics","move_type","build_cost","attack_strength","defense_strength","move_rate","vision_range","transport_capacity","hitpoints","firepower","fuel","uk_happy","uk_shield","uk_food","uk_gold" ; Name: should be the same as table 1. ; Move_type: 1=land, 2=sea, 3=heli, 4=air @@ -106,63 +106,64 @@ ; Fuel: 0=none, 1=end of turn, 2=end of 2nd turn ; Second table data: -; "Longname unit", g#, T, bc, at, de, mv, v, c, hp, f, u +; - upkeep - +; "Longname unit", g#, T, bc, at, de, mv, v, c, hp, f, u, H, S, F, G -"Settlers", 24, 1, 40, 0, 1, 1, 1, 0, 20, 1, 0 -"Engineers", 42, 1, 40, 0, 2, 2, 1, 0, 20, 1, 0 -"Militia", 18, 1, 10, 1, 1, 1, 1, 0, 10, 1, 0 -"Phalanx", 21, 1, 20, 1, 2, 1, 1, 0, 10, 1, 0 -"Archers", 28, 1, 30, 3, 2, 1, 1, 0, 10, 1, 0 -"Legion", 16, 1, 20, 3, 1, 1, 1, 0, 10, 1, 0 -"Pikemen", 37, 1, 20, 1, 2, 1, 1, 0, 10, 1, 0 -"Musketeers", 19, 1, 30, 2, 3, 1, 1, 0, 20, 1, 0 -"Fanatics", 49, 1, 20, 4, 4, 1, 1, 0, 20, 1, 0 -"Partisan", 36, 1, 50, 4, 4, 1, 1, 0, 20, 1, 0 -"Alpine Troops", 45, 1, 50, 5, 5, 1, 1, 0, 20, 1, 0 -"Riflemen", 22, 1, 30, 3, 5, 1, 1, 0, 20, 1, 0 -"Marines", 40, 1, 60, 8, 5, 1, 1, 0, 20, 1, 0 -"Paratroopers", 0, 1, 60, 6, 4, 1, 1, 0, 20, 1, 0 -"Mech. Inf.", 17, 1, 50, 6, 6, 3, 1, 0, 30, 1, 0 -"Cavalry", 8, 1, 20, 2, 1, 2, 1, 0, 10, 1, 0 -"Chariot", 9, 1, 40, 4, 1, 2, 1, 0, 10, 1, 0 -"Elephants", 39, 1, 40, 4, 1, 2, 1, 0, 10, 1, 0 -"Crusaders", 38, 1, 40, 5, 1, 2, 1, 0, 10, 1, 0 -"Knights", 15, 1, 40, 4, 2, 2, 1, 0, 10, 1, 0 -"Dragoons", 32, 1, 50, 5, 2, 2, 1, 0, 20, 1, 0 -"Civ2-Cavalry", 29, 1, 60, 8, 3, 2, 1, 0, 20, 1, 0 -"Armor", 0, 1, 80, 10, 5, 3, 1, 0, 30, 1, 0 -"Catapult", 7, 1, 40, 6, 1, 1, 1, 0, 10, 1, 0 -"Cannon", 4, 1, 40, 8, 1, 1, 1, 0, 20, 1, 0 -"Civ2-Artillery", 43, 1, 50, 10, 1, 1, 1, 0, 20, 2, 0 -"Artillery", 1, 1, 60, 12, 2, 2, 1, 0, 30, 2, 0 +"Settlers", 24, 1, 40, 0, 1, 1, 1, 0, 20, 1, 0, 0, 1, 1, 0 +"Engineers", 42, 1, 40, 0, 2, 2, 1, 0, 20, 1, 0, 0, 1, 1, 0 +"Militia", 18, 1, 10, 1, 1, 1, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Phalanx", 21, 1, 20, 1, 2, 1, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Archers", 28, 1, 30, 3, 2, 1, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Legion", 16, 1, 20, 3, 1, 1, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Pikemen", 37, 1, 20, 1, 2, 1, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Musketeers", 19, 1, 30, 2, 3, 1, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Fanatics", 49, 1, 20, 4, 4, 1, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Partisan", 36, 1, 50, 4, 4, 1, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Alpine Troops", 45, 1, 50, 5, 5, 1, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Riflemen", 22, 1, 30, 3, 5, 1, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Marines", 40, 1, 60, 8, 5, 1, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Paratroopers", 0, 1, 60, 6, 4, 1, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Mech. Inf.", 17, 1, 50, 6, 6, 3, 1, 0, 30, 1, 0, 1, 1, 0, 0 +"Cavalry", 8, 1, 20, 2, 1, 2, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Chariot", 9, 1, 40, 4, 1, 2, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Elephants", 39, 1, 40, 4, 1, 2, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Crusaders", 38, 1, 40, 5, 1, 2, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Knights", 15, 1, 40, 4, 2, 2, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Dragoons", 32, 1, 50, 5, 2, 2, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Civ2-Cavalry", 29, 1, 60, 8, 3, 2, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Armor", 0, 1, 80, 10, 5, 3, 1, 0, 30, 1, 0, 1, 1, 0, 0 +"Catapult", 7, 1, 40, 6, 1, 1, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Cannon", 4, 1, 40, 8, 1, 1, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Civ2-Artillery", 43, 1, 50, 10, 1, 1, 1, 0, 20, 2, 0, 1, 1, 0, 0 +"Artillery", 1, 1, 60, 12, 2, 2, 1, 0, 30, 2, 0, 1, 1, 0, 0 ; Second table data, continued: ; "Longname unit", g#, T, bc, at, de, mv, v, c, hp, f, u -"Fighter", 12, 4, 60, 4, 2, 10, 2, 0, 20, 2, 1 -"Bomber", 3, 4, 120, 12, 1, 8, 2, 0, 20, 2, 2 -"Helicopter", 44, 3, 100, 10, 3, 6, 2, 0, 20, 2, 0 -"Stealth Fighter", 47, 4, 80, 8, 4, 14, 2, 0, 20, 2, 1 -"Stealth Bomber", 46, 4, 160, 14, 5, 12, 2, 0, 20, 2, 2 -"Trireme", 27, 2, 40, 1, 0, 3, 1, 2, 10, 1, 0 -"Sail", 23, 2, 40, 1, 1, 3, 1, 3, 10, 1, 0 -"Galleon", 35, 2, 40, 0, 2, 4, 1, 4, 20, 1, 0 -"Frigate", 13, 2, 40, 2, 2, 3, 1, 4, 20, 1, 0 -"Ironclad", 14, 2, 60, 4, 4, 4, 1, 0, 30, 1, 0 -"Destroyer", 31, 2, 60, 4, 4, 6, 2, 0, 30, 1, 0 -"Cruiser", 10, 2, 80, 6, 6, 6, 2, 0, 30, 2, 0 -"AEGIS Cruiser", 48, 2, 100, 8, 8, 5, 2, 0, 30, 2, 0 -"Battleship", 2, 2, 160, 18, 12, 4, 2, 0, 40, 2, 0 -"Submarine", 25, 2, 50, 8, 2, 3, 2, 0, 30, 2, 0 -"Carrier", 6, 2, 160, 1, 12, 5, 2, 8, 40, 2, 0 -"Transport", 26, 2, 50, 0, 3, 4, 2, 8, 30, 1, 0 -"Cruise Missile", 30, 4, 60, 18, 0, 12, 1, 0, 10, 3, 1 -"Nuclear", 20, 4, 160, 99, 0, 16, 1, 0, 10, 1, 1 -"Diplomat", 11, 1, 30, 0, 0, 2, 1, 0, 10, 1, 0 -"Spy", 41, 1, 30, 0, 0, 3, 2, 0, 10, 1, 0 -"Caravan", 5, 1, 50, 0, 1, 1, 1, 0, 10, 1, 0 -"Freight", 34, 1, 50, 0, 1, 2, 1, 0, 10, 1, 0 -"Explorer", 33, 1, 30, 0, 1, 1, 1, 0, 10, 1, 0 +"Fighter", 12, 4, 60, 4, 2, 10, 2, 0, 20, 2, 1, 1, 1, 0, 0 +"Bomber", 3, 4, 120, 12, 1, 8, 2, 0, 20, 2, 2, 1, 1, 0, 0 +"Helicopter", 44, 3, 100, 10, 3, 6, 2, 0, 20, 2, 0, 1, 1, 0, 0 +"Stealth Fighter", 47, 4, 80, 8, 4, 14, 2, 0, 20, 2, 1, 1, 1, 0, 0 +"Stealth Bomber", 46, 4, 160, 14, 5, 12, 2, 0, 20, 2, 2, 1, 1, 0, 0 +"Trireme", 27, 2, 40, 1, 0, 3, 1, 2, 10, 1, 0, 1, 1, 0, 0 +"Sail", 23, 2, 40, 1, 1, 3, 1, 3, 10, 1, 0, 1, 1, 0, 0 +"Galleon", 35, 2, 40, 0, 2, 4, 1, 4, 20, 1, 0, 1, 1, 0, 0 +"Frigate", 13, 2, 40, 2, 2, 3, 1, 4, 20, 1, 0, 1, 1, 0, 0 +"Ironclad", 14, 2, 60, 4, 4, 4, 1, 0, 30, 1, 0, 1, 1, 0, 0 +"Destroyer", 31, 2, 60, 4, 4, 6, 2, 0, 30, 1, 0, 1, 1, 0, 0 +"Cruiser", 10, 2, 80, 6, 6, 6, 2, 0, 30, 2, 0, 1, 1, 0, 0 +"AEGIS Cruiser", 48, 2, 100, 8, 8, 5, 2, 0, 30, 2, 0, 1, 1, 0, 0 +"Battleship", 2, 2, 160, 18, 12, 4, 2, 0, 40, 2, 0, 1, 1, 0, 0 +"Submarine", 25, 2, 50, 8, 2, 3, 2, 0, 30, 2, 0, 1, 1, 0, 0 +"Carrier", 6, 2, 160, 1, 12, 5, 2, 8, 40, 2, 0, 1, 1, 0, 0 +"Transport", 26, 2, 50, 0, 3, 4, 2, 8, 30, 1, 0, 1, 1, 0, 0 +"Cruise Missile", 30, 4, 60, 18, 0, 12, 1, 0, 10, 3, 1, 1, 1, 0, 0 +"Nuclear", 20, 4, 160, 99, 0, 16, 1, 0, 10, 1, 1, 1, 1, 0, 0 +"Diplomat", 11, 1, 30, 0, 0, 2, 1, 0, 10, 1, 0, 0, 1, 0, 0 +"Spy", 41, 1, 30, 0, 0, 3, 2, 0, 10, 1, 0, 0, 1, 0, 0 +"Caravan", 5, 1, 50, 0, 1, 1, 1, 0, 10, 1, 0, 0, 1, 0, 0 +"Freight", 34, 1, 50, 0, 1, 2, 1, 0, 10, 1, 0, 0, 1, 0, 0 +"Explorer", 33, 1, 30, 0, 1, 1, 1, 0, 10, 1, 0, 0, 1, 0, 0 ; Second table data above: ; "Longname unit", g#, T, bc, at, de, mv, v, c, hp, f, u diff -N -u -r --exclude-from ../.diff_ignore freeciv-cvs/data/default/units.ruleset freeciv/data/default/units.ruleset --- freeciv-cvs/data/default/units.ruleset Fri Feb 12 19:39:40 1999 +++ freeciv/data/default/units.ruleset Fri Jun 4 20:46:27 1999 @@ -96,7 +96,7 @@ } ; Second table: -u2={ "name","graphics","move_type","build_cost","attack_strength","defense_strength","move_rate","vision_range","transport_capacity","hitpoints","firepower","fuel" +u2={ "name","graphics","move_type","build_cost","attack_strength","defense_strength","move_rate","vision_range","transport_capacity","hitpoints","firepower","fuel","uk_happy","uk_shield","uk_food","uk_gold" ; Name: should be the same as table 1. ; Move_type: 1=land, 2=sea, 3=heli, 4=air @@ -105,63 +105,64 @@ ; Fuel: 0=none, 1=end of turn, 2=end of 2nd turn ; Second table data: -; "Longname unit", g#, T, bc, at, de, mv, v, c, hp, f, u +; - upkeep - +; "Longname unit", g#, T, bc, at, de, mv, v, c, hp, f, u, H, S, F, G -"Settlers", 24, 1, 40, 0, 1, 1, 1, 0, 20, 1, 0 -"Engineers", 42, 1, 40, 0, 2, 2, 1, 0, 20, 1, 0 -"Warriors", 18, 1, 10, 1, 1, 1, 1, 0, 10, 1, 0 -"Phalanx", 21, 1, 20, 1, 2, 1, 1, 0, 10, 1, 0 -"Archers", 28, 1, 30, 3, 2, 1, 1, 0, 10, 1, 0 -"Legion", 16, 1, 40, 4, 2, 1, 1, 0, 10, 1, 0 -"Pikemen", 37, 1, 20, 1, 2, 1, 1, 0, 10, 1, 0 -"Musketeers", 19, 1, 30, 3, 3, 1, 1, 0, 20, 1, 0 -"Fanatics", 49, 1, 20, 4, 4, 1, 1, 0, 20, 1, 0 -"Partisan", 36, 1, 50, 4, 4, 1, 1, 0, 20, 1, 0 -"Alpine Troops", 45, 1, 50, 5, 5, 1, 1, 0, 20, 1, 0 -"Riflemen", 22, 1, 40, 5, 4, 1, 1, 0, 20, 1, 0 -"Marines", 40, 1, 60, 8, 5, 1, 1, 0, 20, 1, 0 -"Paratroopers", 0, 1, 60, 6, 4, 1, 1, 0, 20, 1, 0 -"Mech. Inf.", 17, 1, 50, 6, 6, 3, 1, 0, 30, 1, 0 -"Horsemen", 8, 1, 20, 2, 1, 2, 1, 0, 10, 1, 0 -"Chariot", 9, 1, 30, 3, 1, 2, 1, 0, 10, 1, 0 -"Elephants", 39, 1, 40, 4, 1, 2, 1, 0, 10, 1, 0 -"Crusaders", 38, 1, 40, 5, 1, 2, 1, 0, 10, 1, 0 -"Knights", 15, 1, 40, 4, 2, 2, 1, 0, 10, 1, 0 -"Dragoons", 32, 1, 50, 5, 2, 2, 1, 0, 20, 1, 0 -"Cavalry", 29, 1, 60, 8, 3, 2, 1, 0, 20, 1, 0 -"Armor", 0, 1, 80, 10, 5, 3, 1, 0, 30, 1, 0 -"Catapult", 7, 1, 40, 6, 1, 1, 1, 0, 10, 1, 0 -"Cannon", 4, 1, 40, 8, 1, 1, 1, 0, 20, 1, 0 -"Artillery", 43, 1, 50, 10, 1, 1, 1, 0, 20, 2, 0 -"Howitzer", 1, 1, 70, 12, 2, 2, 1, 0, 30, 2, 0 +"Settlers", 24, 1, 40, 0, 1, 1, 1, 0, 20, 1, 0, 0, 1, 1, 0 +"Engineers", 42, 1, 40, 0, 2, 2, 1, 0, 20, 1, 0, 0, 1, 1, 0 +"Warriors", 18, 1, 10, 1, 1, 1, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Phalanx", 21, 1, 20, 1, 2, 1, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Archers", 28, 1, 30, 3, 2, 1, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Legion", 16, 1, 40, 4, 2, 1, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Pikemen", 37, 1, 20, 1, 2, 1, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Musketeers", 19, 1, 30, 3, 3, 1, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Fanatics", 49, 1, 20, 4, 4, 1, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Partisan", 36, 1, 50, 4, 4, 1, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Alpine Troops", 45, 1, 50, 5, 5, 1, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Riflemen", 22, 1, 40, 5, 4, 1, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Marines", 40, 1, 60, 8, 5, 1, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Paratroopers", 0, 1, 60, 6, 4, 1, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Mech. Inf.", 17, 1, 50, 6, 6, 3, 1, 0, 30, 1, 0, 1, 1, 0, 0 +"Horsemen", 8, 1, 20, 2, 1, 2, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Chariot", 9, 1, 30, 3, 1, 2, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Elephants", 39, 1, 40, 4, 1, 2, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Crusaders", 38, 1, 40, 5, 1, 2, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Knights", 15, 1, 40, 4, 2, 2, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Dragoons", 32, 1, 50, 5, 2, 2, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Cavalry", 29, 1, 60, 8, 3, 2, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Armor", 0, 1, 80, 10, 5, 3, 1, 0, 30, 1, 0, 1, 1, 0, 0 +"Catapult", 7, 1, 40, 6, 1, 1, 1, 0, 10, 1, 0, 1, 1, 0, 0 +"Cannon", 4, 1, 40, 8, 1, 1, 1, 0, 20, 1, 0, 1, 1, 0, 0 +"Artillery", 43, 1, 50, 10, 1, 1, 1, 0, 20, 2, 0, 1, 1, 0, 0 +"Howitzer", 1, 1, 70, 12, 2, 2, 1, 0, 30, 2, 0, 1, 1, 0, 0 ; Second table data, continued: ; "Longname unit", g#, T, bc, at, de, mv, v, c, hp, f, u -"Fighter", 12, 4, 60, 4, 3, 10, 2, 0, 20, 2, 1 -"Bomber", 3, 4, 120, 12, 1, 8, 2, 0, 20, 2, 2 -"Helicopter", 44, 3, 100, 10, 3, 6, 2, 0, 20, 2, 0 -"Stealth Fighter", 47, 4, 80, 8, 4, 14, 2, 0, 20, 2, 1 -"Stealth Bomber", 46, 4, 160, 14, 5, 12, 2, 0, 20, 2, 2 -"Trireme", 27, 2, 40, 1, 1, 3, 1, 2, 10, 1, 0 -"Caravel", 23, 2, 40, 2, 1, 3, 1, 3, 10, 1, 0 -"Galleon", 35, 2, 40, 0, 2, 4, 1, 4, 20, 1, 0 -"Frigate", 13, 2, 50, 4, 2, 4, 1, 2, 20, 1, 0 -"Ironclad", 14, 2, 60, 4, 4, 4, 1, 0, 30, 1, 0 -"Destroyer", 31, 2, 60, 4, 4, 6, 2, 0, 30, 1, 0 -"Cruiser", 10, 2, 80, 6, 6, 5, 2, 0, 30, 2, 0 -"AEGIS Cruiser", 48, 2, 100, 8, 8, 5, 2, 0, 30, 2, 0 -"Battleship", 2, 2, 160, 12, 12, 4, 2, 0, 40, 2, 0 -"Submarine", 25, 2, 60, 10, 2, 3, 2, 8, 30, 2, 0 -"Carrier", 6, 2, 160, 1, 9, 5, 2, 8, 40, 2, 0 -"Transport", 26, 2, 50, 0, 3, 5, 2, 8, 30, 1, 0 -"Cruise Missile", 30, 4, 60, 18, 0, 12, 1, 0, 10, 3, 1 -"Nuclear", 20, 4, 160, 99, 0, 16, 1, 0, 10, 1, 1 -"Diplomat", 11, 1, 30, 0, 0, 2, 1, 0, 10, 1, 0 -"Spy", 41, 1, 30, 0, 0, 3, 2, 0, 10, 1, 0 -"Caravan", 5, 1, 50, 0, 1, 1, 1, 0, 10, 1, 0 -"Freight", 34, 1, 50, 0, 1, 2, 1, 0, 10, 1, 0 -"Explorer", 33, 1, 30, 0, 1, 1, 1, 0, 10, 1, 0 +"Fighter", 12, 4, 60, 4, 3, 10, 2, 0, 20, 2, 1, 1, 1, 0, 0 +"Bomber", 3, 4, 120, 12, 1, 8, 2, 0, 20, 2, 2, 1, 1, 0, 0 +"Helicopter", 44, 3, 100, 10, 3, 6, 2, 0, 20, 2, 0, 1, 1, 0, 0 +"Stealth Fighter", 47, 4, 80, 8, 4, 14, 2, 0, 20, 2, 1, 1, 1, 0, 0 +"Stealth Bomber", 46, 4, 160, 14, 5, 12, 2, 0, 20, 2, 2, 1, 1, 0, 0 +"Trireme", 27, 2, 40, 1, 1, 3, 1, 2, 10, 1, 0, 1, 1, 0, 0 +"Caravel", 23, 2, 40, 2, 1, 3, 1, 3, 10, 1, 0, 1, 1, 0, 0 +"Galleon", 35, 2, 40, 0, 2, 4, 1, 4, 20, 1, 0, 1, 1, 0, 0 +"Frigate", 13, 2, 50, 4, 2, 4, 1, 2, 20, 1, 0, 1, 1, 0, 0 +"Ironclad", 14, 2, 60, 4, 4, 4, 1, 0, 30, 1, 0, 1, 1, 0, 0 +"Destroyer", 31, 2, 60, 4, 4, 6, 2, 0, 30, 1, 0, 1, 1, 0, 0 +"Cruiser", 10, 2, 80, 6, 6, 5, 2, 0, 30, 2, 0, 1, 1, 0, 0 +"AEGIS Cruiser", 48, 2, 100, 8, 8, 5, 2, 0, 30, 2, 0, 1, 1, 0, 0 +"Battleship", 2, 2, 160, 12, 12, 4, 2, 0, 40, 2, 0, 1, 1, 0, 0 +"Submarine", 25, 2, 60, 10, 2, 3, 2, 8, 30, 2, 0, 1, 1, 0, 0 +"Carrier", 6, 2, 160, 1, 9, 5, 2, 8, 40, 2, 0, 1, 1, 0, 0 +"Transport", 26, 2, 50, 0, 3, 5, 2, 8, 30, 1, 0, 1, 1, 0, 0 +"Cruise Missile", 30, 4, 60, 18, 0, 12, 1, 0, 10, 3, 1, 1, 1, 0, 0 +"Nuclear", 20, 4, 160, 99, 0, 16, 1, 0, 10, 1, 1, 1, 1, 0, 0 +"Diplomat", 11, 1, 30, 0, 0, 2, 1, 0, 10, 1, 0, 0, 1, 0, 0 +"Spy", 41, 1, 30, 0, 0, 3, 2, 0, 10, 1, 0, 0, 1, 0, 0 +"Caravan", 5, 1, 50, 0, 1, 1, 1, 0, 10, 1, 0, 0, 1, 0, 0 +"Freight", 34, 1, 50, 0, 1, 2, 1, 0, 10, 1, 0, 0, 1, 0, 0 +"Explorer", 33, 1, 30, 0, 1, 1, 1, 0, 10, 1, 0, 0, 1, 0, 0 ; Second table data above: ; "Longname unit", g#, T, bc, at, de, mv, v, c, hp, f, u diff -N -u -r --exclude-from ../.diff_ignore freeciv-cvs/server/cityturn.c freeciv/server/cityturn.c --- freeciv-cvs/server/cityturn.c Sat Jun 5 11:43:55 1999 +++ freeciv/server/cityturn.c Sat Jun 5 11:14:24 1999 @@ -58,7 +58,6 @@ static void unhappy_city_check(struct city *pcity); static void city_populate(struct city *pcity); -static void city_settlersupport(struct city *pcity); static void city_increase_size(struct city *pcity); static void city_reduce_size(struct city *pcity); @@ -393,24 +392,6 @@ } /************************************************************************** -... -**************************************************************************/ -void city_settlersupport(struct city *pcity) -{ - unit_list_iterate(pcity->units_supported, punit) { - if (unit_flag(punit->type, F_SETTLERS)) { - pcity->food_surplus--; - punit->upkeep=1; - if (get_government(pcity->owner)>=G_COMMUNISM) { - pcity->food_surplus--; - punit->upkeep=2; - } - } - } - unit_list_iterate_end; -} - -/************************************************************************** An "aggressive" unit is a unit which may cause unhappiness under a Republic or Democracy. A unit is *not* aggressive if one or more of following is true: @@ -437,99 +418,109 @@ /************************************************************************** ... **************************************************************************/ +#define extra_happy_cost governments[gov].extra_happy_cost +#define extra_shield_cost governments[gov].extra_shield_cost +#define extra_food_cost governments[gov].extra_food_cost +#define extra_gold_cost governments[gov].extra_gold_cost void city_support(struct city *pcity) { - int milunits=0; - int city_units=0; - int unhap=0; - int gov=get_government(pcity->owner); - int orig_suffrage_applies = (improvement_variant(B_WOMENS)==1 && - city_got_effect(pcity, B_POLICE)); - happy_copy(pcity, 2); - city_settlersupport(pcity); - unit_list_iterate(map_get_tile(pcity->x, pcity->y)->units, this_unit) { - if (is_military_unit(this_unit)) - city_units++; + int gov = get_government(pcity->owner); + + int content_mod = governments[gov].military_contentment_mod; + + int free_happy = governments[gov].free_happy; + int free_shield = governments[gov].free_shield; + int free_food = governments[gov].free_food; + int free_gold = governments[gov].free_gold; + + /* handle special values of free_* -- SKi */ + if (free_happy == CITY_SIZE_FREE) { + free_happy = pcity->size; } - unit_list_iterate_end; + if (free_shield == CITY_SIZE_FREE) { + free_shield = pcity->size; + } + if (free_food == CITY_SIZE_FREE) { + free_food = pcity->size; + } + if (free_gold == CITY_SIZE_FREE) { + free_gold = pcity->size; + } + + happy_copy(pcity, 2); + + /* loop units, subtracting appropriate amounts of food, shields, gold etc -- SKi */ unit_list_iterate(pcity->units_supported, this_unit) { - this_unit->unhappiness=0; - if (!unit_flag(this_unit->type, F_SETTLERS)) - this_unit->upkeep=0; - if (is_military_unit(this_unit)) { - milunits++; - switch (gov) { - case G_ANARCHY: - case G_DESPOTISM: - if (milunits>pcity->size) { - pcity->shield_surplus--; - this_unit->upkeep=1; - } - break; - case G_MONARCHY: - case G_COMMUNISM: - if (milunits>3) { - pcity->shield_surplus--; - this_unit->upkeep=1; - } - break; - case G_REPUBLIC: - pcity->shield_surplus--; - this_unit->upkeep=1; - if (!orig_suffrage_applies && (unit_being_aggressive(this_unit) - || is_field_unit(this_unit))) { - if (unhap) - this_unit->unhappiness=1; - unhap++; - } - break; - case G_DEMOCRACY: - pcity->shield_surplus--; - this_unit->upkeep=1; - if (unit_being_aggressive(this_unit)) { - this_unit->unhappiness=2; - } else if (is_field_unit(this_unit)) { - this_unit->unhappiness=1; - } - if (this_unit->unhappiness>0 && orig_suffrage_applies) { - this_unit->unhappiness--; - } - unhap += this_unit->unhappiness; - break; - default: - break; + struct unit_type *ut = &unit_types[this_unit->type]; + int happy_cost = (extra_happy_cost == NO_UPKEEP || ut->happy_cost == 0) ? 0 : ut->happy_cost + extra_happy_cost; + int shield_cost = (extra_shield_cost == NO_UPKEEP || ut->shield_cost == 0) ? 0 : ut->shield_cost + extra_shield_cost; + int food_cost = (extra_food_cost == NO_UPKEEP || ut->food_cost == 0) ? 0 : ut->food_cost + extra_food_cost; + int gold_cost = (extra_gold_cost == NO_UPKEEP || ut->gold_cost == 0) ? 0 : ut->gold_cost + extra_gold_cost; + + /* set current upkeep on unit to zero */ + this_unit->unhappiness = 0; + this_unit->upkeep = 0; + this_unit->upkeep_food = 0; + this_unit->upkeep_gold = 0; + + /* no happy_cost for non agressive units -- SKi */ + if (! unit_being_aggressive (this_unit)) { + happy_cost = 0; + } + /* effects of police stations; + * ignored if it's a field unit + * -- SKi */ + if (happy_cost > 0 && city_got_effect (pcity, B_POLICE) + && ! is_field_unit (this_unit)) { + --happy_cost; + } + /* military units in home city can make unhappy citizens content -- SKi */ + if (content_mod > 0 && pcity->ppl_unhappy[3] > 0 && + this_unit->x == pcity->x && this_unit->y == pcity->y) { + --content_mod; + --pcity->ppl_unhappy[3]; + ++pcity->ppl_content[3]; + } + + if (happy_cost > 0) { + if (free_happy) { + --free_happy; + } else { + citizen_happy_units (pcity, happy_cost); + this_unit->unhappiness = happy_cost; + } + } + if (shield_cost > 0) { + if (free_shield) { + --free_shield; + } else { + pcity->shield_surplus -= shield_cost; + this_unit->upkeep = shield_cost; } - } + } + if (food_cost > 0) { + if (free_food) { + --free_food; + } else { + pcity->food_surplus -= food_cost; + this_unit->upkeep_food = food_cost; + } + } + if (gold_cost > 0) { + if (free_gold) { + --free_gold; + } else { + /* hmmm... */ + this_unit->upkeep_gold = gold_cost; + } + } } unit_list_iterate_end; - - switch (gov) { - case G_ANARCHY: - case G_DESPOTISM: - city_units = min(city_units, pcity->ppl_unhappy[3]); - pcity->ppl_unhappy[3]-= city_units; - pcity->ppl_content[3]+= city_units; - break; - case G_MONARCHY: - city_units = min(3, city_units); - city_units = min(pcity->ppl_unhappy[3], city_units); - pcity->ppl_unhappy[3]-= city_units; - pcity->ppl_content[3]+= city_units; - break; - case G_COMMUNISM: - city_units = min(3, city_units); - city_units = min(pcity->ppl_unhappy[3], city_units*2); - pcity->ppl_unhappy[3]-= city_units; - pcity->ppl_content[3]+= city_units; - break; - case G_REPUBLIC: - unhap--; - case G_DEMOCRACY: - citizen_happy_units(pcity, unhap); - } - } - +#undef extra_happy_cost +#undef extra_shield_cost +#undef extra_food_cost +#undef extra_gold_cost /************************************************************************** ... diff -N -u -r --exclude-from ../.diff_ignore freeciv-cvs/server/ruleset.c freeciv/server/ruleset.c --- freeciv-cvs/server/ruleset.c Wed Jun 2 22:23:09 1999 +++ freeciv/server/ruleset.c Fri Jun 4 20:37:07 1999 @@ -343,6 +343,11 @@ u->firepower = max_firepower; } u->fuel = secfile_lookup_int(&file,"%s.fuel", prefix); + /* upkeep costs */ + u->happy_cost = secfile_lookup_int (&file, "%s.uk_happy", prefix); + u->shield_cost = secfile_lookup_int (&file, "%s.uk_shield", prefix); + u->food_cost = secfile_lookup_int (&file, "%s.uk_food", prefix); + u->gold_cost = secfile_lookup_int (&file, "%s.uk_gold", prefix); } /* third block: flags */ @@ -572,6 +582,10 @@ packet.fuel = u->fuel; packet.flags = u->flags; packet.roles = u->roles; + packet.happy_cost = u->happy_cost; + packet.shield_cost = u->shield_cost; + packet.food_cost = u->food_cost; + packet.gold_cost = u->gold_cost; for(to=0; toactivity_count; info.unhappiness=punit->unhappiness; info.upkeep=punit->upkeep; + info.upkeep_food=punit->upkeep_food; + info.upkeep_gold=punit->upkeep_gold; info.ai=punit->ai.control; info.fuel=punit->fuel; info.goto_dest_x=punit->goto_dest_x;