コード例 #1
0
 def __init__(self, amount):
     Item.__init__(
         self,
         str(amount) + " Gold",
         "imgs/dungeon_crawl/item/gold/gold_pile_10.png",
         "Gold could be used to buy some items or other services", 0)
     self.amount = amount
コード例 #2
0
    def __init__(self, name, sprite, description, price, equipped_sprites,
                 body_part, defense, res, atk, weight, restrictions):
        Item.__init__(self, name, sprite, description, price)
        self.defense = defense
        self.res = res
        self.atk = atk
        self.weight = weight
        self.restrictions = restrictions
        self.body_part = body_part
        self.equipped_sprite = pg.transform.scale(
            pg.image.load(equipped_sprites[0]).convert_alpha(),
            (TILE_SIZE, TILE_SIZE))
        if len(equipped_sprites) > 1:
            for sp in equipped_sprites[1:]:
                self.equipped_sprite.blit(
                    pg.transform.scale(
                        pg.image.load(sp).convert_alpha(),
                        (TILE_SIZE, TILE_SIZE)), (0, 0))

        # Used when character wearing the equipment cannot be selected
        self.sprite_unavailable = self.equipped_sprite.copy()
        color_image = pg.Surface(self.sprite.get_size()).convert_alpha()
        color_image.fill(LIGHT_GREY)
        self.sprite_unavailable.blit(color_image, (0, 0),
                                     special_flags=pg.BLEND_RGBA_MULT)
        self.normal_sprite = self.equipped_sprite
コード例 #3
0
 def __init__(self, name, sprite, description, price, effects):
     Item.__init__(self, name, sprite, description, price)
     self.effects = effects
コード例 #4
0
 def __init__(self, name, sprite, description, price):
     Item.__init__(self, name, sprite, description, price)
コード例 #5
0
 def __init__(self, name, sprite, description, price, for_chest, for_door):
     Item.__init__(self, name, sprite, description, price)
     self.for_chest = for_chest
     self.for_door = for_door
コード例 #6
0
    def __init__(self, name, sprite, description, price, effects):
        Item.__init__(self, name, sprite, description, price)
        self.effects = effects

        self.drinksfx = pygame.mixer.Sound(
            os.path.join('sound_fx', 'potion.ogg'))