Index: ai/aitools.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/ai/aitools.c,v retrieving revision 1.27 diff -u -w -r1.27 ai//aitools.c --- cvs/ai/aitools.c 1999/08/25 12:27:17 1.27 +++ local/ai/aitools.c 1999/08/29 17:27:38 @@ -405,12 +405,6 @@ ); } - /* - * Government flags, these were intentionally left out of the evaluation: - * G_IS_NICE - Has no impact on rules. - * G_FAVORS_GROWTH - Ditto. - * -- SKi - */ rating_before = rating; if (government_has_flag(g, G_BUILD_VETERAN_DIPLOMAT)) { rating += 100; /* ignore this advantage for now -- SKi */ Index: client/packhand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v retrieving revision 1.83 diff -u -w -r1.83 client//packhand.c --- cvs/client/packhand.c 1999/08/27 10:53:53 1.83 +++ local/client/packhand.c 1999/08/29 17:27:39 @@ -738,7 +738,7 @@ if (ship->modules > (ship->habitation + ship->life_support + ship->solar_panels)) { - int nice = government_has_flag(g, G_IS_NICE); + int nice = government_has_hint(g, G_IS_NICE); /* "nice" governments prefer to keep success 100%; * others build habitation first (for score?) (Thanks Massimo.) */ @@ -1162,6 +1162,7 @@ gov->extra_corruption_distance = p->extra_corruption_distance; gov->flags = p->flags; + gov->hints = p->hints; gov->num_ruler_titles = p->num_ruler_titles; strcpy(gov->name, p->name); Index: common/capstr.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/capstr.c,v retrieving revision 1.10 diff -u -w -r1.10 common//capstr.c --- cvs/common/capstr.c 1999/08/27 10:53:54 1.10 +++ local/common/capstr.c 1999/08/29 17:27:39 @@ -69,7 +69,7 @@ */ #define CAPABILITY "+1.8 caravan1 nuke clientcommands" \ - " +terrainrulesets1 +governmentrulesets1 +num_units +tilespec" \ + " +terrainrulesets1 +governmentrulesets2 +num_units +tilespec" \ " +ruleset_control" /* "caravan1" means the server automatically establishes a traderoute @@ -86,8 +86,9 @@ "terrainrulesets1" means that the protocol is extended to handle the new, expanded terrain rulesets. (jjm@xxxxxxxxxxxx 13aug1999) - "governmentrulesets1" is for the new government.ruleset packages; - includes unit upkeep changes. + "governmentrulesets2" is for the new government.ruleset packages; + includes unit upkeep changes and split flags into actual flags + and hints. "num_units" means the number of unit types is variable. Index: common/government.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/government.c,v retrieving revision 1.7 diff -u -w -r1.7 common//government.c --- cvs/common/government.c 1999/08/28 06:24:26 1.7 +++ local/common/government.c 1999/08/29 17:27:39 @@ -65,8 +65,11 @@ static char *flag_names[] = { "Build_Veteran_Diplomats", "Revolution_When_Unhappy", "Has_Senate", - "Unbribable", "Inspires_Partisans", "Is_Nice", "Favors_Growth" + "Unbribable", "Inspires_Partisans" }; +static char *hint_names[] = { + "Is_Nice", "Favors_Growth" +}; /*************************************************************** Convert flag names to enum; case insensitive; @@ -94,6 +97,34 @@ { assert(flag>=0 && flagflags & (1<=0 && hinthints & (1<extra_corruption_distance); cptr=put_int8(cptr, packet->flags); + cptr=put_int8(cptr, packet->hints); cptr=put_int8(cptr, packet->num_ruler_titles); @@ -2368,6 +2369,7 @@ iget_int8(&iter, &packet->extra_corruption_distance); iget_int8(&iter, &packet->flags); + iget_int8(&iter, &packet->hints); iget_int8(&iter, &packet->num_ruler_titles); Index: common/packets.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/packets.h,v retrieving revision 1.37 diff -u -w -r1.37 common//packets.h --- cvs/common/packets.h 1999/08/27 10:53:55 1.37 +++ local/common/packets.h 1999/08/29 17:27:39 @@ -581,6 +581,7 @@ int extra_corruption_distance; int flags; + int hints; int num_ruler_titles; Index: data/civ1/governments.ruleset =================================================================== RCS file: /home/freeciv/CVS/freeciv/data/civ1/governments.ruleset,v retrieving revision 1.3 diff -u -w -r1.3 data/civ1//governments.ruleset --- cvs/data/civ1/governments.ruleset 1999/08/28 06:24:27 1.3 +++ local/data/civ1/governments.ruleset 1999/08/29 17:27:39 @@ -40,6 +40,7 @@ ; should be a standard tag if preferred is not; ; otherwise may be "-" ; flags = special effects; see government.c for strings +; hints = hints to the AI about how to use / behave with government ; martial_law_max = maximum number of units which can enforce martial law ; in the city @@ -88,7 +89,8 @@ tech_req = "None" graphic = "gov.anarchy" graphic_alt = "-" -flags = "Favors_Growth" +flags = "-" +hints = "Favors_Growth" martial_law_max = 100 ; unlimited martial_law_per = 1 @@ -133,7 +135,8 @@ tech_req = "None" graphic = "gov.despotism" graphic_alt = "-" -flags = "Favors_Growth" +flags = "-" +hints = "Favors_Growth" martial_law_max = 100 ; unlimited martial_law_per = 1 @@ -181,7 +184,8 @@ tech_req = "Monarchy" graphic = "gov.monarchy" graphic_alt = "-" -flags = "Favors_Growth" +flags = "-" +hints = "Favors_Growth" martial_law_max = 100 ; unlimited martial_law_per = 1 @@ -233,7 +237,8 @@ tech_req = "Communism" graphic = "gov.communism" graphic_alt = "-" -flags = "Favors_Growth", "Build_Veteran_Diplomats" +flags = "Build_Veteran_Diplomats" +hints = "Favors_Growth" martial_law_max = 100 ; unlimited martial_law_per = 1 @@ -278,7 +283,8 @@ tech_req = "The Republic" graphic = "gov.republic" graphic_alt = "-" -flags = "Has_Senate", "Is_Nice" +flags = "Has_Senate" +hints = "Is_Nice" martial_law_max = 0 martial_law_per = 0 @@ -323,7 +329,8 @@ tech_req = "Democracy" graphic = "gov.democracy" graphic_alt = "-" -flags = "Has_Senate", "Is_Nice", "Revolution_When_Unhappy" +flags = "Has_Senate", "Revolution_When_Unhappy" +hints = "Is_Nice" martial_law_max = 0 martial_law_per = 0 Index: data/civ2/governments.ruleset =================================================================== RCS file: /home/freeciv/CVS/freeciv/data/civ2/governments.ruleset,v retrieving revision 1.4 diff -u -w -r1.4 data/civ2//governments.ruleset --- cvs/data/civ2/governments.ruleset 1999/08/28 06:24:27 1.4 +++ local/data/civ2/governments.ruleset 1999/08/29 17:27:39 @@ -38,6 +38,7 @@ ; should be a standard tag if preferred is not; ; otherwise may be "-" ; flags = special effects; see government.c for strings +; hints = hints to the AI about how to use / behave with government ; martial_law_max = maximum number of units which can enforce martial law ; in the city @@ -86,7 +87,8 @@ tech_req = "None" graphic = "gov.anarchy" graphic_alt = "-" -flags = "Favors_Growth" +flags = "-" +hints = "Favors_Growth" martial_law_max = 100 ; unlimited martial_law_per = 1 @@ -131,7 +133,8 @@ tech_req = "None" graphic = "gov.despotism" graphic_alt = "-" -flags = "Favors_Growth" +flags = "-" +hints = "Favors_Growth" martial_law_max = 100 ; unlimited martial_law_per = 1 @@ -179,7 +182,8 @@ tech_req = "Monarchy" graphic = "gov.monarchy" graphic_alt = "-" -flags = "Favors_Growth" +flags = "-" +hints = "Favors_Growth" martial_law_max = 3 martial_law_per = 1 @@ -231,7 +235,8 @@ tech_req = "Communism" graphic = "gov.communism" graphic_alt = "-" -flags = "Favors_Growth", "Build_Veteran_Diplomats", "Inspires_Partisans" +flags = "Build_Veteran_Diplomats", "Inspires_Partisans" +hints = "Favors_Growth" martial_law_max = 3 martial_law_per = 2 @@ -276,7 +281,8 @@ tech_req = "Fundamentalism" graphic = "gov.fundamentalism" graphic_alt = "-" -flags = "Favors_Growth" ; others TODO +flags = ; others TODO +hints = "Favors_Growth" ; others TODO () martial_law_max = 0 martial_law_per = 0 @@ -329,7 +335,8 @@ tech_req = "The Republic" graphic = "gov.republic" graphic_alt = "-" -flags = "Has_Senate", "Is_Nice" +flags = "Has_Senate" +hints = "Is_Nice" martial_law_max = 0 martial_law_per = 0 @@ -374,8 +381,9 @@ tech_req = "Democracy" graphic = "gov.democracy" graphic_alt = "-" -flags = "Has_Senate", "Is_Nice", "Revolution_When_Unhappy", +flags = "Has_Senate", "Revolution_When_Unhappy", "Inspires_Partisans", "Unbribable" +hints = "Is_Nice" martial_law_max = 0 martial_law_per = 0 Index: data/default/governments.ruleset =================================================================== RCS file: /home/freeciv/CVS/freeciv/data/default/governments.ruleset,v retrieving revision 1.4 diff -u -w -r1.4 data/default//governments.ruleset --- cvs/data/default/governments.ruleset 1999/08/28 06:24:28 1.4 +++ local/data/default/governments.ruleset 1999/08/29 17:27:39 @@ -39,6 +39,7 @@ ; should be a standard tag if preferred is not; ; otherwise may be "-" ; flags = special effects; see government.c for strings +; hints = hints to the AI about how to use / behave with government ; martial_law_max = maximum number of units which can enforce martial law ; in the city @@ -87,7 +88,8 @@ tech_req = "None" graphic = "gov.anarchy" graphic_alt = "-" -flags = "Favors_Growth" +flags = "-" +hints = "Favors_Growth" martial_law_max = 100 ; unlimited martial_law_per = 1 @@ -132,7 +134,8 @@ tech_req = "None" graphic = "gov.despotism" graphic_alt = "-" -flags = "Favors_Growth" +flags = "-" +hints = "Favors_Growth" martial_law_max = 100 ; unlimited martial_law_per = 1 @@ -180,7 +183,8 @@ tech_req = "Monarchy" graphic = "gov.monarchy" graphic_alt = "-" -flags = "Favors_Growth" +flags = "-" +hints = "Favors_Growth" martial_law_max = 3 martial_law_per = 1 @@ -232,7 +236,8 @@ tech_req = "Communism" graphic = "gov.communism" graphic_alt = "-" -flags = "Favors_Growth", "Build_Veteran_Diplomats", "Inspires_Partisans" +flags = "Build_Veteran_Diplomats", "Inspires_Partisans" +hints = "Favors_Growth" martial_law_max = 3 martial_law_per = 2 @@ -277,7 +282,8 @@ tech_req = "The Republic" graphic = "gov.republic" graphic_alt = "-" -flags = "Has_Senate", "Is_Nice" +flags = "Has_Senate" +hints = "Is_Nice" martial_law_max = 0 martial_law_per = 0 @@ -322,8 +328,9 @@ tech_req = "Democracy" graphic = "gov.democracy" graphic_alt = "-" -flags = "Has_Senate", "Is_Nice", "Revolution_When_Unhappy", +flags = "Has_Senate", "Revolution_When_Unhappy", "Inspires_Partisans", "Unbribable" +hints = "Is_Nice" martial_law_max = 0 martial_law_per = 0 Index: server/citytools.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/citytools.c,v retrieving revision 1.49 diff -u -w -r1.49 server//citytools.c --- cvs/server/citytools.c 1999/08/25 12:27:19 1.49 +++ local/server/citytools.c 1999/08/29 17:27:40 @@ -303,7 +303,7 @@ values[i]=0; } - if (government_has_flag(g, G_FAVORS_GROWTH) || pcity->size < 5) { + if (government_has_hint(g, G_FAVORS_GROWTH) || pcity->size < 5) { if (can_build_improvement(pcity, B_GRANARY)) values[B_GRANARY]=pcity->food_surplus*50; } @@ -337,7 +337,7 @@ /* FIXME: I think this should trigger on g->trade_bonus, not G_IS_NICE --dwp */ - if (government_has_flag(g, G_IS_NICE)) + if (government_has_hint(g, G_IS_NICE)) if (can_build_improvement(pcity, B_SUPERHIGHWAYS)) values[B_SUPERHIGHWAYS]=pcity->trade_prod*60; if (can_build_improvement(pcity, B_COURTHOUSE)) { Index: server/ruleset.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/ruleset.c,v retrieving revision 1.21 diff -u -w -r1.21 server//ruleset.c --- cvs/server/ruleset.c 1999/08/28 06:24:28 1.21 +++ local/server/ruleset.c 1999/08/29 17:27:40 @@ -927,6 +927,9 @@ for(j=0; jname, sval); exit(1); @@ -937,6 +940,27 @@ free(slist); } + /* hints: */ + for(i=0; ihints = 0; + slist = secfile_lookup_str_vec(&file, &nval, "%s.hints", sec[i]); + for(j=0; jname, sval); + exit(1); + } else { + g->hints |= (1<extra_corruption_distance; gov.flags = g->flags; + gov.hints = g->hints; gov.num_ruler_titles = g->num_ruler_titles; strcpy(gov.name, g->name);