def __init__(self,
                 name,
                 sprite,
                 hp,
                 defense,
                 res,
                 strength,
                 classes,
                 equipments,
                 race,
                 gold,
                 lvl,
                 skills,
                 compl_sprite=None):
        Character.__init__(self, name, (), sprite, hp, defense, res, strength,
                           None, classes, equipments, 'MANUAL', lvl, skills,
                           race, gold, compl_sprite)
        self.state = PlayerState.WAITING_SELECTION
        self.old_pos = ()
        self._selected = False

        # Sprite displayed when player cannot be selected
        self.sprite_unavaible = self.sprite.copy()
        color_image = pg.Surface(self.sprite.get_size()).convert_alpha()
        color_image.fill(LIGHT_GREY)
        self.sprite_unavaible.blit(color_image, (0, 0),
                                   special_flags=pg.BLEND_RGBA_MULT)

        # Memorize normal state sprite
        self.normal_sprite = self.sprite

        # Memorize the current action performed by the player, it must be a value of CharacterMenu
        self.current_action = None
示例#2
0
    def __init__(self,
                 name,
                 sprite,
                 hp,
                 defense,
                 res,
                 max_move,
                 strength,
                 classes,
                 equipments,
                 race,
                 gold,
                 lvl=1,
                 compl_sprite=None):
        Character.__init__(self, name, (), sprite, hp, defense, res, max_move,
                           strength, None, classes, equipments, None, lvl,
                           race, gold, compl_sprite)
        '''Possible states :
        - 0 : Waiting to be selected
        - 1 : Waiting to be moved
        - 2 : On move
        - 3 : Waiting an action post-move
        - 4 : Waiting a target selected to attack OR waiting an target to interact with
        - 5 : Turn finished'''
        self.old_pos = ()
        self.state = 0
        self.last_state = 5
        self.selected = False

        # Sprite displayed when player cannot be selected
        self.sprite_unavaible = self.sprite.copy()
        color_image = pg.Surface(self.sprite.get_size()).convert_alpha()
        color_image.fill(LIGHT_GREY)
        self.sprite_unavaible.blit(color_image, (0, 0),
                                   special_flags=pg.BLEND_RGBA_MULT)

        # Memorize normal state sprite
        self.normal_sprite = self.sprite
示例#3
0
 def __init__(self,
              name,
              pos,
              sprite,
              hp,
              defense,
              res,
              max_move,
              strength,
              classes,
              equipments,
              lvl=1):
     Character.__init__(self, name, pos, sprite, hp, defense, res, max_move,
                        strength, classes, equipments, lvl)
     '''Possible states :
     - 0 : Waiting to be selected
     - 1 : Waiting to be moved
     - 2 : On move
     - 3 : Waiting an action post-move
     - 4 : Waiting a target selected to attack OR waiting an target to interact with
     - 5 : Turn finished'''
     self.state = 0
     self.last_state = 5
     self.selected = False