Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
432ae91
Logging game state
novice-rb Mar 27, 2014
010ab7b
Added separate global define for game state logging. Logging pauses a…
novice-rb Apr 1, 2014
8882a0d
Added turn roll event. Refactored.
novice-rb Apr 1, 2014
2905d0f
diplo+pause problem fix
plako Apr 3, 2014
4f865ea
pause+diplo window problem fix
plako Apr 3, 2014
3469c70
Lower cap on #civs in known tech bonus calculation
novice-rb Jul 20, 2014
2d641db
Reenabling map trading at Writing for RB Mod
novice-rb Jul 20, 2014
6c97dfd
Autosaves on connect, end turn and disconnect
novice-rb Jul 20, 2014
2fe7859
Tweaked known tech bonus caps for RB mod
novice-rb Jul 20, 2014
f26b9f0
Added Plako's pause fix for pitboss
novice-rb Oct 10, 2014
1a68c0b
DLL / XML support for capital plot yields
novice-rb Jan 7, 2015
7e55de9
Extended XML schema for Civics
novice-rb Jan 7, 2015
79da8aa
Reading new XML tags in dll and showing texts
novice-rb Jan 12, 2015
e0fd41b
Reading all the new civic xml tags in the dll.
novice-rb Jan 13, 2015
a8db8b2
Completed civic description logic and sample xml
novice-rb Jan 16, 2015
eef015d
Implemented building yields from civics effect.
novice-rb Jan 17, 2015
4bbbda8
Implemented civics xml tags effects
novice-rb Jan 25, 2015
2638710
ToW tech cost scaling
novice-rb Jan 25, 2015
851c044
Added building civiliopedia / tooltip help text
novice-rb Jan 26, 2015
a7505dd
Fixed tooltip help for modifiers
novice-rb Jan 27, 2015
57b37b7
Added tooltip for AGG maintenance reduction
novice-rb Jan 27, 2015
26d6625
Added iCityUpkeepModifier effect to traits description
novice-rb Jan 27, 2015
9f84a19
Adding settled great person for PHI
novice-rb Mar 2, 2015
b9fc714
Support for traits on civilizations.
novice-rb Mar 19, 2015
ce1a0af
Improved civilopedia and tooltip info on Civ traits
novice-rb Mar 22, 2015
99bfb75
Merge branch 'pr/1'
plako Jul 24, 2015
9017ec5
Specialist counts can now be tied to civics - RtR 3.0.0.1d
plako Jul 24, 2015
f148236
Fixed problems caused by the merge
plako Jul 24, 2015
33aef16
3.0.0.g + Krills xml changes doen to .f + NO_CITY_TRADING added
plako Aug 11, 2015
62cbda9
3.0.0.1.g dll updated
plako Aug 11, 2015
f5984c4
Space ship launch chrash fixed
plako Aug 12, 2015
ebd08b5
Tie No barbs = No map trading
plako Aug 12, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 83 additions & 1 deletion CvGameCoreDLL/CvCity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,35 @@ void CvCity::init(int iID, PlayerTypes eOwner, int iX, int iY, bool bBumpUnits,
GC.getGameINLINE().updatePlotGroups();
}

// AGDM addition, apply civic effects:
for (iI = 0; iI < GC.getNumBuildingClassInfos(); iI++)
{
for (int iJ = 0; iJ < NUM_YIELD_TYPES; ++iJ)
{
for (int iK = 0; iK < GC.getNumCivicOptionInfos(); iK++)
{
CivicTypes eCivic = GET_PLAYER(getOwnerINLINE()).getCivics((CivicOptionTypes)iK);
if (GC.getCivicInfo(eCivic).getBuildingYieldChanges(iI, iJ) != 0)
{
changeBuildingYieldChange((BuildingClassTypes)iI, (YieldTypes)iJ, (GC.getCivicInfo(eCivic)).getBuildingYieldChanges(iI, iJ));
}
}
}
for (iJ = 0; iJ < NUM_COMMERCE_TYPES; ++iJ)
{
for (int iK = 0; iK < GC.getNumCivicOptionInfos(); iK++)
{
CivicTypes eCivic = GET_PLAYER(getOwnerINLINE()).getCivics((CivicOptionTypes)iK);
if (GC.getCivicInfo(eCivic).getBuildingCommerceChanges(iI, iJ) != 0)
{
changeBuildingCommerceChange((BuildingClassTypes)iI, (CommerceTypes)iJ, (GC.getCivicInfo(eCivic)).getBuildingCommerceChanges(iI, iJ));
}
}
}
}

pPlot->updateYield(); // AGDM addition

AI_init();
}

Expand Down Expand Up @@ -1122,6 +1151,23 @@ void CvCity::updateVisibility()
void CvCity::createGreatPeople(UnitTypes eGreatPersonUnit, bool bIncrementThreshold, bool bIncrementExperience)
{
GET_PLAYER(getOwnerINLINE()).createGreatPeople(eGreatPersonUnit, bIncrementThreshold, bIncrementExperience, getX_INLINE(), getY_INLINE());
// AGDM addition: Add settled great people for PHI.
int iI, iJ;
int iExtraSettledGreatPeople = GC.getDefineINT("EXTRA_SETTLED_GREAT_PEOPLE_FROM_PHI");
if(iExtraSettledGreatPeople > 0 && bIncrementThreshold) {
for (iJ = 0; iJ < GC.getNumTraitInfos(); iJ++)
{
if(GET_PLAYER(getOwnerINLINE()).hasTrait((TraitTypes)iJ) && GC.getTraitInfo((TraitTypes)iJ).getGreatPeopleRateModifier() > 0) {
for (iI = 0; iI < GC.getNumSpecialistInfos(); ++iI)
{
if (GC.getUnitInfo(eGreatPersonUnit).getGreatPeoples(iI))
{
changeFreeSpecialistCount((SpecialistTypes)iI, iExtraSettledGreatPeople);
}
}
}
}
}
}


Expand Down Expand Up @@ -3695,12 +3741,31 @@ void CvCity::processBuilding(BuildingTypes eBuilding, int iChange, bool bObsolet
changeBaseYieldRate(((YieldTypes)iI), ((GC.getBuildingInfo(eBuilding).getYieldChange(iI) + getBuildingYieldChange((BuildingClassTypes)GC.getBuildingInfo(eBuilding).getBuildingClassType(), (YieldTypes)iI))* iChange));
changeYieldRateModifier(((YieldTypes)iI), (GC.getBuildingInfo(eBuilding).getYieldModifier(iI) * iChange));
changePowerYieldRateModifier(((YieldTypes)iI), (GC.getBuildingInfo(eBuilding).getPowerYieldModifier(iI) * iChange));
// AGDM addition: Add building yield modifiers and commerce modifiers from civics
for(iJ = 0; iJ < GC.getNumCivicOptionInfos(); iJ++)
{
CivicTypes eCivic = GET_PLAYER(getOwnerINLINE()).getCivics((CivicOptionTypes)iJ);
changeYieldRateModifier((YieldTypes)iI, GC.getCivicInfo(eCivic).getBuildingYieldModifiers(GC.getBuildingInfo(eBuilding).getBuildingClassType(), iI) * iChange);
}
}

for (iI = 0; iI < NUM_COMMERCE_TYPES; iI++)
{
changeCommerceRateModifier(((CommerceTypes)iI), (GC.getBuildingInfo(eBuilding).getCommerceModifier(iI) * iChange));
changeCommerceHappinessPer(((CommerceTypes)iI), (GC.getBuildingInfo(eBuilding).getCommerceHappiness(iI) * iChange));
// AGDM addition: Add building yield modifiers and commerce modifiers from civics
for(iJ = 0; iJ < GC.getNumCivicOptionInfos(); iJ++)
{
CivicTypes eCivic = GET_PLAYER(getOwnerINLINE()).getCivics((CivicOptionTypes)iJ);
changeCommerceRateModifier((CommerceTypes)iI, GC.getCivicInfo(eCivic).getBuildingCommerceModifiers(GC.getBuildingInfo(eBuilding).getBuildingClassType(), iI) * iChange);
}
}
// AGDM addition: Get military production and free experience from civics
for(iI = 0; iI < GC.getNumCivicOptionInfos(); iI++)
{
CivicTypes eCivic = GET_PLAYER(getOwnerINLINE()).getCivics((CivicOptionTypes)iI);
changeMilitaryProductionModifier(GC.getCivicInfo(eCivic).getBuildingMilitaryProductionModifiers(GC.getBuildingInfo(eBuilding).getBuildingClassType()) * iChange);
changeFreeExperience(GC.getCivicInfo(eCivic).getBuildingFreeExperiences(GC.getBuildingInfo(eBuilding).getBuildingClassType()) * iChange);
}

