[sanguoforciv4] r338 committed - 0.296: 新增内容:选择创建随机英雄时提供部分定制选项...

2 views
Skip to first unread message

codesite...@google.com

unread,
Sep 19, 2009, 8:23:34 AM9/19/09
to sanguom...@googlegroups.com
Revision: 338
Author: TongShen.Martin
Date: Sat Sep 19 05:22:49 2009
Log: 0.296: 新增内容:选择创建随机英雄时提供部分定制选项

0.296: New Content: add customization options when creating random hero
http://code.google.com/p/sanguoforciv4/source/detail?r=338

Modified:
/trunk/The History of Three Kingdoms/Assets/Python/CvSanguoEventManager.py
/trunk/The History of Three
Kingdoms/Assets/Python/EntryPoints/CvSanguoInterface.py
/trunk/The History of Three
Kingdoms/Assets/Python/EntryPoints/CvScreensInterface.py
/trunk/The History of Three
Kingdoms/Assets/Python/Screens/CvAdvancedLegionScreen.py
/trunk/The History of Three
Kingdoms/Assets/Python/Screens/CvCreateChampionScreen.py
/trunk/The History of Three Kingdoms/Assets/Python/Screens/CvHeroAdvisor.py
/trunk/The History of Three
Kingdoms/Assets/Python/Screens/CvLegionScreen.py
/trunk/The History of Three
Kingdoms/Assets/Python/Screens/CvMainInterface.py
/trunk/The History of Three
Kingdoms/Assets/Python/Screens/CvWorldBuilderScreen.py
/trunk/The History of Three Kingdoms/Assets/Python/pyWB/CvWBDesc.py
/trunk/The History of Three
Kingdoms/Assets/XML/Text/CIV4GameText_Sanguo_Hero.xml
/trunk/The History of Three
Kingdoms/Assets/XML/Units/CIV4PromotionInfos.xml
/trunk/The History of Three Kingdoms/Assets/XML/Units/CIV4UnitSchema.xml
/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/CvGameTextMgr.cpp
/trunk/The History of Three Kingdoms/CvGameCoreDLL/CvInfos.cpp
/trunk/The History of Three Kingdoms/CvGameCoreDLL/CvInfos.h
/trunk/The History of Three Kingdoms/CvGameCoreDLL/CvPlayer.cpp
/trunk/The History of Three Kingdoms/CvGameCoreDLL/CvUnit.cpp
/trunk/The History of Three Kingdoms/CvGameCoreDLL/CyGame.cpp
/trunk/The History of Three Kingdoms/CvGameCoreDLL/CyGame.h
/trunk/The History of Three Kingdoms/CvGameCoreDLL/CyGameInterface.cpp
/trunk/The History of Three Kingdoms/CvGameCoreDLL/CyInfoInterface1.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/CvSanguoEventManager.py Fri Sep 18 07:27:23 2009
+++ /trunk/The History of Three
Kingdoms/Assets/Python/CvSanguoEventManager.py Sat Sep 19 05:22:49 2009
@@ -484,7 +484,59 @@
return 0
# Create New Hero Stuff
elif iData1 == 1:
- gc.getGame().createRandomHero(iData2, iData3, iData4)
+ unit = CyInterface().getHeadSelectedUnit()
+ if not unit.isNone():
+ iX = unit.getX()
+ iY = unit.getY()
+ else:
+ city = gc.getPlayer(iData2).getCapitalCity()
+ if not city.isNone():
+ iX = city.getX()
+ iY = city.getY()
+ else:
+ (unit, iter)= gc.getPlayer(iData2).firstUnit()
+ assert (not unit.isNone());
+ if not unit.isNone():
+ iX = unit.getX()
+ iY = unit.getY()
+ iLeadership = -1
+ iMight = -1
+ iLoyalty = -1
+ iCombat = -1
+ iFirstPro = -1
+ iSecondPro = -1
+ iThirdPro = -1
+ bThreePros = False
+ if iData3 == 0:
+ iLeadership = 90
+ elif iData3 == 1:
+ iMight = 90
+ elif iData3 == 2:
+ iLoyalty = 100
+ elif iData4 == 0:
+ iCombat = gc.getInfoTypeForString("UNITCOMBAT_MELEE")
+ elif iData4 == 1:
+ iCombat = gc.getInfoTypeForString("UNITCOMBAT_MOUNTED")
+ elif iData4 == 2:
+ iCombat = gc.getInfoTypeForString("UNITCOMBAT_ARCHER")
+ elif iData4 == 3:
+ iCombat = gc.getInfoTypeForString("UNITCOMBAT_SIEGE")
+ elif iData4 == 4:
+ iCombat = gc.getInfoTypeForString("UNITCOMBAT_NAVAL")
+ elif iData5 == 0:
+ iFirstPro = gc.getInfoTypeForString("PROMOTION_ATTACK1")
+ iSecondPro = gc.getInfoTypeForString("PROMOTION_ATTACK2")
+ elif iData5 == 1:
+ iFirstPro = gc.getInfoTypeForString("PROMOTION_DEFENCE1")
+ iSecondPro = gc.getInfoTypeForString("PROMOTION_DEFENCE2")
+ elif iData5 == 2:
+ iFirstPro = gc.getInfoTypeForString("PROMOTION_RESILIENT1")
+ iSecondPro = gc.getInfoTypeForString("PROMOTION_RESILIENT2")
+ elif iData5 == 3:
+ iFirstPro = gc.getInfoTypeForString("PROMOTION_FIGHTER1")
+ elif iData5 == 4:
+ bThreePros = True
+ gc.getGame().createRandomHero(iData2, iX, iY, iLeadership, iMight,
iLoyalty, iCombat, iFirstPro, iSecondPro, iThirdPro, bThreePros)
gc.getPlayer(iData2).recalculateGreatGeneralThreshold()
# Recruit Hero Stuff
elif iData1 == 2:
@@ -526,24 +578,73 @@
gc.getPlayer(iData3).releaseHero(iData2)
# Form Advanced Legion Stuff
elif iData1 == 9:
- if iData2 != -1 and iData3 != -1:
- pHero =
gc.getPlayer(iData2).getUnit(gc.getGame().getHeroUnitID(iData3))
- if not pHero.isNone():
- bRegroup = True
- if iData4 == 0:
- bRegroup = False
- pHero.formAdvancedLegion(bRegroup,
True)
+ if iData2 != -1 and iData3 != -1:
+ pHero =
gc.getPlayer(iData2).getUnit(gc.getGame().getHeroUnitID(iData3))
+ if not pHero.isNone():
+ bRegroup = True
+ if iData4 == 0:
+ bRegroup = False
+ pHero.formAdvancedLegion(bRegroup, True)
# Join Legion / Advanced Legion Stuff
elif iData1 == 10:
pPlayer = gc.getPlayer(iData3)
pHero = pPlayer.getUnit(iData4)
pUnit = pPlayer.getUnit(iData2)
if not pUnit.isNone():
- if iData5 == 0:
- pUnit.joinLegion( iData4 )
- else:
- pUnit.joinAdvancedLegion( iData4 )
+ if iData5 == 0:
+ pUnit.joinLegion( iData4 )
+ else:
+ pUnit.joinAdvancedLegion( iData4 )
pPlayer.clearJoinLegionTempHeroList()
+ # AI create random hero
+ elif iData1 == 11:
+ iLeadership = -1
+ iMight = -1
+ iLoyalty = -1
+ iCombat = -1
+ iFirstPro = -1
+ iSecondPro = -1
+ iThirdPro = -1
+ bThreePros = False
+
+ iRand = gc.getGame().getSorenRandNum(99, "hell")
+ if iRand < 33:
+ iRand1 = gc.getGame().getSorenRandNum(99, "bloody hell")
+ if iRand1 < 33:
+ iLeadership = 90
+ elif iRand1 < 66:
+ iMight = 90
+ else:
+ iLoyalty = 100
+ elif iRand < 66:
+ iRand1 = gc.getGame().getSorenRandNum(100, "holy hell")
+ if iRand1 < 20:
+ iCombat = gc.getInfoTypeForString("UNITCOMBAT_MELEE")
+ elif iRand1 < 40:
+ iCombat = gc.getInfoTypeForString("UNITCOMBAT_MOUNTED")
+ elif iRand1 < 60:
+ iCombat = gc.getInfoTypeForString("UNITCOMBAT_ARCHER")
+ elif iRand1 < 80:
+ iCombat = gc.getInfoTypeForString("UNITCOMBAT_SIEGE")
+ else:
+ iCombat = gc.getInfoTypeForString("UNITCOMBAT_NAVAL")
+ else:
+ iRand1 = gc.getGame().getSorenRandNum(100, "What the Hell")
+ if iRand1 < 20:
+ iFirstPro = gc.getInfoTypeForString("PROMOTION_ATTACK1")
+ iSecondPro = gc.getInfoTypeForString("PROMOTION_ATTACK2")
+ elif iRand1 < 40:
+ iFirstPro = gc.getInfoTypeForString("PROMOTION_DEFENCE1")
+ iSecondPro = gc.getInfoTypeForString("PROMOTION_DEFENCE2")
+ elif iRand1 < 60:
+ iFirstPro = gc.getInfoTypeForString("PROMOTION_RESILIENT1")
+ iSecondPro = gc.getInfoTypeForString("PROMOTION_RESILIENT2")
+ elif iRand1 < 80:
+ iFirstPro = gc.getInfoTypeForString("PROMOTION_FIGHTER1")
+ else:
+ bThreePros = True
+ gc.getGame().createRandomHero(iData2, iData3, iData4, iLeadership,
iMight, iLoyalty, iCombat, iFirstPro, iSecondPro, iThirdPro, bThreePros)
+ gc.getPlayer(iData2).recalculateGreatGeneralThreshold()


def onGameStart(self, argsList):
=======================================
--- /trunk/The History of Three
Kingdoms/Assets/Python/EntryPoints/CvSanguoInterface.py Fri Sep 18 07:27:23
2009
+++ /trunk/The History of Three
Kingdoms/Assets/Python/EntryPoints/CvSanguoInterface.py Sat Sep 19 05:22:49
2009
@@ -166,6 +166,7 @@
(pLoopCity, iter) = pNewPlayer.nextCity(iter, False)


-
+def doAICreateRandomHero(argsList):
+ CyMessageControl().sendModNetMessage(11, argsList[0], argsList[1],
argsList[2], -1)


=======================================
--- /trunk/The History of Three
Kingdoms/Assets/Python/EntryPoints/CvScreensInterface.py Fri Sep 18
07:27:23 2009
+++ /trunk/The History of Three
Kingdoms/Assets/Python/EntryPoints/CvScreensInterface.py Sat Sep 19
05:22:49 2009
@@ -133,7 +133,7 @@
createChampionScreen = CvCreateChampionScreen.CvCreateChampionScreen()
def showCreateChampionScreen(argsList):
if (-1 != CyGame().getActivePlayer()):
- createChampionScreen.interfaceScreen(argsList[0], argsList[1],
argsList[2])
+ createChampionScreen.interfaceScreen(argsList[0])
#### Sanguo Mod Hero, end

optionsScreen = CvOptionsScreen.CvOptionsScreen()
@@ -1230,7 +1230,7 @@
LEGION_SCREEN : legionScreen,
NINE_TRANSFORMATION_SCREEN : nineTransformationScreen,
CREATE_CHAMPION_SCREEN : createChampionScreen,
- ADVANCED_LEGION_SCREEN :
advancedLegionScreen,
+ ADVANCED_LEGION_SCREEN : advancedLegionScreen,
#### Sanguo Mod Hero, end
}

=======================================
--- /trunk/The History of Three
Kingdoms/Assets/Python/Screens/CvAdvancedLegionScreen.py Fri Sep 18
07:27:23 2009
+++ /trunk/The History of Three
Kingdoms/Assets/Python/Screens/CvAdvancedLegionScreen.py Sat Sep 19
05:22:49 2009
@@ -305,7 +305,7 @@
screen.setActivation( control,
ActivationTypes.ACTIVATE_MIMICPARENTFOCUS )

