Example #1
0
    def __init__(self, cid, name=u'城管', dynamicId=-1, status=1):
        '''构造方法
        @dynamicId (int) 角色登陆的动态ID socket连接产生的id
        '''
        Character.__init__(self, cid, name)
        self.setCharacterType(Character.PLAYERTYPE)  #设置角色类型为玩家角色
        self.dynamicId = dynamicId  #角色登陆服务器时的动态id
        #--------角色的各个组件类------------
        self.level = CharacterLevelComponent(self)  #角色等级
        self.finance = CharacterFinanceComponent(self)  #角色资产
        self.profession = CharacterProfessionComponent(self)  #角色职业
        self.pack = CharacterPackageComponent(self)  #角色包裹
        self.friend = CharacterFriendComponent(self)  #角色好友
        self.mail = CharacterMailListComponent(self)  #角色邮件列表
        self.shop = CharacterShopComponent(self)  #角色个人商店
        self.teamcom = CharacterTeamComponent(self)  #角色的队伍组件
        self.skill = CharacterSkillComponent(self)  #角色技能组件
        self.guild = CharacterGuildComponet(self)  #角色的行会
        self.practice = CharacterPracticeComponent(self)  #角色修炼
        self.dropping = CharacterDroppingComponent(self)  #角色掉落
        self.quest = CharacterQuestComponent(self)  #角色任务
        self.rank = CharacterRankComponent(self)  #军衔
        self.effect = CharacterEffectComponent(self)
        self.status = CharacterStatusComponent(self)  #角色的状态
        self.attribute = CharacterAttributeComponent(self)  #角色属性
        self.pet = CharacterPetComponent(self)  #角色的宠物
        self.matrix = CharacterMatrixComponent(self)  #阵法摆放信息
        self.msgbox = CharacterMSGComponent(self)  #角色消息盒子
        self.instance = InstanceColonizeComponent(self)  #角色殖民
        self.icon = CharacterIconComponent(self)  #角色图标
        self.award = CharacterAwardComponent(self)  #角色的奖励
        self.afk = CharacterAFKComponent(self)  #角色挂机
        self.raids = CharacterRaidsComponent(self)  #角色扫荡
        self.schedule = CharacterScheduleComponent(self)  #角色日程表
        self.nobility = CharacterNobility(self)  #角色官爵
        self.daily = CharacterDailyComponent(self)  #角色每日目标
        self.godhead = CharacterGodheadComponent(self)  #角色神格
        self.qhtime = IconTime(self)  #强化冷却时间
        self.petShop = PetWineshop(self)  #宠物酒店
        self.fate = CharacterFateComponent(self)  #符文
        self.arena = CharacterAreanaComponent(self)  #竞技场
        self.tower = CharacterTowerComponent(self)  #爬塔
        self.pvp = CharacterPVPComponent(self)  #角色pvp信息
        self.zhanyi = CharacterZhanYiComponent(self)  #角色的战役信息

        self.nodeId = 0
        self.userId = 0  #角色的用户id
        self.CharacterType = 1  #角色的类型  1:玩家角色 2:怪物 3:宠物
        self.lastOnline = None
        self.outtime = None
        self.creatTime = None
        if status:
            self.initPlayerInfo()  #初始化角色