Revision: 351
Author: TongShen.Martin
Date: Thu Oct 15 05:02:19 2009
Log: 0.306: 修正:修正占领城市的CTD问题
修正雇佣屏幕监禁中的英雄也显示可雇用的Bug
修正只有一个单位的集团军选择九变晋升导致集团军解散的Bug
修正194AD地图部分英雄初始化错误
0.307: 修正:永远真正完全修正占领城市CTD问题
修正CAR Mod中打错了字导致的CTD
规则调整:英雄可以在任何地形行走
在无城市真实地图剧情初始领袖英雄自动加入势力
0.307: fix: fix the capture last city CTD bug once and for all
fix a type-induced CTD in CAR Mod
rule tweak: heroes can now walk all terrain
on no city scenarios the initial leader hero will join faction at start
0.306: fix: fix a bug when capture the last city of an enemy CTD may occur
fix a screen bug a captured hero displayed as recruitable
fix a bug when there's only one unit in army, selecting nine
transformation promotion results in army dismissed
fix a bug in 194AD map some heroes do not appear properly
http://code.google.com/p/sanguoforciv4/source/detail?r=351
Modified:
/trunk/The History of Three Kingdoms/Assets/Python/Screens/CvHeroAdvisor.py
/trunk/The History of Three Kingdoms/Assets/Python/pyWB/CvWBDesc.py
/trunk/The History of Three Kingdoms/CvGameCoreDLL/CvGame.cpp
/trunk/The History of Three Kingdoms/CvGameCoreDLL/CvGame.h
/trunk/The History of Three Kingdoms/CvGameCoreDLL/CvPlayer.cpp
/trunk/The History of Three Kingdoms/CvGameCoreDLL/CvPlot.cpp
/trunk/The History of Three Kingdoms/CvGameCoreDLL/CvTeam.cpp
/trunk/The History of Three Kingdoms/CvGameCoreDLL/CvUnit.cpp
/trunk/The History of Three Kingdoms/CvGameCoreDLL/CyPlayer.cpp
/trunk/The History of Three Kingdoms/CvGameCoreDLL/CyPlayer.h
/trunk/The History of Three Kingdoms/CvGameCoreDLL/CyPlayerInterface2.cpp
/trunk/The History of Three Kingdoms/Documents/changelog.txt
/trunk/The History of Three Kingdoms/Documents/changelog_en.txt
=======================================
--- /trunk/The History of Three
Kingdoms/Assets/Python/Screens/CvHeroAdvisor.py Wed Oct 7 20:41:24 2009
+++ /trunk/The History of Three
Kingdoms/Assets/Python/Screens/CvHeroAdvisor.py Thu Oct 15 05:02:19 2009
@@ -433,9 +433,9 @@
for iLoopHero in range(gc.getNumHeroInfos()):
if self.objActiveLeader.canRecruitHero(iLoopHero, False):
lAvailableHeroes.append(iLoopHero)
- elif gc.getGame().getHeroDebutStatus(iLoopHero) == -2:
+ elif gc.getGame().getHeroDebutStatus(iLoopHero) == -2 and
gc.getGame().getHeroCapturePlayer(iLoopHero) == -1:
lMaybeLaterHeroes.append(iLoopHero)
- elif gc.getGame().getHeroDebutStatus(iLoopHero) >= 0:
+ elif gc.getGame().getHeroDebutStatus(iLoopHero) >= 0 and
gc.getGame().getHeroCapturePlayer(iLoopHero) == -1:
lEmployedHeroes.append(iLoopHero)
iCount = 0
=======================================
--- /trunk/The History of Three Kingdoms/Assets/Python/pyWB/CvWBDesc.py Tue
Sep 29 23:51:43 2009
+++ /trunk/The History of Three Kingdoms/Assets/Python/pyWB/CvWBDesc.py Thu
Oct 15 05:02:19 2009
@@ -766,17 +766,12 @@
else:
hero = unit
- listHeroType = []
- for i in range(gc.getNumHeroInfos()):
- if gc.getHeroInfo(i).getUnitType() == iUnitType:
- listHeroType.append(i)
-
- if len(listHeroType) > 1:
- hero.setHeroType(self.iHeroType)
- if gc.getGame().getHeroDebutStatus(self.iHeroType) != self.owner:
- gc.getGame().setHeroDebutStatus(self.iHeroType, self.owner)
- player.changeHeroMaintenance(self.iHeroType, True, False, 0)
- gc.getGame().setHeroUnitID(self.iHeroType, hero.getID())
+
+ hero.setHeroType(self.iHeroType)
+ if gc.getGame().getHeroDebutStatus(self.iHeroType) != self.owner:
+ gc.getGame().setHeroDebutStatus(self.iHeroType, self.owner)
+ player.changeHeroMaintenance(self.iHeroType, True, False, 0)
+ gc.getGame().setHeroUnitID(self.iHeroType, hero.getID())
elif gc.getUnitInfo(unitTypeNum).isHero():
listHeroType = []
for i in
range(gc.getNumHeroInfos()):
@@ -2208,6 +2203,14 @@
if (self.playersDesc[iPlayerLoop]):
pPlayer = gc.getPlayer(iPlayerLoop)
+
+ for iLoopHero in range(gc.getNumHeroInfos()):
+ if pPlayer.getLeaderType()
== gc.getHeroInfo(iLoopHero).getLeaderType():
+ if
gc.getGame().getHeroDebutStatus(iLoopHero) < 0:
+ iX, iY =
pPlayer.findXY(False)
+ if iX > -1
and iY > -1:
+
pPlayer.initHero(iLoopHero, iX, iY, True)
+
pPlayer.recalculateGreatGeneralThreshold()
#### Sanguo Mod WB, set combat experience threshold, end
=======================================
--- /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvGame.cpp Wed Oct
7 20:41:24 2009
+++ /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvGame.cpp Thu Oct
15 05:02:19 2009
@@ -10236,12 +10236,21 @@
int iLeaderID = getHeroUnitID(eLeader);
bool bLeaderTroop = (iLeaderID == pCore->getID());
pCore->quitAdvancedLegion(true);
+ CvUnit* pLeaderTroop = getHeroUnit(eLeader);
backUpHeroLegionMember(eHero);
FAssert (pCore->getHeroType() >= 0 && pCore->getHeroType() <
GC.getNumHeroInfos());
pCore->processLegion(false, true, false, false);
m_ppaiHeroPromotionStatus[eHero][ePromotion] = iNewValue;
pCore->processLegion(false, false, true, false);
- pCore->joinAdvancedLegion(getHeroUnitID(eLeader), bLeaderTroop);
+ if (pLeaderTroop->isNakedHero())
+ {
+ addHeroCoreTroop(eLeader, pCore->getID());
+ pLeaderTroop->formAdvancedLegion(false, true);
+ }
+ else
+ {
+ pCore->joinAdvancedLegion(getHeroUnitID(eLeader), bLeaderTroop);
+ }
}
else
{
=======================================
--- /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvGame.h Tue Sep 29
23:51:43 2009
+++ /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvGame.h Thu Oct 15
05:02:19 2009
@@ -805,4 +805,8 @@
void doUpdateCacheOnTurn();
};
+// Sanguo Mod helper, start, by poyuzhe 10.15.09
+#define GAME GC.getGameINLINE()
+// Sanguo Mod helper, end
+
#endif
=======================================
--- /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvPlayer.cpp Wed
Oct 7 20:41:24 2009
+++ /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvPlayer.cpp Thu Oct
15 05:02:19 2009
@@ -12003,19 +12003,26 @@
{
if (GC.getGameINLINE().getHeroCapturePlayer((HeroTypes)iI) == getID())
{
- if (GC.getGameINLINE().getHeroDebutStatus((HeroTypes)iI) >= 0)
- {
-
freePlayerHeroes((PlayerTypes)GC.getGameINLINE().getHeroDebutStatus((HeroTypes)iI),
(HeroTypes)iI);
+ if (GAME.getHeroDebutStatus((HeroTypes)iI) >= 0)
+ {
+
freePlayerHeroes((PlayerTypes)GAME.getHeroDebutStatus((HeroTypes)iI),
(HeroTypes)iI);
}
else
{
- GC.getGameINLINE().setHeroDebutStatus((HeroTypes)iI, -2);
- GC.getGameINLINE().setHeroCapturePlayer((HeroTypes)iI, NO_PLAYER);
+ GAME.setHeroDebutStatus((HeroTypes)iI, -2);
+ GAME.setHeroCapturePlayer((HeroTypes)iI, NO_PLAYER);
}
}
- else if (GC.getGameINLINE().getHeroDebutStatus((HeroTypes)iI) ==
getID())
- {
- GC.getGameINLINE().setHeroDebutStatus((HeroTypes)iI, -2);
+ // set our heroes who have been captured by other faction to unemployed
+ else if (GAME.getHeroDebutStatus((HeroTypes)iI) == getID())
+ {
+ GAME.setHeroDebutStatus((HeroTypes)iI, -2);
+ // This is when last city is captured but hero is not, so set the
hero debut status to unemployed.
+ if (GAME.getHeroCapturePlayer((HeroTypes)iI) == NO_PLAYER)
+ {
+ GAME.setHeroUnitID((HeroTypes)iI, -1);
+ //changeHeroMaintenance((HeroTypes)iI, false, true, 0);
+ }
}
}
// Sanguo Mod Hero, end
=======================================
--- /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvPlot.cpp Tue Sep
22 03:53:27 2009
+++ /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvPlot.cpp Thu Oct
15 05:02:19 2009
@@ -6441,14 +6441,13 @@
{
if (eBonus != NO_BONUS &&
GET_TEAM(GET_PLAYER(ePlayer).getTeam()).isHasTech((TechTypes)(GC.getBonusInfo(eBonus).getTechReveal())))
{
- std::map<UnitTypes, int> aUnitYieldChange; // so that more
than 1 unit of the same type will not accumulatively affect the plot's yield
CLLNode<IDInfo>* pUnitNode = headUnitNode();
+ int iBestYield = 0;
while (pUnitNode != NULL)
{
CvUnit* pLoopUnit = ::getUnit(pUnitNode->m_data);
pUnitNode = nextUnitNode(pUnitNode);
UnitTypes eUnitType = NO_UNIT;
- int iYieldChange = 0;
if (NULL != pLoopUnit && getOwnerINLINE() ==
pLoopUnit->getOwnerINLINE())
{
eUnitType = pLoopUnit->getUnitType();
@@ -6458,22 +6457,16 @@
if (eCamp != NO_SANGUOCAMP)
{
- iYieldChange =
GC.getSanguoCampInfo(eCamp).getBonusYieldChange(eBonus, eYield);
- if (iYieldChange != 0)
- {
- aUnitYieldChange[eUnitType] = iYieldChange;
+ if
(GC.getSanguoCampInfo(eCamp).getBonusYieldChange(eBonus, eYield) >
iBestYield)
+ {
+ iBestYield =
GC.getSanguoCampInfo(eCamp).getBonusYieldChange(eBonus, eYield);
}
}
}
}
}
- std::map<UnitTypes, int>::iterator iter;
- for (iter = aUnitYieldChange.begin(); iter!=
aUnitYieldChange.end(); ++iter)
- {
- iYield += iter->second;
- }
- aUnitYieldChange.clear();
+ iYield += iBestYield;
}
}
@@ -6507,6 +6500,14 @@
}
}
}
+
+ // Sanguo Mod City Loyalty, start, by poyuzhe 10.15.09
+ /*if (ePlayer != NO_PLAYER)
+ {
+ iYield *= calculateCulturePercent(ePlayer);
+ iYield /= 100;
+ }*/
+ // Sanguo Mod City Loyalty, end
return std::max(0, iYield);
}
@@ -6530,6 +6531,8 @@
void CvPlot::updateYield()
{
+ PROFILE_FUNC();
+
CvCity* pWorkingCity;
bool bChange;
int iNewYield;
@@ -6717,6 +6720,10 @@
{
pCity->AI_setAssignWorkDirty(true);
}
+
+ // Sanguo Mod City Loyalty, start, by poyuzhe 10.15.09
+ //updateYield();
+ // Sanguo Mod City Loyalty, end
}
}
=======================================
--- /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvTeam.cpp Tue Sep
22 03:53:27 2009
+++ /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvTeam.cpp Thu Oct
15 05:02:19 2009
@@ -1631,7 +1631,7 @@
{
for (int iJ = 0; iJ < GET_TEAM(eTeam).getPlayerMemberListSize(); iJ++)
{
- for (int iK = 0; iJ <
GET_TEAM((TeamTypes)iI).getPlayerMemberListSize(); iJ++)
+ for (int iK = 0; iK <
GET_TEAM((TeamTypes)iI).getPlayerMemberListSize(); iK++)
{
GET_PLAYER(GET_TEAM(eTeam).getPlayerMemberAt(iJ)).AI_invalidateAttitudeCache(GET_TEAM((TeamTypes)iI).getPlayerMemberAt(iK));
GET_PLAYER(GET_TEAM((TeamTypes)iI).getPlayerMemberAt(iK)).AI_invalidateAttitudeCache(GET_TEAM(eTeam).getPlayerMemberAt(iJ));
=======================================
--- /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvUnit.cpp Wed Oct
7 20:41:24 2009
+++ /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvUnit.cpp Thu Oct
15 05:02:19 2009
@@ -10715,6 +10715,12 @@
bool CvUnit::canMoveAllTerrain() const
{
+ // Sanguo Mod Hero, start, by poyuzhe 10.15.09
+ if (m_pUnitInfo->isHero())
+ {
+ return true;
+ }
+ // Sanguo Mod Hero, end
return m_pUnitInfo->isCanMoveAllTerrain();
}
@@ -15470,7 +15476,7 @@
return false;
}
- if (GC.getGameINLINE().isHeroHasLegionMember(pUnit->getHeroType(),
getID()))
+ if (GAME.isHeroHasLegionMember(pUnit->getHeroType(), getID()))
{
return false;
}
@@ -15490,17 +15496,17 @@
return false;
}
- if (GC.getGameINLINE().getHeroLegionSize(pUnit->getHeroType()) > 0 &&
getUnitCombatType() !=
GET_PLAYER(getOwnerINLINE()).getUnit(GC.getGameINLINE().getHeroCoreTroop(pUnit->getHeroType()))->getUnitCombatType())
+ if (GAME.getHeroLegionSize(pUnit->getHeroType()) > 0 &&
getUnitCombatType() !=
GET_PLAYER(getOwnerINLINE()).getUnit(GAME.getHeroCoreTroop(pUnit->getHeroType()))->getUnitCombatType())
{
return false;
}
- if (GC.getGameINLINE().getHeroLegionSize(pUnit->getHeroType()) >=
GC.getGameINLINE().getHeroCapacity(pUnit->getHeroType()))
+ if (GAME.getHeroLegionSize(pUnit->getHeroType()) >=
GAME.getHeroCapacity(pUnit->getHeroType()))
{
return false;
}
- if (GC.getGameINLINE().isLegionUnitMoved(pUnit->getHeroType()))
+ if (GAME.isLegionUnitMoved(pUnit->getHeroType()))
{
return false;
}
@@ -15592,7 +15598,7 @@
if (!bRegroup)
{
FAssert (getHeroType() != NO_HERO);
- if (GC.getGameINLINE().getHeroLegionSize(getHeroType()) == 0)
+ if (GAME.getHeroLegionSize(getHeroType()) == 0)
{
CyArgsList argsList;
argsList.add(getHeroType());
@@ -15604,7 +15610,7 @@
{
CvUnit* pCoreTroop = processLegion(false, false, false, false);
FAssert (pCoreTroop != NULL);
- GC.getGameINLINE().setLegionUnitMoved(pCoreTroop->getHeroType(), true);
+ GAME.setLegionUnitMoved(pCoreTroop->getHeroType(), true);
if (plot()->isActiveVisible(false))
{
@@ -15642,7 +15648,7 @@
FAssert (isCoreTroop());
if (!bRegroupDone)
{
- GC.getGameINLINE().backUpHeroLegionMember(getHeroType());
+ GAME.backUpHeroLegionMember(getHeroType());
CyArgsList argsList;
argsList.add(getHeroType());
argsList.add(bRegroup);
@@ -15653,10 +15659,10 @@
{
HeroTypes eLeaderHero = getLeaderHero();
bool bLeaderTroop = isLeaderTroop();
- int iAdvancedLegionSize = eLeaderHero != NO_HERO ?
GC.getGameINLINE().getHeroLegionSize(eLeaderHero) : 0;
+ int iAdvancedLegionSize = eLeaderHero != NO_HERO ?
GAME.getHeroLegionSize(eLeaderHero) : 0;
int iLeaderTroopID = -1;
CvUnit* pLeaderHero = NULL;
- GC.getGameINLINE().swapHeroLegionList(getHeroType());
+ GAME.swapHeroLegionList(getHeroType());
if (eLeaderHero != NO_HERO)
{
if (iAdvancedLegionSize > 1)
@@ -15668,7 +15674,7 @@
pLeaderHero = dismissAdvancedLegion(true);
}
}
- GC.getGameINLINE().swapHeroLegionList(getHeroType());
+ GAME.swapHeroLegionList(getHeroType());
CvUnit* pCoreTroop = processLegion(true, false, false, false);
@@ -15676,7 +15682,7 @@
if (!pCoreTroop->isNakedHero() && eLeaderHero != NO_HERO)
{
- iLeaderTroopID =
GC.getGameINLINE().getHeroCoreTroop(eLeaderHero);
+ iLeaderTroopID = GAME.getHeroCoreTroop(eLeaderHero);
if (iAdvancedLegionSize > 1)
{
if (bLeaderTroop)
@@ -15690,12 +15696,12 @@
}
else
{
- GC.getGameINLINE().addHeroLegionMember(eLeaderHero,
pCoreTroop->getID());
+ GAME.addHeroLegionMember(eLeaderHero,
pCoreTroop->getID());
pLeaderHero->formAdvancedLegion(false, true);
}
}
- GC.getGameINLINE().setLegionUnitMoved(pCoreTroop->getHeroType(),
true);
+ GAME.setLegionUnitMoved(pCoreTroop->getHeroType(), true);
if (isHuman() && getOwnerINLINE() ==
GC.getGame().getActivePlayer())
{
@@ -15748,13 +15754,13 @@
return false;
}
- if (GC.getGameINLINE().isLegionUnitMoved(getHeroType()))
+ if (GAME.isLegionUnitMoved(getHeroType()))
{
return false;
}
- FAssert (GC.getGameINLINE().getHeroLegionSize(getHeroType()) > 0);
- FAssert (GC.getGameINLINE().getHeroCoreTroop(getHeroType()) ==
getID());
+ FAssert (GAME.getHeroLegionSize(getHeroType()) > 0);
+ FAssert (GAME.getHeroCoreTroop(getHeroType()) == getID());
return true;
}
@@ -15774,7 +15780,7 @@
// pCoreTroop is:
// 1. We are naked hero, then is the unit we are going to attach to
// 2. We are a Core Troop, then is ourselves, or the new unit our hero
will abandon us for, or is NULL if legion is cleared
- CvUnit* pCoreTroop =
GET_PLAYER(getOwnerINLINE()).getUnit(GC.getGameINLINE().getHeroCoreTroop(eHero));
+ CvUnit* pCoreTroop =
GET_PLAYER(getOwnerINLINE()).getUnit(GAME.getHeroCoreTroop(eHero));
// Find the correct unitCombatType.
if (!bRegroup)
@@ -15799,16 +15805,16 @@
{
if
(GC.getPromotionInfo((PromotionTypes)iI).getPromotionUnitCombatType() ==
eUnitCombat)
{
- if
(GC.getPromotionInfo((PromotionTypes)iI).getPromotionUnitCombatLevel() ==
GC.getGameINLINE().getHeroUnitCombatLevel(eHero, eUnitCombat))
+ if
(GC.getPromotionInfo((PromotionTypes)iI).getPromotionUnitCombatLevel() ==
GAME.getHeroUnitCombatLevel(eHero, eUnitCombat))
{
eUnitCombatPromotion = (PromotionTypes)iI;
}
}
- else if (GC.getGameINLINE().getHeroPromotionStatus(eHero,
(PromotionTypes)iI) == 1)
+ else if (GAME.getHeroPromotionStatus(eHero, (PromotionTypes)iI) ==
1)
{
UniquePromotionVec.push_back((PromotionTypes)iI);
}
- else if (GC.getGameINLINE().getHeroPromotionStatus(eHero,
(PromotionTypes)iI) == 2)
+ else if (GAME.getHeroPromotionStatus(eHero, (PromotionTypes)iI) ==
2)
{
MemberPromotionVec.push_back((PromotionTypes)iI);
}
@@ -15817,7 +15823,7 @@
#ifdef _DEBUG
if (eUnitCombatPromotion == NO_PROMOTION)
{
- FAssert (GC.getGameINLINE().getHeroUnitCombatLevel(eHero,
eUnitCombat) <= 0);
+ FAssert (GAME.getHeroUnitCombatLevel(eHero, eUnitCombat) <= 0);
}
#endif
@@ -15825,9 +15831,9 @@
// If is Regrouping Mission, strip all old members' hero stats as well
if (bRegroup || bPrePromotion)
{
- for (int iI = 0; iI <
GC.getGameINLINE().getHeroLegionBackUpSize(eHero); iI++)
- {
- CvUnit* pLoopUnit =
GET_PLAYER(getOwnerINLINE()).getUnit(GC.getGameINLINE().getHeroLegionBackUpMemberAt(eHero,
iI));
+ for (int iI = 0; iI < GAME.getHeroLegionBackUpSize(eHero); iI++)
+ {
+ CvUnit* pLoopUnit =
GET_PLAYER(getOwnerINLINE()).getUnit(GAME.getHeroLegionBackUpMemberAt(eHero,
iI));
if (iI == 0)
{
if (bRegroup)
@@ -15836,7 +15842,7 @@
}
for (std::vector<PromotionTypes>::iterator iter1 =
UniquePromotionVec.begin(); iter1 != UniquePromotionVec.end(); ++iter1)
{
- if (getLeaderHero() == NO_HERO ||
GC.getGameINLINE().getHeroPromotionStatus(getLeaderHero(), *iter1) != 1)
+ if (getLeaderHero() == NO_HERO ||
GAME.getHeroPromotionStatus(getLeaderHero(), *iter1) != 1)
{
pLoopUnit->setHasPromotion((*iter1), false);
}
@@ -15853,7 +15859,7 @@
pLoopUnit->setHasPromotion((*iter2), false);
}
- if (bRegroup
&& !GC.getGameINLINE().isHeroHasLegionMember(eHero, pLoopUnit->getID()))
+ if (bRegroup && !GAME.isHeroHasLegionMember(eHero,
pLoopUnit->getID()))
{
pLoopUnit->setLegionHero(NO_HERO);
}
@@ -15877,7 +15883,7 @@
setLeaderUnitType(NO_UNIT);
// set pCoreTroop = pHero so we could return a value that is not NULL
and means we have resurrect a hero
- pCoreTroop = GET_PLAYER(getOwnerINLINE()).initHero(eHero,
getX_INLINE(), getY_INLINE(),
GC.getGameINLINE().getHeroDebutStatus(eHero) != getOwnerINLINE());
+ pCoreTroop = GET_PLAYER(getOwnerINLINE()).initHero(eHero,
getX_INLINE(), getY_INLINE(), GAME.getHeroDebutStatus(eHero) !=
getOwnerINLINE());
}
// since the legion is cleared, it's not necessary to do the
rest, stop here
@@ -15893,7 +15899,7 @@
{
if
(GC.getPromotionInfo((PromotionTypes)iI).getPromotionUnitCombatType() ==
eUnitCombat)
{
- if
(GC.getPromotionInfo((PromotionTypes)iI).getPromotionUnitCombatLevel() ==
GC.getGameINLINE().getHeroUnitCombatLevel(eHero, eUnitCombat))
+ if
(GC.getPromotionInfo((PromotionTypes)iI).getPromotionUnitCombatLevel() ==
GAME.getHeroUnitCombatLevel(eHero, eUnitCombat))
{
eUnitCombatPromotion = (PromotionTypes)iI;
}
@@ -15909,9 +15915,9 @@
pNewSelectionGroup->init(pNewSelectionGroup->getID(), getOwnerINLINE());
bool bOffenseWar = (area()->getAreaAIType(getTeam()) == AREAAI_OFFENSIVE);
- for (int iI = 0; iI < GC.getGameINLINE().getHeroLegionSize(eHero);
iI++)
- {
- CvUnit* pLoopUnit =
GET_PLAYER(getOwnerINLINE()).getUnit(GC.getGameINLINE().getHeroLegionMemberAt(eHero,
iI));
+ for (int iI = 0; iI < GAME.getHeroLegionSize(eHero); iI++)
+ {
+ CvUnit* pLoopUnit =
GET_PLAYER(getOwnerINLINE()).getUnit(GAME.getHeroLegionMemberAt(eHero, iI));
if (bOffenseWar && pLoopUnit->AI_getUnitAIType() == UNITAI_COUNTER)
{
pLoopUnit->AI_setUnitAIType(UNITAI_ATTACK);
@@ -15967,14 +15973,14 @@
{
//clearLegionMember();
setLeaderUnitType(NO_UNIT);
- GC.getGameINLINE().setHeroUnitID(eHero, pCoreTroop->getID());
+ GAME.setHeroUnitID(eHero, pCoreTroop->getID());
pCoreTroop->setLeaderUnitType((UnitTypes)GC.getHeroInfo(eHero).getUnitType());
}
}
// If is From Legion Mission, set the New Hero Unit ID
else
{
- GC.getGameINLINE().setHeroUnitID(eHero, pCoreTroop->getID());
+ GAME.setHeroUnitID(eHero, pCoreTroop->getID());
pCoreTroop->setLeaderUnitType((UnitTypes)GC.getHeroInfo(eHero).getUnitType());
}
@@ -16017,14 +16023,14 @@
return false;
}
- if (GC.getGameINLINE().isLegionUnitMoved(getHeroType()))
+ if (GAME.isLegionUnitMoved(getHeroType()))
{
return false;
}
- for (int iI = 0; iI <
GC.getGameINLINE().getHeroLegionSize(getHeroType()); iI++)
- {
- CvUnit* pMember =
GET_PLAYER(getOwnerINLINE()).getUnit(GC.getGameINLINE().getHeroLegionMemberAt(getHeroType(),
iI));
+ for (int iI = 0; iI < GAME.getHeroLegionSize(getHeroType()); iI++)
+ {
+ CvUnit* pMember =
GET_PLAYER(getOwnerINLINE()).getUnit(GAME.getHeroLegionMemberAt(getHeroType(),
iI));
FAssert (pMember != NULL);
if (pMember->isHurt())
{
@@ -16032,8 +16038,8 @@
}
}
- FAssert ( GC.getGameINLINE().getHeroLegionSize(getHeroType()) > 0);
- FAssert ( GC.getGameINLINE().getHeroCoreTroop(getHeroType()) ==
getID());
+ FAssert ( GAME.getHeroLegionSize(getHeroType()) > 0);
+ FAssert ( GAME.getHeroCoreTroop(getHeroType()) == getID());
return true;
}
@@ -16042,32 +16048,32 @@
{
FAssert (getHeroType() >= 0 && getHeroType() < GC.getNumHeroInfos());
bool bInArmy = (getLeaderHero() != NO_HERO);
- PromotionTypes eNineTransformation = bInArmy ?
GC.getGameINLINE().getHeroCurrentNineTransformationPromotion(getHeroType()) :
NO_PROMOTION;
+ PromotionTypes eNineTransformation = bInArmy ?
GAME.getHeroCurrentNineTransformationPromotion(getHeroType()) :
NO_PROMOTION;
if (bInArmy)
{
quitAdvancedLegion(true);
// if legion current sets a nine transformation promotion, then check to
see if after quiting army that nine tranformation promotion is still valid
- if (eNineTransformation != NO_PROMOTION &&
GC.getGameINLINE().isHeroNineTransformationPromotion(getHeroType(),
eNineTransformation))
+ if (eNineTransformation != NO_PROMOTION &&
GAME.isHeroNineTransformationPromotion(getHeroType(), eNineTransformation))
{
eNineTransformation = NO_PROMOTION;
}
}
- GC.getGameINLINE().backUpHeroLegionMember(getHeroType());
- GC.getGameINLINE().clearHeroLegionMember(getHeroType());
+ GAME.backUpHeroLegionMember(getHeroType());
+ GAME.clearHeroLegionMember(getHeroType());
CvUnit* pHero = processLegion(true, false, false, bAttacked);
// only take away nine transformation promotion that is not valid any more
if (eNineTransformation != NO_PROMOTION)
{
-
GC.getGameINLINE().setHeroCurrentNineTransformationPromotion(pHero->getHeroType(),
NO_PROMOTION);
+ GAME.setHeroCurrentNineTransformationPromotion(pHero->getHeroType(),
NO_PROMOTION);
}
#ifndef _DEBUG
if (pHero != NULL)
{
- GC.getGameINLINE().setLegionUnitMoved(pHero->getHeroType(), true);
+ GAME.setLegionUnitMoved(pHero->getHeroType(), true);
}
#endif
@@ -16126,8 +16132,8 @@
FAssert (pHero != NULL);
FAssert (pHero->getHeroType() >= 0 && pHero->getHeroType()
< GC.getNumHeroInfos());
- GC.getGameINLINE().backUpHeroLegionMember(pHero->getHeroType());
- GC.getGameINLINE().addHeroLegionMember(pHero->getHeroType(), getID());
+ GAME.backUpHeroLegionMember(pHero->getHeroType());
+ GAME.addHeroLegionMember(pHero->getHeroType(), getID());
pHero->processLegion(true, false, false, false);
return true;
@@ -16149,7 +16155,7 @@
{
pHero->setTempCheck(true);
GET_PLAYER(getOwnerINLINE()).pushToJoinLegionTempHeroList(pHero->getID());
- pInfo->addPythonButton(gDLL->getText("TXT_KEY_CHOOSE_LEGION_HELP",
GC.getHeroInfo(pHero->getHeroType()).getDescription(), pHero->getNameKey(),
GET_PLAYER(getOwnerINLINE()).getUnit(GC.getGameINLINE().getHeroCoreTroop(pHero->getHeroType()))->getLevel()), "");
+ pInfo->addPythonButton(gDLL->getText("TXT_KEY_CHOOSE_LEGION_HELP",
GC.getHeroInfo(pHero->getHeroType()).getDescription(), pHero->getNameKey(),
GET_PLAYER(getOwnerINLINE()).getUnit(GAME.getHeroCoreTroop(pHero->getHeroType()))->getLevel()), "");
pHero =
plot()->plotCheck(PUF_canAcceptLegionMember, getOwnerINLINE(), getID(),
NO_PLAYER, NO_TEAM, PUF_isNotTempCheck);
}
@@ -16176,7 +16182,7 @@
FAssert (pHero->getHeroType() >= 0 && pHero->getHeroType() <
GC.getNumHeroInfos());
HeroTypes eLeaderHero = pHero->getLeaderHero();
- int iAdvancedLegionSize = eLeaderHero != NO_HERO ?
GC.getGameINLINE().getHeroLegionSize(eLeaderHero) : 0;
+ int iAdvancedLegionSize = eLeaderHero != NO_HERO ?
GAME.getHeroLegionSize(eLeaderHero) : 0;
CvUnit* pLeaderHero = NULL;
if (eLeaderHero != NO_HERO)
@@ -16191,20 +16197,20 @@
}
}
- GC.getGameINLINE().backUpHeroLegionMember(pHero->getHeroType());
- GC.getGameINLINE().addHeroLegionMember(pHero->getHeroType(),
getID());
+ GAME.backUpHeroLegionMember(pHero->getHeroType());
+ GAME.addHeroLegionMember(pHero->getHeroType(), getID());
pHero->processLegion(true, false, false, false);
if (eLeaderHero != NO_HERO)
{
if (iAdvancedLegionSize > 1)
{
- int iUnitID =
GC.getGameINLINE().getHeroCoreTroop(eLeaderHero);
+ int iUnitID = GAME.getHeroCoreTroop(eLeaderHero);
pHero->joinAdvancedLegion(iUnitID);
}
else
{
- GC.getGameINLINE().addHeroCoreTroop(eLeaderHero,
pHero->getID());
+ GAME.addHeroCoreTroop(eLeaderHero, pHero->getID());
pLeaderHero->formAdvancedLegion(false, true);
}
}
@@ -16226,7 +16232,7 @@
return false;
}
- if ( GC.getGameINLINE().getHeroLegionSize(getHeroType()) == 0)
+ if ( GAME.getHeroLegionSize(getHeroType()) == 0)
{
return false;
}
@@ -16236,21 +16242,21 @@
return false;
}
- FAssert (getID() ==
GC.getGameINLINE().getHeroCoreTroop(getHeroType()));
+ FAssert (getID() == GAME.getHeroCoreTroop(getHeroType()));
if (getUnitCombatType() != pUnit->getUnitCombatType())
{
return false;
}
- if ( GC.getGameINLINE().getHeroLegionSize(getHeroType()) >=
GC.getGameINLINE().getHeroCapacity(getHeroType()))
+ if ( GAME.getHeroLegionSize(getHeroType()) >=
GAME.getHeroCapacity(getHeroType()))
{
return false;
}
- FAssert ( GC.getGameINLINE().getHeroLegionSize(getHeroType()) <
GC.getGameINLINE().getHeroCapacity(getHeroType()));
-
- if (GC.getGameINLINE().isLegionUnitMoved(getHeroType()))
+ FAssert ( GAME.getHeroLegionSize(getHeroType()) <
GAME.getHeroCapacity(getHeroType()));
+
+ if (GAME.isLegionUnitMoved(getHeroType()))
{
return false;
}
@@ -16287,7 +16293,7 @@
return false;
}
- if (GC.getGameINLINE().isLegionUnitMoved(getLegionHero()))
+ if (GAME.isLegionUnitMoved(getLegionHero()))
{
return false;
}
@@ -16297,7 +16303,7 @@
return false;
}
- CvUnit* pHero = GC.getGameINLINE().getHeroUnit(getLegionHero());
+ CvUnit* pHero = GAME.getHeroUnit(getLegionHero());
FAssert (pHero != NULL);
if (pHero->hasMoved())
{
@@ -16309,7 +16315,7 @@
bool CvUnit::quitLegion(bool bAttacked)
{
- CvUnit* pCoreTroop = GC.getGameINLINE().getHeroUnit(getLegionHero());
+ CvUnit* pCoreTroop = GAME.getHeroUnit(getLegionHero());
FAssert (pCoreTroop != NULL);
FAssert (pCoreTroop->getHeroType() >= 0 && pCoreTroop->getHeroType() <
GC.getNumHeroInfos());
@@ -16319,7 +16325,7 @@
if (eLeaderHero != NO_HERO)
{
// if the Army has more than 1 legion, then temp quit army
- if (GC.getGameINLINE().getHeroLegionSize(eLeaderHero) > 1)
+ if (GAME.getHeroLegionSize(eLeaderHero) > 1)
{
pCoreTroop->quitAdvancedLegion(true);
}
@@ -16330,8 +16336,8 @@
}
}
- GC.getGameINLINE().backUpHeroLegionMember(getLegionHero());
- GC.getGameINLINE().deleteHeroLegionMember(getLegionHero(), getID());
+ GAME.backUpHeroLegionMember(getLegionHero());
+ GAME.deleteHeroLegionMember(getLegionHero(), getID());
pCoreTroop = pCoreTroop->processLegion(true, false, false, bAttacked);
if (eLeaderHero != NO_HERO)
@@ -16341,7 +16347,7 @@
if (pLeaderHero == NULL)
{
// if army is not dismissed
- int iUnitID = GC.getGameINLINE().getHeroCoreTroop(eLeaderHero);
+ int iUnitID = GAME.getHeroCoreTroop(eLeaderHero);
FAssert (pCoreTroop != NULL && pCoreTroop->getHeroType() != NO_HERO);
if (!bLeaderTroop)
{
@@ -16469,7 +16475,7 @@
if (bCoreTroop && bLoserCoreTroop && iStartGoldenAgeChancePerLevel > 0)
{
- if (GC.getGameINLINE().getSorenRandNum(100, "Start a Golden Age") <
iStartGoldenAgeChancePerLevel *
(GC.getGameINLINE().getHeroLevel(pLoser->getHeroType())))
+ if (GAME.getSorenRandNum(100, "Start a Golden Age") <
iStartGoldenAgeChancePerLevel * (GAME.getHeroLevel(pLoser->getHeroType())))
{
GET_PLAYER(getOwnerINLINE()).changeGoldenAgeTurns(GET_PLAYER(getOwnerINLINE()).getGoldenAgeLength());
if (isHuman())
@@ -16525,11 +16531,11 @@
{
if (pLoser->isHasPromotion((PromotionTypes)iI))
{
- if
(GC.getGameINLINE().canHeroAcquirePromotion(getHeroType(),
(PromotionTypes)iI, true))
- {
- if
(GC.getGameINLINE().getSorenRandNum(100, "Steal Hero Promotion") <
GC.getDefineINT("HERO_STEAL_PROMOTION_PERCENT"))
- {
-
GC.getGameINLINE().setHeroPromotionStatus(getHeroType(),
(PromotionTypes)iI,
GC.getPromotionInfo((PromotionTypes)iI).getHeroPromotionStatus(), false);
+ if (GAME.canHeroAcquirePromotion(getHeroType(),
(PromotionTypes)iI, true))
+ {
+ if (GAME.getSorenRandNum(100, "Steal Hero
Promotion") < GC.getDefineINT("HERO_STEAL_PROMOTION_PERCENT"))
+ {
+ GAME.setHeroPromotionStatus(getHeroType(),
(PromotionTypes)iI,
GC.getPromotionInfo((PromotionTypes)iI).getHeroPromotionStatus(), false);
if (isHuman())
{
szBuffer =
gDLL->getText("TXT_KEY_HERO_STEALT_PROMOTION",
GC.getHeroInfo(getLegionHero()).getDescription(),
GC.getPromotionInfo((PromotionTypes)iI).getDescription(),
GC.getHeroInfo(pLoser->getLegionHero()).getDescription());
@@ -16553,14 +16559,14 @@
//{
// if (pLoser->getHeroType() == NO_HERO &&
pLoser->getLeaderUnitType() != NO_UNIT)
// {
- // if (GC.getGameINLINE().getSorenRandNum(100, "Convert Warlord")
< iConvertWarlordChance)
+ // if (GAME.getSorenRandNum(100, "Convert Warlord") <
iConvertWarlordChance)
// {
// CvUnit* pWarlord =
GET_PLAYER(getOwnerINLINE()).initUnit(pLoser->getLeaderUnitType(),
getX_INLINE(), getY_INLINE());
// if (pWarlord != NULL)
// {
- //
GC.getGameINLINE().removeGreatPersonBornName(pWarlord->getNameNoDesc());
+ // GAME.removeGreatPersonBornName(pWarlord->getNameNoDesc());
// CvWString szOldName = pLoser->getNameNoDesc();
- // if (GC.getGameINLINE().isGreatPersonBorn(szOldName))
+ // if (GAME.isGreatPersonBorn(szOldName))
// {
// pWarlord->setName(szOldName);
// }
@@ -16584,9 +16590,9 @@
// CvUnit* pWarlord =
GET_PLAYER(pLoser->getOwnerINLINE()).initUnit(pLoser->getLeaderUnitType(),
pLoserCapital->getX_INLINE(), pLoserCapital->getY_INLINE());
// if (pWarlord != NULL)
// {
- //
GC.getGameINLINE().removeGreatPersonBornName(pWarlord->getNameNoDesc());
+ // GAME.removeGreatPersonBornName(pWarlord->getNameNoDesc());
// CvWString szOldName = pLoser->getNameNoDesc();
- // if (GC.getGameINLINE().isGreatPersonBorn(szOldName))
+ // if (GAME.isGreatPersonBorn(szOldName))
// {
// pWarlord->setName(szOldName);
// }
@@ -16651,7 +16657,7 @@
// only capture the enemy if it's not a warlord, not a naked hero,
not a no capture unit, and not a capturable unit whose capture UnitType is
the same as his own UnitType
if ((pLoser->getLeaderUnitType() == NO_UNIT ||
(pLoser->getLeaderUnitType() != NO_UNIT && pLoser->getHeroType() !=
NO_HERO)) && !pLoser->isNakedHero() && !pLoser->isNoCapture() &&
pLoser->getCaptureUnitType(getCivilizationType()) != pLoser->getUnitType())
{
- if (GC.getGameINLINE().getSorenRandNum(100, "Capture Enemy
Unit") < iCaptureEnemyChance)
+ if (GAME.getSorenRandNum(100, "Capture Enemy Unit") <
iCaptureEnemyChance)
{
CvUnit* pNewUnit =
GET_PLAYER(getOwnerINLINE()).initUnit(pLoser->getUnitType(), getX_INLINE(),
getY_INLINE());
pNewUnit->finishMoves();
@@ -16765,7 +16771,7 @@
if (bValid)
{
- iValue = (1 +
GC.getGameINLINE().getSorenRandNum(1000, "Barb Unit Selection"));
+ iValue = (1 + GAME.getSorenRandNum(1000, "Barb
Unit Selection"));
if (iValue > iBestValue)
{
@@ -16789,13 +16795,13 @@
if (isHuman())
{
szBuffer = gDLL->getText("TXT_KEY_HERO_STEAL_CULTURE",
GC.getHeroInfo(getLegionHero()).getDescription());
- gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GC.getGameINLINE().getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_RED"), getX_INLINE(),
getY_INLINE());
+ gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GAME.getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_RED"), getX_INLINE(),
getY_INLINE());
}
if (pLoser->isHuman())
{
szBuffer = gDLL->getText("TXT_KEY_HERO_CULTURE_STEALT",
GC.getHeroInfo(getLegionHero()).getDescription());
-
gDLL->getInterfaceIFace()->addMessage(pLoser->getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GC.getGameINLINE().getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_RED"), pLoser->getX_INLINE(),
pLoser->getY_INLINE());
+
gDLL->getInterfaceIFace()->addMessage(pLoser->getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GAME.getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_RED"), pLoser->getX_INLINE(),
pLoser->getY_INLINE());
}
}
@@ -16803,17 +16809,17 @@
{
if (bLoserCoreTroop)
{
- CvUnit* pUnit =
GET_PLAYER(pLoser->getOwnerINLINE()).getUnit(GC.getGameINLINE().getHeroNextLegionMember(pLoser->getLegionHero(),
pLoser->getID()));
+ CvUnit* pUnit =
GET_PLAYER(pLoser->getOwnerINLINE()).getUnit(GAME.getHeroNextLegionMember(pLoser->getLegionHero(),
pLoser->getID()));
while(pUnit != NULL && pUnit->getID() != pLoser->getID())
{
pUnit->changeTempStrengthModifier(iCoreTroopDefeatedStrengthModifier);
- pUnit =
GET_PLAYER(pLoser->getOwnerINLINE()).getUnit(GC.getGameINLINE().getHeroNextLegionMember(pLoser->getLegionHero(),
pUnit->getID()));
+ pUnit =
GET_PLAYER(pLoser->getOwnerINLINE()).getUnit(GAME.getHeroNextLegionMember(pLoser->getLegionHero(),
pUnit->getID()));
}
if (pLoser->isHuman())
{
szBuffer =
gDLL->getText("TXT_KEY_HERO_CORE_TROOP_DEAD_STRENGTH_BOOST",
GC.getHeroInfo(pLoser->getHeroType()).getDescription());
-
gDLL->getInterfaceIFace()->addMessage(pLoser->getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GC.getGameINLINE().getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_RED"), pLoser->getX_INLINE(),
pLoser->getY_INLINE());
+
gDLL->getInterfaceIFace()->addMessage(pLoser->getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GAME.getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_RED"), pLoser->getX_INLINE(),
pLoser->getY_INLINE());
}
}
}
@@ -16821,17 +16827,17 @@
{
if (bLoserCoreTroop)
{
- CvUnit* pUnit =
GET_PLAYER(pLoser->getOwnerINLINE()).getUnit(GC.getGameINLINE().getHeroNextLegionMember(pLoser->getLegionHero(),
pLoser->getID()));
+ CvUnit* pUnit =
GET_PLAYER(pLoser->getOwnerINLINE()).getUnit(GAME.getHeroNextLegionMember(pLoser->getLegionHero(),
pLoser->getID()));
while(pUnit != NULL && pUnit->getID() != pLoser->getID())
{
pUnit->changeTempStrengthModifier(GC.getDefineINT("HERO_CORE_TROOP_DEFEATED_STRENGTH_DOWN"));
- pUnit =
GET_PLAYER(pLoser->getOwnerINLINE()).getUnit(GC.getGameINLINE().getHeroNextLegionMember(pLoser->getLegionHero(),
pUnit->getID()));
+ pUnit =
GET_PLAYER(pLoser->getOwnerINLINE()).getUnit(GAME.getHeroNextLegionMember(pLoser->getLegionHero(),
pUnit->getID()));
}
- if (pLoser->isHuman() &&
GC.getGameINLINE().getHeroLegionSize(pLoser->getLegionHero()) > 1)
+ if (pLoser->isHuman() &&
GAME.getHeroLegionSize(pLoser->getLegionHero()) > 1)
{
szBuffer =
gDLL->getText("TXT_KEY_HERO_CORE_TROOP_DEAD_STRENGTH_DOWN",
GC.getHeroInfo(pLoser->getHeroType()).getDescription());
-
gDLL->getInterfaceIFace()->addMessage(pLoser->getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GC.getGameINLINE().getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(pLoser->getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_RED"), pLoser->getX_INLINE(),
pLoser->getY_INLINE());
+
gDLL->getInterfaceIFace()->addMessage(pLoser->getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GAME.getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(pLoser->getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_RED"), pLoser->getX_INLINE(),
pLoser->getY_INLINE());
}
}
}
@@ -16841,16 +16847,16 @@
if (bLoserCoreTroop)
{
changeTempStrengthModifier(iDefeatCoreTroopStrengthModifier);
- CvUnit* pUnit =
GET_PLAYER(getOwnerINLINE()).getUnit(GC.getGameINLINE().getHeroNextLegionMember(getLegionHero(),
getID()));
+ CvUnit* pUnit =
GET_PLAYER(getOwnerINLINE()).getUnit(GAME.getHeroNextLegionMember(getLegionHero(),
getID()));
while(pUnit != NULL && pUnit->getID() != getID())
{
pUnit->changeTempStrengthModifier(iDefeatCoreTroopStrengthModifier);
- pUnit =
GET_PLAYER(getOwnerINLINE()).getUnit(GC.getGameINLINE().getHeroNextLegionMember(getLegionHero(),
pUnit->getID()));
+ pUnit =
GET_PLAYER(getOwnerINLINE()).getUnit(GAME.getHeroNextLegionMember(getLegionHero(),
pUnit->getID()));
}
if (isHuman())
{
szBuffer =
gDLL->getText("TXT_KEY_HERO_DEFEAT_CORE_TROOP_STRENGTH_BOOST",
GC.getHeroInfo(pLoser->getHeroType()).getDescription(),
GC.getHeroInfo(getLegionHero()).getDescription());
- gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(),
true, GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GC.getGameINLINE().getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_RED"), getX_INLINE(),
getY_INLINE());
+ gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(),
true, GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GAME.getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_RED"), getX_INLINE(),
getY_INLINE());
}
}
}
@@ -16859,20 +16865,20 @@
{
if (pLoser->getLegionHero() != NO_HERO)
{
- for (iI = 0; iI <
GC.getGameINLINE().getHeroLegionSize(pLoser->getLegionHero()); iI++)
- {
- int iUnitID =
GC.getGameINLINE().getHeroLegionMemberAt(pLoser->getLegionHero(), iI);
+ for (iI = 0; iI < GAME.getHeroLegionSize(pLoser->getLegionHero()); iI++)
+ {
+ int iUnitID = GAME.getHeroLegionMemberAt(pLoser->getLegionHero(), iI);
if (iUnitID != pLoser->getID())
{
- FAssert (
GC.getGameINLINE().getHeroLegionSize(pLoser->getLegionHero()) >= 2);
+ FAssert ( GAME.getHeroLegionSize(pLoser->getLegionHero()) >= 2);
CvUnit* pUnit = GET_PLAYER(pLoser->getOwnerINLINE()).getUnit(iUnitID);
- pUnit->changeExperience(pLoser->getExperience() *
iUponDeathShareExperienceAmount / ((
GC.getGameINLINE().getHeroLegionSize(pLoser->getLegionHero()) - 1) * 100),
-1, false, false, false, NO_TERRAIN, false);
+ pUnit->changeExperience(pLoser->getExperience() *
iUponDeathShareExperienceAmount / ((
GAME.getHeroLegionSize(pLoser->getLegionHero()) - 1) * 100), -1, false,
false, false, NO_TERRAIN, false);
}
}
if (pLoser->isHuman())
{
szBuffer =
gDLL->getText("TXT_KEY_HERO_lEGION_MEMBER_SHARE_EXPERIENCE",
pLoser->getNameKey(),
GC.getHeroInfo(pLoser->getLegionHero()).getDescription());
-
gDLL->getInterfaceIFace()->addMessage(pLoser->getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GC.getGameINLINE().getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(pLoser->getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_RED"), pLoser->getX_INLINE(),
pLoser->getY_INLINE());
+
gDLL->getInterfaceIFace()->addMessage(pLoser->getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GAME.getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(pLoser->getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_RED"), pLoser->getX_INLINE(),
pLoser->getY_INLINE());
}
}
}
@@ -16894,7 +16900,7 @@
}
if (pLoopUnit->isEnemy(getTeam())
&& !pLoopUnit->isDefendFromCharge())
{
- if (GC.getGameINLINE().getSorenRandNum(100, "Scatter
enemy stack") < GC.getDefineINT("HERO_SCATTER_ENEMY_STACK_CHANCE"))
+ if (GAME.getSorenRandNum(100, "Scatter enemy stack") <
GC.getDefineINT("HERO_SCATTER_ENEMY_STACK_CHANCE"))
{
pLoopUnit->joinGroup(NULL);
CvPlot* pLoopPlot;
@@ -16917,7 +16923,7 @@
{
if
(pLoopPlot->isRevealed(pLoopUnit->getTeam(), false))
{
- iValue =
GC.getGameINLINE().getSorenRandNum(10, "Random Plot Value");
+ iValue =
GAME.getSorenRandNum(10, "Random Plot Value");
if (iValue > iBestValue)
{
@@ -16947,17 +16953,17 @@
{
int iCost = pLoser->getUnitInfo().getProductionCost();
- iCost *=
GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getTrainPercent();
+ iCost *=
GC.getGameSpeedInfo(GAME.getGameSpeedType()).getTrainPercent();
iCost /= 100;
- iCost *=
GC.getEraInfo(GC.getGameINLINE().getStartEra()).getTrainPercent();
+ iCost *= GC.getEraInfo(GAME.getStartEra()).getTrainPercent();
iCost /= 100;
if (iCost > 0)
{
int iGold = iCost * iSeaBattleWinPlunderPercent / 100;
- iGold =
std::max(GC.getGameINLINE().getSorenRandNum(iGold, "Random Plunder Gold"),
iGold / 2);
+ iGold = std::max(GAME.getSorenRandNum(iGold, "Random
Plunder Gold"), iGold / 2);
if (iGold > GET_PLAYER(pLoser->getOwnerINLINE()).getGold())
{
iGold = GET_PLAYER(pLoser->getOwnerINLINE()).getGold();
@@ -16969,12 +16975,12 @@
if (isHuman())
{
szBuffer = gDLL->getText("TXT_KEY_HERO_SEA_PLUNDER",
getNameKey(), iGold,
GET_PLAYER(pLoser->getOwnerINLINE()).getCivilizationDescriptionKey());
-
gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GC.getGameINLINE().getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, NULL,
(ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), getX_INLINE(),
getY_INLINE());
+
gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GAME.getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, NULL,
(ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), getX_INLINE(),
getY_INLINE());
}
if (pLoser->isHuman())
{
szBuffer = gDLL->getText("TXT_KEY_HERO_SEA_PLUNDERED",
pLoser->getNameKey(),
GET_PLAYER(pLoser->getOwnerINLINE()).getCivilizationDescriptionKey(),
iGold);
-
gDLL->getInterfaceIFace()->addMessage(pLoser->getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GC.getGameINLINE().getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, NULL, (ColorTypes)GC.getInfoTypeForString("COLOR_RED"),
pLoser->getX_INLINE(), pLoser->getY_INLINE());
+
gDLL->getInterfaceIFace()->addMessage(pLoser->getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GAME.getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, NULL, (ColorTypes)GC.getInfoTypeForString("COLOR_RED"),
pLoser->getX_INLINE(), pLoser->getY_INLINE());
}
}
}
@@ -16986,12 +16992,12 @@
if (isHuman())
{
szBuffer = gDLL->getText("TXT_KEY_HERO_RESTORE_HEALTH",
GC.getHeroInfo(getHeroType()).getDescription());
- gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GC.getGameINLINE().getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), getX_INLINE(),
getY_INLINE());
+ gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GAME.getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), getX_INLINE(),
getY_INLINE());
}
if (pLoser->isHuman())
{
szBuffer = gDLL->getText("TXT_KEY_HERO_RESTORE_HEALTH",
GC.getHeroInfo(getHeroType()).getDescription());
-
gDLL->getInterfaceIFace()->addMessage(pLoser->getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GC.getGameINLINE().getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_RED"), pLoser->getX_INLINE(),
pLoser->getY_INLINE());
+
gDLL->getInterfaceIFace()->addMessage(pLoser->getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GAME.getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_RED"), pLoser->getX_INLINE(),
pLoser->getY_INLINE());
}
}
@@ -17007,7 +17013,7 @@
pUnitNode = pLoser->plot()->nextUnitNode(pUnitNode);
if (pLoopUnit->getLegionHero() == pLoser->getLegionHero())
{
-
pLoopUnit->changeTempStrengthModifier(-GC.getGameINLINE().getSorenRandNum(GC.getDefineINT("HERO_ASSAULT_CORE_TROOP_HEALTH_CHANGE"), "Assault
Random Hit Point Change"));
+
pLoopUnit->changeTempStrengthModifier(-GAME.getSorenRandNum(GC.getDefineINT("HERO_ASSAULT_CORE_TROOP_HEALTH_CHANGE"), "Assault
Random Hit Point Change"));
bAssaulted = true;
}
}
@@ -17016,19 +17022,19 @@
if (isHuman())
{
szBuffer =
gDLL->getText("TXT_KEY_HERO_ASSAULT_CORE_TROOP_HEALTH_CHANGE",
GC.getHeroInfo(getHeroType()).getDescription(),
GC.getHeroInfo(pLoser->getHeroType()).getDescription());
- gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GC.getGameINLINE().getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), getX_INLINE(),
getY_INLINE());
+ gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GAME.getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), getX_INLINE(),
getY_INLINE());
}
if (pLoser->isHuman())
{
szBuffer =
gDLL->getText("TXT_KEY_HERO_ASSAULT_CORE_TROOP_HEALTH_CHANGE",
GC.getHeroInfo(getHeroType()).getDescription(),
GC.getHeroInfo(pLoser->getHeroType()).getDescription());
- gDLL->getInterfaceIFace()->addMessage(pLoser->getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GC.getGameINLINE().getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(pLoser->getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_RED"), pLoser->getX_INLINE(),
pLoser->getY_INLINE());
+ gDLL->getInterfaceIFace()->addMessage(pLoser->getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer,
GC.getEraInfo(GAME.getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_INFO, GC.getHeroInfo(pLoser->getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_RED"), pLoser->getX_INLINE(),
pLoser->getY_INLINE());
}
}
}
if (bCoreTroop && bAttacking && iSecondAttackChance > 0)
{
- if (GC.getGameINLINE().getSorenRandNum(100, "Second Attack Chance") <
iSecondAttackChance)
+ if (GAME.getSorenRandNum(100, "Second Attack Chance") <
iSecondAttackChance)
{
CvUnit* pBestDefender =
pLoserPlot->getBestDefender(pLoser->getOwnerINLINE(), getOwnerINLINE(),
this, true);
if (pBestDefender != pLoser && pBestDefender != NULL &&
getCombatOdds(this, pBestDefender) >
GC.getDefineINT("HERO_SECOND_ATTACK_ODDS") * 10)
@@ -17141,11 +17147,11 @@
{
if (pDefender->isHasPromotion((PromotionTypes)iI))
{
- if
(GC.getGameINLINE().canHeroAcquirePromotion(getHeroType(),
(PromotionTypes)iI, true))
- {
- if
(GC.getGameINLINE().getSorenRandNum(100, "Steal Hero Promotion") <
GC.getDefineINT("HERO_STEAL_PROMOTION_PERCENT"))
- {
-
GC.getGameINLINE().setHeroPromotionStatus(getHeroType(),
(PromotionTypes)iI,
GC.getPromotionInfo((PromotionTypes)iI).getHeroPromotionStatus(), false);
+ if (GAME.canHeroAcquirePromotion(getHeroType(),
(PromotionTypes)iI, true))
+ {
+ if (GAME.getSorenRandNum(100, "Steal Hero
Promotion") < GC.getDefineINT("HERO_STEAL_PROMOTION_PERCENT"))
+ {
+ GAME.setHeroPromotionStatus(getHeroType(),
(PromotionTypes)iI,
GC.getPromotionInfo((PromotionTypes)iI).getHeroPromotionStatus(), false);
CvWString szBuffer =
gDLL->getText("TXT_KEY_HERO_STEALT_PROMOTION",
GC.getHeroInfo(getLegionHero()).getDescription(),
GC.getPromotionInfo((PromotionTypes)iI).getDescription(),
GC.getHeroInfo(pDefender->getLegionHero()).getDescription());
gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), true,
GC.getEVENT_MESSAGE_TIME(), szBuffer, "AS2D_UNIT_GREATPEOPLE",
MESSAGE_TYPE_INFO, GC.getHeroInfo(getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), getX_INLINE(),
getY_INLINE(), true, true);
szBuffer =
gDLL->getText("TXT_KEY_HERO_PROMOTION_STEALT",
GC.getHeroInfo(getLegionHero()).getDescription(),
GC.getPromotionInfo((PromotionTypes)iI).getDescription(),
GC.getHeroInfo(pDefender->getLegionHero()).getDescription());
@@ -17159,11 +17165,11 @@
{
if (isHasPromotion((PromotionTypes)iI))
{
- if
(GC.getGameINLINE().canHeroAcquirePromotion(pDefender->getHeroType(),
(PromotionTypes)iI, true))
- {
- if
(GC.getGameINLINE().getSorenRandNum(100, "Steal Hero Promotion") <
GC.getDefineINT("HERO_STEAL_PROMOTION_PERCENT"))
- {
-
GC.getGameINLINE().setHeroPromotionStatus(pDefender->getHeroType(),
(PromotionTypes)iI,
GC.getPromotionInfo((PromotionTypes)iI).getHeroPromotionStatus(), false);
+ if
(GAME.canHeroAcquirePromotion(pDefender->getHeroType(), (PromotionTypes)iI,
true))
+ {
+ if (GAME.getSorenRandNum(100, "Steal Hero
Promotion") < GC.getDefineINT("HERO_STEAL_PROMOTION_PERCENT"))
+ {
+
GAME.setHeroPromotionStatus(pDefender->getHeroType(), (PromotionTypes)iI,
GC.getPromotionInfo((PromotionTypes)iI).getHeroPromotionStatus(), false);
CvWString szBuffer =
gDLL->getText("TXT_KEY_HERO_STEALT_PROMOTION",
GC.getHeroInfo(pDefender->getLegionHero()).getDescription(),
GC.getPromotionInfo((PromotionTypes)iI).getDescription(),
GC.getHeroInfo(getLegionHero()).getDescription());
gDLL->getInterfaceIFace()->addMessage(pDefender->getOwnerINLINE(), true,
GC.getEVENT_MESSAGE_TIME(), szBuffer, "AS2D_UNIT_GREATPEOPLE",
MESSAGE_TYPE_INFO, GC.getHeroInfo(getLegionHero()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"),
pDefender->getX_INLINE(), pDefender->getY_INLINE(), true, true);
szBuffer =
gDLL->getText("TXT_KEY_HERO_PROMOTION_STEALT",
GC.getHeroInfo(pDefender->getLegionHero()).getDescription(),
GC.getPromotionInfo((PromotionTypes)iI).getDescription(),
GC.getHeroInfo(getLegionHero()).getDescription());
@@ -17180,7 +17186,7 @@
if (getLegionHero() != NO_HERO && bAttackWithSameLegion &&
bAttackerWithdrawal)
{
setTempCheck(true);
- CvUnit* pNextMember =
GET_PLAYER(getOwnerINLINE()).getUnit(GC.getGameINLINE().getHeroNextLegionMember(getLegionHero(),
getID()));
+ CvUnit* pNextMember =
GET_PLAYER(getOwnerINLINE()).getUnit(GAME.getHeroNextLegionMember(getLegionHero(),
getID()));
while (pNextMember->getID() != getID())
{
if (!pNextMember->isTempCheck() &&
plotDistance(pNextMember->getX_INLINE(), pNextMember->getY_INLINE(),
pDefender->getX_INLINE(), pDefender->getY_INLINE()) == 1)
@@ -17192,11 +17198,11 @@
return;
}
}
- pNextMember =
GET_PLAYER(getOwnerINLINE()).getUnit(GC.getGameINLINE().getHeroNextLegionMember(getLegionHero(),
pNextMember->getID()));
- }
- for (iI = 0; iI < GC.getGameINLINE().getHeroLegionSize(getLegionHero());
iI++)
- {
- pNextMember = GET_PLAYER(getOwnerINLINE()).getUnit(
GC.getGameINLINE().getHeroLegionMemberAt(getLegionHero(), iI));
+ pNextMember =
GET_PLAYER(getOwnerINLINE()).getUnit(GAME.getHeroNextLegionMember(getLegionHero(),
pNextMember->getID()));
+ }
+ for (iI = 0; iI < GAME.getHeroLegionSize(getLegionHero()); iI++)
+ {
+ pNextMember = GET_PLAYER(getOwnerINLINE()).getUnit(
GAME.getHeroLegionMemberAt(getLegionHero(), iI));
pNextMember->setTempCheck(false);
}
}
@@ -17227,7 +17233,7 @@
if (pPotentialPlots.size() > 0)
{
- int iRand =
GC.getGameINLINE().getSorenRandNum(pPotentialPlots.size(), "Random Plot
Pick");
+ int iRand = GAME.getSorenRandNum(pPotentialPlots.size(), "Random Plot
Pick");
setXY(pDefender->getX_INLINE(), pDefender->getY_INLINE());
pDefender->setXY(pPotentialPlots[iRand]->getX_INLINE(),
pPotentialPlots[iRand]->getY_INLINE());
return;
@@ -17278,7 +17284,7 @@
for (iter = AdditionalAttackUnits.begin(); iter !=
AdditionalAttackUnits.end(); ++iter)
{
- if (GC.getGameINLINE().getSorenRandNum(100, "Additional Attack") <
(*iter).second.first)
+ if (GAME.getSorenRandNum(100, "Additional Attack") <
(*iter).second.first)
{
CvUnit* pAttackUnit =
GET_PLAYER(getOwnerINLINE()).getUnit((*iter).first);
FAssert (pAttackUnit != NULL);
@@ -17331,7 +17337,7 @@
for (iter = AdditionalAttackUnits.begin(); iter !=
AdditionalAttackUnits.end(); ++iter)
{
- if (GC.getGameINLINE().getSorenRandNum(100, "Additional Attack") <
(*iter).second.first)
+ if (GAME.getSorenRandNum(100, "Additional Attack") <
(*iter).second.first)
{
CvUnit* pAttackUnit =
GET_PLAYER(eDefendPlayer).getUnit((*iter).first);
FAssert (pAttackUnit != NULL);
@@ -17463,9 +17469,9 @@
// fBaseCombatInfluence =
GC.getDefineFLOAT("IDW_BASE_COMBAT_INFLUENCE");
// calculate base multiplier used for all plots
- float fGameSpeedMultiplier = (float)
GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getConstructPercent();
+ float fGameSpeedMultiplier = (float)
GC.getGameSpeedInfo(GAME.getGameSpeedType()).getConstructPercent();
fGameSpeedMultiplier /= 100;
- fGameSpeedMultiplier *=
GC.getEraInfo(GC.getGameINLINE().getStartEra()).getConstructPercent();
+ fGameSpeedMultiplier *=
GC.getEraInfo(GAME.getStartEra()).getConstructPercent();
fGameSpeedMultiplier /= 100;
fGameSpeedMultiplier = sqrt(fGameSpeedMultiplier);
@@ -17475,7 +17481,7 @@
float fExperienceMultiplier = 1.0f + (getExperience() * 0.01f);
if (getHeroType() != NO_HERO)
{
- fExperienceMultiplier += fExperienceMultiplier +
(GC.getGameINLINE().getHeroExperience(getHeroType()) * 0.01f);
+ fExperienceMultiplier += fExperienceMultiplier +
(GAME.getHeroExperience(getHeroType()) * 0.01f);
}
float fWarlordMultiplier = 1.0;
@@ -17680,10 +17686,10 @@
}
}
}
- iUnitDamage = GC.getGameINLINE().getSorenRandNum(bSharpShooter ?
bombardRate() * 2 : bombardRate(), "Bombard damage");//(rand() %
(bombardRate()));
+ iUnitDamage = GAME.getSorenRandNum(bSharpShooter ? bombardRate() * 2 :
bombardRate(), "Bombard damage");//(rand() % (bombardRate()));
}
- if (GC.getGameINLINE().getSorenRandNum(100, "Bombard Accuracy") <=
GC.getDefineINT("HERO_RANGED_BOMBARD_ACCURACY"))
+ if (GAME.getSorenRandNum(100, "Bombard Accuracy") <=
GC.getDefineINT("HERO_RANGED_BOMBARD_ACCURACY"))
{
bTarget = true;
}
@@ -17728,7 +17734,7 @@
}
else if (pPlot->getImprovementType() != NO_IMPROVEMENT)
{
- if (GC.getGameINLINE().getSorenRandNum(bombardRate(), "Bomb - Offense")
>=
GC.getGameINLINE().getSorenRandNum(GC.getImprovementInfo(pPlot->getImprovementType()).getAirBombDefense(), "Bomb
- Defense"))
+ if (GAME.getSorenRandNum(bombardRate(), "Bomb - Offense") >=
GAME.getSorenRandNum(GC.getImprovementInfo(pPlot->getImprovementType()).getAirBombDefense(), "Bomb
- Defense"))
{
szBuffer = gDLL->getText("TXT_KEY_MISC_YOU_UNIT_DESTROYED_IMP",
getNameKey(),
GC.getImprovementInfo(pPlot->getImprovementType()).getTextKeyWide());
gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), true,
GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer, "AS2D_PILLAGE",
MESSAGE_TYPE_INFO, GC.getUnitInfo(getUnitType()).getButton(),
(ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), pPlot->getX_INLINE(),
pPlot->getY_INLINE());
@@ -17880,7 +17886,7 @@
}
}
- if (GC.getGameINLINE().getSorenRandNum(100, "Bombard Accuracy") <=
(bSharpShooter ? 100 : GC.getDefineINT("HERO_RANGED_BOMBARD_ACCURACY")))
+ if (GAME.getSorenRandNum(100, "Bombard Accuracy") <= (bSharpShooter ?
100 : GC.getDefineINT("HERO_RANGED_BOMBARD_ACCURACY")))
{
bTarget = true;
}
@@ -17944,7 +17950,7 @@
{
PROFILE_FUNC();
- CvUnit* pHero = GC.getGameINLINE().getHeroUnit(getLegionHero());
+ CvUnit* pHero = GAME.getHeroUnit(getLegionHero());
FAssert (pHero != NULL);
PlayerTypes eEnemyPlayer;
@@ -17964,7 +17970,7 @@
if (getHeroType() == NO_HERO)
{
// if it's a plain member unit
- GC.getGameINLINE().deleteHeroLegionMember(getLegionHero(),
getID());
+ GAME.deleteHeroLegionMember(getLegionHero(), getID());
setLegionHero(NO_HERO);
}
else
@@ -17982,28 +17988,28 @@
FAssert (eHero >= 0 && eHero < GC.getNumHeroInfos());
CvWString szBuffer;
- int iDieRand = GC.getGameINLINE().getSorenRandNum(100, "Hero Die
Rand");
+ int iDieRand = GAME.getSorenRandNum(100, "Hero Die Rand");
bool bHeroProcessed = false;
CvUnit* pNewCore = NULL;
bool bLegionProcessed = false;
bool bCurrentLeader =
(GC.getHeroInfo(getHeroType()).getLeaderType() ==
GET_PLAYER(getOwnerINLINE()).getLeaderType());
- bool bCurrentCiv =
(GC.getGameINLINE().getCurrentDefaultCivilization(getHeroType()) ==
getCivilizationType());
- bool bHighDeathChance =
GC.getGameINLINE().isOption(GAMEOPTION_HIGH_HERO_DEATH_CHANCE);
+ bool bCurrentCiv =
(GAME.getCurrentDefaultCivilization(getHeroType()) ==
getCivilizationType());
+ bool bHighDeathChance = GAME.isOption(GAMEOPTION_HIGH_HERO_DEATH_CHANCE);
if (iDieRand < ((pEnemy != NULL && pEnemy->isCoreTroop()) ?
std::max(GC.getDefineINT("HERO_DIE_CHANCE") +
std::min((GC.getHeroInfo(pEnemy->getHeroType()).getMight() -
GC.getHeroInfo(eHero).getMight()), 10), 0) * (bHighDeathChance ? 4 : 1) :
GC.getDefineINT("HERO_DIE_CHANCE") * (bHighDeathChance ? 4 : 1)))
{
- if
(!GC.getGameINLINE().isOption(GAMEOPTION_NO_HERO_DEATH_FROM_COMBAT))
+ if (!GAME.isOption(GAMEOPTION_NO_HERO_DEATH_FROM_COMBAT))
{
for (int iI = 0; iI < MAX_PLAYERS; iI++)
{
if (GET_PLAYER((PlayerTypes)iI).isAlive())
{
szBuffer = gDLL->getText("TXT_KEY_MISC_HERO_DIED",
GC.getHeroInfo(eHero).getDescription());
- gDLL->getInterfaceIFace()->addMessage(((PlayerTypes)iI), false,
GC.getEVENT_MESSAGE_TIME(), szBuffer,
GC.getEraInfo(GC.getGameINLINE().getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_MAJOR_EVENT);
+ gDLL->getInterfaceIFace()->addMessage(((PlayerTypes)iI), false,
GC.getEVENT_MESSAGE_TIME(), szBuffer,
GC.getEraInfo(GAME.getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_MAJOR_EVENT);
}
}
- GC.getGameINLINE().doHeroDeath(eHero, false);
+ GAME.doHeroDeath(eHero, false);
bHeroProcessed = true;
bLegionProcessed = true;
@@ -18016,7 +18022,7 @@
if ((GET_PLAYER(eEnemyPlayer).isBarbarian()) ? true
: (iDieRand < ((pEnemy != NULL && pEnemy->isCoreTroop()) ?
(std::max(1, GC.getDefineINT("HERO_ESCAPE_CHANCE") + std::min(20,
GC.getHeroInfo(eHero).getMight() -
GC.getHeroInfo(pEnemy->getHeroType()).getMight()))) :
GC.getDefineINT("HERO_ESCAPE_CHANCE"))))
{
- bool bOneUnitLegion =
(GC.getGameINLINE().getHeroLegionSize(eHero) == 1);
+ bool bOneUnitLegion = (GAME.getHeroLegionSize(eHero) == 1);
quitLegion(true);
if (bOneUnitLegion)
{
@@ -18024,7 +18030,7 @@
}
else
{
- pNewCore = GC.getGameINLINE().getHeroUnit(eHero);
+ pNewCore = GAME.getHeroUnit(eHero);
}
bLegionProcessed = true;
@@ -18040,7 +18046,7 @@
// if there's fightable own units on the same plot,
stay here for a second chance
if (!plot()->isWater() &&
plot()->plotCount(PUF_isPlayer, getOwnerINLINE(), -1, NO_PLAYER, NO_TEAM,
PUF_canDefend) > 1)
{
- CvUnit* pNewHero =
GET_PLAYER(getOwnerINLINE()).initHero(eHero, plot()->getX_INLINE(),
plot()->getY_INLINE(), GC.getGameINLINE().getHeroDebutStatus(eHero) !=
getOwnerINLINE());
+ CvUnit* pNewHero =
GET_PLAYER(getOwnerINLINE()).initHero(eHero, plot()->getX_INLINE(),
plot()->getY_INLINE(), GAME.getHeroDebutStatus(eHero) != getOwnerINLINE());
pNewHero->finishMoves();
bHeroProcessed = true;
}
@@ -18049,7 +18055,7 @@
CvCity* pCapital =
GET_PLAYER(getOwnerINLINE()).getCapitalCity();
if (pCapital)
{
- CvUnit* pNewHero;
+ CvUnit* pNewHero = NULL;
// flee to nearest city, or already at capital
while not attacking, which means capital has fallen, then surrender if we
have only 1 city left
if (!atPlot(pCapital->plot()) ||
GET_PLAYER(getOwnerINLINE()).getNumCities() > 1)
{
@@ -18069,11 +18075,11 @@
iY = pNearestCity->getY_INLINE();
}
- pNewHero = GET_PLAYER(getOwnerINLINE()).initHero(eHero, iX, iY,
GC.getGameINLINE().getHeroDebutStatus(eHero) != getOwnerINLINE());
- }
+ pNewHero = GET_PLAYER(getOwnerINLINE()).initHero(eHero, iX, iY,
GAME.getHeroDebutStatus(eHero) != getOwnerINLINE());
+ }
else if (bAttacking)
{
- pNewHero = GET_PLAYER(getOwnerINLINE()).initHero(eHero,
plot()->getX_INLINE(), plot()->getY_INLINE(),
GC.getGameINLINE().getHeroDebutStatus(eHero) != getOwnerINLINE());
+ pNewHero = GET_PLAYER(getOwnerINLINE()).initHero(eHero,
plot()->getX_INLINE(), plot()->getY_INLINE(),
GAME.getHeroDebutStatus(eHero) != getOwnerINLINE());
}
if (pNewHero != NULL)
{
@@ -18085,8 +18091,8 @@
if (bHeroProcessed)
{
szBuffer =
gDLL->getText("TXT_KEY_MISC_HERO_ESCAPED",
GC.getHeroInfo(eHero).getDescription());
-
gDLL->getInterfaceIFace()->addMessage(eEnemyPlayer, false,
GC.getEVENT_MESSAGE_TIME(), szBuffer,
GC.getEraInfo(GC.getGameINLINE().getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_MAJOR_EVENT);
-
gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), false,
GC.getEVENT_MESSAGE_TIME(), szBuffer,
GC.getEraInfo(GC.getGameINLINE().getCurrentEra()).getAudioUnitVictoryScript(),
MESSAGE_TYPE_MAJOR_EVENT);
+
gDLL->getInterfaceIFace()->addMessage(eEnemyPlayer, false,
GC.getEVENT_MESSAGE_TIME(), szBuffer,
GC.getEraInfo(GAME.getCurrentEra()).getAudioUnitDefeatScript(),
MESSAGE_TYPE_MAJOR_EVENT);
+
gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), false,
GC.getEVENT_MESSAGE_TIME(), szBuffer,
GC.getEraInfo(GAME.getCurrentEra()).getAudioUnitVictoryScript(),
MESSAGE_TYPE_MAJOR_EVENT);
int iWoundChance = GC.getDefineINT("HERO_WOUND_CHANCE");
***The diff for this file has been truncated for email.***
=======================================
--- /trunk/The History of Three Kingdoms/CvGameCoreDLL/CyPlayer.cpp Sun Sep
27 18:36:06 2009
+++ /trunk/The History of Three Kingdoms/CvGameCoreDLL/CyPlayer.cpp Thu Oct
15 05:02:19 2009
@@ -2392,6 +2392,15 @@
{
return m_pPlayer ? new CyUnit(m_pPlayer->initHero((HeroTypes)eHero, iX,
iY, bUpdateMaintenance)) : NULL;
}
+
+python::tuple CyPlayer::findXY(bool bUnitOnly)
+{
+ int iX = -1, iY = -1;
+ if (m_pPlayer)
+ m_pPlayer->findXY(&iX, &iY, bUnitOnly);
+ python::tuple tup=python::make_tuple(iX, iY);
+ return tup;
+}
// Sanguo Mod Hero, end
// Sanguo Mod Hero, join legion, start, by poyuzhe 09.14.08
=======================================
--- /trunk/The History of Three Kingdoms/CvGameCoreDLL/CyPlayer.h Sun Sep
27 18:36:06 2009
+++ /trunk/The History of Three Kingdoms/CvGameCoreDLL/CyPlayer.h Thu Oct
15 05:02:19 2009
@@ -548,6 +548,7 @@
void executeHero(int /*HeroTypes*/ eHero);
void releaseHero(int /*HeroTypes*/ eHero);
CyUnit* initHero(int /*HeroTypes*/ eHero, int iX, int iY, bool
bUpdateMaintenance);
+ python::tuple findXY(bool bUnitOnly);
// Sanguo Mod Hero, end
// Sanguo Mod Hero, join legion, start, by poyuzhe 09.14.08
=======================================
--- /trunk/The History of Three
Kingdoms/CvGameCoreDLL/CyPlayerInterface2.cpp Sun Sep 27 18:36:06 2009
+++ /trunk/The History of Three
Kingdoms/CvGameCoreDLL/CyPlayerInterface2.cpp Thu Oct 15 05:02:19 2009
@@ -95,6 +95,7 @@
.def("executeHero", &CyPlayer::executeHero, "void (int /*HeroTypes*/
eHero)")
.def("releaseHero", &CyPlayer::releaseHero, "void (int /*HeroTypes*/
eHero)")
.def("initHero", &CyPlayer::initHero,
python::return_value_policy<python::manage_new_object>(), "CyUnit*
initHero(int /*HeroTypes*/ eHero, int iX, int iY, bool bUpdateMaintenance)")
+ .def("findXY", &CyPlayer::findXY, "tuple(int iX, int iY) (bool
bUnitOnly) - gets the X and Y to initial a hero/unit")
// Sanguo Mod Hero, end
// Sanguo Mod Hero, join legion, start, by poyuzhe 09.14.08
=======================================
--- /trunk/The History of Three Kingdoms/Documents/changelog.txt Wed Oct 7
20:41:24 2009
+++ /trunk/The History of Three Kingdoms/Documents/changelog.txt Thu Oct 15
05:02:19 2009
@@ -1091,3 +1091,13 @@
0.305: ÐÞÕý£ºÐÞÕý¼¸¸öCTD
ÐÞÕý¼¯ÍžüÖÐÆÕͨӢÐÛÎÞ·¨Õý³£»ñµÃÇ×ÎÀ¶Ó½úÉýµÄBug
+
+0.306: ÐÞÕý£ºÐÞÕýÕ¼Áì³ÇÊеÄCTDÎÊÌâ
+ ÐÞÕý¹ÍÓ¶ÆÁÄ»¼à½ûÖеÄÓ¢ÐÛÒ²ÏÔʾ¿É¹ÍÓõÄBug
+ ÐÞÕýÖ»ÓÐÒ»¸öµ¥Î»µÄ¼¯ÍžüÑ¡Ôñ¾Å±ä½úÉýµ¼Ö¼¯Ížü½âÉ¢µÄBug
+ ÐÞÕý194ADµØÍ¼²¿·ÖÓ¢ÐÛ³õʼ»¯´íÎó
+
+0.307: ÐÞÕý£ºÓÀÔ¶ÕæÕýÍêÈ«ÐÞÕýÕ¼Áì³ÇÊÐCTDÎÊÌâ
+ ÐÞÕýCAR ModÖдò´íÁË×Öµ¼ÖµÄCTD
+ ¹æÔòµ÷Õû£ºÓ¢ÐÛ¿ÉÒÔÔÚÈκεØÐÎÐÐ×ß
+ ÔÚÎÞ³ÇÊÐÕæÊµµØÍ¼¾çÇé³õʼÁìÐäÓ¢ÐÛ×Ô¶¯¼ÓÈëÊÆÁ¦
=======================================
--- /trunk/The History of Three Kingdoms/Documents/changelog_en.txt Wed
Oct 7 20:41:24 2009
+++ /trunk/The History of Three Kingdoms/Documents/changelog_en.txt Thu Oct
15 05:02:19 2009
@@ -1,3 +1,13 @@
+0.307: fix: fix the capture last city CTD bug once and for all
+ fix a type-induced CTD in CAR Mod
+ rule tweak: heroes can now walk all terrain
+ on no city scenarios the initial leader hero will join faction at start
+
+0.306: fix: fix a bug when capture the last city of an enemy CTD may occur
+ fix a screen bug a captured hero displayed as recruitable
+ fix a bug when there's only one unit in army, selecting nine
transformation promotion results in army dismissed
+ fix a bug in 194AD map some heroes do not appear properly
+
0.305: fix: fix few CTDs
fix a bug a non-guardian member hero in an Army cannot acquire core
troop promotion as usual.