当前位置: 首页>>代码示例>>Python>>正文


Python Character.set_lifepath方法代码示例

本文整理汇总了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"):
开发者ID:Krypticdator,项目名称:First,代码行数:70,代码来源:Controller.py


注:本文中的Character.Character.set_lifepath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。