lichen8566
Warlord
....... To lower the MAX_BOMBARD_DEFENSE not work, the early weapons still have no effect.
Check the code below:
File: CvUnit.cpp Line:5516
File: CvCity.cpp Line:9081
If I bombard the city that has 300% defenses and 80% bombard defenses ( that's common for a city in the medieval era. ) with catapult ( which has 8% bombarb rate ).
The final bombard modifer value is 1% ( where in the first section of code is "pBombardCity->changeDefenseModifier(-(8 * std::max(0, 100 + -20 )) / 100); " ). And in the second section of code " changeDefenseDamage(-(GC.getMAX_CITY_DEFENSE_DAMAGE() * iChange) / iTotalDefense); " where getMAX_CITY_DEFENSE_DAMAGE() returns 100 and the iTotalDefense is 350, so that we can only reduce the city defenses for 1 / 350 = 0 point.
There are other bombardment units like early fighters have less bombrate, but they ignore the bombard defense of city, so actually they have more strength than catapult.
I highly recommend that to change the value of MAX_BOMBARD_DEFENSE to 80 and change the code to below:
Edited, the previous code is wrong.
Wish the A New Dawn will be better and better.
Check the code below:
File: CvUnit.cpp Line:5516
Code:
int iBombardModifier = 0;
if (!ignoreBuildingDefense())
{
iBombardModifier -= pBombardCity->getBuildingBombardDefense();
}
pBombardCity->changeDefenseModifier(-(bombardRate() * std::max(0, 100 + iBombardModifier)) / 100);
File: CvCity.cpp Line:9081
Code:
void CvCity::changeDefenseModifier(int iChange)
{
if (iChange != 0)
{
int iTotalDefense = getTotalDefense(false);
if (iTotalDefense > 0)
{
changeDefenseDamage(-(GC.getMAX_CITY_DEFENSE_DAMAGE() * iChange) / iTotalDefense);
}
}
}
If I bombard the city that has 300% defenses and 80% bombard defenses ( that's common for a city in the medieval era. ) with catapult ( which has 8% bombarb rate ).
The final bombard modifer value is 1% ( where in the first section of code is "pBombardCity->changeDefenseModifier(-(8 * std::max(0, 100 + -20 )) / 100); " ). And in the second section of code " changeDefenseDamage(-(GC.getMAX_CITY_DEFENSE_DAMAGE() * iChange) / iTotalDefense); " where getMAX_CITY_DEFENSE_DAMAGE() returns 100 and the iTotalDefense is 350, so that we can only reduce the city defenses for 1 / 350 = 0 point.
There are other bombardment units like early fighters have less bombrate, but they ignore the bombard defense of city, so actually they have more strength than catapult.
I highly recommend that to change the value of MAX_BOMBARD_DEFENSE to 80 and change the code to below:
Edited, the previous code is wrong.
Code:
void CvCity::changeDefenseModifier(int iChange)
{
if (iChange != 0)
{
int iTotalDefense = getTotalDefense(false);
if (iTotalDefense > 0)
{
changeDefenseDamage( ( std::max( -( GC.getMAX_CITY_DEFENSE_DAMAGE() * iChange / iTotalDefense ), 1 ) ) );
}
}
}
Wish the A New Dawn will be better and better.