control = "HeroXP" + str(iID)
- szText = BugUtil.getPlainText("TXT_KEY_HERO_XP") + ": " + "%d" %
(gc.getGame().getHeroExperience(eLoopHero)) + "/" + "%d" %
(gc.getGame().heroExperienceNeeded(eLoopHero))
+ szText = BugUtil.getPlainText("TXT_KEY_HERO_XP") + ": " + "%d" %
(int(gc.getGame().getHeroExperience(eLoopHero))) + "/" + "%d" %
(gc.getGame().heroExperienceNeeded(eLoopHero))
screen.setTextAt( control, szHeroRow, szText, CvUtil.FONT_LEFT_JUSTIFY,
iIncrement * 3 + iIconSize + iButtonSize, iIncrement + 24, -0.1,
FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
screen.setActivation( control,
ActivationTypes.ACTIVATE_MIMICPARENTFOCUS )

=======================================
--- /trunk/The History of Three
Kingdoms/Assets/Python/Screens/CvCreateChampionScreen.py Fri Sep 18
07:27:23 2009
+++ /trunk/The History of Three
Kingdoms/Assets/Python/Screens/CvCreateChampionScreen.py Sat Sep 19
05:22:49 2009
@@ -20,8 +20,6 @@
def __init__(self):
self.iPlayer = -1
self.iHero = -1
- self.iX = -1
- self.iY = -1
self.W_SCREEN = 600
self.H_SCREEN = 800
self.X_SCREEN = 100
@@ -95,6 +93,43 @@
self.UnitCombatInfo = {}
self.CombatLevelSign = {}

+ self.stringPrefix = "TXT_KEY_RANDOM_GUARANTEE_"
+ self.stringSuffix = "_HELP"
+
+ self.MainChoiceWidget = "MainChoice"
+ self.SecondaryChoiceWidget = "SecondaryChoice"
+ self.HelpTextWidget = "HelpText"
+
+ self.ChoiceRemembered = {"GENERAL" : "",
+ "STATS" : -1,
+ "COMBAT" : -1,
+ "PROMOTION" : -1}
+
+ self.StatsChoice = {0:"LEADERSHIP",
+ 1:"MIGHT",
+ 2:"LOYALTY"}
+
+ self.CombatChoice = {0:"MELEE",
+ 1:"MOUNTED",
+ 2:"ARCHER",
+ 3:"SIEGE",
+ 4:"NAVAL"}
+
+ self.PromotionChoice = {0:"ATTACK",
+ 1:"DEFENCE",
+ 2:"CITY",
+ 3:"STRENGTH",
+ 4:"NUMBER"}
+
+ self.ChoiceCategory = {0:"STATS",
+ 1:"COMBAT",
+ 2:"PROMOTION"}
+
+ self.ChoiceCallback = {"STATS" : self.StatsChoice,
+ "COMBAT" : self.CombatChoice,
+ "PROMOTION" : self.PromotionChoice}
+
+
def killScreen(self):
if (self.iScreen >= 0):
screen = self.getScreen()
@@ -105,12 +140,10 @@
def getScreen(self):
return CyGInterfaceScreen("createChampionScreen",
CvScreenEnums.CREATE_CHAMPION_SCREEN)

- def interfaceScreen (self, iPlayer, iX, iY):
+ def interfaceScreen (self, iPlayer):
screen = self.getScreen()

self.iPlayer = iPlayer
- self.iX = iX
- self.iY = iY

self.W_SCREEN = 800
self.H_SCREEN = 710
@@ -206,8 +239,8 @@
screen.addPanel( "MainPanel", u"", u"", True, True, self.X_SCREEN,
self.Y_SCREEN, self.W_SCREEN, self.H_SCREEN, PanelStyles.PANEL_STYLE_MAIN )
screen.setButtonGFC( "Confirm",
localText.getText("TXT_KEY_SCREEN_CONFIRM", ()), "", (self.X_SCREEN +
self.W_SCREEN) / 2 - 20, self.Y_SCREEN + self.H_SCREEN - 40, 76, 30,
WidgetTypes.WIDGET_GENERAL, -1, -1, ButtonStyles.BUTTON_STYLE_STANDARD )
screen.setActivation( "Confirm",
ActivationTypes.ACTIVATE_MIMICPARENTFOCUS )
- screen.setButtonGFC( "Random",
localText.getText("TXT_KEY_SCREEN_CREATE_RANDOM_HERO", ()), "",
(self.X_SCREEN + self.W_SCREEN) / 2 + 100, self.Y_SCREEN + self.H_SCREEN -
40, 200, 30, WidgetTypes.WIDGET_GENERAL, -1, -1,
ButtonStyles.BUTTON_STYLE_STANDARD )
- screen.setActivation( "Random",
ActivationTypes.ACTIVATE_MIMICPARENTFOCUS )
+## screen.setButtonGFC( "Random",
localText.getText("TXT_KEY_SCREEN_CREATE_RANDOM_HERO", ()), "",
(self.X_SCREEN + self.W_SCREEN) / 2 + 100, self.Y_SCREEN + self.H_SCREEN -
40, 200, 30, WidgetTypes.WIDGET_GENERAL, -1, -1,
ButtonStyles.BUTTON_STYLE_STANDARD )
+## screen.setActivation( "Random",
ActivationTypes.ACTIVATE_MIMICPARENTFOCUS )
screen.setTextAt("LabelText", "MainPanel", u"<font=4b>" +
localText.getText("TXT_KEY_PICK_A_HERO", ()).upper() + u"</font>",
CvUtil.FONT_CENTER_JUSTIFY, 30, 10, 0, FontTypes.MENU_FONT,
WidgetTypes.WIDGET_GENERAL, -1, -1)

screen.showWindowBackground(False)
@@ -229,9 +262,27 @@
screen.addScrollPanel( szPanel, u"", self.X_HERO_PANE, self.Y_HERO_PANE,
self.W_HERO_PANE, self.H_HERO_PANE - 20, PanelStyles.PANEL_STYLE_EXTERNAL )
screen.setActivation( szPanel, ActivationTypes.ACTIVATE_NORMAL )

- iCount = 0
iButtonSize = 48
iIncrement = 1
+
+ infoPanelName = "HeroRow" + str(gc.getNumHeroInfos())
+ screen.attachPanelAt( szPanel, infoPanelName, "", "", False, False,
PanelStyles.PANEL_STYLE_STANDARD, iIncrement, iIncrement, self.W_HERO_PANE
- 35, iButtonSize + iIncrement * 2, WidgetTypes.WIDGET_GENERAL, -1, -1 )
+ screen.setActivation( infoPanelName,
ActivationTypes.ACTIVATE_MIMICPARENTFOCUS)
+ screen.hide(infoPanelName)
+
+ itemName = "HeroButton" + str(gc.getNumHeroInfos())
+ screen.addCheckBoxGFCAt( infoPanelName, itemName,
gc.getDefineSTRING("LEADERHEAD_RANDOM"),
ArtFileMgr.getInterfaceArtInfo("BUTTON_HILITE_SQUARE").getPath(),
iIncrement, iIncrement, iButtonSize, iButtonSize,
WidgetTypes.WIDGET_GENERAL, gc.getNumHeroInfos(), -1,
ButtonStyles.BUTTON_STYLE_LABEL, False )
+ itemName = "HeroRecruitMoney" + str(gc.getNumHeroInfos())
+ screen.setTextAt(itemName, infoPanelName, "0",
CvUtil.FONT_CENTER_JUSTIFY, iIncrement * 2 + iButtonSize, iButtonSize / 2
- iIncrement, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
+
+ screen.show(infoPanelName)
+
+ self.iHero = gc.getNumHeroInfos()
+ screen.setState("HeroButton" + str(self.iHero), True)
+ self.drawRandomHeroChoice()
+
+ iCount = 1
+
for iHero in self.AvailableHeroes:
infoPanelName = "HeroRow" + str(iHero)
screen.attachPanelAt( szPanel, infoPanelName, "", "", False, False,
PanelStyles.PANEL_STYLE_STANDARD, iIncrement, iButtonSize * iCount +
iIncrement * (iCount + 1), self.W_HERO_PANE - 35, iButtonSize + iIncrement
* 2, WidgetTypes.WIDGET_GENERAL, -1, -1 )
@@ -243,14 +294,71 @@
itemName = "HeroRecruitMoney" + str(iHero)
screen.setTextAt(itemName, infoPanelName,
localText.changeTextColor(str(gc.getPlayer(self.iPlayer).getRecruitHeroGold(iHero)
/ 2), gc.getInfoTypeForString("COLOR_YELLOW")), CvUtil.FONT_CENTER_JUSTIFY,
iIncrement * 2 + iButtonSize, iButtonSize / 2 - iIncrement, 0,
FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)

- if iCount == 0:
- self.iHero = iHero
- screen.setState("HeroButton" + str(iHero), True)
- self.drawPediaContent(iHero)
-
iCount += 1

screen.show(infoPanelName)
+
+ def drawRandomHeroChoice(self):
+ screen = self.getScreen()
+
+ panelName = "Concept"
+ screen.addPanel(panelName,
localText.getText("TXT_KEY_CREATE_RANDOM_HERO", ()), "", True, True,
self.X_UNIT_PANE, self.Y_UNIT_PANE, 650, 300,
PanelStyles.PANEL_STYLE_BLUE50)
+ szText =
gc.getNewConceptInfo(gc.getInfoTypeForString("CONCEPT_RANDOM_HERO")).getCivilopedia()
+ screen.attachMultilineText(panelName, "Text", szText,
WidgetTypes.WIDGET_GENERAL, -1, -1, CvUtil.FONT_LEFT_JUSTIFY)
+
+ screen.addDropDownBoxGFC(self.MainChoiceWidget, self.X_UNIT_PANE,
self.Y_UNIT_PANE + 320, 300, WidgetTypes.WIDGET_GENERAL, -1, -1,
FontTypes.GAME_FONT)
+ for choice in self.ChoiceCategory.keys():
+ szString = self.stringPrefix + self.ChoiceCategory[choice]
+ screen.addPullDownString(self.MainChoiceWidget,
localText.getText(szString, ()), -1, -1, False )
+
+ screen.addDropDownBoxGFC(self.SecondaryChoiceWidget, self.X_UNIT_PANE,
self.Y_UNIT_PANE + 370, 300, WidgetTypes.WIDGET_GENERAL, -1, -1,
FontTypes.GAME_FONT)
+ for choice in self.StatsChoice.keys():
+ szString = self.stringPrefix + self.StatsChoice[choice]
+ screen.addPullDownString(self.SecondaryChoiceWidget,
localText.getText(szString, ()), -1, -1, False)
+
+ self.ChoiceRemembered["GENERAL"] = "STATS"
+ self.ChoiceRemembered["STATS"] = 0
+ self.ChoiceRemembered["COMBAT"] = -1
+ self.ChoiceRemembered["PROMOTION"] = -1
+
+ self.updateHelpText()
+
+
+ def updateHelpText(self):
+ screen = self.getScreen()
+
+ Category = self.ChoiceCallback.get(self.ChoiceRemembered["GENERAL"])
+ if len(Category) > 0:
+ iIndex = self.ChoiceRemembered.get(self.ChoiceRemembered["GENERAL"])
+ if iIndex != -1:
+ szText = self.stringPrefix + Category[iIndex] + self.stringSuffix
+ screen.setText(self.HelpTextWidget, "", localText.getText(szText, ()),
CvUtil.FONT_LEFT_JUSTIFY, self.X_UNIT_PANE, self.Y_UNIT_PANE + 420, 0,
FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
+
+
+ def updateCategoryChoice(self, sCategory):
+ screen = self.getScreen()
+
+ screen.addDropDownBoxGFC(self.SecondaryChoiceWidget, self.X_UNIT_PANE,
self.Y_UNIT_PANE + 370, 300, WidgetTypes.WIDGET_GENERAL, -1, -1,
FontTypes.GAME_FONT)
+ for choice in self.ChoiceCallback[sCategory].keys():
+ szString = self.stringPrefix +
self.ChoiceCallback[sCategory].get(choice)
+ screen.addPullDownString(self.SecondaryChoiceWidget,
localText.getText(szString, ()), -1, -1, False)
+
+ for key in self.ChoiceRemembered.keys():
+ self.ChoiceRemembered[key] = -1
+ self.ChoiceRemembered["GENERAL"] = sCategory
+ self.ChoiceRemembered[sCategory] = 0
+
+ self.updateHelpText()
+
+
+ def updateSecondaryChoice(self, iIndex):
+ screen = self.getScreen
+
+ for key in ["STATS", "COMBAT", "PROMOTION"]:
+ self.ChoiceRemembered[key] = -1
+ self.ChoiceRemembered[self.ChoiceRemembered["GENERAL"]] = iIndex
+ self.updateHelpText()
+

def drawPediaContent(self, iHero):
screen = self.getScreen()
@@ -265,7 +373,7 @@

screen.setTextAt("Leadership", panelName,
localText.getText("TXT_KEY_RECRUIT_HERO_LEADERSHIP",
(gc.getHeroInfo(iHero).getLeadership(), )), CvUtil.FONT_CENTER_JUSTIFY, 5,
15, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
screen.setTextAt("Might", panelName,
localText.getText("TXT_KEY_RECRUIT_HERO_MIGHT",
(gc.getHeroInfo(iHero).getMight(), )), CvUtil.FONT_CENTER_JUSTIFY, 5, 35,
0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
- screen.setTextAt("XP", panelName,
localText.getText("TXT_KEY_RECRUIT_HERO_EXPERIENCE",
(gc.getGame().getHeroExperience(iHero), )), CvUtil.FONT_CENTER_JUSTIFY, 5,
55, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
+ screen.setTextAt("XP", panelName,
localText.getText("TXT_KEY_RECRUIT_HERO_EXPERIENCE",
(int(gc.getGame().getHeroExperience(iHero)), )),
CvUtil.FONT_CENTER_JUSTIFY, 5, 55, 0, FontTypes.GAME_FONT,
WidgetTypes.WIDGET_GENERAL, -1, -1)

self.placeCivAndBelief(iHero)
self.placeUnitCombatLevel(iHero)
@@ -433,16 +541,29 @@

# Handles the input for this screen...
def handleInput (self, inputClass):
- if (inputClass.getNotifyCode() == NotifyCode.NOTIFY_CLICKED):
+ if (inputClass.getNotifyCode() ==
NotifyCode.NOTIFY_LISTBOX_ITEM_SELECTED):
+ if (inputClass.getFunctionName() == self.MainChoiceWidget):
+ iIndex = self.getScreen().getSelectedPullDownID(self.MainChoiceWidget)
+ sSelectedCategory = self.ChoiceCategory[iIndex]
+ if sSelectedCategory != self.ChoiceRemembered["GENERAL"]:
+ self.updateCategoryChoice(sSelectedCategory)
+ return 1
+ elif (inputClass.getFunctionName() == self.SecondaryChoiceWidget):
+ sCategory = self.ChoiceRemembered["GENERAL"]
+ iIndex =
self.getScreen().getSelectedPullDownID(self.SecondaryChoiceWidget)
+ if iIndex != self.ChoiceRemembered[sCategory]:
+ self.updateSecondaryChoice(iIndex)
+ return 1
+ elif (inputClass.getNotifyCode() == NotifyCode.NOTIFY_CLICKED):
if inputClass.getFunctionName() == "Confirm":
- if self.iHero != -1 and self.iPlayer != -1:
+ if self.iHero == gc.getNumHeroInfos():
+ CyMessageControl().sendModNetMessage(1, self.iPlayer,
self.ChoiceRemembered["STATS"], self.ChoiceRemembered["COMBAT"],
self.ChoiceRemembered["PROMOTION"])
+ self.getScreen().hideScreen()
+ return 1
+ elif self.iHero != -1 and self.iPlayer != -1:
CyMessageControl().sendModNetMessage(2, self.iHero, self.iPlayer, 1,
-1)
self.getScreen().hideScreen()
return 1
- elif inputClass.getFunctionName() == "Random":
- CyMessageControl().sendModNetMessage(1, self.iPlayer, self.iX,
self.iY, -1)
- self.getScreen().hideScreen()
- return 1
elif inputClass.getFunctionName() == "HeroButton":
screen = self.getScreen()
functionName = "HeroButton" + str(inputClass.getID())
@@ -451,11 +572,17 @@
for iHero in self.AvailableHeroes:
screen.setState("HeroButton" + str(iHero), False)
screen.setState(functionName, True)
- self.drawPediaContent(inputClass.getID())
- return 1
+ if inputClass.getID() != gc.getNumHeroInfos():
+ screen.setState("HeroButton" + str(gc.getNumHeroInfos()), False)
+ self.drawPediaContent(inputClass.getID())
+ return 1
+ else:
+ self.drawRandomHeroChoice()
+ return 1
else:
screen.setState(functionName, True)
return 1
+
return 0

def update(self, fDelta):
=======================================
--- /trunk/The History of Three
Kingdoms/Assets/Python/Screens/CvHeroAdvisor.py Fri Sep 18 07:27:23 2009
+++ /trunk/The History of Three
Kingdoms/Assets/Python/Screens/CvHeroAdvisor.py Sat Sep 19 05:22:49 2009
@@ -425,20 +425,14 @@
# loop through all other heroes and add their rows; show available first
lAvailableHeroes = []
lMaybeLaterHeroes = []
- lUnbornHeroes = []
lEmployedHeroes = []
- lDeadHeroes = []
for iLoopHero in range(gc.getNumHeroInfos()):
if self.objActiveLeader.canRecruitHero(iLoopHero, False):
lAvailableHeroes.append(iLoopHero)
elif gc.getGame().getHeroDebutStatus(iLoopHero) == -2:
lMaybeLaterHeroes.append(iLoopHero)
- elif gc.getGame().getHeroDebutStatus(iLoopHero) == -1:
- lUnbornHeroes.append(iLoopHero)
elif gc.getGame().getHeroDebutStatus(iLoopHero) >= 0:
lEmployedHeroes.append(iLoopHero)
- elif gc.getGame().getHeroDebutStatus(iLoopHero) == -3:
- lDeadHeroes.append(iLoopHero)

iCount = 0
for iLoopHero in lAvailableHeroes:
@@ -447,15 +441,9 @@
for iLoopHero in lMaybeLaterHeroes:
self.drawRecruitmentRow(screen, mainPanelName, iLoopHero,
PanelStyles.PANEL_STYLE_STANDARD, -2, iCount)
iCount += 1
- for iLoopHero in lUnbornHeroes:
- self.drawRecruitmentRow(screen, mainPanelName, iLoopHero,
PanelStyles.PANEL_STYLE_STANDARD, -1, iCount)
- iCount += 1
for iLoopHero in lEmployedHeroes:
self.drawRecruitmentRow(screen, mainPanelName, iLoopHero,
PanelStyles.PANEL_STYLE_STANDARD,
gc.getGame().getHeroDebutStatus(iLoopHero), iCount)
iCount += 1
- for iLoopHero in lDeadHeroes:
- self.drawRecruitmentRow(screen, mainPanelName, iLoopHero,
PanelStyles.PANEL_STYLE_STANDARD, -3, iCount)
- iCount += 1


def drawRecruitmentRow (self, screen, mainPanelName, iLoopHero,
ePanelStyle, iDebutStatus, iCount):
@@ -643,38 +631,20 @@

# loop through all other heroes and add their rows; show available first
lOurHeroes = []
- lEmployedHeroes = []
- lMaybeLaterHeroes = []
- lUnbornHeroes = []
- lDeadHeroes = []
+## lEmployedHeroes = []
for iLoopHero in range(gc.getNumHeroInfos()):
if gc.getGame().getHeroDebutStatus(iLoopHero) ==
gc.getGame().getActivePlayer():
lOurHeroes.append(iLoopHero)
- elif gc.getGame().getHeroDebutStatus(iLoopHero) >= 0:
- lEmployedHeroes.append(iLoopHero)
- elif gc.getGame().getHeroDebutStatus(iLoopHero) == -2:
- lMaybeLaterHeroes.append(iLoopHero)
- elif gc.getGame().getHeroDebutStatus(iLoopHero) == -1:
- lUnbornHeroes.append(iLoopHero)
- elif gc.getGame().getHeroDebutStatus(iLoopHero) == -3:
- lDeadHeroes.append(iLoopHero)
+## elif gc.getGame().getHeroDebutStatus(iLoopHero) >= 0:
+## lEmployedHeroes.append(iLoopHero)

iCount = 0
for iLoopHero in lOurHeroes:
self.drawInfoRow(screen, mainPanelName, iLoopHero,
PanelStyles.PANEL_STYLE_STANDARD,
gc.getGame().getHeroDebutStatus(iLoopHero), iCount)
iCount += 1
- for iLoopHero in lEmployedHeroes:
- self.drawInfoRow(screen, mainPanelName, iLoopHero,
PanelStyles.PANEL_STYLE_STANDARD,
gc.getGame().getHeroDebutStatus(iLoopHero), iCount)
- iCount += 1
- for iLoopHero in lMaybeLaterHeroes:
- self.drawInfoRow(screen, mainPanelName, iLoopHero,
PanelStyles.PANEL_STYLE_STANDARD, -2, iCount)
- iCount += 1
- for iLoopHero in lUnbornHeroes:
- self.drawInfoRow(screen, mainPanelName, iLoopHero,
PanelStyles.PANEL_STYLE_STANDARD, -1, iCount)
- iCount += 1
- for iLoopHero in lDeadHeroes:
- self.drawInfoRow(screen, mainPanelName, iLoopHero,
PanelStyles.PANEL_STYLE_STANDARD, -3, iCount)
- iCount += 1
+## for iLoopHero in lEmployedHeroes:
+## self.drawInfoRow(screen, mainPanelName, iLoopHero,
PanelStyles.PANEL_STYLE_STANDARD,
gc.getGame().getHeroDebutStatus(iLoopHero), iCount)
+## iCount += 1


# draws the current hero unit's stats
@@ -900,7 +870,7 @@

screen.setTextAt("Leadership", panelName,
localText.getText("TXT_KEY_RECRUIT_HERO_LEADERSHIP",
(gc.getHeroInfo(iHero).getLeadership(), )), CvUtil.FONT_CENTER_JUSTIFY, 5,
15, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
screen.setTextAt("Might", panelName,
localText.getText("TXT_KEY_RECRUIT_HERO_MIGHT",
(gc.getHeroInfo(iHero).getMight(), )), CvUtil.FONT_CENTER_JUSTIFY, 5, 35,
0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
- screen.setTextAt("XP", panelName,
localText.getText("TXT_KEY_RECRUIT_HERO_EXPERIENCE",
(gc.getGame().getHeroExperience(iHero), )), CvUtil.FONT_CENTER_JUSTIFY, 5,
55, 0, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)
+ screen.setTextAt("XP", panelName,
localText.getText("TXT_KEY_RECRUIT_HERO_EXPERIENCE",
(int(gc.getGame().getHeroExperience(iHero)), )),
CvUtil.FONT_CENTER_JUSTIFY, 5, 55, 0, FontTypes.GAME_FONT,
WidgetTypes.WIDGET_GENERAL, -1, -1)

self.placeCivAndBelief(iHero)
self.placeUnitCombatLevel(iHero)
=======================================
--- /trunk/The History of Three
Kingdoms/Assets/Python/Screens/CvLegionScreen.py Fri Sep 18 07:27:23 2009
+++ /trunk/The History of Three
Kingdoms/Assets/Python/Screens/CvLegionScreen.py Sat Sep 19 05:22:49 2009
@@ -50,10 +50,10 @@
"UNITCOMBAT_NAVAL" : []}

self.PerceivedUnitCombatLevels = {"UNITCOMBAT_MELEE" : 0,
- "UNITCOMBAT_MOUNTED" :
0,
- "UNITCOMBAT_ARCHER" :
0,
- "UNITCOMBAT_SIEGE" :
0,
- "UNITCOMBAT_NAVAL" :
0}
+ "UNITCOMBAT_MOUNTED" : 0,
+ "UNITCOMBAT_ARCHER" : 0,
+ "UNITCOMBAT_SIEGE" : 0,
+ "UNITCOMBAT_NAVAL" : 0}

self.PerceivedUniquePromotions = []
self.PerceivedMemberPromotions = []
@@ -136,28 +136,28 @@

screen.setImageButtonAt( "HeroPortrait", "HeroPortraitPanel",
gc.getHeroInfo(self.iHero).getPortrait(), 3, 3, self.iPortraitSize,
self.iPortraitSize, WidgetTypes.WIDGET_PEDIA_JUMP_TO_HERO, self.iHero, -1 )

- self.PerceivedUniquePromotions = []
- self.PerceivedMemberPromotions = []
- if pHero.getLeaderHero() == -1:
- for sUnitCombat in
self.PerceivedUnitCombatLevels.keys():
-
self.PerceivedUnitCombatLevels[sUnitCombat] =
gc.getGame().getHeroUnitCombatLevel(self.iHero,
gc.getInfoTypeForString(sUnitCombat))
- for ePromotion in range(gc.getNumPromotionInfos()):
- if
gc.getGame().getHeroPromotionStatus(self.iHero, ePromotion) == 1:
-
self.PerceivedUniquePromotions.append(ePromotion)
- elif
gc.getGame().getHeroPromotionStatus(self.iHero, ePromotion) == 2:
-
self.PerceivedMemberPromotions.append(ePromotion)
- else:
- for sUnitCombat in
self.PerceivedUnitCombatLevels.keys():
- eUnitCombat =
gc.getInfoTypeForString(sUnitCombat)
- if
gc.getGame().getHeroUnitCombatLevel(self.iHero, eUnitCombat) <
gc.getGame().getHeroUnitCombatLevel(pHero.getLeaderHero(), eUnitCombat):
-
self.PerceivedUnitCombatLevels[sUnitCombat] =
gc.getGame().getHeroUnitCombatLevel(self.iHero, eUnitCombat) + 1
- else:
-
self.PerceivedUnitCombatLevels[sUnitCombat] =
gc.getGame().getHeroUnitCombatLevel(self.iHero, eUnitCombat)
- for ePromotion in range(gc.getNumPromotionInfos()):
- if (
gc.getGame().getHeroPromotionStatus(self.iHero, ePromotion) == 1 or
(gc.getGame().getHeroCoreTroop(pHero.getLeaderHero()) == self.iUnitID and
gc.getGame().getHeroPromotionStatus(pHero.getLeaderHero(), ePromotion) ==
1) ):
-
self.PerceivedUniquePromotions.append(ePromotion)
- elif
gc.getGame().getHeroPromotionStatus(self.iHero, ePromotion) == 2 or
(gc.getGame().getHeroPromotionStatus(pHero.getLeaderHero(), ePromotion) ==
2 and gc.getGame().getHeroCurrentNineTransformationPromotion(self.iHero) ==
ePromotion):
-
self.PerceivedMemberPromotions.append(ePromotion)
+ self.PerceivedUniquePromotions = []
+ self.PerceivedMemberPromotions = []
+ if pHero.getLeaderHero() == -1:
+ for sUnitCombat in self.PerceivedUnitCombatLevels.keys():
+ self.PerceivedUnitCombatLevels[sUnitCombat] =
gc.getGame().getHeroUnitCombatLevel(self.iHero,
gc.getInfoTypeForString(sUnitCombat))
+ for ePromotion in range(gc.getNumPromotionInfos()):
+ if gc.getGame().getHeroPromotionStatus(self.iHero, ePromotion) == 1:
+ self.PerceivedUniquePromotions.append(ePromotion)
+ elif gc.getGame().getHeroPromotionStatus(self.iHero, ePromotion) == 2:
+ self.PerceivedMemberPromotions.append(ePromotion)
+ else:
+ for sUnitCombat in self.PerceivedUnitCombatLevels.keys():
+ eUnitCombat = gc.getInfoTypeForString(sUnitCombat)
+ if gc.getGame().getHeroUnitCombatLevel(self.iHero, eUnitCombat) <
gc.getGame().getHeroUnitCombatLevel(pHero.getLeaderHero(), eUnitCombat):
+ self.PerceivedUnitCombatLevels[sUnitCombat] =
gc.getGame().getHeroUnitCombatLevel(self.iHero, eUnitCombat) + 1
+ else:
+ self.PerceivedUnitCombatLevels[sUnitCombat] =
gc.getGame().getHeroUnitCombatLevel(self.iHero, eUnitCombat)
+ for ePromotion in range(gc.getNumPromotionInfos()):
+ if ( gc.getGame().getHeroPromotionStatus(self.iHero, ePromotion) == 1
or (gc.getGame().getHeroCoreTroop(pHero.getLeaderHero()) == self.iUnitID
and gc.getGame().getHeroPromotionStatus(pHero.getLeaderHero(), ePromotion)
== 1) ):
+ self.PerceivedUniquePromotions.append(ePromotion)
+ elif gc.getGame().getHeroPromotionStatus(self.iHero, ePromotion) == 2
or (gc.getGame().getHeroPromotionStatus(pHero.getLeaderHero(), ePromotion)
== 2 and gc.getGame().getHeroCurrentNineTransformationPromotion(self.iHero)
== ePromotion):
+ self.PerceivedMemberPromotions.append(ePromotion)

self.placeStats()
self.placeUnits()
@@ -237,7 +237,7 @@
szTempBuffer = localText.changeTextColor(szTempBuffer,
gc.getInfoTypeForString("COLOR_UNIT_TEXT"))
screen.setTextAt( "HeroLevel", szPanel, szTempBuffer,
CvUtil.FONT_LEFT_JUSTIFY, iIncrement, iIconSize * 3+ iIncrement * 3, -0.1,
FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1)

- szTempBuffer = localText.getText("INTERFACE_PANE_EXPERIENCE", ()) + ": "
+ u"%d/%d" % (gc.getGame().getHeroExperience(self.iHero),
gc.getGame().heroExperienceNeeded(self.iHero))
+ szTempBuffer = localText.getText("INTERFACE_PANE_EXPERIENCE", ()) + ": "
+ u"%d/%d" % (int(gc.getGame().getHeroExperience(self.iHero)),
gc.getGame().heroExperienceNeeded(self.iHero))
szTempBuffer = localText.changeTextColor(szTempBuffer,
gc.getInfoTypeForString("COLOR_UNIT_TEXT"))
screen.setTextAt( "HeroExperience", szPanel, szTempBuffer,
CvUtil.FONT_LEFT_JUSTIFY, iIncrement * 3 + iIconSize * 2, iIconSize * 3+
iIncrement * 3, -0.1, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1,
-1)

@@ -276,7 +276,7 @@
if (pLoopUnit.getOwner() == gc.getGame().getActivePlayer()
and pLoopUnit.getUnitCombatType() != -1
and pLoopUnit.getUnitCombatType() !=
gc.getInfoTypeForString("UNITCOMBAT_HERO")
- and pLoopUnit.getUnitCombatType() !=
gc.getInfoTypeForString("UNITCOMBAT_RECON")
+ and pLoopUnit.getUnitCombatType() !=
gc.getInfoTypeForString("UNITCOMBAT_RECON")
and ( pLoopUnit.getLegionHero() == -1 or pLoopUnit.getLegionHero()
== self.iHero ) ):
UnitList.append(pLoopUnit.getID())

@@ -319,7 +319,7 @@
elif len(self.InitLegionMemberList) ==
gc.getGame().getHeroCapacity(self.iHero, False, -1):
screen.enable( control, False )
if pHero.getLegionHero() != HeroTypes.NO_HERO and (pHero.isHurt() or
pHero.hasMoved()):
- screen.enable( control, False)
+ screen.enable( control, False)

# Member Check Box --- Unit Button, temporarily disable it if it's a
Warlord and there's currently no Legion Member
control = "UnitButton" + str(iID)
@@ -374,8 +374,8 @@

for j in range (gc.getNumPromotionInfos()):
if ( pLoopUnit.isHasPromotion(j) ):
- if (
gc.getGame().getHeroCurrentNineTransformationPromotion(self.iHero) == j and
self.LegionMemberCheck[iID] == 0):
- continue
+ if (
gc.getGame().getHeroCurrentNineTransformationPromotion(self.iHero) == j and
self.LegionMemberCheck[iID] == 0):
+ continue
szButton = gc.getPromotionInfo(j).getButton()
screen.appendMultiListButton( control, szButton, 0,
WidgetTypes.WIDGET_PEDIA_JUMP_TO_PROMOTION, j, -1, False )
screen.show( control )
@@ -471,8 +471,8 @@

for j in range (gc.getNumPromotionInfos()):
if ( pUnit.isHasPromotion(j) ):
- if (
gc.getGame().getHeroCurrentNineTransformationPromotion(self.iHero) == j and
self.LegionMemberCheck[iUnitID] == 0):
- continue
+ if (
gc.getGame().getHeroCurrentNineTransformationPromotion(self.iHero) == j and
self.LegionMemberCheck[iUnitID] == 0):
+ continue
if not ( (j in self.PerceivedUniquePromotions) and
self.LegionCoreTroopCheck.get(iUnitID) == 0):
if not ( self.LegionMemberCheck.get(iUnitID) == 0 and
(gc.getPromotionInfo(j).getPromotionUnitCombatType() ==
pUnit.getUnitCombatType() or (j in self.PerceivedMemberPromotions)) ):
szButton = gc.getPromotionInfo(j).getButton()
@@ -518,9 +518,9 @@
control = "UnitButton" + str(iLoopID)
screen.enable( control, True )
else:
- if
pHero.getLegionHero() != HeroTypes.NO_HERO and not pHero.isHurt():
-
control = "CoreTroopCheck" + str(iLoopID)
-
screen.enable( control, True )
+ if pHero.getLegionHero() != HeroTypes.NO_HERO and not
pHero.isHurt():
+ control = "CoreTroopCheck" + str(iLoopID)
+ screen.enable( control, True )
control = "UnitButton" + str(iLoopID)
screen.enable( control, True )

=======================================
--- /trunk/The History of Three
Kingdoms/Assets/Python/Screens/CvMainInterface.py Fri Sep 18 07:27:23 2009
+++ /trunk/The History of Three
Kingdoms/Assets/Python/Screens/CvMainInterface.py Sat Sep 19 05:22:49 2009
@@ -2090,7 +2090,7 @@
# a naked hero needs to calculate level again
if pUnit.getHeroType() != -1 and pUnit.getLegionHero() == -1:
iLevel = gc.getGame().getHeroLevel(pUnit.getHeroType())
- iMaxLevel =
mt.GetPossiblePromotions(gc.getGame().heroExperienceNeeded(pUnit.getHeroType()),
gc.getGame().getHeroExperience(pUnit.getHeroType()))
+ iMaxLevel =
mt.GetPossiblePromotions(gc.getGame().heroExperienceNeeded(pUnit.getHeroType()),
int(gc.getGame().getHeroExperience(pUnit.getHeroType())))
#### Sanguo Mod Hero, end

if (iMaxLevel > 0) or (iLevel > 1):
@@ -2107,7 +2107,7 @@
#### Sanguo Mod Hero, start, added by poyuzhe 02.15.09
# a naked hero needs to calculate experience again
if pUnit.getHeroType() != -1 and pUnit.getLegionHero() == -1:
- iExperience = gc.getGame().getHeroExperience(pUnit.getHeroType())
+ iExperience = int(gc.getGame().getHeroExperience(pUnit.getHeroType()))
#### Sanguo Mod Hero, end

if (iExperience > 0):
@@ -6754,10 +6754,10 @@
# The following line indented once
szRightBuffer = u"%d/%d" %(pHeadSelectedUnit.getExperience(),
pHeadSelectedUnit.experienceNeeded())
if pHeadSelectedUnit.getLegionHero() != -1:
- szTempBuffer = u" (%d/%d)" %
(gc.getGame().getHeroExperience(pHeadSelectedUnit.getLegionHero()),
gc.getGame().heroExperienceNeeded(pHeadSelectedUnit.getLegionHero()))
+ szTempBuffer = u" (%d/%d)" %
(int(gc.getGame().getHeroExperience(pHeadSelectedUnit.getLegionHero())),
gc.getGame().heroExperienceNeeded(pHeadSelectedUnit.getLegionHero()))
szLeftBuffer += localText.changeTextColor(szTempBuffer,
gc.getInfoTypeForString("COLOR_UNIT_TEXT"))
else:
- szRightBuffer = u"%d/%d" %
(gc.getGame().getHeroExperience(pHeadSelectedUnit.getHeroType()),
gc.getGame().heroExperienceNeeded(pHeadSelectedUnit.getHeroType()))
+ szRightBuffer = u"%d/%d" %
(int(gc.getGame().getHeroExperience(pHeadSelectedUnit.getHeroType())),
gc.getGame().heroExperienceNeeded(pHeadSelectedUnit.getHeroType()))
szRightBuffer = localText.changeTextColor(szRightBuffer,
gc.getInfoTypeForString("COLOR_UNIT_TEXT"))
#### Sanguo Mod Hero, end
szBuffer = szLeftBuffer + " " + szRightBuffer
=======================================
--- /trunk/The History of Three
Kingdoms/Assets/Python/Screens/CvWorldBuilderScreen.py Thu Aug 6 20:18:36
2009
+++ /trunk/The History of Three
Kingdoms/Assets/Python/Screens/CvWorldBuilderScreen.py Sat Sep 19 05:22:49
2009
@@ -429,7 +429,7 @@
bNakedHero = (iHeroType != -1 and iLegionHeroType == -1)

if bNakedHero:
- CyGame().setHeroExperience(iHeroType, iNewXP)
+ CyGame().setHeroExperience(iHeroType, float(iNewXP))
else:
pUnit.setExperience(iNewXP,-1)

@@ -1408,7 +1408,7 @@
bNakedHero = (iHeroType != -1 and iLegionType == -1)

if bNakedHero:
- iExperience = CyGame().getHeroExperience(iHeroType)
+ iExperience = int(CyGame().getHeroExperience(iHeroType))
iLevel = CyGame().getHeroLevel(iHeroType)
else:
iExperience = pUnit.getExperience()
=======================================
--- /trunk/The History of Three Kingdoms/Assets/Python/pyWB/CvWBDesc.py Wed
Sep 9 04:00:26 2009
+++ /trunk/The History of Three Kingdoms/Assets/Python/pyWB/CvWBDesc.py Sat
Sep 19 05:22:49 2009
@@ -1645,7 +1645,7 @@
f.write("\tLevel=%d\n" % (gc.getGame().getHeroLevel(idx)))

if gc.getGame().getHeroExperience(idx) > 0:
- f.write("\tExperience=%d\n" % (gc.getGame().getHeroExperience(idx)))
+ f.write("\tExperience=%f\n" % (gc.getGame().getHeroExperience(idx)))

f.write("\tVitality=%d\n" % (gc.getGame().getHeroVitality(idx)))

=======================================
--- /trunk/The History of Three
Kingdoms/Assets/XML/Text/CIV4GameText_Sanguo_Hero.xml Fri Sep 18 07:27:23
2009
+++ /trunk/The History of Three
Kingdoms/Assets/XML/Text/CIV4GameText_Sanguo_Hero.xml Sat Sep 19 05:22:49
2009
Binary file, no diff available.
=======================================
--- /trunk/The History of Three
Kingdoms/Assets/XML/Units/CIV4PromotionInfos.xml Fri Sep 18 07:27:23 2009
+++ /trunk/The History of Three
Kingdoms/Assets/XML/Units/CIV4PromotionInfos.xml Sat Sep 19 05:22:49 2009
@@ -13,6 +13,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/KAMIKAZE.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>40</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
+ <iUnitCombatMod>2</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<bNoEnemyWithdrawal>1</bNoEnemyWithdrawal>
</PromotionInfo>
@@ -29,6 +36,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/GUARDSMAN.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>40</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
+ <iUnitCombatMod>2</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<bDefendFromMarksman>1</bDefendFromMarksman>
</PromotionInfo>
@@ -46,6 +60,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/TERRAIN_MASTER.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>5</iRandomWeight>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<bIgnoreDefenderTerrain>1</bIgnoreDefenderTerrain>
</PromotionInfo>
@@ -62,6 +77,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/CHARGING.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>40</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
+ <iUnitCombatMod>4</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<iMoveAttackStrengthModifier>30</iMoveAttackStrengthModifier>
</PromotionInfo>
@@ -78,6 +100,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/TOUGH.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>10</iRandomWeight>
<iHeroPromotionStatus>1</iHeroPromotionStatus>

<iVersusEnemyCoreTroopStrengthModifier>50</iVersusEnemyCoreTroopStrengthModifier>
</PromotionInfo>
@@ -94,6 +117,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/DEFENDER1.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>40</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<iBarbarianModifier>50</iBarbarianModifier>
<iNonGoodReligionStrengthModifier>25</iNonGoodReligionStrengthModifier>
@@ -112,6 +136,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/DEFENDER2.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>40</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<bCaptureBarbarian>1</bCaptureBarbarian>
<iNonGoodReligionStrengthModifier>25</iNonGoodReligionStrengthModifier>
@@ -129,6 +154,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/DETERMINED.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>20</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
+ <iUnitCombatMod>2</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<iBetterStrengthEnemyModifier>50</iBetterStrengthEnemyModifier>
</PromotionInfo>
@@ -145,6 +177,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/STURDY.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>5</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
+ <iUnitCombatMod>4</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<iDefenseBuildingEffectModifier>50</iDefenseBuildingEffectModifier>
</PromotionInfo>
@@ -163,6 +202,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/RIVER_LORD.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>40</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_NAVAL</UnitCombatType>
+ <iUnitCombatMod>4</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<iBesideRiverStrengthModifier>25</iBesideRiverStrengthModifier>
</PromotionInfo>
@@ -179,6 +225,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/conqueror.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>1</iRandomWeight>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<bWarGod>1</bWarGod>
</PromotionInfo>
@@ -1586,6 +1633,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/defence1.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>80</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
</PromotionInfo>
<PromotionInfo>
@@ -1611,6 +1659,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/defence2.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>80</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
</PromotionInfo>
<PromotionInfo>
@@ -1636,6 +1685,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/defence3.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>80</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
</PromotionInfo>
<PromotionInfo>
@@ -1653,6 +1703,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/defence4.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>40</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<bDefendAgainstCharge>1</bDefendAgainstCharge>
</PromotionInfo>
@@ -1688,6 +1739,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/attack1.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>80</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
</PromotionInfo>
<PromotionInfo>
@@ -1723,6 +1775,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/attack2.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>80</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
</PromotionInfo>
<PromotionInfo>
@@ -1758,6 +1811,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/attack3.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>80</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
</PromotionInfo>
<PromotionInfo>
@@ -1774,6 +1828,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/attack4.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>40</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
</PromotionInfo>
<PromotionInfo>
@@ -1789,6 +1844,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/TRIUMPH.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>5</iRandomWeight>
<iHeroPromotionStatus>1</iHeroPromotionStatus>

<iKillCoreTroopGoldenAgeChancePerLevel>5</iKillCoreTroopGoldenAgeChancePerLevel>
</PromotionInfo>
@@ -1805,6 +1861,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/INSTIGATOR.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>10</iRandomWeight>
<iHeroPromotionStatus>1</iHeroPromotionStatus>

<iDestroySurroundingImprovementChance>90</iDestroySurroundingImprovementChance>
</PromotionInfo>
@@ -1821,6 +1878,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/SWEEP.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>5</iRandomWeight>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<bDestroyOwnTown>1</bDestroyOwnTown>
</PromotionInfo>
@@ -1837,6 +1895,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/MARKSMAN.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>10</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
+ <iUnitCombatMod>10</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<bTargetWeakestFirst>1</bTargetWeakestFirst>
</PromotionInfo>
@@ -1853,6 +1918,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/SOLID.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>10</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
+ <iUnitCombatMod></iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<iEnemyAttackNullifyChance>40</iEnemyAttackNullifyChance>
</PromotionInfo>
@@ -1869,6 +1941,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/SHOCKING.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>10</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
+ <iUnitCombatMod>5</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<bScatterEnemyStack>1</bScatterEnemyStack>
</PromotionInfo>
@@ -1885,6 +1964,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/DESTROYER.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>1</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_SIEGE</UnitCombatType>
+ <iUnitCombatMod>20</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<iAttackedCityDefenseChange>40</iAttackedCityDefenseChange>
</PromotionInfo>
@@ -1901,6 +1987,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/MOTIVATED.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>20</iRandomWeight>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<iSameTurnWinStrengthModifier>25</iSameTurnWinStrengthModifier>
</PromotionInfo>
@@ -1917,6 +2004,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/LEARNED.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>3</iRandomWeight>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<bStealHeroPromotion>1</bStealHeroPromotion>
</PromotionInfo>
@@ -1933,6 +2021,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/FEARFUL.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>5</iRandomWeight>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<iSurroundingEnemyHealthChange>-10</iSurroundingEnemyHealthChange>
</PromotionInfo>
@@ -1949,6 +2038,17 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/SURPRISE_ATTACK.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>20</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
+ <iUnitCombatMod>4</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
+ <iUnitCombatMod>4</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<bTargetCoreTroopFirst>1</bTargetCoreTroopFirst>
</PromotionInfo>
@@ -1965,6 +2065,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/HEROIC.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>5</iRandomWeight>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<iConvertWarlordChance>20</iConvertWarlordChance>
</PromotionInfo>
@@ -1981,6 +2082,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/SWIFT.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>1</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
+ <iUnitCombatMod>5</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<bDefeatGeneralRestoreMoves>1</bDefeatGeneralRestoreMoves>
</PromotionInfo>
@@ -1998,6 +2106,17 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/SHARPSHOOTER.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>10</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
+ <iUnitCombatMod>10</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_SIEGE</UnitCombatType>
+ <iUnitCombatMod>10</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<iArcherBombardRangeChange>1</iArcherBombardRangeChange>
</PromotionInfo>
@@ -2014,6 +2133,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/STOPPER.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>30</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
+ <iUnitCombatMod>3</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<iAdditionalAttackChance>80</iAdditionalAttackChance>
</PromotionInfo>
@@ -2069,6 +2195,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/WILD1.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>80</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
</PromotionInfo>
<PromotionInfo>
@@ -2125,6 +2252,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/WILD2.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>80</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<NoHealthPercentFeature>FEATURE_FALLOUT</NoHealthPercentFeature>
</PromotionInfo>
@@ -2141,6 +2269,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/FIGHTER1.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>80</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<iStrengthIncrease>1</iStrengthIncrease>
</PromotionInfo>
@@ -2159,6 +2288,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/FIGHTER2.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>80</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<iStrengthIncrease>1</iStrengthIncrease>
</PromotionInfo>
@@ -2177,6 +2307,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/FIGHTER3.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>40</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<iStrengthIncrease>1</iStrengthIncrease>
</PromotionInfo>
@@ -2195,6 +2326,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/FIGHTER4.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>20</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<iStrengthIncrease>1</iStrengthIncrease>
</PromotionInfo>
@@ -2221,6 +2353,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/STEALTH1.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>80</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
</PromotionInfo>
<PromotionInfo>
@@ -2237,6 +2370,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/STEALTH2.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>5</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
+ <iUnitCombatMod>5</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<Invisible>INVISIBLE_TERRAIN</Invisible>
</PromotionInfo>
@@ -2253,6 +2393,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/PSYCHO_ATTACK.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>10</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<iCaptureEnemyChance>20</iCaptureEnemyChance>
</PromotionInfo>
@@ -2269,6 +2410,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/STRONG.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>10</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
+ <iUnitCombatMod>2</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<iTotalWinStrengthThreshold>3</iTotalWinStrengthThreshold>
</PromotionInfo>
@@ -2285,6 +2433,17 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/FAR_SHOT.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>5</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
+ <iUnitCombatMod>10</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_SIEGE</UnitCombatType>
+ <iUnitCombatMod>10</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<bBombardingArcher>1</bBombardingArcher>
</PromotionInfo>
@@ -2301,6 +2460,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/SEA_LORD.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>1</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_NAVAL</UnitCombatType>
+ <iUnitCombatMod>10</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<bSeaLord>1</bSeaLord>
<LimitToUnitCombatType>UNITCOMBAT_NAVAL</LimitToUnitCombatType>
@@ -2318,6 +2484,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/SILK_SAIL.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>1</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_NAVAL</UnitCombatType>
+ <iUnitCombatMod>10</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<iSeaBattleWinPlunderPercent>50</iSeaBattleWinPlunderPercent>
<LimitToUnitCombatType>UNITCOMBAT_NAVAL</LimitToUnitCombatType>
@@ -2335,6 +2508,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/YELLOW_TURBAN1.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>20</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<bWinCombatSprawlBarbarian>1</bWinCombatSprawlBarbarian>
</PromotionInfo>
@@ -2352,6 +2526,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/YELLOW_TURBAN2.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>10</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<bWinCombatSpreadCulture>1</bWinCombatSpreadCulture>
</PromotionInfo>
@@ -2368,6 +2543,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/DISCIPLINED.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>40</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>

<iCoreTroopDefeatedStrengthModifier>25</iCoreTroopDefeatedStrengthModifier>
</PromotionInfo>
@@ -2384,6 +2560,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/EXCITED.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>40</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<iDefeatCoreTroopStrengthModifier>50</iDefeatCoreTroopStrengthModifier>
</PromotionInfo>
@@ -2400,6 +2577,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/TUTOR.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>40</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<iUponDeathShareExperienceAmount>100</iUponDeathShareExperienceAmount>
</PromotionInfo>
@@ -2416,6 +2594,17 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/SHOUT.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>1</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
+ <iUnitCombatMod>5</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
+ <iUnitCombatMod>5</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<iTerrifyAttackingEnemyChance>50</iTerrifyAttackingEnemyChance>
</PromotionInfo>
@@ -2432,6 +2621,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/COMMANDER.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>3</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
+ <iUnitCombatMod>4</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<iNoDeathCombatOddsThreshold>10</iNoDeathCombatOddsThreshold>
</PromotionInfo>
@@ -2448,6 +2644,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/unstoppable.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>20</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
+ <iUnitCombatMod>4</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<bAttackWithSameLegion>1</bAttackWithSameLegion>
<LimitToUnitCombatType>UNITCOMBAT_MOUNTED</LimitToUnitCombatType>
@@ -2465,6 +2668,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/reconditioning.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>5</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
+ <iUnitCombatMod>5</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<iWinCombatRestoreHealthPercent>15</iWinCombatRestoreHealthPercent>
</PromotionInfo>
@@ -2481,6 +2691,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/frontal_assault.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>20</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
+ <iUnitCombatMod>5</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<iFlankingDamageIncreasePercent>25</iFlankingDamageIncreasePercent>
<LimitToUnitCombatType>UNITCOMBAT_MOUNTED</LimitToUnitCombatType>
@@ -2500,6 +2717,17 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/quick.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>40</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
+ <iUnitCombatMod>2</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_NAVAL</UnitCombatType>
+ <iUnitCombatMod>2</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
</PromotionInfo>
<PromotionInfo>
@@ -2525,6 +2753,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/discretion.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>40</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
</PromotionInfo>
<PromotionInfo>
@@ -2543,6 +2772,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/resilient1.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>80</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
</PromotionInfo>
<PromotionInfo>
@@ -2562,6 +2792,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/resilient2.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>80</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
</PromotionInfo>
<PromotionInfo>
@@ -2581,6 +2812,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/resilient3.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>40</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
</PromotionInfo>
<PromotionInfo>
@@ -2600,6 +2832,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/resilient4.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>20</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
</PromotionInfo>
<PromotionInfo>
@@ -2618,6 +2851,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/heavy_armor.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>10</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
+ <iUnitCombatMod>8</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<LimitToUnitCombatType>UNITCOMBAT_MOUNTED</LimitToUnitCombatType>
<bForceDefensiveBonus>1</bForceDefensiveBonus>
@@ -2719,6 +2959,17 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/logistics.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>20</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
+ <iUnitCombatMod>2</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
+ <iUnitCombatMod>2</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<ActivePromotionPrereq>PROMOTION_MEDIC2</ActivePromotionPrereq>
</PromotionInfo>
@@ -2735,6 +2986,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/runner.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>1</iRandomWeight>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<bForceDefensiveWithdrawal>1</bForceDefensiveWithdrawal>
</PromotionInfo>
@@ -2751,6 +3003,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/warrior_soul.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>20</iRandomWeight>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<bReckless>1</bReckless>
</PromotionInfo>
@@ -2768,6 +3021,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/penetration.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>5</iRandomWeight>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<SeeInvisibles>
<InvisibleTypes>
@@ -2793,6 +3047,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/morale.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>20</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
+ <iUnitCombatMod>2</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<iSecondAttackChance>50</iSecondAttackChance>
</PromotionInfo>
@@ -2809,6 +3070,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/mature_late.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>1</iRandomWeight>
<iHeroPromotionStatus>1</iHeroPromotionStatus>
<iMatureLevel>5</iMatureLevel>
</PromotionInfo>
@@ -2825,6 +3087,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/naval_stealth.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>1</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_NAVAL</UnitCombatType>
+ <iUnitCombatMod>10</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<Invisible>INVISIBLE_NAVAL</Invisible>
<LimitToUnitCombatType>UNITCOMBAT_NAVAL</LimitToUnitCombatType>
@@ -2842,6 +3111,7 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/elite.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>30</iRandomWeight>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
<iExperienceModifierPerLegionTurn>1</iExperienceModifierPerLegionTurn>
</PromotionInfo>
@@ -2863,6 +3133,13 @@
</UnitCombats>
<Button>Art/Interface/Buttons/Promotions/cavalry_killer.dds</Button>
<bHero>1</bHero>
+ <iRandomWeight>5</iRandomWeight>
+ <UnitCombatWeightMods>
+ <UnitCombatWeightMod>
+ <UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
+ <iUnitCombatMod>10</iUnitCombatMod>
+ </UnitCombatWeightMod>
+ </UnitCombatWeightMods>
<iHeroPromotionStatus>2</iHeroPromotionStatus>
</PromotionInfo>
</PromotionInfos>
=======================================
--- /trunk/The History of Three
Kingdoms/Assets/XML/Units/CIV4UnitSchema.xml Sun Aug 16 09:48:46 2009
+++ /trunk/The History of Three
Kingdoms/Assets/XML/Units/CIV4UnitSchema.xml Sat Sep 19 05:22:49 2009
@@ -905,6 +905,14 @@
<ElementType name="iSecondAttackChance" content="textOnly" dt:type="int"/>
<ElementType name="iMatureLevel" content="textOnly" dt:type="int"/>
<ElementType name="iExperienceModifierPerLegionTurn" content="textOnly"
dt:type="int"/>
+ <ElementType name="iRandomWeight" content="textOnly" dt:type="int"/>
+ <ElementType name="UnitCombatWeightMod" content="eltOnly">
+ <element type="UnitCombatType"/>
+ <element type="iUnitCombatMod"/>
+ </ElementType>
+ <ElementType name="UnitCombatWeightMods" content="eltOnly">
+ <element type="UnitCombatWeightMod" minOccurs="0" maxOccurs="*"/>
+ </ElementType>
<!-- Sanguo Mod Hero, end -->

<ElementType name="PromotionInfo" content="eltOnly">
@@ -970,7 +978,9 @@
<element type="iHotKeyPriority" minOccurs="0"/>
<element type="Button" minOccurs="0" maxOccurs="*"/>
<element type="iOrderPriority" minOccurs="0"/>
- <element type="bHero" minOccurs="0"/>
+ <element type="bHero" minOccurs="0"/>
+ <element type="iRandomWeight" minOccurs="0"/>
+ <element type="UnitCombatWeightMods" minOccurs="0"/>
<element type="PromotionUnitCombatType" minOccurs="0"/>
<element type="iPromotionUnitCombatLevel" minOccurs="0"/>
<element type="iHeroUnitCombatLevelChange" minOccurs="0"/>
=======================================
--- /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvGame.cpp Fri Sep
18 07:27:23 2009
+++ /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvGame.cpp Sat Sep
19 05:22:49 2009
@@ -10075,10 +10075,10 @@

if (iChange != 0)
{
- FAssert (m_mapHeroes[eHero].aSeeInvisibleCount.size() ==
GC.getNumInvisibleInfos());
+ FAssert ((int)m_mapHeroes[eHero].aSeeInvisibleCount.size() ==
GC.getNumInvisibleInfos());
for (int iI = 0; iI < GC.getNumInvisibleInfos(); iI++)
{
- if (m_mapHeroes[eHero].aSeeInvisibleCount.size() !=
GC.getNumInvisibleInfos())
+ if ((int)m_mapHeroes[eHero].aSeeInvisibleCount.size() <
GC.getNumInvisibleInfos())
{
m_mapHeroes[eHero].aSeeInvisibleCount.push_back(0);
}
@@ -11052,7 +11052,7 @@
}
}

-HeroTypes CvGame::createRandomHero(PlayerTypes ePlayer, int iX, int iY)
+HeroTypes CvGame::createRandomHero(PlayerTypes ePlayer, int iX, int iY,
int iLeadership, int iMight, int iLoyalty, int iUnitCombat, PromotionTypes
eFirstPromotion, PromotionTypes eSecondPromotion, PromotionTypes
eThirdPromotion, bool bThreeRandomPromotions)
{
CvHeroInfo* pNewHeroInfo = new CvHeroInfo;
FAssert (pNewHeroInfo != NULL);
@@ -11133,7 +11133,14 @@
pNewHeroInfo->setDefaultCivilizationEndYear(iI, -1);
pNewHeroInfo->setCivilizationLoyalty(iI, getSorenRandNum(100, "Random
Civilization Loyalty Pick"));
}
-
pNewHeroInfo->setCivilizationLoyalty(GET_PLAYER(ePlayer).getCivilizationType(),
std::max(70,
pNewHeroInfo->getCivilizationLoyalty(GET_PLAYER(ePlayer).getCivilizationType())));
+ if (iLoyalty == -1)
+ {
+
pNewHeroInfo->setCivilizationLoyalty(GET_PLAYER(ePlayer).getCivilizationType(),
std::max(70,
pNewHeroInfo->getCivilizationLoyalty(GET_PLAYER(ePlayer).getCivilizationType())));
+ }
+ else
+ {
+
pNewHeroInfo->setCivilizationLoyalty(GET_PLAYER(ePlayer).getCivilizationType(),
iLoyalty);
+ }

pNewHeroInfo->setVitality(std::max(4, getSorenRandNum(10, "Random
Vitality Pick")));

@@ -11161,12 +11168,20 @@
else
{
pNewHeroInfo->setUnitCombatLevel(iI, std::min(1,
getSorenRandNum(2, "Random Unit Combat Level Pick")));
+ if (iUnitCombat == iI)
+ {
+ pNewHeroInfo->setUnitCombatLevel(iI, 2);
+ }
if (pNewHeroInfo->getUnitCombatLevel(iI) > 0)
{
iNumSet += 1;
}
pNewHeroInfo->setPotentialUnitCombatLevel(iI,
std::max(pNewHeroInfo->getUnitCombatLevel(iI), getSorenRandNum(6, "Random
Potential Unit Combat Level Pick")));
- }
+ if (iUnitCombat == iI)
+ {
+ pNewHeroInfo->setPotentialUnitCombatLevel(iI,
std::max(pNewHeroInfo->getPotentialUnitCombatLevel(iI), 4));
+ }
+ }
}
for (iI = 0; iI < GC.getNumUnitCombatInfos(); iI++)
{
@@ -11215,32 +11230,77 @@
}

// SurrenderType choice
- std::map<int, int> mRandomSurrenders;
+ std::vector< std::pair<int, int> > aTempVector;
int iTotalWeight = 0, iRand;
for (iI = 0; iI < GC.getNumSurrenderInfos(); iI++)
{
if (GC.getSurrenderInfo((SurrenderTypes)iI).getRandomWeight() > 0)
{
iTotalWeight +=
GC.getSurrenderInfo((SurrenderTypes)iI).getRandomWeight();
- mRandomSurrenders[iTotalWeight] = iI;
+ aTempVector.push_back( std::make_pair<int, int>(iTotalWeight,
iI) );
}
}

- FAssert ((int)mRandomSurrenders.size() > 0);
+ FAssert ((int)aTempVector.size() > 0);

iRand = getSorenRandNum(iTotalWeight, "Random Surrender Type Pick");
- for (std::map<int, int>::const_iterator iter =
mRandomSurrenders.begin(); iter != mRandomSurrenders.end(); ++iter)
- {
- if (iRand < iter->first)
- {
- pNewHeroInfo->setSurrenderType(iter->second);
+ for (std::vector< std::pair<int, int> >::const_iterator iter =
aTempVector.begin(); iter != aTempVector.end(); ++iter)
+ {
+ if (iRand < (*iter).first)
+ {
+ pNewHeroInfo->setSurrenderType((*iter).second);
break;
}
}
+
+ aTempVector.clear();

// HoTK ToDo: find a way to determine hero attributes after designing
random hero type
- pNewHeroInfo->setLeadership(80);
- pNewHeroInfo->setMight(80);
+ iTotalWeight = 0;
+ for (iI = 1; iI <= 100; iI++)
+ {
+ if (iI < 59)
+ {
+ iTotalWeight += 1;
+ }
+ else if (iI < 75)
+ {
+ iTotalWeight += 50 + (iI - 60);
+ }
+ else if (iI < 90)
+ {
+ iTotalWeight += 100 - (iI - 75) * 6;
+ }
+ else
+ {
+ iTotalWeight += 1;
+ }
+ aTempVector.push_back( std::make_pair<int, int>(iTotalWeight, iI)
);
+ }
+
+ iRand = getSorenRandNum(iTotalWeight, "random leadership");
+
+ for (std::vector< std::pair<int, int> >::const_iterator iter =
aTempVector.begin(); iter != aTempVector.end(); ++iter)
+ {
+ if (iRand < (*iter).first)
+ {
+ pNewHeroInfo->setLeadership(std::max(iLeadership,
(*iter).second));
+ break;
+ }
+ }
+
+ iRand = getSorenRandNum(iTotalWeight, "random might");
+
+ for (std::vector< std::pair<int, int> >::const_iterator iter =
aTempVector.begin(); iter != aTempVector.end(); ++iter)
+ {
+ if (iRand < (*iter).first)
+ {
+ pNewHeroInfo->setMight(std::max(iMight, (*iter).second));
+ break;
+ }
+ }
+
+ aTempVector.clear();

// Add to info vector
int iIndex = -1;
@@ -11295,27 +11355,115 @@

m_ppaiHeroPromotionStatus.push_back(new int[GC.getNumPromotionInfos()]);
iNumSet = 0;
- int iRandOffset = getSorenRandNum(GC.getNumPromotionInfos(), "Random
Offset");
- for (iI = 0; iI < GC.getNumPromotionInfos(); iI++)
- {
- PromotionTypes ePromotion = (PromotionTypes)((iI +
iRandOffset)%(GC.getNumPromotionInfos()));
- m_ppaiHeroPromotionStatus[(HeroTypes)iIndex][ePromotion] = 0;
- if (GC.getPromotionInfo(ePromotion).getHeroUnitCombatLevelChange() > 0)
- {
- m_ppaiHeroPromotionStatus[(HeroTypes)iIndex][ePromotion] = 3;
- }
- else if (canHeroAcquirePromotion((HeroTypes)iIndex, ePromotion, false,
true))
- {
- if (iNumSet < 3)
- {
- if (getSorenRandNum(GC.getNumPromotionInfos(), "Random Promotion
Pick") < 5)
- {
- m_ppaiHeroPromotionStatus[(HeroTypes)iIndex][ePromotion] =
GC.getPromotionInfo(ePromotion).getHeroPromotionStatus();
- pNewHeroInfo->setUnitPromotionStatus(ePromotion,
GC.getPromotionInfo(ePromotion).getHeroPromotionStatus());
- iNumSet++;
- }
- }
- }
+
+ for (iI = 0; iI < GC.getNumPromotionInfos(); iI++)
+ {
+ PromotionTypes ePromotion = (PromotionTypes)iI;
+ m_ppaiHeroPromotionStatus[(HeroTypes)iIndex][ePromotion] = 0;
+ if (GC.getPromotionInfo(ePromotion).getHeroUnitCombatLevelChange() >
0)
+ {
+ m_ppaiHeroPromotionStatus[(HeroTypes)iIndex][ePromotion] = 3;
+ }
+ }
+
+ if (eFirstPromotion != NO_PROMOTION)
+ {
+ m_ppaiHeroPromotionStatus[(HeroTypes)iIndex][eFirstPromotion] =
GC.getPromotionInfo(eFirstPromotion).getHeroPromotionStatus();
+ iNumSet += 1;
+ }
+ if (eSecondPromotion != NO_PROMOTION)
+ {
+ m_ppaiHeroPromotionStatus[(HeroTypes)iIndex][eSecondPromotion] =
GC.getPromotionInfo(eSecondPromotion).getHeroPromotionStatus();
+ iNumSet += 1;
+ }
+ if (eThirdPromotion != NO_PROMOTION)
+ {
+ m_ppaiHeroPromotionStatus[(HeroTypes)iIndex][eThirdPromotion] =
GC.getPromotionInfo(eThirdPromotion).getHeroPromotionStatus();
+ iNumSet += 1;
+ }
+
+ if (iNumSet < 3)
+ {
+ iTotalWeight = 0;
+ int iLevel, iBestLevel = 0;
+ int iHighestCombat;
+ for (iI = 0; iI < GC.getNumUnitCombatInfos(); iI++)
+ {
+ iLevel = pNewHeroInfo->getPotentialUnitCombatLevel(iI);
+ if (iLevel > iBestLevel)
+ {
+ iBestLevel = iLevel;
+ iHighestCombat = iI;
+ }
+ }
+
+ for (iI = 0; iI < GC.getNumPromotionInfos(); iI++)
+ {
+ PromotionTypes ePromotion = (PromotionTypes)iI;
+
+ if (m_ppaiHeroPromotionStatus[(HeroTypes)iIndex][ePromotion]
== 0)
+ {
+ if (GC.getPromotionInfo(ePromotion).getRandomWeight() > 0)
+ {
+ iTotalWeight +=
GC.getPromotionInfo(ePromotion).getRandomWeight() * std::max(1,
GC.getPromotionInfo(ePromotion).getUnitCombatWeightMod(iHighestCombat));
+ aTempVector.push_back( std::make_pair<int,
int>(iTotalWeight, iI) );
+ }
+ }
+ }
+
+ if (iNumSet == 0)
+ {
+ if (bThreeRandomPromotions || getSorenRandNum(100, "first
promotion chance") < 80)
+ {
+ iRand = getSorenRandNum(iTotalWeight, "first promotion
choice");
+ for (std::vector< std::pair<int, int> >::const_iterator
iter = aTempVector.begin(); iter != aTempVector.end(); ++iter)
+ {
+ if (iRand < (*iter).first &&
canHeroAcquirePromotion((HeroTypes)iIndex, (PromotionTypes)(*iter).second,
false, true))
+ {
+
m_ppaiHeroPromotionStatus[(HeroTypes)iIndex][(*iter).second] =
GC.getPromotionInfo((PromotionTypes)(*iter).second).getHeroPromotionStatus();
+ iNumSet += 1;
+ eFirstPromotion = (PromotionTypes)(*iter).second;
+ break;
+ }
+ }
+ }
+ }
+
+ if (iNumSet == 1)
+ {
+ if (bThreeRandomPromotions || getSorenRandNum(100, "second
promotion chance") < 40)
+ {
+ iRand = getSorenRandNum(iTotalWeight, "second promotion
choice");
+ for (std::vector< std::pair<int, int> >::const_iterator
iter = aTempVector.begin(); iter != aTempVector.end(); ++iter)
+ {
+ if (iRand < (*iter).first && eFirstPromotion !=
(*iter).second && canHeroAcquirePromotion((HeroTypes)iIndex,
(PromotionTypes)(*iter).second, false, true))
+ {
+
m_ppaiHeroPromotionStatus[(HeroTypes)iIndex][(*iter).second] =
GC.getPromotionInfo((PromotionTypes)(*iter).second).getHeroPromotionStatus();
+ iNumSet += 1;
+ eSecondPromotion = (PromotionTypes)(*iter).second;
+ break;
+ }
+ }
+ }
+ }
+
+ if (iNumSet == 2)
+ {
+ if (bThreeRandomPromotions || getSorenRandNum(100, "third
promotion chance") < 5)
+ {
+ iRand = getSorenRandNum(iTotalWeight, "third promotion
choice");
+ for (std::vector< std::pair<int, int> >::const_iterator
iter = aTempVector.begin(); iter != aTempVector.end(); ++iter)
+ {
+ if (iRand < (*iter).first && eFirstPromotion !=
(*iter).second && eSecondPromotion != (*iter).second &&
canHeroAcquirePromotion((HeroTypes)iIndex, (PromotionTypes)(*iter).second,
false, true))
+ {
+
m_ppaiHeroPromotionStatus[(HeroTypes)iIndex][(*iter).second] =
GC.getPromotionInfo((PromotionTypes)(*iter).second).getHeroPromotionStatus();
+ iNumSet += 1;
+ eSecondPromotion = (PromotionTypes)(*iter).second;
+ break;
+ }
+ }
+ }
+ }
}

if (pNewHeroInfo->isNineTransformation())
=======================================
--- /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvGame.h Fri Sep 18
07:27:23 2009
+++ /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvGame.h Sat Sep 19
05:22:49 2009
@@ -621,7 +621,7 @@
void tempRemoveHeroCoreTroop(HeroTypes eHero); // Exposed to Python
void clearHeroBackUpList(HeroTypes eHero); // Exposed to
Python

- HeroTypes createRandomHero(PlayerTypes ePlayer, int iX, int iY); //
Exposed to Python
+ HeroTypes createRandomHero(PlayerTypes ePlayer, int iX, int iY, int
iLeadership = -1, int iMight = -1, int iLoyalty = -1, int iUnitCombat = -1,
PromotionTypes eFirstPromotion = NO_PROMOTION, PromotionTypes
eSecondPromotion = NO_PROMOTION, PromotionTypes eThirdPromotion =
NO_PROMOTION, bool bThreeRandomPromotions = false); // Exposed to Python

int getHeroSeeInvisibleCount(HeroTypes eHero, InvisibleTypes eInvisible);
PlayerTypes getHeroCapturePlayer(HeroTypes eHero) const; // Exposed to
Python
=======================================
--- /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvGameTextMgr.cpp
Fri Sep 18 07:27:23 2009
+++ /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvGameTextMgr.cpp
Sat Sep 19 05:22:49 2009
@@ -621,7 +621,7 @@

if (pUnit->getLegionHero() == NO_HERO &&
(GC.getGameINLINE().getHeroExperience(eHero) > 0) && !(pUnit->isFighting()))
{
- szString.append(gDLL->getText("TXT_KEY_UNIT_HELP_LEVEL",
GC.getGameINLINE().getHeroExperience(eHero),
GC.getGameINLINE().heroExperienceNeeded(eHero)));
+ szString.append(gDLL->getText("TXT_KEY_UNIT_HELP_LEVEL",
(int)GC.getGameINLINE().getHeroExperience(eHero),
GC.getGameINLINE().heroExperienceNeeded(eHero)));
}

szString.append(L", ");
@@ -729,13 +729,29 @@
bHasLeadsToPro = false;
for (int iJ = 0; iJ < GC.getNumPromotionInfos(); ++iJ)
{
- if
(GC.getPromotionInfo((PromotionTypes)iJ).getPrereqPromotion() == iI)
- {
- if (pUnit->isHasPromotion((PromotionTypes)iJ))
+ if (pUnit->isHasPromotion((PromotionTypes)iJ))
+ {
+ if
(GC.getPromotionInfo((PromotionTypes)iJ).getPrereqPromotion() == iI)
{
bHasLeadsToPro = true;
break;
}
+ else if
(GC.getPromotionInfo((PromotionTypes)iJ).getPrereqOrPromotion1() == iI)
+ {
+ if
(GC.getPromotionInfo((PromotionTypes)iJ).getPrereqOrPromotion2() == -1 &&
GC.getPromotionInfo((PromotionTypes)iJ).getPrereqPromotion() == -1)
+ {
+ bHasLeadsToPro = true;
+ break;
+ }
+ }
+ else if
(GC.getPromotionInfo((PromotionTypes)iJ).getPrereqOrPromotion2() == iI)
+ {
+ if
(GC.getPromotionInfo((PromotionTypes)iJ).getPrereqOrPromotion1() == -1 &&
GC.getPromotionInfo((PromotionTypes)iJ).getPrereqOrPromotion1() == -1)
+ {
+ bHasLeadsToPro = true;
+ break;
+ }
+ }
}
}

=======================================
--- /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvInfos.cpp Tue Sep
15 08:01:36 2009
+++ /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvInfos.cpp Sat Sep
19 05:22:49 2009
@@ -1733,7 +1733,9 @@
m_iSecondAttackChance(0),
m_iMatureLevel(0),
m_iExperienceModifierPerLegionTurn(0),
+m_iRandomWeight(0),
m_pbSeeInvisibles(NULL),
+m_piUnitCombatWeightMods(NULL),
// Sanguo Mod Hero, end
m_piTerrainAttackPercent(NULL),
m_piTerrainDefensePercent(NULL),
@@ -1765,6 +1767,10 @@
SAFE_DELETE_ARRAY(m_pbTerrainDoubleMove);
SAFE_DELETE_ARRAY(m_pbFeatureDoubleMove);
SAFE_DELETE_ARRAY(m_pbUnitCombat);
+ // Sanguo Mod Hero, start, added by poyuzhe 09.19.09
+ SAFE_DELETE_ARRAY(m_pbSeeInvisibles);
+ SAFE_DELETE_ARRAY(m_piUnitCombatWeightMods);
+ // Sanguo Mod Hero, end
}

int CvPromotionInfo::getLayerAnimationPath() const
@@ -2307,6 +2313,11 @@
{
return m_iExperienceModifierPerLegionTurn;
}
+
+int CvPromotionInfo::getRandomWeight() const
+{
+ return m_iRandomWeight;
+}

bool CvPromotionInfo::isSeeInvisibles(int i) const
{
@@ -2314,6 +2325,13 @@
FAssertMsg(i > -1, "Index out of bounds");
return m_pbSeeInvisibles ? m_pbSeeInvisibles[i] : false;
}
+
+int CvPromotionInfo::getUnitCombatWeightMod(int i) const
+{
+ FAssertMsg(i < GC.getNumUnitCombatInfos(), "Index out of bounds");
+ FAssertMsg(i > -1, "Index out of bounds");
+ return m_piUnitCombatWeightMods ? m_piUnitCombatWeightMods[i] : -1;
+}
// Sanguo Mod Hero, end

// Arrays
@@ -2497,10 +2515,15 @@
stream->Read(&m_iSecondAttackChance);
stream->Read(&m_iMatureLevel);
stream->Read(&m_iExperienceModifierPerLegionTurn);
+ stream->Read(&m_iRandomWeight);

SAFE_DELETE_ARRAY(m_pbSeeInvisibles);
m_pbSeeInvisibles = new bool[GC.getNumInvisibleInfos()];
stream->Read(GC.getNumInvisibleInfos(), m_pbSeeInvisibles);
+
+ SAFE_DELETE_ARRAY(m_piUnitCombatWeightMods);
+ m_piUnitCombatWeightMods = new int[GC.getNumUnitCombatInfos()];
+ stream->Read(GC.getNumUnitCombatInfos(), m_piUnitCombatWeightMods);
// Sanguo Mod Hero, end

// Arrays
@@ -2658,8 +2681,10 @@
stream->Write(m_iSecondAttackChance);
stream->Write(m_iMatureLevel);
stream->Write(m_iExperienceModifierPerLegionTurn);
+ stream->Write(m_iRandomWeight);

stream->Write(GC.getNumInvisibleInfos(), m_pbSeeInvisibles);
+ stream->Write(GC.getNumUnitCombatInfos(), m_piUnitCombatWeightMods);
// Sanguo Mod Hero, end

// Arrays
@@ -2749,6 +2774,10 @@

// Sanguo Mod Hero, start, added by poyuzhe 01.11.09
pXML->GetChildXmlValByName(&m_bHero, "bHero");
+ pXML->GetChildXmlValByName(&m_iRandomWeight, "iRandomWeight");
+
+
pXML->SetVariableListTagPair(&m_piUnitCombatWeightMods, "UnitCombatWeightMods",
sizeof(GC.getUnitCombatInfo((UnitCombatTypes)0)),
GC.getNumUnitCombatInfos());
+
pXML->GetChildXmlValByName(szTextVal, "PromotionUnitCombatType");
m_iPromotionUnitCombatType = pXML->FindInInfoClass(szTextVal);

pXML->GetChildXmlValByName(&m_iPromotionUnitCombatLevel, "iPromotionUnitCombatLevel");
@@ -25290,6 +25319,7 @@
stream->Read(&m_iMurdererCiv);
stream->Read(&m_bNineTransformation);
stream->Read(&m_bRandom);
+ stream->Read(&m_iFamily);

SAFE_DELETE_ARRAY(m_paiDefaultCivilizationEndYear);
m_paiDefaultCivilizationEndYear = new int[GC.getNumCivilizationInfos()];
@@ -25334,6 +25364,7 @@
stream->Write(m_iMurdererCiv);
stream->Write(m_bNineTransformation);
stream->Write(m_bRandom);
+ stream->Write(m_iFamily);

stream->Write(GC.getNumCivilizationInfos(),
m_paiDefaultCivilizationEndYear);
stream->Write(GC.getNumCivilizationInfos(), m_paiCivilizationLoyalty);
=======================================
--- /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvInfos.h Tue Sep 15
08:01:36 2009
+++ /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvInfos.h Sat Sep 19
05:22:49 2009
@@ -577,8 +577,10 @@
int getExperienceModifierPerLegionTurn() const;
int getSecondAttackChance() const;
int getMatureLevel() const;
+ int getRandomWeight() const;

bool isSeeInvisibles(int i) const;
+ int getUnitCombatWeightMod(int i) const;
// Sanguo Mod Hero, end

// Arrays
@@ -713,8 +715,10 @@
int m_iSecondAttackChance;
int m_iMatureLevel;
int m_iExperienceModifierPerLegionTurn;
+ int m_iRandomWeight;

bool* m_pbSeeInvisibles;
+ int* m_piUnitCombatWeightMods;
// Sanguo Mod Hero, end

// Arrays
=======================================
--- /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvPlayer.cpp Mon Sep
14 23:16:47 2009
+++ /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvPlayer.cpp Sat Sep
19 05:22:49 2009
@@ -11617,47 +11617,20 @@
}
else
{
- eLoopHero = GC.getGameINLINE().createRandomHero(getID(),
pBestCity->getX_INLINE(), pBestCity->getY_INLINE());
- recalculateGreatGeneralThreshold();
+ CyArgsList argsList;
+ argsList.add(getID());
+ argsList.add(pBestCity->getX_INLINE());
+ argsList.add(pBestCity->getY_INLINE());
+
gDLL->getPythonIFace()->callFunction(PYSanguoModule, "doAICreateRandomHero",
argsList.makeFunctionArgs());
}
setCombatExperience(getCombatExperience() - iExperienceThreshold);
}
else
{
- bool bCanRecruitHero = false;
- for (int iI = 0; iI < GC.getNumHeroInfos(); iI++)
- {
- if (canRecruitHero((HeroTypes)iI, true))
- {
- bCanRecruitHero = true;
- break;
- }
- }
-
- int iBestX = pBestCity->getX_INLINE();
- int iBestY = pBestCity->getY_INLINE();
- CvUnit* pHeadUnit = gDLL->getInterfaceIFace()->getHeadSelectedUnit();
- if (NULL != pHeadUnit && pHeadUnit->getOwnerINLINE() == getID())
- {
- iBestX = pHeadUnit->getX_INLINE();
- iBestY = pHeadUnit->getY_INLINE();
- }
-
- if (bCanRecruitHero)
- {
- setCombatExperience(getCombatExperience() - iExperienceThreshold);
- CyArgsList argsList;
- argsList.add(getID());
- argsList.add(iBestX);
- argsList.add(iBestY);
-
gDLL->getPythonIFace()->callFunction(PYScreensModule, "showCreateChampionScreen",
argsList.makeFunctionArgs());
- }
- else
- {
- GC.getGameINLINE().createRandomHero(getID(), iBestX, iBestY);
- setCombatExperience(getCombatExperience() - iExperienceThreshold);
- recalculateGreatGeneralThreshold();
- }
+ setCombatExperience(getCombatExperience() - iExperienceThreshold);
+ CyArgsList argsList;
+ argsList.add(getID());
+
gDLL->getPythonIFace()->callFunction(PYScreensModule, "showCreateChampionScreen",
argsList.makeFunctionArgs());
}
// Sanguo Mod Hero, end
}
=======================================
--- /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvUnit.cpp Fri Sep
18 07:27:23 2009
+++ /trunk/The History of Three Kingdoms/CvGameCoreDLL/CvUnit.cpp Sat Sep
19 05:22:49 2009
@@ -17866,8 +17866,16 @@
if ((GET_PLAYER(eEnemyPlayer).isBarbarian() ||
bCurrentLeader) ? 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);
quitLegion(true);
- pNewCore = GC.getGameINLINE().getHeroUnit(eHero);
+ if (bOneUnitLegion)
+ {
+ pNewCore = NULL;
+ }
+ else
+ {
+ pNewCore = GC.getGameINLINE().getHeroUnit(eHero);
+ }
bLegionProcessed = true;

// if there is at least one more unit in the legion, do
the following
=======================================
--- /trunk/The History of Three Kingdoms/CvGameCoreDLL/CyGame.cpp Fri Sep
18 07:27:23 2009
+++ /trunk/The History of Three Kingdoms/CvGameCoreDLL/CyGame.cpp Sat Sep
19 05:22:49 2009
@@ -1476,9 +1476,9 @@
return (NULL != m_pGame ?
m_pGame->getHeroNextLegionMember((HeroTypes)eHero, iID) : -1);
}

-int /*HeroTypes*/ CyGame::createRandomHero(int /*PlayerTypes*/ ePlayer,
int iX, int iY)
-{
- return (NULL != m_pGame ? m_pGame->createRandomHero((PlayerTypes)ePlayer,
iX, iY) : -1);
+int /*HeroTypes*/ CyGame::createRandomHero(int /*PlayerTypes*/ ePlayer,
int iX, int iY, int iLeadership, int iMight, int iLoyalty, int iUnitCombat,
int /*PromotionTypes*/ eFirstPromotion, int /*PromotionTypes*/
eSecondPromotion, int /*PromotionTypes*/ eThirdPromotion, bool
bThreeRandomPromotions)
+{
+ return (NULL != m_pGame ? m_pGame->createRandomHero((PlayerTypes)ePlayer,
iX, iY, iLeadership, iMight, iLoyalty, iUnitCombat,
(PromotionTypes)eFirstPromotion, (PromotionTypes)eSecondPromotion,
(PromotionTypes)eThirdPromotion, bThreeRandomPromotions) : -1);
}

int /*PlayerTypes*/ CyGame::getHeroCapturePlayer(int /*HeroTypes*/ eHero)
=======================================
--- /trunk/The History of Three Kingdoms/CvGameCoreDLL/CyGame.h Fri Sep 18
07:27:23 2009
+++ /trunk/The History of Three Kingdoms/CvGameCoreDLL/CyGame.h Sat Sep 19
05:22:49 2009
@@ -331,7 +331,7 @@
void backUpHeroLegionMember(int /*HeroTypes*/ eHero);
int getHeroNextLegionMember(int /*HeroTypes*/ eHero, int iID) const;

- int /*HeroTypes*/ createRandomHero(int /*PlayerTypes*/ ePlayer, int iX,
int iY);
+ int /*HeroTypes*/ createRandomHero(int /*PlayerTypes*/ ePlayer, int iX,
int iY, int iLeadership, int iMight, int iLoyalty, int iUnitCombat, int
/*PromotionTypes*/ eFirstPromotion, int /*PromotionTypes*/
eSecondPromotion, int /*PromotionTypes*/ eThirdPromotion, bool
bThreeRandomPromotions);
int /*PlayerTypes*/ getHeroCapturePlayer(int /*HeroTypes*/ eHero);
bool willHeroJoinFaction(int /*HeroTypes*/ eHero, int /*PlayerTypes*/
ePlayer);

=======================================
--- /trunk/The History of Three Kingdoms/CvGameCoreDLL/CyGameInterface.cpp
Fri Sep 18 07:27:23 2009
+++ /trunk/The History of Three Kingdoms/CvGameCoreDLL/CyGameInterface.cpp
Sat Sep 19 05:22:49 2009
@@ -320,7 +320,7 @@
.def("getHeroLegionBackUpMemberAt",
&CyGame::getHeroLegionBackUpMemberAt, "int (int /*HeroTypes*/ eHero, int
iUnitID)")
.def("backUpHeroLegionMember", &CyGame::backUpHeroLegionMember, "void
(int /*HeroTypes*/ eHero)")
.def("getHeroNextLegionMember", &CyGame::getHeroNextLegionMember, "int
(int /*HeroTypes*/ eHero, int iID)")
- .def("createRandomHero", &CyGame::createRandomHero, "int /*HeroTypes*/
(int /*PlayerTypes*/ ePlayer, int iX, int iY)")
+ .def("createRandomHero", &CyGame::createRandomHero, "int /*HeroTypes*/
(int /*PlayerTypes*/ ePlayer, int iX, int iY, int iLeadership, int iMight,
int iLoyalty, int iUnitCombat, int /*PromotionTypes*/ eFirstPromotion, int
/*PromotionTypes*/ eSecondPromotion, int /*PromotionTypes*/
eThirdPromotion, bool bThreeRandomPromotions)")
.def("getHeroCapturePlayer", &CyGame::getHeroCapturePlayer, "int
/*PlayerTypes*/ (int /*HeroTypes*/ eHero)")
.def("willHeroJoinFaction", &CyGame::willHeroJoinFaction, "bool (int
/*HeroTypes*/ eHero, int /*PlayerTypes*/ ePlayer)")
.def("getHeroLeadership", &CyGame::getHeroLeadership, "int (int
/*HeroTypes*/ eHero, bool bOverWrite, int /*HeroTypes*/ eOverWriteHero)")
=======================================
--- /trunk/The History of Three Kingdoms/CvGameCoreDLL/CyInfoInterface1.cpp
Sun Aug 16 09:48:46 2009
+++ /trunk/The History of Three Kingdoms/CvGameCoreDLL/CyInfoInterface1.cpp
Sat Sep 19 05:22:49 2009
@@ -222,7 +222,9 @@
.def("getSecondAttackChance",
&CvPromotionInfo::getSecondAttackChance, "int ()")
.def("getMatureLevel", &CvPromotionInfo::getMatureLevel, "int ()")
.def("getExperienceModifierPerLegionTurn",
&CvPromotionInfo::getExperienceModifierPerLegionTurn, "int ()")
+ .def("getRandomWeight", &CvPromotionInfo::getRandomWeight, "int
()")
.def("isSeeInvisibles", &CvPromotionInfo::isSeeInvisibles, "int (int i)")
+ .def("getUnitCombatWeightMod",
&CvPromotionInfo::getUnitCombatWeightMod, "int (int i)")
// Sanguo Mod Hero, end

// Arrays
=======================================
--- /trunk/The History of Three Kingdoms/Documents/changelog.txt Fri Sep 18
07:27:23 2009
+++ /trunk/The History of Three Kingdoms/Documents/changelog.txt Sat Sep 19
05:22:49 2009
@@ -1021,3 +1021,5 @@
0.294£ºÍê³ÉÁËÓ¢ÐÛͶ½µÇãÏòµÄÉ趨

0.295: ÐÂÔöÄÚÈÝ£ºÌí¼Ó¼¯Ížüϵͳ
+
+0.296: ÐÂÔöÄÚÈÝ£ºÑ¡Ôñ´´½¨Ëæ»úÓ¢ÐÛʱÌṩ²¿·Ö¶¨ÖÆÑ¡Ïî
=======================================
--- /trunk/The History of Three Kingdoms/Documents/changelog_en.txt Fri Sep
18 07:27:23 2009
+++ /trunk/The History of Three Kingdoms/Documents/changelog_en.txt Sat Sep
19 05:22:49 2009
@@ -1,3 +1,5 @@
+0.296: New Content: add customization options when creating random hero
+
0.295: New Content: add Army system

0.294: Adjusted the surrender type of different heroes.
Reply all
Reply to author
Forward
0 new messages