Now I'm trying to add tags to promotions that could change the ranged bombard(range +1, more accuracy). I have followed xienwolf's great tutorial and managed to add proper texts to promotions' civilopedia with DLL, but now I'm out of ideas how would I display it on unit. Right now it looks like this in CvGameTextMgr.cpp void CvGameTextMgr::setUnitHelp(CvWStringBuffer &szString, const CvUnit* pUnit, bool bOneLine, bool bShort)
The red part adds the range text if the unit has range defined. I don't think it would work if I add my code here. It would just display it right. So after that, I went looking for the pUnit->getDCMBombRange()
I thought that this would be the right place to add check if the unit has promotion that changes the range. I'm not totally sure about it or how to check the promotion and what the promotion does.
So if anyone could tell me was I right about how it works and teach me how to check the promotion?
Code:
...
// Dale - RB: Field Bombard START
if (GC.getDCM_RANGE_BOMBARD())
{
if (pUnit->getDCMBombRange() > 0 || pUnit->getDCMBombAccuracy() > 0)
{
szString.append(NEWLINE);
szString.append(gDLL->getText("TXT_KEY_IS_DCM_BOMBARD"));
}
[COLOR="Red"]if (pUnit->getDCMBombRange() > 0)
{
szString.append(NEWLINE);
szString.append(gDLL->getText("TXT_KEY_IS_RANGE_BOMBARD", pUnit->getDCMBombRange()));
}[/COLOR]
if (pUnit->getDCMBombAccuracy() > 0)
{
szString.append(NEWLINE);
szString.append(gDLL->getText("TXT_KEY_IS_ACCURACY_BOMBARD", pUnit->getDCMBombAccuracy()));
}
}
if (pUnit->bombardRate() > 0)
{
if (bShort)
{
szString.append(NEWLINE);
szString.append(gDLL->getText("TXT_KEY_UNIT_BOMBARD_RATE_SHORT", ((pUnit->bombardRate() * 100) / GC.getMAX_CITY_DEFENSE_DAMAGE())));
}
else
{
szString.append(NEWLINE);
szString.append(gDLL->getText("TXT_KEY_UNIT_BOMBARD_RATE", ((pUnit->bombardRate() * 100) / GC.getMAX_CITY_DEFENSE_DAMAGE())));
}
}
// Dale - RB: Field Bombard END
...
Code:
int CvUnit::getDCMBombRange() const
{
return GC.getUnitInfo(getUnitType()).getDCMBombRange();
}
So if anyone could tell me was I right about how it works and teach me how to check the promotion?