Author: cazfi Date: Thu Jun 30 18:05:47 2016 New Revision: 33127 URL: http://svn.gna.org/viewcvs/freeciv?rev=33127&view=rev Log: Added new production change penalty handicap for novice and handicapped AI levels.
See patch #7342 Modified: trunk/ai/default/aicity.c trunk/ai/difficulty.c trunk/ai/handicaps.h trunk/server/citytools.c Modified: trunk/ai/default/aicity.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/aicity.c?rev=33127&r1=33126&r2=33127&view=diff ============================================================================== --- trunk/ai/default/aicity.c (original) +++ trunk/ai/default/aicity.c Thu Jun 30 18:05:47 2016 @@ -1715,7 +1715,11 @@ || (!is_wonder(pcity->production.value.building) && is_wonder(pimprove))) && pcity->turn_last_built != game.info.turn) { - v -= pcity->shield_stock * SHIELD_WEIGHTING / 10; + if (has_handicap(pplayer, H_PRODCHGPEN)) { + v -= pcity->shield_stock * SHIELD_WEIGHTING / 4; + } else { + v -= pcity->shield_stock * SHIELD_WEIGHTING / 15; + } } /* Reduce want if building gets obsoleted soon */ Modified: trunk/ai/difficulty.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/difficulty.c?rev=33127&r1=33126&r2=33127&view=diff ============================================================================== --- trunk/ai/difficulty.c (original) +++ trunk/ai/difficulty.c Thu Jun 30 18:05:47 2016 @@ -64,6 +64,7 @@ BV_SET(handicap, H_TARGETS); BV_SET(handicap, H_HUTS); BV_SET(handicap, H_REVOLUTION); + BV_SET(handicap, H_PRODCHGPEN); break; case AI_LEVEL_NOVICE: case AI_LEVEL_HANDICAPPED: @@ -80,6 +81,7 @@ BV_SET(handicap, H_DANGER); BV_SET(handicap, H_CEASEFIRE); BV_SET(handicap, H_NOBRIBE_WF); + BV_SET(handicap, H_PRODCHGPEN); break; case AI_LEVEL_EASY: BV_SET(handicap, H_RATES); @@ -104,11 +106,11 @@ BV_SET(handicap, H_NOBRIBE_WF); break; -#ifdef DEBUG +#ifdef FREECIV_DEBUG case AI_LEVEL_EXPERIMENTAL: BV_SET(handicap, H_EXPERIMENTAL); break; -#endif /* DEBUG */ +#endif /* FREECIV_DEBUG */ case AI_LEVEL_CHEATING: BV_SET(handicap, H_RATES); Modified: trunk/ai/handicaps.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/handicaps.h?rev=33127&r1=33126&r2=33127&view=diff ============================================================================== --- trunk/ai/handicaps.h (original) +++ trunk/ai/handicaps.h Thu Jun 30 18:05:47 2016 @@ -31,6 +31,7 @@ H_DANGER, /* Always thinks its city is in danger */ H_CEASEFIRE, /* Has to offer cease-fire on first contact */ H_NOBRIBE_WF, /* Can't bribe worker and city founder units. */ + H_PRODCHGPEN, /* Pays production change penalty. */ H_LAST }; Modified: trunk/server/citytools.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/citytools.c?rev=33127&r1=33126&r2=33127&view=diff ============================================================================== --- trunk/server/citytools.c (original) +++ trunk/server/citytools.c Thu Jun 30 18:05:47 2016 @@ -2891,7 +2891,7 @@ /* Manage the city change-production penalty. (May penalize, restore or do nothing to the shield_stock.) */ - if (!is_ai(pplayer) || has_handicap(pplayer, H_AWAY)) { + if (!is_ai(pplayer) || has_handicap(pplayer, H_PRODCHGPEN)) { pcity->shield_stock = city_change_production_penalty(pcity, target); } _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits