codesite...@google.com
unread,Dec 4, 2008, 9:54:18 AM12/4/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sanguom...@googlegroups.com
Author: tongshen.martin
Date: Thu Dec 4 06:51:56 2008
New Revision: 113
Modified:
trunk/Sanguo Rand/Assets/XML/BasicInfos/CIV4UnitAIInfos.xml
trunk/Sanguo Rand/Assets/XML/Civilizations/CIV4LeaderHeadInfos.xml
trunk/Sanguo Rand/Assets/XML/GameInfo/CIV4GameInfoSchema.xml
trunk/Sanguo Rand/Assets/XML/GameInfo/CIV4SpecialistInfos.xml
trunk/Sanguo Rand/Assets/XML/GlobalDefinesAlt.xml
trunk/Sanguo Rand/Assets/XML/Text/CIV4GameTextInfos.xml
trunk/Sanguo Rand/Assets/XML/Text/Civ4GameText_Generalname.xml
trunk/Sanguo Rand/Assets/XML/Units/CIV4UnitInfos.xml
trunk/Sanguo Rand/SDK files/CvCity.cpp
trunk/Sanguo Rand/SDK files/CvEnums.h
trunk/Sanguo Rand/SDK files/CvGameCoreUtils.cpp
trunk/Sanguo Rand/SDK files/CvGameTextMgr.cpp
trunk/Sanguo Rand/SDK files/CvInfos.cpp
trunk/Sanguo Rand/SDK files/CvInfos.h
trunk/Sanguo Rand/SDK files/CvPlayer.cpp
trunk/Sanguo Rand/SDK files/CvPlayerAI.cpp
trunk/Sanguo Rand/SDK files/CvPlayerAI.h
trunk/Sanguo Rand/SDK files/CvSelectionGroupAI.cpp
trunk/Sanguo Rand/SDK files/CvTeam.cpp
trunk/Sanguo Rand/SDK files/CvTeamAI.cpp
trunk/Sanguo Rand/SDK files/CvUnitAI.cpp
trunk/Sanguo Rand/SDK files/CvUnitAI.h
trunk/Sanguo Rand/SDK files/CyEnumsInterface.cpp
trunk/Sanguo Rand/SDK files/CyInfoInterface1.cpp
trunk/Sanguo Rand/SDK files/CyTeam.cpp
trunk/Sanguo Rand/SDK files/CyTeam.h
trunk/Sanguo Rand/SDK files/CyTeamInterface.cpp
trunk/Sanguo Rand/changelog.txt
Log:
0.088:实现了除行宫和投票功能之外的皇帝功能
测试后发现还存在不少问题
Modified: trunk/Sanguo Rand/Assets/XML/BasicInfos/CIV4UnitAIInfos.xml
==============================================================================
--- trunk/Sanguo Rand/Assets/XML/BasicInfos/CIV4UnitAIInfos.xml (original)
+++ trunk/Sanguo Rand/Assets/XML/BasicInfos/CIV4UnitAIInfos.xml Thu Dec 4
06:51:56 2008
@@ -174,5 +174,9 @@
<Type>UNITAI_CAMP</Type>
<Description>UNITAI_CAMP</Description>
</UnitAIInfo>
+ <UnitAIInfo>
+ <Type>UNITAI_EMPEROR</Type>
+ <Description>UNITAI_CAMP</Description>
+ </UnitAIInfo>
</UnitAIInfos>
</Civ4UnitAIInfos>
Modified: trunk/Sanguo Rand/Assets/XML/Civilizations/CIV4LeaderHeadInfos.xml
==============================================================================
--- trunk/Sanguo Rand/Assets/XML/Civilizations/CIV4LeaderHeadInfos.xml
(original)
+++ trunk/Sanguo Rand/Assets/XML/Civilizations/CIV4LeaderHeadInfos.xml Thu
Dec 4 06:51:56 2008
@@ -236,7 +236,7 @@
<iBuildUnitProb>30</iBuildUnitProb>
<iBaseAttackOddsChange>0</iBaseAttackOddsChange>
<iAttackOddsChangeRand>8</iAttackOddsChangeRand>
- <iHasHolyCityAttitudeChange>0</iHasHolyCityAttitudeChange>
+ <iHasHolyCityAttitudeChange>-2</iHasHolyCityAttitudeChange>
<iShareWorstEnemyAttitudeChange>0</iShareWorstEnemyAttitudeChange>
<iSharePowerfulEnemyAttitudeChange>0</iSharePowerfulEnemyAttitudeChange>
<iSimilarRankAttitudeChange>0</iSimilarRankAttitudeChange>
@@ -804,7 +804,7 @@
<iBuildUnitProb>30</iBuildUnitProb>
<iBaseAttackOddsChange>0</iBaseAttackOddsChange>
<iAttackOddsChangeRand>8</iAttackOddsChangeRand>
- <iHasHolyCityAttitudeChange>0</iHasHolyCityAttitudeChange>
+ <iHasHolyCityAttitudeChange>-2</iHasHolyCityAttitudeChange>
<iShareWorstEnemyAttitudeChange>0</iShareWorstEnemyAttitudeChange>
<iSharePowerfulEnemyAttitudeChange>0</iSharePowerfulEnemyAttitudeChange>
<iSimilarRankAttitudeChange>0</iSimilarRankAttitudeChange>
@@ -1370,7 +1370,7 @@
<iBuildUnitProb>40</iBuildUnitProb>
<iBaseAttackOddsChange>0</iBaseAttackOddsChange>
<iAttackOddsChangeRand>8</iAttackOddsChangeRand>
- <iHasHolyCityAttitudeChange>0</iHasHolyCityAttitudeChange>
+ <iHasHolyCityAttitudeChange>-2</iHasHolyCityAttitudeChange>
<iShareWorstEnemyAttitudeChange>0</iShareWorstEnemyAttitudeChange>
<iSharePowerfulEnemyAttitudeChange>0</iSharePowerfulEnemyAttitudeChange>
<iSimilarRankAttitudeChange>0</iSimilarRankAttitudeChange>
@@ -1951,7 +1951,7 @@
<iBuildUnitProb>30</iBuildUnitProb>
<iBaseAttackOddsChange>2</iBaseAttackOddsChange>
<iAttackOddsChangeRand>8</iAttackOddsChangeRand>
- <iHasHolyCityAttitudeChange>0</iHasHolyCityAttitudeChange>
+ <iHasHolyCityAttitudeChange>-2</iHasHolyCityAttitudeChange>
<iShareWorstEnemyAttitudeChange>0</iShareWorstEnemyAttitudeChange>
<iSharePowerfulEnemyAttitudeChange>0</iSharePowerfulEnemyAttitudeChange>
<iSimilarRankAttitudeChange>0</iSimilarRankAttitudeChange>
Modified: trunk/Sanguo Rand/Assets/XML/GameInfo/CIV4GameInfoSchema.xml
==============================================================================
--- trunk/Sanguo Rand/Assets/XML/GameInfo/CIV4GameInfoSchema.xml (original)
+++ trunk/Sanguo Rand/Assets/XML/GameInfo/CIV4GameInfoSchema.xml Thu Dec 4
06:51:56 2008
@@ -963,6 +963,7 @@
<ElementType name="iGreatPeopleRateChange" content="textOnly"
dt:type="int"/>
<!-- Sanguo Mod Emperor, start, by poyuzhe 12.02.08 -->
+ <ElementType name="DefaultUnitClass" content="textOnly"/>
<ElementType name="bEmperor" content="textOnly" dt:type="boolean"/>
<ElementType name="iThemWarWearinessModifier" content="textOnly"
dt:type="int"/>
<!-- Sanguo Mod Emperor, end -->
@@ -989,6 +990,7 @@
<element type="iOrderPriority" minOccurs="0"/>
<element type="Button" maxOccurs="*"/>
<!-- Sanguo Mod Emperor, start, by poyuzhe 12.02.08 -->
+ <element type="DefaultUnitClass"/>
<element type="bEmperor" minOccurs="0"/>
<element type="iGreatPeopleRateModifier" minOccurs="0"/>
<element type="iThemWarWearinessModifier" minOccurs="0"/>
Modified: trunk/Sanguo Rand/Assets/XML/GameInfo/CIV4SpecialistInfos.xml
==============================================================================
--- trunk/Sanguo Rand/Assets/XML/GameInfo/CIV4SpecialistInfos.xml (original)
+++ trunk/Sanguo Rand/Assets/XML/GameInfo/CIV4SpecialistInfos.xml Thu Dec
4 06:51:56 2008
@@ -30,6 +30,7 @@
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>Art/Interface/MainScreen/CityScreen/Citizen.dds</Button>
+ <DefaultUnitClass>NONE</DefaultUnitClass>
</SpecialistInfo>
<SpecialistInfo>
<Type>SPECIALIST_PRIEST</Type>
@@ -59,6 +60,7 @@
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>Art/Interface/MainScreen/CityScreen/Priest.dds</Button>
+ <DefaultUnitClass>NONE</DefaultUnitClass>
</SpecialistInfo>
<SpecialistInfo>
<Type>SPECIALIST_ARTIST</Type>
@@ -84,6 +86,7 @@
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>Art/Interface/MainScreen/CityScreen/Artist.dds</Button>
+ <DefaultUnitClass>NONE</DefaultUnitClass>
</SpecialistInfo>
<SpecialistInfo>
<Type>SPECIALIST_SCIENTIST</Type>
@@ -109,6 +112,7 @@
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>Art/Interface/MainScreen/CityScreen/scientist.dds</Button>
+ <DefaultUnitClass>NONE</DefaultUnitClass>
</SpecialistInfo>
<SpecialistInfo>
<Type>SPECIALIST_MERCHANT</Type>
@@ -134,6 +138,7 @@
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>Art/Interface/MainScreen/CityScreen/merchant.dds</Button>
+ <DefaultUnitClass>NONE</DefaultUnitClass>
</SpecialistInfo>
<SpecialistInfo>
<Type>SPECIALIST_ENGINEER</Type>
@@ -159,6 +164,7 @@
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>Art/Interface/MainScreen/CityScreen/engineer.dds</Button>
+ <DefaultUnitClass>NONE</DefaultUnitClass>
</SpecialistInfo>
<SpecialistInfo>
<Type>SPECIALIST_SPY</Type>
@@ -185,6 +191,7 @@
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>,Art/Interface/Buttons/TechTree/Corporation.dds,Art/Interface/Buttons/Beyond_the_Sword_Atlas.dds,5,14</Button>
+ <DefaultUnitClass>NONE</DefaultUnitClass>
</SpecialistInfo>
<SpecialistInfo>
<Type>SPECIALIST_GREAT_PRIEST</Type>
@@ -214,6 +221,7 @@
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>Art/Interface/MainScreen/CityScreen/Great_Priest.dds</Button>
+ <DefaultUnitClass>UNITCLASS_PROPHET</DefaultUnitClass>
</SpecialistInfo>
<SpecialistInfo>
<Type>SPECIALIST_GREAT_ARTIST</Type>
@@ -239,6 +247,7 @@
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>Art/Interface/MainScreen/CityScreen/Great_Artist.dds</Button>
+ <DefaultUnitClass>UNITCLASS_ARTIST</DefaultUnitClass>
</SpecialistInfo>
<SpecialistInfo>
<Type>SPECIALIST_GREAT_SCIENTIST</Type>
@@ -268,6 +277,7 @@
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>Art/Interface/MainScreen/CityScreen/Great_Scientist.dds</Button>
+ <DefaultUnitClass>UNITCLASS_SCIENTIST</DefaultUnitClass>
</SpecialistInfo>
<SpecialistInfo>
<Type>SPECIALIST_GREAT_MERCHANT</Type>
@@ -297,6 +307,7 @@
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>Art/Interface/MainScreen/CityScreen/Great_Merchant.dds</Button>
+ <DefaultUnitClass>UNITCLASS_MERCHANT</DefaultUnitClass>
</SpecialistInfo>
<SpecialistInfo>
<Type>SPECIALIST_GREAT_ENGINEER</Type>
@@ -326,6 +337,7 @@
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>Art/Interface/MainScreen/CityScreen/Great_Engineer.dds</Button>
+ <DefaultUnitClass>UNITCLASS_ENGINEER</DefaultUnitClass>
</SpecialistInfo>
<SpecialistInfo>
<Type>SPECIALIST_GREAT_GENERAL</Type>
@@ -355,6 +367,7 @@
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>,Art/Interface/MainScreen/CityScreen/Great_Engineer.dds,Art/Interface/Buttons/Warlords_Atlas_2.dds,2,6</Button>
+ <DefaultUnitClass>UNITCLASS_GREAT_GENERAL</DefaultUnitClass>
</SpecialistInfo>
<SpecialistInfo>
<Type>SPECIALIST_GREAT_SPY</Type>
@@ -381,6 +394,7 @@
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>,Art/Interface/Buttons/TechTree/Corporation.dds,Art/Interface/Buttons/Beyond_the_Sword_Atlas.dds,6,14</Button>
+ <DefaultUnitClass>UNITCLASS_GREAT_SPY</DefaultUnitClass>
</SpecialistInfo>
<SpecialistInfo>
<Type>SPECIALIST_EMPEROR</Type>
@@ -402,6 +416,7 @@
<bCtrlDown>0</bCtrlDown>
<iHotKeyPriority>0</iHotKeyPriority>
<Button>,Art/Interface/Buttons/TechTree/Corporation.dds,Art/Interface/Buttons/Beyond_the_Sword_Atlas.dds,6,14</Button>
+ <DefaultUnitClass>UNITCLASS_EMPEROR</DefaultUnitClass>
<bEmperor>1</bEmperor>
<iGreatPeopleRateModifier>50</iGreatPeopleRateModifier>
<iThemWarWearinessModifier>50</iThemWarWearinessModifier>
Modified: trunk/Sanguo Rand/Assets/XML/GlobalDefinesAlt.xml
==============================================================================
--- trunk/Sanguo Rand/Assets/XML/GlobalDefinesAlt.xml (original)
+++ trunk/Sanguo Rand/Assets/XML/GlobalDefinesAlt.xml Thu Dec 4 06:51:56
2008
@@ -11,7 +11,7 @@
</Define>
<Define>
<DefineName>START_YEAR</DefineName>
- <iDefineIntVal>196</iDefineIntVal>
+ <iDefineIntVal>186</iDefineIntVal>
</Define>
<Define>
<DefineName>MAX_CIVIC_OPTIONS</DefineName>
@@ -100,5 +100,9 @@
<Define>
<DefineName>EMPEROR_DECLARE_WAR_THEM_ATTITUDE_THRESHOLD_CHANGE</DefineName>
<iDefineIntVal>1</iDefineIntVal>
+ </Define>
+ <Define>
+ <DefineName>EMPEROR_DEFENSIVE_POWER_MODIFIER</DefineName>
+ <iDefineIntVal>20</iDefineIntVal>
</Define>
</Civ4Defines>
Modified: trunk/Sanguo Rand/Assets/XML/Text/CIV4GameTextInfos.xml
==============================================================================
--- trunk/Sanguo Rand/Assets/XML/Text/CIV4GameTextInfos.xml (original)
+++ trunk/Sanguo Rand/Assets/XML/Text/CIV4GameTextInfos.xml Thu Dec 4
06:51:56 2008
@@ -10492,4 +10492,22 @@
<L1 /><L2 /><L3 /><L4 />
<Chinese>[ICON_BULLET]%D1%%[ICON_GREATPEOPLE] ��Գ���ΰ��</Chinese>
</TEXT>
+ <TEXT>
+ <Tag>TXT_KEY_MISC_ATTITUDE_EMPEROR_GOOD_RELIGION</Tag>
+ <English>%D1: "You are a loyal servant of Han Dynasty."</English>
+<L1 /><L2 /><L3 /><L4 />
+ <Chinese>%D1: "�����ڴ����"</Chinese>
+ </TEXT>
+ <TEXT>
+ <Tag>TXT_KEY_MISC_ATTITUDE_EMPEROR_NON_GOOD_RELIGION</Tag>
+ <English>%D1: "You are not a loyal servant of Han Dynasty."</English>
+<L1 /><L2 /><L3 /><L4 />
+ <Chinese>%D1: "�㲻���ڴ����"</Chinese>
+ </TEXT>
+ <TEXT>
+ <Tag>TXT_KEY_MISC_ATTITUDE_EMPEROR</Tag>
+ <English>%D1: "The emperor is on your side."</English>
+<L1 /><L2 /><L3 /><L4 />
+ <Chinese>%D1: "��ӭ���˴����ӡ�"</Chinese>
+ </TEXT>
</Civ4GameText>
Modified: trunk/Sanguo Rand/Assets/XML/Text/Civ4GameText_Generalname.xml
==============================================================================
--- trunk/Sanguo Rand/Assets/XML/Text/Civ4GameText_Generalname.xml
(original)
+++ trunk/Sanguo Rand/Assets/XML/Text/Civ4GameText_Generalname.xml Thu Dec
4 06:51:56 2008
@@ -1468,5 +1468,11 @@
<English>Shu Shuang</English>
<L1 /><L2 /><L3 /><L4 />
<Chinese>��˫</Chinese>
- </TEXT>
+ </TEXT>
+ <TEXT>
+ <Tag>TXT_KEY_GREAT_PERSON_HAN_XIAN_DI</Tag>
+ <English>Emperor XianDi</English>
+<L1 /><L2 /><L3 /><L4 />
+ <Chinese>����</Chinese>
+ </TEXT>
</Civ4GameText>
Modified: trunk/Sanguo Rand/Assets/XML/Units/CIV4UnitInfos.xml
==============================================================================
--- trunk/Sanguo Rand/Assets/XML/Units/CIV4UnitInfos.xml (original)
+++ trunk/Sanguo Rand/Assets/XML/Units/CIV4UnitInfos.xml Thu Dec 4
06:51:56 2008
@@ -22657,7 +22657,7 @@
<Capture>UNITCLASS_EMPEROR</Capture>
<Combat>NONE</Combat>
<Domain>DOMAIN_LAND</Domain>
- <DefaultUnitAI>UNITAI_MERCHANT</DefaultUnitAI>
+ <DefaultUnitAI>UNITAI_EMPEROR</DefaultUnitAI>
<Invisible>NONE</Invisible>
<SeeInvisible>NONE</SeeInvisible>
<Description>TXT_KEY_UNIT_EMPEROR</Description>
@@ -22706,7 +22706,7 @@
<FlankingStrikes/>
<UnitAIs>
<UnitAI>
- <UnitAIType>UNITAI_MERCHANT</UnitAIType>
+ <UnitAIType>UNITAI_EMPEROR</UnitAIType>
<bUnitAI>1</bUnitAI>
</UnitAI>
</UnitAIs>
Modified: trunk/Sanguo Rand/SDK files/CvCity.cpp
==============================================================================
--- trunk/Sanguo Rand/SDK files/CvCity.cpp (original)
+++ trunk/Sanguo Rand/SDK files/CvCity.cpp Thu Dec 4 06:51:56 2008
@@ -3883,6 +3883,17 @@
if (iChange == 1)
{
GET_TEAM(getTeam()).setHasEmperor(true);
+ CvCity* pOldCapital =
GET_PLAYER(getOwnerINLINE()).getCapitalCity();
+ BuildingTypes eCapitalBuilding =
((BuildingTypes)(GC.getCivilizationInfo(GET_PLAYER(getOwnerINLINE()).getCivilizationType()).getCivilizationBuildings(GC.getDefineINT("CAPITAL_BUILDINGCLASS"))));
+ if (eCapitalBuilding != NO_BUILDING)
+ {
+ if (pOldCapital != NULL)
+ {
+ pOldCapital->setNumRealBuilding(eCapitalBuilding, 0);
+ }
+
FAssertMsg(!(getNumRealBuilding(eCapitalBuilding)), "(getNumRealBuilding(eCapitalBuilding))
did not return false as expected");
+ setNumRealBuilding(eCapitalBuilding, 1);
+ }
}
else if (iChange == -1)
{
Modified: trunk/Sanguo Rand/SDK files/CvEnums.h
==============================================================================
--- trunk/Sanguo Rand/SDK files/CvEnums.h (original)
+++ trunk/Sanguo Rand/SDK files/CvEnums.h Thu Dec 4 06:51:56 2008
@@ -1314,6 +1314,8 @@
// Sanguo Mod Civilization Trait, start, by poyuzhe 11.25.08
// Zhang Yang, TRAIT_FOREIGNER
UNITAI_CAMP,
+ // Emperor, added by poyuzhe 12.04.08
+ UNITAI_EMPEROR,
// Sanguo Mod Civilization Trait, end
#ifdef _USRDLL
Modified: trunk/Sanguo Rand/SDK files/CvGameCoreUtils.cpp
==============================================================================
--- trunk/Sanguo Rand/SDK files/CvGameCoreUtils.cpp (original)
+++ trunk/Sanguo Rand/SDK files/CvGameCoreUtils.cpp Thu Dec 4 06:51:56 2008
@@ -2248,6 +2248,8 @@
// Sanguo Mod Civilization Trait, start, by poyuzhe 11.25.08
// Zhang Yang, TRAIT_FOREIGNER
case UNITAI_CAMP: szString = L"camp"; break;
+ // Emperor, added by poyuzhe 12.04.08
+ case UNITAI_EMPEROR: szString = L"emperor"; break;
// Sanguo Mod Civilization Trait, end
default: szString = CvWString::format(L"unknown(%d)", eUnitAI); break;
Modified: trunk/Sanguo Rand/SDK files/CvGameTextMgr.cpp
==============================================================================
--- trunk/Sanguo Rand/SDK files/CvGameTextMgr.cpp (original)
+++ trunk/Sanguo Rand/SDK files/CvGameTextMgr.cpp Thu Dec 4 06:51:56 2008
@@ -10699,6 +10699,32 @@
}
// Sanguo Mod Official Belief, end
+ // Sanguo Mod Emperor, start, by poyuzhe 12.04.08
+ iAttitudeChange =
kPlayer.AI_getEmperorGoodReligionAttitude(eTargetPlayer);
+ if ((iPass == 0) ? (iAttitudeChange > 0) : (iAttitudeChange < 0))
+ {
+ szTempBuffer.Format(SETCOLR L"%s" ENDCOLR, TEXT_COLOR((iAttitudeChange
> 0) ? "COLOR_POSITIVE_TEXT" : "COLOR_NEGATIVE_TEXT"),
gDLL->getText("TXT_KEY_MISC_ATTITUDE_EMPEROR_GOOD_RELIGION",
iAttitudeChange).GetCString());
+ szBuffer.append(NEWLINE);
+ szBuffer.append(szTempBuffer);
+ }
+
+ iAttitudeChange =
kPlayer.AI_getEmperorNonGoodReligionAttitude(eTargetPlayer);
+ if ((iPass == 0) ? (iAttitudeChange > 0) : (iAttitudeChange < 0))
+ {
+ szTempBuffer.Format(SETCOLR L"%s" ENDCOLR, TEXT_COLOR((iAttitudeChange
> 0) ? "COLOR_POSITIVE_TEXT" : "COLOR_NEGATIVE_TEXT"),
gDLL->getText("TXT_KEY_MISC_ATTITUDE_EMPEROR_NON_GOOD_RELIGION",
iAttitudeChange).GetCString());
+ szBuffer.append(NEWLINE);
+ szBuffer.append(szTempBuffer);
+ }
+
+ iAttitudeChange = kPlayer.AI_getEmperorAttitude(eTargetPlayer);
+ if ((iPass == 0) ? (iAttitudeChange > 0) : (iAttitudeChange < 0))
+ {
+ szTempBuffer.Format(SETCOLR L"%s" ENDCOLR, TEXT_COLOR((iAttitudeChange
> 0) ? "COLOR_POSITIVE_TEXT" : "COLOR_NEGATIVE_TEXT"),
gDLL->getText("TXT_KEY_MISC_ATTITUDE_EMPEROR",
iAttitudeChange).GetCString());
+ szBuffer.append(NEWLINE);
+ szBuffer.append(szTempBuffer);
+ }
+ // Sanguo Mod Emperor, end
+
iAttitudeChange = kPlayer.AI_getWarAttitude(eTargetPlayer);
if ((iPass == 0) ? (iAttitudeChange > 0) : (iAttitudeChange < 0))
{
Modified: trunk/Sanguo Rand/SDK files/CvInfos.cpp
==============================================================================
--- trunk/Sanguo Rand/SDK files/CvInfos.cpp (original)
+++ trunk/Sanguo Rand/SDK files/CvInfos.cpp Thu Dec 4 06:51:56 2008
@@ -826,6 +826,7 @@
m_piFlavorValue(NULL),
m_iExperience(0),
// Sanguo Mod Emperor, start, by poyuzhe 12.02.08
+m_iDefaultUnitClass(NO_UNITCLASS),
m_bEmperor(false),
m_iGreatPeopleRateModifier(0),
m_iThemWarWearinessModifier(0)
@@ -916,6 +917,11 @@
}
// Sanguo Mod Emperor, start, by poyuzhe 12.02.08
+int CvSpecialistInfo::getDefaultUnitClass() const
+{
+ return m_iDefaultUnitClass;
+}
+
bool CvSpecialistInfo::isEmperor() const
{
return m_bEmperor;
@@ -978,6 +984,9 @@
pXML->SetVariableListTagPair(&m_piFlavorValue, "Flavors",
GC.getFlavorTypes(), GC.getNumFlavorTypes());
// Sanguo Mod Emperor, start, by poyuzhe 12.02.08
+ pXML->GetChildXmlValByName(szTextVal, "DefaultUnitClass");
+ m_iDefaultUnitClass = pXML->FindInInfoClass(szTextVal);
+
pXML->GetChildXmlValByName(&m_bEmperor, "bEmperor");
pXML->GetChildXmlValByName(&m_iGreatPeopleRateModifier, "iGreatPeopleRateModifier");
pXML->GetChildXmlValByName(&m_iThemWarWearinessModifier, "iThemWarWearinessModifier");
Modified: trunk/Sanguo Rand/SDK files/CvInfos.h
==============================================================================
--- trunk/Sanguo Rand/SDK files/CvInfos.h (original)
+++ trunk/Sanguo Rand/SDK files/CvInfos.h Thu Dec 4 06:51:56 2008
@@ -262,6 +262,7 @@
DllExport void setTexture(const TCHAR* szVal);
// Sanguo Mod Emperor, start, by poyuzhe 12.02.08
+ int getDefaultUnitClass() const;
bool isEmperor() const;
int getGreatPeopleRateModifier() const;
int getThemWarWearinessModifier() const;
@@ -289,6 +290,7 @@
int* m_piFlavorValue;
// Sanguo Mod Emperor, start, by poyuzhe 12.02.08
+ int m_iDefaultUnitClass;
bool m_bEmperor;
int m_iGreatPeopleRateModifier;
int m_iThemWarWearinessModifier;
Modified: trunk/Sanguo Rand/SDK files/CvPlayer.cpp
==============================================================================
--- trunk/Sanguo Rand/SDK files/CvPlayer.cpp (original)
+++ trunk/Sanguo Rand/SDK files/CvPlayer.cpp Thu Dec 4 06:51:56 2008
@@ -1634,7 +1634,23 @@
for (iI = 0; iI < GC.getNumSpecialistInfos(); ++iI)
{
-
aeFreeSpecialists.push_back(pOldCity->getAddedFreeSpecialistCount((SpecialistTypes)iI));
+ // Sanguo Mod Emperor, start, by poyuzhe 12.04.08
+ //
aeFreeSpecialists.push_back(pOldCity->getAddedFreeSpecialistCount((SpecialistTypes)iI));
+ if (GC.getSpecialistInfo((SpecialistTypes)iI).isEmperor())
+ {
+ aeFreeSpecialists.push_back(0);
+ if (pOldCity->getAddedFreeSpecialistCount((SpecialistTypes)iI) == 1)
+ {
+ UnitTypes eUnit =
(UnitTypes)GC.getCivilizationInfo(getCivilizationType()).getCivilizationUnits(GC.getSpecialistInfo((SpecialistTypes)iI).getDefaultUnitClass());
+ FAssert (eUnit != NO_UNIT);
+ initUnit(eUnit, pOldCity->getX_INLINE(),
pOldCity->getY_INLINE());
+ }
+ }
+ else
+ {
+
aeFreeSpecialists.push_back(pOldCity->getAddedFreeSpecialistCount((SpecialistTypes)iI));
+ }
+ // Sanguo Mod Emperor, end
}
for (iI = 0; iI < GC.getNumVoteSourceInfos(); ++iI)
@@ -2231,6 +2247,9 @@
case UNITAI_GENERAL:
case UNITAI_MERCHANT:
case UNITAI_ENGINEER:
+ // Sanguo Mod Emperor, start, by poyuzhe 12.04.08
+ case UNITAI_EMPEROR:
+ // Sanguo Mod Emperor, end
break;
case UNITAI_SPY:
Modified: trunk/Sanguo Rand/SDK files/CvPlayerAI.cpp
==============================================================================
--- trunk/Sanguo Rand/SDK files/CvPlayerAI.cpp (original)
+++ trunk/Sanguo Rand/SDK files/CvPlayerAI.cpp Thu Dec 4 06:51:56 2008
@@ -1401,6 +1401,7 @@
// Sanguo Mod Civilization Trait, start, by poyuzhe 11.25.08
// Zhang Yang, TRAIT_FOREIGNER
case UNITAI_CAMP:
+ case UNITAI_EMPEROR:
// Sanguo Mod Civilization Trait, end
return DOMAIN_LAND;
break;
@@ -3681,6 +3682,9 @@
case UNITAI_GENERAL:
case UNITAI_MERCHANT:
case UNITAI_ENGINEER:
+ // Sanguo Mod Emperor, start, by poyuzhe 12.04.08
+ case UNITAI_EMPEROR:
+ // Sanguo Mod Emperor, end
break;
case UNITAI_SPY:
@@ -4851,6 +4855,12 @@
iAttitude++;
}
+ // Sanguo Mod Emperor, start, by poyuzhe 12.04.08
+ iAttitude += AI_getEmperorGoodReligionAttitude(ePlayer);
+ iAttitude += AI_getEmperorNonGoodReligionAttitude(ePlayer);
+ iAttitude += AI_getEmperorAttitude(ePlayer);
+ // Sanguo Mod Emperor, end
+
if (GET_TEAM(GET_PLAYER(ePlayer).getTeam()).AI_getWarSuccess(getTeam()) >
GET_TEAM(getTeam()).AI_getWarSuccess(GET_PLAYER(ePlayer).getTeam()))
{
iAttitude +=
GC.getLeaderHeadInfo(getPersonalityType()).getLostWarAttitudeChange();
@@ -4994,6 +5004,67 @@
return iAttitude;
}
+
+// Emperor, added by poyuzhe 12.04.08
+int CvPlayerAI::AI_getEmperorGoodReligionAttitude(PlayerTypes ePlayer)
+{
+ int iAttitude = 0;
+
+ if (getTeam() != GET_PLAYER(ePlayer).getTeam())
+ {
+ if (GET_TEAM(GET_PLAYER(ePlayer).getTeam()).isHasEmperor())
+ {
+ if (GET_PLAYER(ePlayer).getStateReligion() != NO_RELIGION &&
GC.getReligionInfo(GET_PLAYER(ePlayer).getStateReligion()).isGoodReligion())
+ {
+ if (getStateReligion() != NO_RELIGION)
+ {
+ iAttitude +=
GC.getReligionInfo(getStateReligion()).getEmperorGoodReligionAttitudeChange();
+ }
+ }
+ }
+ }
+
+ return iAttitude;
+}
+
+int CvPlayerAI::AI_getEmperorNonGoodReligionAttitude(PlayerTypes ePlayer)
+{
+ int iAttitude = 0;
+
+ if (getTeam() != GET_PLAYER(ePlayer).getTeam())
+ {
+ if (GET_TEAM(GET_PLAYER(ePlayer).getTeam()).isHasEmperor())
+ {
+ if (GET_PLAYER(ePlayer).getStateReligion() != NO_RELIGION
&& !GC.getReligionInfo(GET_PLAYER(ePlayer).getStateReligion()).isGoodReligion())
+ {
+ if (getStateReligion() != NO_RELIGION)
+ {
+ iAttitude +=
GC.getReligionInfo(getStateReligion()).getEmperorNonGoodReligionAttitudeChange();
+ }
+ }
+ }
+ }
+
+ return iAttitude;
+}
+
+int CvPlayerAI::AI_getEmperorAttitude(PlayerTypes ePlayer)
+{
+ int iAttitude = 0;
+
+ if (getTeam() != GET_PLAYER(ePlayer).getTeam())
+ {
+ if (GET_TEAM(GET_PLAYER(ePlayer).getTeam()).isHasEmperor())
+ {
+ if (getStateReligion() != NO_RELIGION)
+ {
+ iAttitude +=
GC.getReligionInfo(getStateReligion()).getEmperorAttitudeChange();
+ }
+ }
+ }
+
+ return iAttitude;
+}
// Sanguo Mod Official Belief, end
int CvPlayerAI::AI_getWarAttitude(PlayerTypes ePlayer)
@@ -7773,6 +7844,9 @@
case UNITAI_MERCHANT:
case UNITAI_ENGINEER:
case UNITAI_SPY:
+ // Sanguo Mod Emperor, start, by poyuzhe 12.04.08
+ case UNITAI_EMPEROR:
+ // Sanguo Mod Emperor, end
break;
case UNITAI_ICBM:
@@ -8181,6 +8255,9 @@
case UNITAI_GENERAL:
case UNITAI_MERCHANT:
case UNITAI_ENGINEER:
+ // Sanguo Mod Emperor, start, by poyuzhe 12.04.08
+ case UNITAI_EMPEROR:
+ // Sanguo Mod Emperor, end
break;
case UNITAI_SPY:
@@ -13535,6 +13612,9 @@
case UNITAI_GENERAL:
case UNITAI_MERCHANT:
case UNITAI_ENGINEER:
+ // Sanguo Mod Emperor, start, by poyuzhe 12.04.08
+ case UNITAI_EMPEROR:
+ // Sanguo Mod Emperor, end
break;
case UNITAI_SPY:
Modified: trunk/Sanguo Rand/SDK files/CvPlayerAI.h
==============================================================================
--- trunk/Sanguo Rand/SDK files/CvPlayerAI.h (original)
+++ trunk/Sanguo Rand/SDK files/CvPlayerAI.h Thu Dec 4 06:51:56 2008
@@ -109,6 +109,11 @@
int AI_getHasHolyCityAttitude(PlayerTypes ePlayer);
int AI_getShareWorstEnemyAttitude(PlayerTypes ePlayer);
int AI_getSharePowerfulEnemyAttitude(PlayerTypes ePlayer);
+
+ // Emperor, added by poyuzhe 12.04.08
+ int AI_getEmperorGoodReligionAttitude(PlayerTypes ePlayer);
+ int AI_getEmperorNonGoodReligionAttitude(PlayerTypes ePlayer);
+ int AI_getEmperorAttitude(PlayerTypes ePlayer);
// Sanguo Mod Official Belief, end
int AI_getWarAttitude(PlayerTypes ePlayer);
Modified: trunk/Sanguo Rand/SDK files/CvSelectionGroupAI.cpp
==============================================================================
--- trunk/Sanguo Rand/SDK files/CvSelectionGroupAI.cpp (original)
+++ trunk/Sanguo Rand/SDK files/CvSelectionGroupAI.cpp Thu Dec 4 06:51:56
2008
@@ -591,6 +591,9 @@
case UNITAI_MERCHANT:
case UNITAI_ENGINEER:
case UNITAI_SPY:
+ // Sanguo Mod Emperor, start, by poyuzhe 12.04.08
+ case UNITAI_EMPEROR:
+ // Sanguo Mod Emperor, end
case UNITAI_ICBM:
case UNITAI_WORKER_SEA:
break;
Modified: trunk/Sanguo Rand/SDK files/CvTeam.cpp
==============================================================================
--- trunk/Sanguo Rand/SDK files/CvTeam.cpp (original)
+++ trunk/Sanguo Rand/SDK files/CvTeam.cpp Thu Dec 4 06:51:56 2008
@@ -1848,6 +1848,14 @@
}
}
+ // Sanguo Mod Emperor, start, by poyuzhe 12.04.08
+ if (isHasEmperor())
+ {
+ iCount *= (100 + GC.getDefineINT("EMPEROR_DEFENSIVE_POWER_MODIFIER"));
+ iCount /= 100;
+ }
+ // Sanguo Mod Emperor, end
+
return iCount;
}
Modified: trunk/Sanguo Rand/SDK files/CvTeamAI.cpp
==============================================================================
--- trunk/Sanguo Rand/SDK files/CvTeamAI.cpp (original)
+++ trunk/Sanguo Rand/SDK files/CvTeamAI.cpp Thu Dec 4 06:51:56 2008
@@ -3808,6 +3808,9 @@
case UNITAI_GENERAL:
case UNITAI_MERCHANT:
case UNITAI_ENGINEER:
+ // Sanguo Mod Emperor, start, by poyuzhe 12.04.08
+ case UNITAI_EMPEROR:
+ // Sanguo Mod Emperor, end
break;
case UNITAI_SPY:
Modified: trunk/Sanguo Rand/SDK files/CvUnitAI.cpp
==============================================================================
--- trunk/Sanguo Rand/SDK files/CvUnitAI.cpp (original)
+++ trunk/Sanguo Rand/SDK files/CvUnitAI.cpp Thu Dec 4 06:51:56 2008
@@ -310,6 +310,12 @@
AI_spyMove();
break;
+ // Sanguo Mod Emperor, start, by poyuzhe 12.04.08
+ case UNITAI_EMPEROR:
+ AI_emperorMove();
+ break;
+ // Sanguo Mod Emperor, end
+
case UNITAI_ICBM:
AI_ICBMMove();
break;
@@ -630,6 +636,9 @@
case UNITAI_GENERAL:
case UNITAI_MERCHANT:
case UNITAI_ENGINEER:
+ // Sanguo Mod Emperor, start, by poyuzhe 12.04.08
+ case UNITAI_EMPEROR:
+ // Sanguo Mod Emperor, end
return 11;
break;
@@ -5948,6 +5957,31 @@
}
// Sanguo Mod Civilization Trait, end
+// Sanguo Mod Emperor, start, by poyuzhe 12.04.08
+void CvUnitAI::AI_emperorMove()
+{
+ PROFILE_FUNC();
+
+ if (AI_join())
+ {
+ return;
+ }
+
+ if (AI_retreatToCity())
+ {
+ return;
+ }
+
+ if (AI_safety())
+ {
+ return;
+ }
+
+ getGroup()->pushMission(MISSION_SKIP);
+ return;
+}
+// Sanguo Mod Emperor, end
+
void CvUnitAI::AI_networkAutomated()
{
FAssertMsg(canBuildRoute(), "canBuildRoute is expected to be true");
@@ -9342,6 +9376,21 @@
if (canJoin(pLoopCity->plot(), ((SpecialistTypes)iI)))
{
iValue = pLoopCity->AI_specialistValue(((SpecialistTypes)iI),
pLoopCity->AI_avoidGrowth(), false);
+
+ // Sanguo Mod Emperor, start, by poyuzhe 12.04.08
+ if (GC.getSpecialistInfo((SpecialistTypes)iI).isEmperor())
+ {
+ if (pLoopCity->isCapital())
+ {
+ iValue += 1;
+ iValue *= 100;
+ }
+ else
+ {
+ iValue = 0;
+ }
+ }
+ // Sanguo Mod Emperor, end
if (iValue > iBestValue)
{
Modified: trunk/Sanguo Rand/SDK files/CvUnitAI.h
==============================================================================
--- trunk/Sanguo Rand/SDK files/CvUnitAI.h (original)
+++ trunk/Sanguo Rand/SDK files/CvUnitAI.h Thu Dec 4 06:51:56 2008
@@ -104,6 +104,10 @@
bool AI_campInPlotRange(int iRange1, int iRange2, bool bHasTrait, bool
bOnBonusPlot, bool* pIsTooFar = NULL);
// Sanguo Mod Civilization Trait, end
+ // Sanguo Mod Emperor, start, by poyuzhe 12.04.08
+ void AI_emperorMove();
+ // Sanguo Mod Emperor, end
+
void AI_networkAutomated();
void AI_cityAutomated();
Modified: trunk/Sanguo Rand/SDK files/CyEnumsInterface.cpp
==============================================================================
--- trunk/Sanguo Rand/SDK files/CyEnumsInterface.cpp (original)
+++ trunk/Sanguo Rand/SDK files/CyEnumsInterface.cpp Thu Dec 4 06:51:56
2008
@@ -937,6 +937,8 @@
// Sanguo Mod Civilization Trait, start, by poyuzhe 11.25.08
// Zhang Yang, TRAIT_FOREIGNER
.value("UNITAI_CAMP", UNITAI_CAMP)
+ // Emperor, added by poyuzhe 12.04.08
+ .value("UNITAI_EMPEROR", UNITAI_EMPEROR)
// Sanguo Mod Civilization Trait, end
.value("NUM_UNITAI_TYPES", NUM_UNITAI_TYPES)
;
Modified: trunk/Sanguo Rand/SDK files/CyInfoInterface1.cpp
==============================================================================
--- trunk/Sanguo Rand/SDK files/CyInfoInterface1.cpp (original)
+++ trunk/Sanguo Rand/SDK files/CyInfoInterface1.cpp Thu Dec 4 06:51:56
2008
@@ -48,6 +48,7 @@
.def("getTexture", &CvSpecialistInfo::getTexture, "string ()")
// Sanguo Mod Emperor, start, by poyuzhe 12.02.08
+ .def("getDefaultUnitClass", &CvSpecialistInfo::getDefaultUnitClass, "int
()")
.def("isEmperor", &CvSpecialistInfo::isEmperor, "bool ()")
.def("getGreatPeopleRateModifier",
&CvSpecialistInfo::getGreatPeopleRateModifier, "int ()")
.def("getThemWarWearinessModifier",
&CvSpecialistInfo::getThemWarWearinessModifier, "int ()")
Modified: trunk/Sanguo Rand/SDK files/CyTeam.cpp
==============================================================================
--- trunk/Sanguo Rand/SDK files/CyTeam.cpp (original)
+++ trunk/Sanguo Rand/SDK files/CyTeam.cpp Thu Dec 4 06:51:56 2008
@@ -969,6 +969,19 @@
}
// Sanguo Mod Civilization Trait, end
+// Sanguo Mod Emperor, start, by poyuzhe 12.04.08
+bool CyTeam::isHasEmperor()
+{
+ return m_pTeam ? m_pTeam->isHasEmperor() : false;
+}
+
+void CyTeam::setHasEmperor(bool bNewValue)
+{
+ if (m_pTeam)
+ m_pTeam->setHasEmperor(bNewValue);
+}
+// Sanguo Mod Emperor, end
+
bool CyTeam::AI_shareWar(int /*TeamTypes*/ eTeam)
{
return m_pTeam ? m_pTeam->AI_shareWar((TeamTypes)eTeam) : false;
Modified: trunk/Sanguo Rand/SDK files/CyTeam.h
==============================================================================
--- trunk/Sanguo Rand/SDK files/CyTeam.h (original)
+++ trunk/Sanguo Rand/SDK files/CyTeam.h Thu Dec 4 06:51:56 2008
@@ -224,6 +224,12 @@
void setRecluse(bool bNewValue);
// Sanguo Mod Civilization Trait, end
+ // Sanguo Mod Emperor, start, by poyuzhe 12.04.08
+ bool isHasEmperor();
+ void setHasEmperor(bool bNewValue);
+ // Sanguo Mod Emperor, end
+
+
bool AI_shareWar(int /*TeamTypes*/ eTeam);
void AI_setWarPlan(int /*TeamTypes*/ eIndex, int /*WarPlanTypes*/
eNewValue);
int AI_getAtWarCounter(int /*TeamTypes*/ eTeam) const;
Modified: trunk/Sanguo Rand/SDK files/CyTeamInterface.cpp
==============================================================================
--- trunk/Sanguo Rand/SDK files/CyTeamInterface.cpp (original)
+++ trunk/Sanguo Rand/SDK files/CyTeamInterface.cpp Thu Dec 4 06:51:56 2008
@@ -215,6 +215,10 @@
.def("isRecluse", &CyTeam::isRecluse, "bool ()")
.def("setRecluse", &CyTeam::setRecluse, "void (bool)")
// Sanguo Mod Civilization Trait, end
+ // Sanguo Mod Emperor, start, by poyuzhe 12.04.08
+ .def("isHasEmperor", &CyTeam::isHasEmperor, "bool ()")
+ .def("setHasEmperor", &CyTeam::setHasEmperor, "void (bool)")
+ // Sanguo Mod Emperor, end
.def("AI_shareWar", &CyTeam::AI_shareWar, "bool (TeamTypes)")
.def("AI_setWarPlan", &CyTeam::AI_setWarPlan, "void (int /*TeamTypes*/
eIndex, int /*WarPlanTypes*/ eNewValue)")
.def("AI_getAtWarCounter", &CyTeam::AI_getAtWarCounter, "int
(TeamTypes)")
Modified: trunk/Sanguo Rand/changelog.txt
==============================================================================
--- trunk/Sanguo Rand/changelog.txt (original)
+++ trunk/Sanguo Rand/changelog.txt Thu Dec 4 06:51:56 2008
@@ -241,4 +241,6 @@
0.087:ʵ���˻ʵ��ճ����ܵĴ�
�ӳ���citybar
- ������camp��AI
\ No newline at end of file
+ ������camp��AI
+
+0.088:ʵ���˳��й���ͶƱ����֮��Ļʵ۹���
\ No newline at end of file