[1.0.0.56] City Ranged Attack not modified by forming Corps/Army

sp00n

Prince
Joined
Jan 4, 2007
Messages
371
As explained in the Civilopedia, the ranged attack strength of your cities is dependant on the strongest ranged attack strength of one of your units. This works fine as long as you build a unit/corps/army or upgrade a unit/corps/army. It does however not work when you form a corps or army (resp. fleet/armada) out of already existing units.

Test results:
  • Form Field Cannon Corps: ranged attack value 70
    → City attack range stays at 60
  • Form Field Cannon Army: ranged attack value 77
    → City attack range stays at 60
  • Form Privateer Armada: ranged attack value 67
    → City attack range stays at 60
  • Form Battleship Corps: ranged attack value 75
    → City attack range stays at 65
  • Form Battleship Armada: ranged attack value 82
    → City attack range stays at 65
  • Build Battleship unit: ranged attack value 65
    → City attack range increases to 65
  • Build Machine Gun unit: ranged attack value 75
    → City attack range increases to 75
  • Build Battleship Armada: ranged attack value 82
    → City attack range increases to 82
  • Build Machine Gun Army: ranged attack value 92
    → City attack range increases to 92
  • Upgrade Field Cannon unit to Machine Gun unit: ranged attack value 75
    → City attack range increases to 75
  • Upgrade Field Cannon Corps to Machine Gun Corps: ranged attack value 85
    → City attack range increases to 85
  • Upgrade Field Cannon Army to Machine Gun Army: ranged attack value 92
    → City attack range increases to 92

Note that these test weren't necessarily done in the order of the list, it's just ordered for the "type" of the ranged attack (formation, build, upgrade). And of course if you want to form a Battleship Armada, you first need a basic Battleship unit, so the city ranged attack has already increased to 65 instead of the 60 at the beginning of the test.


Now, with the default UI this is not immediately obvious, but you can modify a LUA file to make it better visible. You'll have to edit \Base\Assets\UI\WorldView\CityBannerManager.lua.
Find the CityBanner.UpdateStats function, and add a
Code:
local garrisonAttack:number = math.floor(pDistrict:GetAttackStrength() + 0.5);
right below the
Code:
local garrisonDefense:number = math.floor(pDistrict:GetDefenseStrength() + 0.5);
line.

Then search further below in the same function, and replace
Code:
self.m_Instance.DefenseNumber:SetText(defValue);
with
Code:
self.m_Instance.DefenseNumber:SetText(defValue .. "/" .. garrisonAttack);
This will make the city banner display e.g. 77/85 for city defense / city attack, instead of only showing the city defense value.

You can do the same for encampments in the CityBanner.UpdateEncampmentBanner function, but to demonstrate this bug the city banner should be sufficient.
 
Back
Top Bottom