本文整理汇总了Python中Character.Character.set_lifepath方法的典型用法代码示例。如果您正苦于以下问题:Python Character.set_lifepath方法的具体用法?Python Character.set_lifepath怎么用?Python Character.set_lifepath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Character.Character
的用法示例。
在下文中一共展示了Character.set_lifepath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Character import Character [as 别名]
# 或者: from Character.Character import set_lifepath [as 别名]
#.........这里部分代码省略.........
self.__char.set_attribute("First name", self.datasets["first name"].get())
self.__char.set_attribute("Second name", self.datasets["second name"].get())
self.__char.set_attribute("Last name", self.datasets["last name"].get())
self.__char.set_attribute("Alias", self.datasets["alias"].get())
self.__char.set_attribute("age", self.datasets["age"].get())
self.__char.set_attribute("family rank", self.datasets["Family rank"].var.get())
self.__char.set_attribute("parents", self.datasets["Your parents were"].var.get())
self.__char.set_attribute("parent status", self.datasets["Parent status"].var.get())
self.__char.set_attribute("parent event", self.datasets["Parent event"].var.get())
self.__char.set_attribute("family status", self.datasets["Family status"].var.get())
self.__char.set_attribute("family event", self.datasets["Family event"].var.get())
self.__char.set_attribute("childhood enviroment", self.datasets["Childhood enviroment"].var.get())
self.__char.set_attribute("childhood trauma/fortune", self.datasets["Childhood trauma/fortune"].var.get())
self.__char.set_attribute("family contact", self.datasets["Family contact"].var.get())
try:
self.__char.set_siblings(self.datasets["siblings"])
except Exception:
pass
self.__char.set_attribute("prime motivation", prime_motivation)
self.__char.set_attribute("most valued person", most_v_person)
self.__char.set_attribute("most valued posession", most_v_pos)
self.__char.set_attribute("feels about people", valued_people)
self.__char.set_attribute("inmode", inmode)
self.__char.set_attribute("exmode", exmode)
self.__char.set_attribute("quirks", quirk_array)
self.__char.set_attribute("disorders", disorder_array)
self.__char.set_attribute("phobias", phobia_array)
self.__char.set_attribute("hair", hair_array)
self.__char.set_attribute("clothes", clothes_array)
self.__char.set_attribute("affections", affe_array)
self.__char.set_lifepath(self.datasets["lifepath"])
self.__char.save()
def getChar_stats(self):
return self.__char_get_attributes()
def recalculate_points(self):
statbox = self.datasets["stats"]
skills = self.get_ability_dictionary("skills")
perks = self.get_ability_dictionary("perks")
talents = self.get_ability_dictionary("talents")
complications = self.get_ability_dictionary("complications")
weapons = self.get_ability_dictionary("weapons")
armors = self.get_ability_dictionary("armor")
cpoint_sum = 0
opoint_sum = 0
for key, value in statbox.variables.items():
cpoint_sum = cpoint_sum + int(value.get())
for key, value in skills.items():
try:
if int(value) != 0:
opoint_sum = opoint_sum + int(value)
except Exception:
pass
for key, value in perks.items():
try:
if key.count("Favor"):
cost = int(value) * 0.5
opoint_sum = opoint_sum + cost
elif key.count("Wealth"):