Author: cazfi Date: Wed Aug 10 22:31:19 2016 New Revision: 33548 URL: http://svn.gna.org/viewcvs/freeciv?rev=33548&view=rev Log: Added effect type Output_Waste_By_Rel_Distance
In response to request by Jacob Nevins <jtn> See patch #7566 Modified: trunk/ai/default/daieffects.c trunk/common/city.c trunk/common/effects.h trunk/doc/README.effects Modified: trunk/ai/default/daieffects.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/daieffects.c?rev=33548&r1=33547&r2=33548&view=diff ============================================================================== --- trunk/ai/default/daieffects.c (original) +++ trunk/ai/default/daieffects.c Wed Aug 10 22:31:19 2016 @@ -181,6 +181,7 @@ case EFT_OUTPUT_PER_TILE: case EFT_OUTPUT_WASTE: case EFT_OUTPUT_WASTE_BY_DISTANCE: + case EFT_OUTPUT_WASTE_BY_REL_DISTANCE: case EFT_OUTPUT_WASTE_PCT: case EFT_SPECIALIST_OUTPUT: case EFT_ENEMY_CITIZEN_UNHAPPY_PCT: Modified: trunk/common/city.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/city.c?rev=33548&r1=33547&r2=33548&view=diff ============================================================================== --- trunk/common/city.c (original) +++ trunk/common/city.c Wed Aug 10 22:31:19 2016 @@ -3048,6 +3048,8 @@ if (total_eft > 0) { int waste_by_dist = get_city_output_bonus(pcity, get_output_type(otype), EFT_OUTPUT_WASTE_BY_DISTANCE); + int waste_by_rel_dist = get_city_output_bonus(pcity, get_output_type(otype), + EFT_OUTPUT_WASTE_BY_REL_DISTANCE); if (waste_by_dist > 0) { const struct city *gov_center = NULL; int min_dist = FC_INFINITY; @@ -3075,6 +3077,9 @@ waste_all = TRUE; /* no gov center - no income */ } else { waste_level += waste_by_dist * min_dist; + if (waste_by_rel_dist > 0) { + waste_level += waste_by_rel_dist * min_dist / MAX(wld.map.xsize, wld.map.ysize); + } } } } Modified: trunk/common/effects.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/effects.h?rev=33548&r1=33547&r2=33548&view=diff ============================================================================== --- trunk/common/effects.h (original) +++ trunk/common/effects.h Wed Aug 10 22:31:19 2016 @@ -285,6 +285,8 @@ #define SPECENUM_VALUE111NAME "Border_Vision" #define SPECENUM_VALUE112 EFT_STEALINGS_IGNORE #define SPECENUM_VALUE112NAME "Stealings_Ignore" +#define SPECENUM_VALUE113 EFT_OUTPUT_WASTE_BY_REL_DISTANCE +#define SPECENUM_VALUE113NAME "Output_Waste_By_Rel_Distance" /* keep this last */ #define SPECENUM_COUNT EFT_COUNT #include "specenum_gen.h" Modified: trunk/doc/README.effects URL: http://svn.gna.org/viewcvs/freeciv/trunk/doc/README.effects?rev=33548&r1=33547&r2=33548&view=diff ============================================================================== --- trunk/doc/README.effects (original) +++ trunk/doc/README.effects Wed Aug 10 22:31:19 2016 @@ -452,6 +452,10 @@ For each tile in real distance that a city is from nearest Government Center, it gets amount of extra waste. +Output_Waste_By_Rel_Distance + City gets extra waste based on distance to nearest Government Center, relative + to world size. The amount of this extra waste is (distance * amount / max_distance) + Output_Penalty_Tile When a tile yields more output than amount, it gets a penalty of -1. _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits