Exemplo n.º 1
0
 def __init__(self, id=-1, name='', templateId=0, zenId=1, clubcategory=1):
     '''初始化NPC球队类'''
     data = {}
     if clubcategory == 1:  #挑战赛球队
         data = dbclub.CHALLENGENPC.get(templateId)
     elif clubcategory == 7:  #训练赛球队
         data = dbclub.TRAINMATCHNPC.get(templateId)
     Character.__init__(self, id, name)
     self.setCharacterType(Character.CLUBTYPE)
     self.player = NPCPlayerComponent(self)  #npc球队球员
     self.attribute = CharacterAttributeComponent(self)  #npc球队属性
     self.templateId = int(data['ID'])
     self.formatInfo = {}
     self.initialiseToo(data)
Exemplo n.º 2
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.attribute = CharacterAttributeComponent(self)  #角色属性
     self.matrix = CharacterMatrixComponent(self)  #阵法摆放信息
     self.zhanyi = CharacterZhanYiComponent(self)  #角色的战役信息
     if status:
         self.initPlayerInfo()  #初始化角色
Exemplo n.º 3
0
    def __init__(self, cid, name=u'', dynamicId=-1, status=1):
        '''构造方法
		@dynamicId (int) 角色登录的动态ID socket连接产生的id
		'''
        Character.__init__(self, cid, name)
        self.setCharacterType(Character.GAMERTYPE)  #设置角色类型为玩家角色
        self.dynamicId = dynamicId  #角色登录服务器时的动态id
        #-----------角色的各个组件类----------------
        self.level = CharacterLevelComponent(self)  #角色等级
        self.finance = CharacterFinanceComponent(self)  #角色资产
        self.pack = CharacterPackageComponent(self)  #角色包裹
        self.attribute = CharacterAttributeComponent(self)  #角色属性
        self.mail = CharacterMailListComponent(self)  #角色邮件列表
        self.playerInner = PlayerInner(self)  #球员找寻
        self.player = PlayerComponent(self)  #球队球员
        self.zen = CharacterZenComponent(self)  #球队战术
        self.shop = CharacterShopComponent(self)  #商店
        self.task = CharacterTaskComponent(self)  #任务
        self.trainmatch = TrainMatchComponent(self)  #训练赛
        self.challengematch = ChallengeMatchComponent(self)  #挑战赛
        if status:
            self.initGamerInfo()  #初始化角色