Your patch works and the code looks very clean.
The tooltip displays the correct values and I also compared the attack damage in an actual battle (compared a ship with 30 units garrissoned with a ship that has only 13 units in it and they did the same damage). The heavy warship was the strongest ship so far, since it could garrisson 40 units and shoot 43 arrows (OP). Now it is limited to 13 arrows too, since it is considered a trireme internally.
The following things could be added:
- Ptolemian military colony can garrisson 20 units and shoots 21 arrows
- Seleucid military colony can garrisson 15 and shoots 17 arrows
- With this patch, the heavy warship receives a tooltip that explains how to increase the firepower. However the other ships also need tooltips urgently, since most players don't know that you need to garrisson ships to make them stronger. (This usually results in empty boat spams, so don't fix this if you want that big sea battle :D )
- There should be a loading screen tip that explains how to increase the ship firepower, so that even those people will be informed, that don't read (or didn't have time to read those) tooltips. Those tips are defined in binaries/data/mods/public/gui/text/tips, the images displayed are defined in binaries/data/mods/public/art/textures/ui/loading/tips.
- Sword cav doesn't shoot arrows, while swordsmen and skirm cavalry does. That is because
GarrisonArrowClasses
contains Infantry
and Ranged
for bireme and trireme. One could add Swordsman
to that list or rather remove the Ranged
class from the list, so that all infantry but no cavalry shoots arrows.
Further I think that the balancing is okay. If you played with naval experts, then you could be certain that they would find out how many ships and units garrissoned you have on the sea and try to get more units on boats. This in turn means that you can lose all your boats and all your units while the expert keeps all of his boats alive and doesn't lose a single unit (if executed correctly). This balancing would mitigate this a bit.