diff -ru -X /home/jjm/cvs/no.freeciv FreecivCVS/client/packhand.c freeciv/client/packhand.c --- FreecivCVS/client/packhand.c Sun Jul 30 01:01:04 2000 +++ freeciv/client/packhand.c Mon Aug 7 15:33:57 2000 @@ -1455,6 +1455,9 @@ my_snprintf(ptr, sizeof(buf)-(ptr-buf), " amount=%d", b->effect[inx].amount); ptr = strchr(ptr, '\0'); + my_snprintf(ptr, sizeof(buf)-(ptr-buf), " survives=%d", + b->effect[inx].survives); + ptr = strchr(ptr, '\0'); freelog(LOG_DEBUG, " %2d. %s", inx, buf); ptr = buf; my_snprintf(ptr, sizeof(buf)-(ptr-buf), " cond_bldg=%d/%s", diff -ru -X /home/jjm/cvs/no.freeciv FreecivCVS/common/capstr.c freeciv/common/capstr.c --- FreecivCVS/common/capstr.c Sat Jul 29 14:38:27 2000 +++ freeciv/common/capstr.c Mon Aug 7 15:27:30 2000 @@ -72,7 +72,7 @@ #define CAPABILITY "+1.11 diplomat_investigate_fix production_change_fix" \ " game_ruleset nuclear_fallout land_channel_requirement event_wonder_obsolete" \ -" event00_fix" +" event00_fix gen_impr_oversights" /* "+1.11" is protocol for 1.11.0 stable release. @@ -100,6 +100,9 @@ "event00_fix" is that client understands that negative positions for events means no position. Previous clients expect (0,0), which is also a genuine position. + + "gen_impr_oversights" extends the protocol to include information + which addresses a few oversights in the original design. */ void init_our_capability(void) diff -ru -X /home/jjm/cvs/no.freeciv FreecivCVS/common/city.c freeciv/common/city.c --- FreecivCVS/common/city.c Sun Jul 30 09:16:57 2000 +++ freeciv/common/city.c Mon Aug 7 15:13:15 2000 @@ -117,7 +117,9 @@ "Pollu_Adj", "Pollu_Adj_Pop", "Pollu_Adj_Prod", - "Pollu_Decrease", + "Pollu_Set", + "Pollu_Set_Pop", + "Pollu_Set_Prod", "Prod_Add_Tile", "Prod_Bonus", "Prod_Inc_Tile", diff -ru -X /home/jjm/cvs/no.freeciv FreecivCVS/common/city.h freeciv/common/city.h --- FreecivCVS/common/city.h Sun Jul 30 09:16:57 2000 +++ freeciv/common/city.h Mon Aug 7 15:19:39 2000 @@ -98,7 +98,9 @@ EFT_POLLU_ADJ, EFT_POLLU_ADJ_POP, EFT_POLLU_ADJ_PROD, - EFT_POLLU_DECREASE, + EFT_POLLU_SET, + EFT_POLLU_SET_POP, + EFT_POLLU_SET_PROD, EFT_PROD_ADD_TILE, EFT_PROD_BONUS, EFT_PROD_INC_TILE, @@ -147,6 +149,7 @@ Eff_Type_id type; Eff_Range_id range; int amount; + int survives; /* 1 = effect survives wonder destruction */ Impr_Type_id cond_bldg; /* B_LAST = unconditional */ int cond_gov; /* game.government_count = unconditional */ Tech_Type_id cond_adv; /* A_NONE = unconditional; A_LAST = never */ diff -ru -X /home/jjm/cvs/no.freeciv FreecivCVS/common/packets.c freeciv/common/packets.c --- FreecivCVS/common/packets.c Mon Aug 7 09:03:04 2000 +++ freeciv/common/packets.c Mon Aug 7 15:37:22 2000 @@ -2853,6 +2853,9 @@ cptr=put_uint8(cptr, eff->type); cptr=put_uint8(cptr, eff->range); cptr=put_sint16(cptr, eff->amount); +if (pc && has_capability("gen_impr_oversights", pc->capability)) { + cptr=put_uint8(cptr, eff->survives); +} cptr=put_uint8(cptr, eff->cond_bldg); cptr=put_uint8(cptr, eff->cond_gov); cptr=put_uint8(cptr, eff->cond_adv); @@ -2905,6 +2908,13 @@ iget_uint8(&iter, (int *)&(packet->effect[inx].type)); iget_uint8(&iter, (int *)&(packet->effect[inx].range)); iget_sint16(&iter, &(packet->effect[inx].amount)); +if (pc && has_capability("gen_impr_oversights", pc->capability)) { + iget_uint8(&iter, &(packet->effect[inx].survives)); +} else { +packet->effect[inx].survives = + ((packet->effect[inx].type == EFT_ENABLE_NUKE) || + (packet->effect[inx].type == EFT_ENABLE_SPACE)); +} iget_uint8(&iter, &(packet->effect[inx].cond_bldg)); iget_uint8(&iter, &(packet->effect[inx].cond_gov)); iget_uint8(&iter, &(packet->effect[inx].cond_adv)); diff -ru -X /home/jjm/cvs/no.freeciv FreecivCVS/data/civ1/buildings.ruleset freeciv/data/civ1/buildings.ruleset --- FreecivCVS/data/civ1/buildings.ruleset Wed Jun 28 09:00:17 2000 +++ freeciv/data/civ1/buildings.ruleset Mon Aug 7 15:17:28 2000 @@ -500,7 +500,7 @@ sabotage = 100 effect = { "type", "range", "amount" - "Pollu_Adj_Pop", "City", 0 + "Pollu_Set_Pop", "City", 0 } helptext = _("\ Neutralizes the pollution generated by the population. \ @@ -838,7 +838,7 @@ effect = { "type", "range", "amount", "cond_bldg" "Prod_Bonus", "City", 50, "Factory" - "Pollu_Adj_Prod", "City", 0 + "Pollu_Set_Prod", "City", 0 "Slow_Global_Warm", "World", 10 } helptext = _("\ @@ -1080,9 +1080,9 @@ upkeep = 0 sabotage = 0 effect = - { "type", "range" - "Reveal_Cities", "None" - "Enable_Space", "World" + { "type", "range", "survives" + "Reveal_Cities", "None", 0 + "Enable_Space", "World", 1 } helptext = _("\ All cities on the map become visible for the player who owns it. \ @@ -1497,8 +1497,8 @@ upkeep = 0 sabotage = 0 effect = - { "type", "range" - "Enable_Nuke", "World" + { "type", "range", "survives" + "Enable_Nuke", "World", 1 } helptext = _("\ Allows all players with knowledge of Rocketry to build Nuclear units.\ diff -ru -X /home/jjm/cvs/no.freeciv FreecivCVS/data/civ2/buildings.ruleset freeciv/data/civ2/buildings.ruleset --- FreecivCVS/data/civ2/buildings.ruleset Wed Jun 28 09:00:18 2000 +++ freeciv/data/civ2/buildings.ruleset Mon Aug 7 15:18:06 2000 @@ -483,7 +483,7 @@ sabotage = 100 effect = { "type", "range", "amount" - "Pollu_Adj_Pop", "City", 0 + "Pollu_Set_Pop", "City", 0 } helptext = _("\ Neutralizes the pollution generated by the population. \ @@ -823,7 +823,7 @@ effect = { "type", "range", "amount", "cond_bldg" "Prod_Bonus", "City", 50, "Factory" - "Pollu_Adj_Prod", "City", 0 + "Pollu_Set_Prod", "City", 0 "Slow_Global_Warm", "World", 10 } helptext = _("\ @@ -1065,9 +1065,9 @@ upkeep = 0 sabotage = 0 effect = - { "type", "range" - "Reveal_Map", "None" - "Enable_Space", "World" + { "type", "range", "survives" + "Reveal_Map", "None", 0 + "Enable_Space", "World", 1 } helptext = _("\ Entire map becomes visible for the player who owns it. \ @@ -1473,8 +1473,8 @@ upkeep = 0 sabotage = 0 effect = - { "type", "range" - "Enable_Nuke", "World" + { "type", "range", "survives" + "Enable_Nuke", "World", 1 } helptext = _("\ Allows all players with knowledge of Rocketry to build Nuclear units.\ diff -ru -X /home/jjm/cvs/no.freeciv FreecivCVS/data/default/buildings.ruleset freeciv/data/default/buildings.ruleset --- FreecivCVS/data/default/buildings.ruleset Sun Jul 9 21:49:07 2000 +++ freeciv/data/default/buildings.ruleset Mon Aug 7 15:17:02 2000 @@ -103,7 +103,14 @@ ; "Pollu_Adj_Prod" - multiplies pollution caused by shield production by ; AMOUNT percent ; (all Pollu_Adj_Prod's are summed before being applied) -; "Pollu_Decrease" - reduces pollution by AMOUNT +; "Pollu_Set" - sets pollution to AMOUNT; override all other effects +; (all Pollu_Set's are summed before being applied) +; "Pollu_Set_Pop" - sets pollution caused by population to AMOUNT; +; override all other effects +; (all Pollu_Set_Pop's are summed before being applied) +; "Pollu_Set_Prod" - sets pollution caused by shield production to AMOUNT; +; override all other effects +; (all Pollu_Set_Prod's are summed before being applied) ; "Prod_Add_Tile" - each worked tile produces AMOUNT additional shield ; production ; "Prod_Bonus" - shield production is increased by AMOUNT percent @@ -176,6 +183,8 @@ ; "None", "Building", "City", "Island", "Player", "World" ; .amount = integral AMOUNT parameter for many effects ; (must be in the range -32767 to 32767) +; .survives = 1 if effect survives destruction (wonders only) +; (if unspecified, 0 (doesn't survive) is assumed) ; .cond_bldg = must have this building in same city for effect ; (if unspecified, effect not conditional on building) ; .cond_gov = must be in this government for effect @@ -664,7 +673,7 @@ sabotage = 100 effect = { "type", "range", "amount" - "Pollu_Adj_Pop", "City", 0 + "Pollu_Set_Pop", "City", 0 } helptext = _("\ Neutralizes the pollution generated by the population. \ @@ -1015,7 +1024,7 @@ { "type", "range", "amount", "cond_bldg" "Prod_Bonus", "City", 25, "Factory" "Prod_Bonus", "City", 25, "Mfg. Plant" - "Pollu_Adj_Prod", "City", 0 + "Pollu_Set_Prod", "City", 0 "Slow_Global_Warm", "World", 10 } helptext = _("\ @@ -1261,9 +1270,9 @@ upkeep = 0 sabotage = 0 effect = - { "type", "range" - "Reveal_Map", "None" - "Enable_Space", "World" + { "type", "range", "survives" + "Reveal_Map", "None", 0 + "Enable_Space", "World", 1 } helptext = _("\ Entire map becomes visible for the player who owns it. \ @@ -1672,8 +1681,8 @@ upkeep = 0 sabotage = 0 effect = - { "type", "range" - "Enable_Nuke", "World" + { "type", "range", "survives" + "Enable_Nuke", "World", 1 } helptext = _("\ Allows all players with knowledge of Rocketry to build Nuclear units.\ diff -ru -X /home/jjm/cvs/no.freeciv FreecivCVS/server/ruleset.c freeciv/server/ruleset.c --- FreecivCVS/server/ruleset.c Wed Aug 2 10:37:33 2000 +++ freeciv/server/ruleset.c Mon Aug 7 15:32:31 2000 @@ -996,6 +996,9 @@ e->amount = secfile_lookup_int_default(file, 0, "%s.effect%d.amount", sec[i], j); + e->survives = + secfile_lookup_int_default(file, 0, "%s.effect%d.survives", sec[i], j); + item = secfile_lookup_str_default(file, "", "%s.effect%d.cond_bldg", sec[i], j); if (*item) {