Author: cazfi Date: Tue Nov 1 10:24:15 2016 New Revision: 34309 URL: http://svn.gna.org/viewcvs/freeciv?rev=34309&view=rev Log: Added Attack_Bonus effect type.
See patch #7894 Modified: trunk/ai/default/daieffects.c trunk/common/combat.c trunk/common/effects.h trunk/doc/README.effects trunk/fc_version Modified: trunk/ai/default/daieffects.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/daieffects.c?rev=34309&r1=34308&r2=34309&view=diff ============================================================================== --- trunk/ai/default/daieffects.c (original) +++ trunk/ai/default/daieffects.c Tue Nov 1 10:24:15 2016 @@ -433,6 +433,10 @@ case EFT_UNIT_BRIBE_COST_PCT: num = num_affected_units(peffect, ai); v += ((2 * c + num) * amount) / 400; + break; + case EFT_ATTACK_BONUS: + num = num_affected_units(peffect, ai); + v += (num + 4) * amount / 200; break; case EFT_DEFEND_BONUS: if (has_handicap(pplayer, H_DEFENSIVE)) { Modified: trunk/common/combat.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/combat.c?rev=34309&r1=34308&r2=34309&view=diff ============================================================================== --- trunk/common/combat.c (original) +++ trunk/common/combat.c Tue Nov 1 10:24:15 2016 @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -413,17 +413,17 @@ } /************************************************************************** - Convenience wrapper for base_get_attack_power. + Convenience wrapper for base_get_attack_power. **************************************************************************/ int get_attack_power(const struct unit *punit) { return base_get_attack_power(unit_type_get(punit), punit->veteran, - punit->moves_left); -} - -/************************************************************************** - Returns the attack power, modified by moves left, and veteran - status. + punit->moves_left); +} + +/************************************************************************** + Returns the attack power, modified by moves left, and veteran + status. **************************************************************************/ int base_get_attack_power(const struct unit_type *punittype, int veteran, int moves_left) @@ -486,15 +486,18 @@ } /*************************************************************************** - return the modified attack power of a unit. Currently they aren't any - modifications... + Return the modified attack power of a unit. ***************************************************************************/ int get_total_attack_power(const struct unit *attacker, - const struct unit *defender) -{ + const struct unit *defender) +{ + int mod; int attackpower = get_attack_power(attacker); - return attackpower; + mod = 100 + get_unittype_bonus(unit_owner(attacker), unit_tile(defender), + unit_type_get(attacker), EFT_ATTACK_BONUS); + + return attackpower * mod / 100; } /************************************************************************** @@ -508,10 +511,10 @@ effects. **************************************************************************/ static int defense_multiplication(const struct unit_type *att_type, - const struct unit_type *def_type, - const struct player *def_player, - const struct tile *ptile, - int defensepower, bool fortified) + const struct unit_type *def_type, + const struct player *def_player, + const struct tile *ptile, + int defensepower, bool fortified) { struct city *pcity = tile_city(ptile); int mod; Modified: trunk/common/effects.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/effects.h?rev=34309&r1=34308&r2=34309&view=diff ============================================================================== --- trunk/common/effects.h (original) +++ trunk/common/effects.h Tue Nov 1 10:24:15 2016 @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -291,6 +291,8 @@ #define SPECENUM_VALUE114NAME "Building_Saboteur_Resistant" #define SPECENUM_VALUE115 EFT_UNIT_SLOTS #define SPECENUM_VALUE115NAME "Unit_Slots" +#define SPECENUM_VALUE116 EFT_ATTACK_BONUS +#define SPECENUM_VALUE116NAME "Attack_Bonus" /* 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=34309&r1=34308&r2=34309&view=diff ============================================================================== --- trunk/doc/README.effects (original) +++ trunk/doc/README.effects Tue Nov 1 10:24:15 2016 @@ -356,6 +356,10 @@ will be applied to the _attacking_ unit. Attackers with "BadWallAttacker" flag will have their firepower set to 1. +Attack_Bonus + Increases offensive bonuses of units. Unit requirements on this effect are + the attacking unit itself. + Gain_AI_Love Gain amount points of "AI love" with AI(s). Modified: trunk/fc_version URL: http://svn.gna.org/viewcvs/freeciv/trunk/fc_version?rev=34309&r1=34308&r2=34309&view=diff ============================================================================== --- trunk/fc_version (original) +++ trunk/fc_version Tue Nov 1 10:24:15 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.Oct.16" +NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-3.0-2016.Nov.01" NETWORK_CAPSTRING_OPTIONAL="" FREECIV_DISTRIBUTOR="" _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits