Author: cazfi Date: Thu Jan 22 19:55:51 2015 New Revision: 27774 URL: http://svn.gna.org/viewcvs/freeciv?rev=27774&view=rev Log: Replaced extra flag "Spreading" with new cause "Spontaneous" for extra appearance.
See patch #5730 Modified: trunk/client/helpdata.c trunk/common/extras.h trunk/common/fc_types.h trunk/data/alien/terrain.ruleset trunk/data/civ1/terrain.ruleset trunk/data/civ2/terrain.ruleset trunk/data/civ2civ3/terrain.ruleset trunk/data/classic/terrain.ruleset trunk/data/experimental/terrain.ruleset trunk/data/multiplayer/terrain.ruleset trunk/data/stub/terrain.ruleset trunk/fc_version trunk/server/srv_main.c Modified: trunk/client/helpdata.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/helpdata.c?rev=27774&r1=27773&r2=27774&view=diff ============================================================================== --- trunk/client/helpdata.c (original) +++ trunk/client/helpdata.c Thu Jan 22 19:55:51 2015 @@ -4265,7 +4265,7 @@ _("* Placed by mapgenerator.\n")); } - if (extra_has_flag(pextra, EF_SPREADS)) { + if (is_extra_caused_by(pextra, EC_SPONTANEOUS)) { CATLSTR(buf, bufsz, _(" * May spread to neighbor tiles.\n")); } Modified: trunk/common/extras.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/extras.h?rev=27774&r1=27773&r2=27774&view=diff ============================================================================== --- trunk/common/extras.h (original) +++ trunk/common/extras.h Thu Jan 22 19:55:51 2015 @@ -48,9 +48,6 @@ /* Counts towards Nuclear Winter */ #define SPECENUM_VALUE7 EF_NUCLEAR_WINTER #define SPECENUM_VALUE7NAME "NuclearWinter" -/* May spread to neighbor tiles. */ -#define SPECENUM_VALUE8 EF_SPREADS -#define SPECENUM_VALUE8NAME "Spreads" #define SPECENUM_COUNT EF_COUNT #define SPECENUM_BITVECTOR bv_extra_flags #include "specenum_gen.h" Modified: trunk/common/fc_types.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/fc_types.h?rev=27774&r1=27773&r2=27774&view=diff ============================================================================== --- trunk/common/fc_types.h (original) +++ trunk/common/fc_types.h Thu Jan 22 19:55:51 2015 @@ -571,6 +571,8 @@ #define SPECENUM_VALUE5NAME "Base" #define SPECENUM_VALUE6 EC_ROAD #define SPECENUM_VALUE6NAME "Road" +#define SPECENUM_VALUE7 EC_SPONTANEOUS +#define SPECENUM_VALUE7NAME "Spontaneous" #define SPECENUM_COUNT EC_COUNT #include "specenum_gen.h" #define EC_NONE EC_COUNT Modified: trunk/data/alien/terrain.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/alien/terrain.ruleset?rev=27774&r1=27773&r2=27774&view=diff ============================================================================== --- trunk/data/alien/terrain.ruleset (original) +++ trunk/data/alien/terrain.ruleset Thu Jan 22 19:55:51 2015 @@ -575,7 +575,7 @@ ; "Infra", "Natural", "Nuisance", or "Bonus" ; causes = events that can create extra type. ; "Irrigation", "Mine", "Hut", "Pollution", "Fallout", -; "Base", or "Road" +; "Base", "Road", or "Spontaneous" ; rmcauses = events that can remove extra type. ; "CleanPollution", "CleanFallout", or "Pillage" ; graphic = tag specifying preferred graphic @@ -630,7 +630,6 @@ ; Global Warming ; - "NuclearWinter" = Instances of this extra on map count towards ; Nuclear Winter -; - "Spreads" = This extra may spread to neighbor tiles. ; helptext = optional help text string; should escape all raw ; newlines so that xgettext parsing works ; Modified: trunk/data/civ1/terrain.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/civ1/terrain.ruleset?rev=27774&r1=27773&r2=27774&view=diff ============================================================================== --- trunk/data/civ1/terrain.ruleset (original) +++ trunk/data/civ1/terrain.ruleset Thu Jan 22 19:55:51 2015 @@ -732,7 +732,7 @@ ; "Infra", "Natural", "Nuisance", or "Bonus" ; causes = events that can create extra type. ; "Irrigation", "Mine", "Hut", "Pollution", "Fallout", -; "Base", or "Road" +; "Base", "Road", or "Spontaneous" ; rmcauses = events that can remove extra type. ; "CleanPollution", "CleanFallout", or "Pillage" ; graphic = tag specifying preferred graphic @@ -787,7 +787,6 @@ ; Global Warming ; - "NuclearWinter" = Instances of this extra on map count towards ; Nuclear Winter -; - "Spreads" = This extra may spread to neighbor tiles. ; helptext = optional help text string; should escape all raw ; newlines so that xgettext parsing works ; Modified: trunk/data/civ2/terrain.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2/terrain.ruleset?rev=27774&r1=27773&r2=27774&view=diff ============================================================================== --- trunk/data/civ2/terrain.ruleset (original) +++ trunk/data/civ2/terrain.ruleset Thu Jan 22 19:55:51 2015 @@ -838,7 +838,7 @@ ; "Infra", "Natural", "Nuisance", or "Bonus" ; causes = events that can create extra type. ; "Irrigation", "Mine", "Hut", "Pollution", "Fallout", -; "Base", or "Road" +; "Base", "Road", or "Spontaneous" ; rmcauses = events that can remove extra type. ; "CleanPollution", "CleanFallout", or "Pillage" ; graphic = tag specifying preferred graphic @@ -893,7 +893,6 @@ ; Global Warming ; - "NuclearWinter" = Instances of this extra on map count towards ; Nuclear Winter -; - "Spreads" = This extra may spread to neighbor tiles. ; helptext = optional help text string; should escape all raw ; newlines so that xgettext parsing works ; Modified: trunk/data/civ2civ3/terrain.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/civ2civ3/terrain.ruleset?rev=27774&r1=27773&r2=27774&view=diff ============================================================================== --- trunk/data/civ2civ3/terrain.ruleset (original) +++ trunk/data/civ2civ3/terrain.ruleset Thu Jan 22 19:55:51 2015 @@ -1017,7 +1017,7 @@ ; "Infra", "Natural", "Nuisance", or "Bonus" ; causes = events that can create extra type. ; "Irrigation", "Mine", "Hut", "Pollution", "Fallout", -; "Base", or "Road" +; "Base", "Road", or "Spontaneous" ; rmcauses = events that can remove extra type. ; "CleanPollution", "CleanFallout", or "Pillage" ; graphic = tag specifying preferred graphic @@ -1072,7 +1072,6 @@ ; Global Warming ; - "NuclearWinter" = Instances of this extra on map count towards ; Nuclear Winter -; - "Spreads" = This extra may spread to neighbor tiles. ; helptext = optional help text string; should escape all raw ; newlines so that xgettext parsing works ; Modified: trunk/data/classic/terrain.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/classic/terrain.ruleset?rev=27774&r1=27773&r2=27774&view=diff ============================================================================== --- trunk/data/classic/terrain.ruleset (original) +++ trunk/data/classic/terrain.ruleset Thu Jan 22 19:55:51 2015 @@ -1017,7 +1017,7 @@ ; "Infra", "Natural", "Nuisance", or "Bonus" ; causes = events that can create extra type. ; "Irrigation", "Mine", "Hut", "Pollution", "Fallout", -; "Base", or "Road" +; "Base", "Road", or "Spontaneous" ; rmcauses = events that can remove extra type. ; "CleanPollution", "CleanFallout", or "Pillage" ; graphic = tag specifying preferred graphic @@ -1072,7 +1072,6 @@ ; Global Warming ; - "NuclearWinter" = Instances of this extra on map count towards ; Nuclear Winter -; - "Spreads" = This extra may spread to neighbor tiles. ; helptext = optional help text string; should escape all raw ; newlines so that xgettext parsing works ; Modified: trunk/data/experimental/terrain.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/experimental/terrain.ruleset?rev=27774&r1=27773&r2=27774&view=diff ============================================================================== --- trunk/data/experimental/terrain.ruleset (original) +++ trunk/data/experimental/terrain.ruleset Thu Jan 22 19:55:51 2015 @@ -993,7 +993,7 @@ ; "Infra", "Natural", "Nuisance", or "Bonus" ; causes = events that can create extra type. ; "Irrigation", "Mine", "Hut", "Pollution", "Fallout", -; "Base", or "Road" +; "Base", "Road", or "Spontaneous" ; rmcauses = events that can remove extra type. ; "CleanPollution", "CleanFallout", or "Pillage" ; graphic = tag specifying preferred graphic @@ -1048,7 +1048,6 @@ ; Global Warming ; - "NuclearWinter" = Instances of this extra on map count towards ; Nuclear Winter -; - "Spreads" = This extra may spread to neighbor tiles. ; helptext = optional help text string; should escape all raw ; newlines so that xgettext parsing works ; Modified: trunk/data/multiplayer/terrain.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/multiplayer/terrain.ruleset?rev=27774&r1=27773&r2=27774&view=diff ============================================================================== --- trunk/data/multiplayer/terrain.ruleset (original) +++ trunk/data/multiplayer/terrain.ruleset Thu Jan 22 19:55:51 2015 @@ -991,7 +991,7 @@ ; "Infra", "Natural", "Nuisance", or "Bonus" ; causes = events that can create extra type. ; "Irrigation", "Mine", "Hut", "Pollution", "Fallout", -; "Base", or "Road" +; "Base", "Road", or "Spontaneous" ; rmcauses = events that can remove extra type. ; "CleanPollution", "CleanFallout", or "Pillage" ; graphic = tag specifying preferred graphic @@ -1046,7 +1046,6 @@ ; Global Warming ; - "NuclearWinter" = Instances of this extra on map count towards ; Nuclear Winter -; - "Spreads" = This extra may spread to neighbor tiles. ; helptext = optional help text string; should escape all raw ; newlines so that xgettext parsing works ; Modified: trunk/data/stub/terrain.ruleset URL: http://svn.gna.org/viewcvs/freeciv/trunk/data/stub/terrain.ruleset?rev=27774&r1=27773&r2=27774&view=diff ============================================================================== --- trunk/data/stub/terrain.ruleset (original) +++ trunk/data/stub/terrain.ruleset Thu Jan 22 19:55:51 2015 @@ -288,7 +288,7 @@ ; "Infra", "Natural", "Nuisance", or "Bonus" ; causes = events that can create extra type. ; "Irrigation", "Mine", "Hut", "Pollution", "Fallout", -; "Base", or "Road" +; "Base", "Road", or "Spontaneous" ; rmcauses = events that can remove extra type. ; "CleanPollution", "CleanFallout", or "Pillage" ; graphic = tag specifying preferred graphic @@ -343,7 +343,6 @@ ; Global Warming ; - "NuclearWinter" = Instances of this extra on map count towards ; Nuclear Winter -; - "Spreads" = This extra may spread to neighbor tiles. ; helptext = optional help text string; should escape all raw ; newlines so that xgettext parsing works ; Modified: trunk/fc_version URL: http://svn.gna.org/viewcvs/freeciv/trunk/fc_version?rev=27774&r1=27773&r2=27774&view=diff ============================================================================== --- trunk/fc_version (original) +++ trunk/fc_version Thu Jan 22 19:55:51 2015 @@ -54,7 +54,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-2015.Jan.16" +NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.0-2015.Jan.22" NETWORK_CAPSTRING_OPTIONAL="" FREECIV_DISTRIBUTOR="" Modified: trunk/server/srv_main.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/srv_main.c?rev=27774&r1=27773&r2=27774&view=diff ============================================================================== --- trunk/server/srv_main.c (original) +++ trunk/server/srv_main.c Thu Jan 22 19:55:51 2015 @@ -1260,62 +1260,60 @@ &game.info.coolinglevel, nuclear_winter); } - extra_type_iterate(pextra) { - if (extra_has_flag(pextra, EF_SPREADS)) { - whole_map_iterate(src_tile) { - if (tile_has_extra(src_tile, pextra) - /* Each spreading extra has a 1,5% chance of spreading each - * turn. This extra spreading speed makes it relatively rare - * but not unheard of. */ - /* TODO: Put probability that an extra will spread in an - * effect ("Extra_Spread_Pm") on the source tile. - * With a cache of what extra types that has any chance of - * spreading at all it could replace the EF_SPREADS extra flag - * without killing performance. */ - && fc_rand(1000) < 15) { - struct tile *tgt_tile; - - /* Select tile to spread to. */ - tgt_tile = mapstep(src_tile, rand_direction()); - - if (!tgt_tile) { - /* Non existing target tile. */ - continue; - } - - if (tile_has_extra(tgt_tile, pextra) - || !is_native_tile_to_extra(pextra, tgt_tile) - /* TODO: Make it ruleset configurable if an extra should - * spread to a tile and replace any conflicting extras or if - * it shouldn't spread to a tile with a conflicting extra. */ - || extra_conflicting_on_tile(pextra, tgt_tile)) { - /* Can't spread to target tile. */ - continue; - } - - tile_add_extra(tgt_tile, pextra); - - update_tile_knowledge(tgt_tile); - - if (tile_owner(tgt_tile) != NULL) { - notify_player(tile_owner(tgt_tile), tgt_tile, - E_EXTRA_SPREAD, ftc_server, - /* TRANS: Small Fish spreads to (32, 72). */ - _("%s spreads to %s."), - extra_name_translation(pextra), - tile_link(tgt_tile)); - } - - /* Unit activities at the target tile and its neighbors may now - * be illegal because of !present reqs. */ - unit_activities_cancel_all_illegal(tgt_tile); - adjc_iterate(tgt_tile, n_tile) { - unit_activities_cancel_all_illegal(n_tile); - } adjc_iterate_end; + extra_type_by_cause_iterate(EC_SPONTANEOUS, pextra) { + whole_map_iterate(src_tile) { + if (tile_has_extra(src_tile, pextra) + /* Each spreading extra has a 1,5% chance of spreading each + * turn. This extra spreading speed makes it relatively rare + * but not unheard of. */ + /* TODO: Put probability that an extra will spread in an + * effect ("Extra_Spread_Pm") on the source tile. + * With a cache of what extra types that has any chance of + * spreading at all it could replace the EF_SPREADS extra flag + * without killing performance. */ + && fc_rand(1000) < 15) { + struct tile *tgt_tile; + + /* Select tile to spread to. */ + tgt_tile = mapstep(src_tile, rand_direction()); + + if (!tgt_tile) { + /* Non existing target tile. */ + continue; } - } whole_map_iterate_end; - } - } extra_type_iterate_end; + + if (tile_has_extra(tgt_tile, pextra) + || !is_native_tile_to_extra(pextra, tgt_tile) + /* TODO: Make it ruleset configurable if an extra should + * spread to a tile and replace any conflicting extras or if + * it shouldn't spread to a tile with a conflicting extra. */ + || extra_conflicting_on_tile(pextra, tgt_tile)) { + /* Can't spread to target tile. */ + continue; + } + + tile_add_extra(tgt_tile, pextra); + + update_tile_knowledge(tgt_tile); + + if (tile_owner(tgt_tile) != NULL) { + notify_player(tile_owner(tgt_tile), tgt_tile, + E_EXTRA_SPREAD, ftc_server, + /* TRANS: Small Fish spreads to (32, 72). */ + _("%s spreads to %s."), + extra_name_translation(pextra), + tile_link(tgt_tile)); + } + + /* Unit activities at the target tile and its neighbors may now + * be illegal because of !present reqs. */ + unit_activities_cancel_all_illegal(tgt_tile); + adjc_iterate(tgt_tile, n_tile) { + unit_activities_cancel_all_illegal(n_tile); + } adjc_iterate_end; + } + } whole_map_iterate_end; + } extra_type_by_cause_iterate_end; update_diplomatics(); make_history_report(); _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits