Skip to content

Commit

Permalink
Fixed mercenary wandering, fixed minor civ tech rate
Browse files Browse the repository at this point in the history
  • Loading branch information
bptato committed Apr 14, 2020
1 parent 750d921 commit 2801da2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
Binary file modified Assets/CvGameCoreDLL.dll
Binary file not shown.
14 changes: 12 additions & 2 deletions CvGameCoreDLL/CvRFCProvince.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,20 @@ void CvRFCProvince::checkMercenaries() {
for(std::vector<CvRFCMercenary>::iterator it = mercenaries.begin(); it != mercenaries.end();) {
if(GC.getGame().getSorenRandNum(100, "Mercenary disband roll") < 5) {
if(GC.getGame().getSorenRandNum(100, "Mercenary wandering roll") < 60) {
int borderProvinces = 0;
for(int i = 0; i<GC.getRiseFall().getNumProvinces(); ++i) {
if(isBorderProvince(GC.getRiseFall().getRFCProvinceByID(i))) {
GC.getRiseFall().getRFCProvinceByID(i)->addMercenary(*it);
break;
++borderProvinces;
}
}
int rand = 0;
for(int i = 0; i<GC.getRiseFall().getNumProvinces(); ++i) {
if(isBorderProvince(GC.getRiseFall().getRFCProvinceByID(i))) {
rand += 100/borderProvinces;
if(100/borderProvinces<GC.getGame().getSorenRandNum(rand, "Border province selection roll")) {
GC.getRiseFall().getRFCProvinceByID(i)->addMercenary(*it);
break;
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions CvGameCoreDLL/CvTeam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ void CvTeam::doTurn()

AI_doTurnPre();

if (isBarbarian())
if (isBarbarian() || isMinorCiv()) //bluepotato
{
for (iI = 0; iI < GC.getNumTechInfos(); iI++)
{
Expand Down Expand Up @@ -6344,4 +6344,4 @@ int CvTeam::getPlayerMemberListSize() const
{
return m_aePlayerMembers.size();
}
//bluepotato end
//bluepotato end
2 changes: 0 additions & 2 deletions CvGameCoreDLL/CyPlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,6 @@ bool CyPlot::isPeak()

void CyPlot::setPlotType(PlotTypes eNewValue, bool bRecalculate, bool bRebuildGraphics)
{
GC.logMsg("setPlotType eNewValue: %i, bRecalculate: %i, bRebuildGraphics: %i", (int)eNewValue, (int)bRecalculate, (int)bRebuildGraphics);

if (m_pPlot)
m_pPlot->setPlotType(eNewValue, bRecalculate, bRebuildGraphics);
}
Expand Down

0 comments on commit 2801da2

Please sign in to comment.