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


Python Character.get_stat方法代码示例

本文整理汇总了Python中Character.Character.get_stat方法的典型用法代码示例。如果您正苦于以下问题:Python Character.get_stat方法的具体用法?Python Character.get_stat怎么用?Python Character.get_stat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Character.Character的用法示例。


在下文中一共展示了Character.get_stat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from Character import Character [as 别名]
# 或者: from Character.Character import get_stat [as 别名]

#.........这里部分代码省略.........

        money_sum = 0
        for key, value in weapons.items():
            try:
                money_sum = money_sum + int(value)
            except Exception:
                pass

        for key, value in armors.items():
            try:
                money_sum = money_sum + int(value)
            except Exception:
                pass

        cpoint_sum = self.max_cpoints - cpoint_sum
        opoint_sum = op_current_limit - opoint_sum
        money_sum = self.money - money_sum

        cpoint_text = str(cpoint_sum) + "/" + str(self.max_cpoints)
        opoint_text = str(opoint_sum) + "/" + str(op_current_limit)

        for header in self.datasets["headers"]:
            header.var_cpoints.set(cpoint_text)
            header.var_opoints.set(opoint_text)
            header.var_money.set(str(money_sum))

        # self.var_cpoints.set(str(cpoint_text))
        # self.var_opoints.set(opoint_text)

    def get_Wpn_availability(self):
        return self.__char.getAttributeRoll("Luck")

    def getChar_stat(self, stat):
        return self.__char.get_stat(stat)

    def setChar_stat(self, stat, value):
        self.__char.set_stat(stat, value)

    def clear_all_skills(self):
        list = self.__char.get_skills()

        for key, value in list.items():
            list[key] = 0

    def set_char_skill(self, skill, value):
        self.__char.add_skill(skill, value)

    def get_char_skill_dictionary(self):
        return self.__char.get_skills()

    def clear_ability_list(self, name):
        list = self.__char.get_ability_list(name)

        if name != "cyberware":
            list.clear()
        else:
            del list[:]

    def set_to_ability_list(self, list, ability, value, complication=False, frequency=0, intensity=0, importance=0):
        self.__char.set_to_ability_list(list, ability, value, complication, frequency, intensity, importance)

    def get_from_ability_list(self, list, ability):
        ability = self.__char.get_ability(list, ability)
        return ability

    def get_ability_dictionary(self, list_name):
开发者ID:Krypticdator,项目名称:First,代码行数:70,代码来源:Controller.py

示例2: Controller

# 需要导入模块: from Character import Character [as 别名]
# 或者: from Character.Character import get_stat [as 别名]

#.........这里部分代码省略.........
        try:
            skill = self.__skill_shorts[short]
            return skill
        except Exception:
            return 'error'

    def get_pc_roster(self):
        return self.__pc_roster

    def load_character(self, filepath):
        self.c = Character(self.prefs)
        self.prefs.load_character(filepath,self.c)

    def get_player_fuz_roll(self, player, detailed=False):
        
        search_for = str.strip(player)
        return self.__pc_roster[search_for].fuz_roll(detailed)
    
    def set_char_stat(self, command, value):
        self.c.set(command, value) 
    
    def destroy_char_attributes_of_type(self, type, attribute):
        self.c.remove_all_attributes_of_type(type, attribute)

    def add_skill_to_char(self, name, lvl, ip, chipped):
        self.c.add_skill(name, lvl, ip=ip, chipped=chipped)
    
    def get_slate_gameobject(self):
        o = GameObject()
        return o   
        
    def get_char_stat(self, name, attribute, search_category=False, return_all=False):
        if search_category:
            return self.c.get_stat(name, name, True, return_all)
        return self.c.get_stat(name, attribute)
    
    def get_char_attribute(self, name):
        return self.c.get_attribute(name)

    def get_char_stat_list(self, stat_type):
        return self.c.get_stat_list(stat_type)

    def get_char_inventory(self):
        return self.c.get_inventory()

    def get_char_bp_points(self, player, skill, detailed=False):
        character = self.__pc_roster[player]
        array = []
        if detailed:
            source_stat_name = character.get_stat(skill, 'stat')
            source_stat_lvl = character.get_stat(source_stat_name, 'lvl')
            skill_lvl = character.get_stat(skill, 'lvl')
            array.append(source_stat_lvl)
            array.append(skill_lvl)
            return array
        
        bp = character.get_bpoints(skill)
        return bp
        

    def add_ui_component(self, comp_name, component):
        self.__ui_components[comp_name] = component

    def save_to_xml(self, root_name, childname, values_dict, filepath):
        x = XmlController()
        x.create_root(root_name)
开发者ID:Krypticdator,项目名称:GameSession,代码行数:70,代码来源:Controller.py


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