for (iI = 0; iI < GC.getNumReligionInfos(); iI++)
Expand All @@ -3712,6 +3777,13 @@ void CvCity::processBuilding(BuildingTypes eBuilding, int iChange, bool bObsolet
{
changeMaxSpecialistCount(((SpecialistTypes)iI), GC.getBuildingInfo(eBuilding).getSpecialistCount(iI) * iChange);
changeFreeSpecialistCount(((SpecialistTypes)iI), GC.getBuildingInfo(eBuilding).getFreeSpecialistCount(iI) * iChange);
// AGDM addition: Add free specialists from civics
for(iJ = 0; iJ < GC.getNumCivicOptionInfos(); iJ++)
{
CivicTypes eCivic = GET_PLAYER(getOwnerINLINE()).getCivics((CivicOptionTypes)iJ);
int iS = GC.getCivicInfo(eCivic).getBuildingFreeSpecialistCounts(GC.getBuildingInfo(eBuilding).getBuildingClassType(), iI);
changeFreeSpecialistCount((SpecialistTypes)iI, iS * iChange);
}
}

for (iI = 0; iI < GC.getNumImprovementInfos(); ++iI)
Expand Down Expand Up @@ -9565,7 +9637,17 @@ int CvCity::getMaxSpecialistCount(SpecialistTypes eIndex) const
{
FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
FAssertMsg(eIndex < GC.getNumSpecialistInfos(), "eIndex expected to be < GC.getNumSpecialistInfos()");
return m_paiMaxSpecialistCount[eIndex];

//Plako for RtRmod 20.7.2015
//If RtRSpecialistCount tied into a civic is > 0 add those to max specialist counts
int rtRExtraSpecialistCount = 0;
for (int iI = 0; iI < GC.getNumCivicInfos(); iI++) {
if (GET_PLAYER(getOwnerINLINE()).isCivic((CivicTypes)iI)) {
rtRExtraSpecialistCount += GC.getCivicInfo((CivicTypes)iI).getRtRExtraSpecialistCounts(eIndex);
}
}

return m_paiMaxSpecialistCount[eIndex]+rtRExtraSpecialistCount;
}


Expand Down
9 changes: 9 additions & 0 deletions CvGameCoreDLL/CvDLLWidgetData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3581,6 +3581,15 @@ void CvDLLWidgetData::parseMaintenanceHelp(CvWidgetDataStruct &widgetDataStruct,
szBuffer.append(gDLL->getText("TXT_KEY_MISC_CORPORATION_MAINT_FLOAT", szMaint.GetCString()));
}

// AGDM addition: Inform about reduced mainenance due to trait introduced by T-hawk for RB balance mod. Works multiplicatively after discounts from courthouse/etc.
int iCityUpkeepModifier = GET_PLAYER(pHeadSelectedCity->getOwnerINLINE()).getCityUpkeepModifier();
if (iCityUpkeepModifier != 0)
{
CvWString szMaint = CvWString::format(L"%d%%", 0-iCityUpkeepModifier);
szBuffer.append(NEWLINE);
szBuffer.append(gDLL->getText("TXT_KEY_MISC_TRAITS_MAINT", szMaint.GetCString()));
}

szBuffer.append(SEPARATOR);

// swprintf(szTempBuffer, "\n%d%c Total Maintenance", pHeadSelectedCity->getMaintenance(), GC.getCommerceInfo(COMMERCE_GOLD).getChar());
Expand Down
Loading