コード例 #1
0
    def olin107(self, campaign, battle_listener):
        enemy_image = pygame.image.load(
            "../assets/images/zombie.png").convert_alpha()
        enemy_rect = pygame.Rect(48, 0, 48, 48)
        enemy_image = enemy_image.subsurface(enemy_rect).copy()
        enemy_party = Party((90, 460), 48, (48, 48), enemy_image,
                            campaign.world, battle_listener)
        enemy1 = Combatant(550, 200, 72, 72, "../assets/images/zombie.png",
                           48 * 4, 0, 48, 48, False)
        enemy2 = Combatant(550, 50, 72, 72,
                           "../assets/images/zombie_magic.png", 48 * 5, 0, 48,
                           48, False)
        enemy_party.members += [enemy1, enemy2]
        campaign.enemy = enemy_party
        campaign.world.add_party(enemy_party)

        player_image = pygame.image.load(
            "../assets/images/player.png").convert_alpha()
        player_rect = pygame.Rect(0, 0, 48, 48)
        player_image = player_image.subsurface(player_rect).copy()
        user = Party(campaign.world.get_border().center, 48, (10, 25),
                     player_image, campaign.world, battle_listener)
        user.make_friendly()
        user.make_controllable("../assets/images/player.png")
        campaign.user = user
        player = Combatant(20, 200, 72, 72, "../assets/images/player.png", 384,
                           0, 48, 48, True)
        player.abilities = [
            Energize(), Fireball(0, 0, 0),
            PowerAttack(),
            Heal()
        ]
        player.change_hp(100)
        campaign.user.members += [player]
        campaign.world.add_party(user)
コード例 #2
0
    def nott_interior(self, campaign, battle_listener):
        friend_image = pygame.image.load(
            "../assets/images/player3.png").convert_alpha()
        friend_rect = pygame.Rect(48, 0, 48, 48)
        friend_image = friend_image.subsurface(friend_rect).copy()
        friend_party = Party((100, 290), 48, (48, 48), friend_image,
                             campaign.world, battle_listener)
        friend = Combatant(550, 200, 72, 72, "../assets/images/player3.png",
                           48 * 7, 0, 48, 48, False)
        friend_party.members += [friend]
        friend_party.make_friendly()

        enemy_image = pygame.image.load(
            "../assets/images/boss.png").convert_alpha()
        enemy_rect = pygame.Rect(48, 0, 48, 48)
        enemy_image = enemy_image.subsurface(enemy_rect).copy()
        enemy_party = Party((320, 300), 100, (100, 100), enemy_image,
                            campaign.world, battle_listener)
        boss = Combatant(550, 200, 144, 144, "../assets/images/boss.png",
                         48 * 4, 0, 48, 48, False)
        boss.change_hp(9900)
        boss.change_energy(400)
        boss.set_dmg(50, 75)
        enemy_party.members += [boss]

        self.party_data["nott_interior"] = [friend_party, enemy_party]
        return [friend_party, enemy_party]
コード例 #3
0
    def olinhallway(self, campaign, battle_listener):
        enemy_image = pygame.image.load(
            "../assets/images/zombie2.png").convert_alpha()
        enemy_rect = pygame.Rect(48, 0, 48, 48)
        enemy_image = enemy_image.subsurface(enemy_rect).copy()
        enemy_party = Party((532, 540), 48, (48, 48), enemy_image,
                            campaign.world, battle_listener)
        enemy1 = Combatant(550, 200, 72, 72, "../assets/images/zombie2.png",
                           48 * 4, 0, 48, 48, False)
        enemy1.change_hp(100)
        enemy_party.members += [enemy1]

        enemy_image = pygame.image.load(
            "../assets/images/zombie_magic.png").convert_alpha()
        enemy_rect = pygame.Rect(48, 0, 48, 48)
        enemy_image = enemy_image.subsurface(enemy_rect).copy()
        enemy_party2 = Party((320, 400), 48, (48, 48), enemy_image,
                             campaign.world, battle_listener)
        enemy1 = Combatant(550, 200, 72, 72,
                           "../assets/images/zombie_magic.png", 48 * 4, 0, 48,
                           48, False)
        enemy2 = Combatant(550, 200, 72, 72, "../assets/images/zombie2.png",
                           48 * 4, 0, 48, 48, False)
        enemy3 = Combatant(550, 200, 72, 72, "../assets/images/zombie.png",
                           48 * 4, 0, 48, 48, False)
        enemies = [enemy1, enemy2, enemy3]
        for e in enemies:
            e.change_hp(-35)
        enemy_party2.members += enemies

        friend_image = pygame.image.load(
            "../assets/images/player2.png").convert_alpha()
        friend_rect = pygame.Rect(48, 0, 48, 48)
        friend_image = friend_image.subsurface(friend_rect).copy()
        friend_party = Party((320, 500), 48, (48, 48), friend_image,
                             campaign.world, battle_listener)
        friend = Combatant(550, 200, 72, 72, "../assets/images/player2.png",
                           48 * 7, 0, 48, 48, False)
        friend_party.members += [friend]
        friend_party.make_friendly()

        parties = [enemy_party, enemy_party2, friend_party]
        self.party_data["olinhallway"] = parties
        return parties