Author: sveinung Date: Tue Aug 16 19:54:18 2016 New Revision: 33626 URL: http://svn.gna.org/viewcvs/freeciv?rev=33626&view=rev Log: Split the Spy_Resisant effect.
Move the protection against building sabotage to the new Building_Saboteur_Resistant effect. Assumes that the DiplomatDefense base flag will start working inside cities in 2.6. If bug #24956 isn't fixed the ruleset upgrade code must change. Requested by Marko Lindqvist <cazfi> See bug #24956 Modified: trunk/ai/default/daieffects.c trunk/common/effects.h trunk/data/alien/effects.ruleset trunk/data/alien/nation_effects.ruleset trunk/data/civ1/effects.ruleset trunk/data/civ2/effects.ruleset trunk/data/civ2civ3/effects.ruleset trunk/data/classic/effects.ruleset trunk/data/experimental/effects.ruleset trunk/data/multiplayer/effects.ruleset trunk/data/sandbox/effects.ruleset trunk/data/webperimental/effects.ruleset trunk/doc/README.effects trunk/fc_version trunk/server/diplomats.c trunk/server/rscompat.c Modified: trunk/ai/default/daieffects.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/daieffects.c?rev=33626&r1=33625&r2=33626&view=diff ============================================================================== --- trunk/ai/default/daieffects.c (original) +++ trunk/ai/default/daieffects.c Tue Aug 16 19:54:18 2016 @@ -395,6 +395,7 @@ } break; case EFT_SPY_RESISTANT: + case EFT_SABOTEUR_RESISTANT: /* Uhm, problem: City Wall has -50% here!! */ break; case EFT_MOVE_BONUS: Modified: trunk/common/effects.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/effects.h?rev=33626&r1=33625&r2=33626&view=diff ============================================================================== --- trunk/common/effects.h (original) +++ trunk/common/effects.h Tue Aug 16 19:54:18 2016 @@ -287,6 +287,8 @@ #define SPECENUM_VALUE112NAME "Stealings_Ignore" #define SPECENUM_VALUE113 EFT_OUTPUT_WASTE_BY_REL_DISTANCE #define SPECENUM_VALUE113NAME "Output_Waste_By_Rel_Distance" +#define SPECENUM_VALUE114 EFT_SABOTEUR_RESISTANT +#define SPECENUM_VALUE114NAME "Building_Saboteur_Resistant" /* keep this last */ #define SPECENUM_COUNT EFT_COUNT #include "specenum_gen.h" Modified: trunk/data/alien/effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/alien/effects.ruleset?rev=33626&r1=33625&r2=33626&view=diff ============================================================================== --- trunk/data/alien/effects.ruleset (original) +++ trunk/data/alien/effects.ruleset Tue Aug 16 19:54:18 2016 @@ -981,6 +981,14 @@ "Tech", "Personal Contact", "Player" } +[effect_personal_contact_sabotage] +type = "Building_Saboteur_Resistant" +value = 40 +reqs = + { "type", "name", "range" + "Tech", "Personal Contact", "Player" + } + [effect_square_map_city_radius] type = "City_Radius_Sq" value = 1 Modified: trunk/data/alien/nation_effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/alien/nation_effects.ruleset?rev=33626&r1=33625&r2=33626&view=diff ============================================================================== --- trunk/data/alien/nation_effects.ruleset (original) +++ trunk/data/alien/nation_effects.ruleset Tue Aug 16 19:54:18 2016 @@ -62,6 +62,14 @@ "Nation", "Secret Society", "Player" } +[effect_secret_society_spy_resistance_sabotage] +type = "Building_Saboteur_Resistant" +value = 50 +reqs = + { "type", "name", "range" + "Nation", "Secret Society", "Player" + } + [effect_secret_society_veteran_spies] type = "Veteran_Build" value = 1 Modified: trunk/data/civ1/effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/civ1/effects.ruleset?rev=33626&r1=33625&r2=33626&view=diff ============================================================================== --- trunk/data/civ1/effects.ruleset (original) +++ trunk/data/civ1/effects.ruleset Tue Aug 16 19:54:18 2016 @@ -844,6 +844,14 @@ "Building", "Palace", "City" } +[effect_palace_2_sabotage] +type = "Building_Saboteur_Resistant" +value = 50 +reqs = + { "type", "name", "range" + "Building", "Palace", "City" + } + [effect_palace_3] type = "Capital_City" value = 1 Modified: trunk/data/civ2/effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2/effects.ruleset?rev=33626&r1=33625&r2=33626&view=diff ============================================================================== --- trunk/data/civ2/effects.ruleset (original) +++ trunk/data/civ2/effects.ruleset Tue Aug 16 19:54:18 2016 @@ -1409,6 +1409,14 @@ "Building", "Palace", "City" } +[effect_palace_2_sabotage] +type = "Building_Saboteur_Resistant" +value = 50 +reqs = + { "type", "name", "range" + "Building", "Palace", "City" + } + [effect_palace_3] type = "Capital_City" value = 1 Modified: trunk/data/civ2civ3/effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2civ3/effects.ruleset?rev=33626&r1=33625&r2=33626&view=diff ============================================================================== --- trunk/data/civ2civ3/effects.ruleset (original) +++ trunk/data/civ2civ3/effects.ruleset Tue Aug 16 19:54:18 2016 @@ -2434,6 +2434,14 @@ "Building", "Palace", "City" } +[effect_palace_2_sabotage] +type = "Building_Saboteur_Resistant" +value = 50 +reqs = + { "type", "name", "range" + "Building", "Palace", "City" + } + [effect_palace_3] type = "Capital_City" value = 1 @@ -2500,6 +2508,15 @@ [effect_ecclesiastical_palace_2] type = "Spy_Resistant" +value = 50 +reqs = + { "type", "name", "range", "present" + "Building", "Ecclesiastical Palace", "City", TRUE + "Building", "Palace", "City", FALSE + } + +[effect_ecclesiastical_palace_2_sabotage] +type = "Building_Saboteur_Resistant" value = 50 reqs = { "type", "name", "range", "present" Modified: trunk/data/classic/effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/classic/effects.ruleset?rev=33626&r1=33625&r2=33626&view=diff ============================================================================== --- trunk/data/classic/effects.ruleset (original) +++ trunk/data/classic/effects.ruleset Tue Aug 16 19:54:18 2016 @@ -1284,6 +1284,14 @@ "Building", "Palace", "City" } +[effect_palace_2_sabotage] +type = "Building_Saboteur_Resistant" +value = 50 +reqs = + { "type", "name", "range" + "Building", "Palace", "City" + } + [effect_palace_3] type = "Capital_City" value = 1 Modified: trunk/data/experimental/effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/experimental/effects.ruleset?rev=33626&r1=33625&r2=33626&view=diff ============================================================================== --- trunk/data/experimental/effects.ruleset (original) +++ trunk/data/experimental/effects.ruleset Tue Aug 16 19:54:18 2016 @@ -1496,6 +1496,14 @@ "Building", "Palace", "City" } +[effect_palace_2_sabotage] +type = "Building_Saboteur_Resistant" +value = 50 +reqs = + { "type", "name", "range" + "Building", "Palace", "City" + } + [effect_palace_3] type = "Capital_City" value = 1 Modified: trunk/data/multiplayer/effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/multiplayer/effects.ruleset?rev=33626&r1=33625&r2=33626&view=diff ============================================================================== --- trunk/data/multiplayer/effects.ruleset (original) +++ trunk/data/multiplayer/effects.ruleset Tue Aug 16 19:54:18 2016 @@ -1291,6 +1291,14 @@ "Building", "Palace", "City" } +[effect_palace_2_sabotage] +type = "Building_Saboteur_Resistant" +value = 50 +reqs = + { "type", "name", "range" + "Building", "Palace", "City" + } + [effect_palace_3] type = "Capital_City" value = 1 Modified: trunk/data/sandbox/effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/sandbox/effects.ruleset?rev=33626&r1=33625&r2=33626&view=diff ============================================================================== --- trunk/data/sandbox/effects.ruleset (original) +++ trunk/data/sandbox/effects.ruleset Tue Aug 16 19:54:18 2016 @@ -2418,6 +2418,14 @@ "Building", "Palace", "City" } +[effect_palace_2_sabotage] +type = "Building_Saboteur_Resistant" +value = 50 +reqs = + { "type", "name", "range" + "Building", "Palace", "City" + } + [effect_palace_3] type = "Capital_City" value = 1 Modified: trunk/data/webperimental/effects.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/webperimental/effects.ruleset?rev=33626&r1=33625&r2=33626&view=diff ============================================================================== --- trunk/data/webperimental/effects.ruleset (original) +++ trunk/data/webperimental/effects.ruleset Tue Aug 16 19:54:18 2016 @@ -1292,6 +1292,14 @@ "Building", "Palace", "City" } +[effect_palace_2_sabotage] +type = "Building_Saboteur_Resistant" +value = 50 +reqs = + { "type", "name", "range" + "Building", "Palace", "City" + } + [effect_palace_3] type = "Capital_City" value = 1 Modified: trunk/doc/README.effects URL: http://svn.gna.org/viewcvs/freeciv/trunk/doc/README.effects?rev=33626&r1=33625&r2=33626&view=diff ============================================================================== --- trunk/doc/README.effects (original) +++ trunk/doc/README.effects Tue Aug 16 19:54:18 2016 @@ -283,10 +283,12 @@ effects. Spy_Resistant - If a spy specifies a target for sabotage, then she has an AMOUNT percent -chance to fail. Also in diplomatic combat defending diplomatic units in cities -will get an AMOUNT percent bonus. All Spy_Resistant's are summed before being -applied. + In diplomatic combat defending diplomatic units will get an AMOUNT +percent bonus. All Spy_Resistant's are summed before being applied. + +Building_Saboteur_Resistant + If a spy specifies a target for sabotage, then she has an AMOUNT +percent chance to fail. Stealings_Ignore When determining how difficult it is to steal a tech from enemy, AMOUNT Modified: trunk/fc_version URL: http://svn.gna.org/viewcvs/freeciv/trunk/fc_version?rev=33626&r1=33625&r2=33626&view=diff ============================================================================== --- trunk/fc_version (original) +++ trunk/fc_version Tue Aug 16 19:54:18 2016 @@ -56,7 +56,7 @@ # - Avoid adding a new mandatory capability to the development branch for # as long as possible. We want to maintain network compatibility with # the stable branch for as long as possible. -NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.0-2016.Aug.16" +NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.0-2016.Aug.16b" NETWORK_CAPSTRING_OPTIONAL="" FREECIV_DISTRIBUTOR="" Modified: trunk/server/diplomats.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/diplomats.c?rev=33626&r1=33625&r2=33626&view=diff ============================================================================== --- trunk/server/diplomats.c (original) +++ trunk/server/diplomats.c Tue Aug 16 19:54:18 2016 @@ -1119,7 +1119,8 @@ * City Walls, then there is a 50% chance of getting caught. */ vulnerability -= (vulnerability - * get_city_bonus(pcity, EFT_SPY_RESISTANT) / 100); + * get_city_bonus(pcity, EFT_SABOTEUR_RESISTANT) + / 100); if (fc_rand(100) >= vulnerability) { /* Caught! */ Modified: trunk/server/rscompat.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/rscompat.c?rev=33626&r1=33625&r2=33626&view=diff ============================================================================== --- trunk/server/rscompat.c (original) +++ trunk/server/rscompat.c Tue Aug 16 19:54:18 2016 @@ -318,6 +318,14 @@ contacts->type = EFT_HAVE_CONTACTS; } + if (peffect->type == EFT_SPY_RESISTANT) { + /* Create "Building_Saboteur_Resistant" effect matching each + * "Spy_Resistant" */ + struct effect *contacts = effect_copy(peffect); + + contacts->type = EFT_SABOTEUR_RESISTANT; + } + if (peffect->type == EFT_ILLEGAL_ACTION_MOVE_COST) { /* Founding and joining a city became action enabler controlled in * Freeciv 3.0. Old hard coded rules had no punishment for trying to _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits