本文整理汇总了Python中CharGenCommon.close方法的典型用法代码示例。如果您正苦于以下问题:Python CharGenCommon.close方法的具体用法?Python CharGenCommon.close怎么用?Python CharGenCommon.close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CharGenCommon
的用法示例。
在下文中一共展示了CharGenCommon.close方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setAccept
# 需要导入模块: import CharGenCommon [as 别名]
# 或者: from CharGenCommon import close [as 别名]
def setAccept():
#set my character up
MyChar = GemRB.GetVar ("Slot")
ClassName = GUICommon.GetClassRowName (MyChar)
#reputation
AllignID = GemRB.GetPlayerStat (MyChar, IE_ALIGNMENT)
TmpTable=GemRB.LoadTable ("repstart")
t = TmpTable.GetValue (AllignID,0) * 10
GemRB.SetPlayerStat (MyChar, IE_REPUTATION, t)
#lore, thac0, hp, and saves
GemRB.SetPlayerStat (MyChar, IE_MAXHITPOINTS, 0)
GemRB.SetPlayerStat (MyChar, IE_HITPOINTS, 0)
LUCommon.SetupSavingThrows (MyChar)
LUCommon.SetupThaco (MyChar)
LUCommon.SetupLore (MyChar)
LUCommon.SetupHP (MyChar)
#slot 1 is the protagonist
if MyChar == 1:
GemRB.GameSetReputation( t )
#gold
TmpTable=GemRB.LoadTable ("strtgold")
t = GemRB.Roll (TmpTable.GetValue (ClassName,"ROLLS"),TmpTable.GetValue(ClassName,"SIDES"), TmpTable.GetValue (ClassName,"MODIFIER") )
GemRB.SetPlayerStat (MyChar, IE_GOLD, t*TmpTable.GetValue (ClassName,"MULTIPLIER") )
#set the base number of attacks; effects will add the proficiency bonus
GemRB.SetPlayerStat (MyChar, IE_NUMBEROFATTACKS, 2)
#colors
GUICommon.SetColorStat (MyChar, IE_METAL_COLOR, 0x1B )
GUICommon.SetColorStat (MyChar, IE_LEATHER_COLOR, 0x16 )
GUICommon.SetColorStat (MyChar, IE_ARMOR_COLOR, 0x17 )
#does all the rest
LargePortrait = GemRB.GetToken ("LargePortrait")
SmallPortrait = GemRB.GetToken ("SmallPortrait")
GemRB.FillPlayerInfo (MyChar, LargePortrait, SmallPortrait)
#10 is a weapon slot (see slottype.2da row 10)
GemRB.CreateItem (MyChar, "staf01", 10, 1, 0, 0)
GemRB.SetEquippedQuickSlot (MyChar, 0)
#LETS PLAY!!
playmode = GemRB.GetVar ("PlayMode")
GUICommon.CloseOtherWindow(None)
if playmode >=0:
CharGenCommon.close()
if GemRB.GetVar("GUIEnhancements"):
GemRB.SaveCharacter ( GemRB.GetVar ("Slot"), "gembak" )
GemRB.EnterGame()
else:
#show the export window
GemRB.SetToken("NextScript","CharGen")
GemRB.SetNextScript ("ExportFile")
示例2: DonePress
# 需要导入模块: import CharGenCommon [as 别名]
# 或者: from CharGenCommon import close [as 别名]
def DonePress():
FileNameEditBox = ExportWindow.GetControl(7)
FileName = FileNameEditBox.QueryText()
Slot = GemRB.GetVar("Slot")
GemRB.SaveCharacter(Slot, FileName)
GUICommon.CloseOtherWindow(None)
CharGenCommon.close()
GemRB.SetNextScript("Start")
return
示例3: DonePress
# 需要导入模块: import CharGenCommon [as 别名]
# 或者: from CharGenCommon import close [as 别名]
def DonePress ():
FileNameEditBox = ExportWindow.GetControl (7)
FileName = FileNameEditBox.QueryText ()
Slot = GemRB.GetVar ("Slot")
GemRB.SaveCharacter (Slot, FileName)
if GameCheck.IsBG1():
GUICommon.CloseOtherWindow (None)
CharGenCommon.close()
GemRB.SetNextScript ("Start")
else:
if ExportWindow:
ExportWindow.Unload ()
GemRB.SetNextScript (GemRB.GetToken("NextScript"))
return
示例4: setAccept
# 需要导入模块: import CharGenCommon [as 别名]
# 或者: from CharGenCommon import close [as 别名]
def setAccept():
#set my character up
MyChar = GemRB.GetVar ("Slot")
ClassName = GUICommon.GetClassRowName (MyChar)
#reputation
AllignID = GemRB.GetPlayerStat (MyChar, IE_ALIGNMENT)
TmpTable=GemRB.LoadTable ("repstart")
t = TmpTable.GetValue (AllignID,0) * 10
GemRB.SetPlayerStat (MyChar, IE_REPUTATION, t)
#lore, thac0, hp, and saves
GemRB.SetPlayerStat (MyChar, IE_MAXHITPOINTS, 0)
GemRB.SetPlayerStat (MyChar, IE_HITPOINTS, 0)
LUCommon.SetupSavingThrows (MyChar)
LUCommon.SetupThaco (MyChar)
LUCommon.SetupLore (MyChar)
LUCommon.SetupHP (MyChar)
#slot 1 is the protagonist
if MyChar == 1:
GemRB.GameSetReputation( t )
#gold
TmpTable=GemRB.LoadTable ("strtgold")
t = GemRB.Roll (TmpTable.GetValue (ClassName,"ROLLS"),TmpTable.GetValue(ClassName,"SIDES"), TmpTable.GetValue (ClassName,"MODIFIER") )
GemRB.SetPlayerStat (MyChar, IE_GOLD, t*TmpTable.GetValue (ClassName,"MULTIPLIER") )
#set the base number of attacks; effects will add the proficiency bonus
GemRB.SetPlayerStat (MyChar, IE_NUMBEROFATTACKS, 2)
#colors
GUICommon.SetColorStat (MyChar, IE_METAL_COLOR, 0x1B )
GUICommon.SetColorStat (MyChar, IE_LEATHER_COLOR, 0x16 )
GUICommon.SetColorStat (MyChar, IE_ARMOR_COLOR, 0x17 )
#does all the rest
LargePortrait = GemRB.GetToken ("LargePortrait")
SmallPortrait = GemRB.GetToken ("SmallPortrait")
GemRB.FillPlayerInfo (MyChar, LargePortrait, SmallPortrait)
#10 is a weapon slot (see slottype.2da row 10)
GemRB.CreateItem (MyChar, "staf01", 10, 1, 0, 0)
GemRB.SetEquippedQuickSlot (MyChar, 0)
# apply class/kit abilities
IsMulti = GUICommon.IsMultiClassed (MyChar, 1)
Levels = [GemRB.GetPlayerStat (MyChar, IE_LEVEL), GemRB.GetPlayerStat (MyChar, IE_LEVEL2), \
GemRB.GetPlayerStat (MyChar, IE_LEVEL3)]
KitIndex = GUICommon.GetKitIndex (MyChar)
if IsMulti[0]>1:
#get the class abilites for each class
for i in range (IsMulti[0]):
TmpClassName = GUICommon.GetClassRowName (IsMulti[i+1], "class")
ABTable = CommonTables.ClassSkills.GetValue (TmpClassName, "ABILITIES")
if ABTable != "*" and GemRB.HasResource (ABTable, RES_2DA, 1):
GUICommon.AddClassAbilities (MyChar, ABTable, Levels[i], Levels[i])
else:
if KitIndex:
ABTable = CommonTables.KitList.GetValue (str(KitIndex), "ABILITIES")
else:
ABTable = CommonTables.ClassSkills.GetValue (ClassName, "ABILITIES")
if ABTable != "*" and GemRB.HasResource (ABTable, RES_2DA, 1):
GUICommon.AddClassAbilities (MyChar, ABTable, Levels[0], Levels[0])
#LETS PLAY!!
playmode = GemRB.GetVar ("PlayMode")
GUICommon.CloseOtherWindow(None)
if playmode >=0:
CharGenCommon.close()
if GemRB.GetVar("GUIEnhancements"):
GemRB.SaveCharacter ( GemRB.GetVar ("Slot"), "gembak" )
GemRB.EnterGame()
else:
#show the export window
GemRB.SetToken("NextScript","CharGen")
GemRB.SetNextScript ("ExportFile")