Exemplo n.º 1
0
class Defencerock(Npc):
    images = load_images(["defencerock.png"])
    dp = 8

    def do_collide(self, player):
        player.defence += self.dp
        self.kill()
Exemplo n.º 2
0
class Spider(BaseSpider):
    images = load_images(["spider.png", "spider2.png"])
    hp = 540
    money = 13
    exp = 12
    condition = "POISON"
    pois_improb = 10
Exemplo n.º 3
0
class Smalldrug(Npc):
    images = load_images(["smalldrug.png"])
    heal = 130

    def do_collide(self, player):
        player.health += self.heal
        self.kill()
Exemplo n.º 4
0
class KingSnake(Snake):
    images = load_images(["kingsnake.png", "kingsnake2.png"])
    _hp = 350
    money = 10
    exp = 10
    first_ften = True
    feature = 'None'
    skill = "NO"
    condition = "NORMAL"

    def do_collide(self, player):
        super(KingSnake, self).do_collide(player)
        for sprite in player.currentfloor.group:
            if isinstance(sprite, Switchdoor):
                sprite.kill()
        player.currentfloor.group.add(
            Largedprock((3.5 * CELL_SIZE, 3.5 * CELL_SIZE)),
            Largedprock((4.5 * CELL_SIZE, 3.5 * CELL_SIZE)),
            Middledrug((3.5 * CELL_SIZE, 4.5 * CELL_SIZE)),
            Middledrug((4.5 * CELL_SIZE, 4.5 * CELL_SIZE)),
            BlueKey((3.5 * CELL_SIZE, 5.5 * CELL_SIZE)),
            BlueKey((4.5 * CELL_SIZE, 5.5 * CELL_SIZE)))
        if player.health > 0:
            Msgbox("No!!! How can you kill me! How can you be so terrible!"
                   ).show()
Exemplo n.º 5
0
class Firerock(Npc):
    images = load_images(["firerock.png"])
    feature = "FIRE"

    def do_collide(self, player):
        player.feature = self.feature
        self.kill()
Exemplo n.º 6
0
class Franklin(Talkable):
    images = load_images(["franklin.png"])
    msgs = [
        "My name is Franklin.",
        "And you'll see you have magic sum now.",
        "Some monsters have power to kill the magic.",
        "These monsters have their own special power.",
        "They have different features.",
        "The Leafies have leaf-feature.",
        "I just can tell you these informations. Good luck.",
    ]

    def do_collide(self, player):
        if player.currentfloor.floornum == 11:
            super(Franklin, self).do_collide(player)
        elif player.currentfloor.floornum == 14:
            self.msgs = [
                "Worior: It's you! We're meet again!",
                "Franklin: Yep. I just want to tell you about the sword.",
                "Worior: The sword on the 13th floor?",
                "Franklin: You know it! You will use it to open a strange door.",
                "Worior: Which door?",
                "Franklin: It is...",
                "(Suddenly some smelly grass-smells come.)",
                "Franklin: Sorry, I can't bear the grass smell here. I must go.",
                "Worior: Oh no, please wait...",
                "Worior: Dad gone it! I must look for him later.",
            ]
            super(Franklin, self).do_collide(player)
Exemplo n.º 7
0
class Ftendoor(Npc):
    images = load_images(["specialdoor.png"])

    def do_collide(self, player):
        player.undo()
        for sprite in player.currentfloor.group:
            if isinstance(sprite, Ftendoor):
                sprite.kill()
Exemplo n.º 8
0
class MagicSnake(Snake):
    images = load_images(["magicsnake.png", "magicsnake2.png"])
    _hp = 300
    money = 9
    exp = 8
    feature = 'None'
    skill = "NO"
    condition = "NORMAL"
Exemplo n.º 9
0
class MiddleSnake(Snake):
    images = load_images(["middlesnake.png", "middlesnake2.png"])
    _hp = 105
    money = 4
    exp = 3
    feature = 'None'
    skill = "NO"
    condition = "NORMAL"
Exemplo n.º 10
0
class LargeButterfly(Butterfly):
    images = load_images(["largebutterfly.png", "largebutterfly2.png"])
    hp = 550
    money = 13
    exp = 13
    feature = 'None'
    skill = "NO"
    condition = "NORMAL"
Exemplo n.º 11
0
class LargeSnake(Snake):
    images = load_images(["largesnake.png", "largesnake2.png"])
    _hp = 280
    money = 8
    exp = 8
    feature = 'None'
    skill = "NO"
    condition = "NORMAL"
Exemplo n.º 12
0
class LargeSoldier(MidSoldier):
    images = load_images(["largesoldier.png", "largesoldier2.png"])
    hp = 500
    money = 12
    exp = 12
    feature = 'None'
    skill = "NO"
    condition = "NORMAL"
Exemplo n.º 13
0
class MidSoldier(Enemy):
    images = load_images(["midsoldier.png", "midsoldier2.png"])
    hp = 420
    money = 10
    exp = 10
    feature = 'None'
    skill = "NO"
    condition = "NORMAL"
Exemplo n.º 14
0
class MidButterfly(Butterfly):
    images = load_images(["midbutterfly.png", "midbutterfly2.png"])
    hp = 150
    money = 4
    exp = 4
    feature = 'None'
    skill = "NO"
    condition = "NORMAL"
Exemplo n.º 15
0
class Butterfly(Enemy):
    images = load_images(["butterfly.png", "butterfly2.png"])
    hp = 80
    money = 2
    exp = 2
    feature = 'None'
    skill = "NO"
    condition = "NORMAL"
Exemplo n.º 16
0
class MiddleDProck(Defencerock):
    images = load_images(["middledprock.png"])
    dp = 30

    def do_collide(self, player):
        super(MiddleDProck, self).do_collide(player)
        for group in self.groups():
            if isinstance(sprite, Trap):
                sprite.kill()
        Msgbox("You killed the trap, you are so clever.").show()
Exemplo n.º 17
0
class Snake(Enemy):
    images = load_images(["snake.png", "snake2.png"])
    _hp = 10
    money = 1
    exp = 1
    feature = 'None'
    skill = "NO"
    condition = "NORMAL"

    @classmethod
    def hp(cls, player):
        return max(cls._hp - player.snakerocknum * 13, 0)
Exemplo n.º 18
0
class MoneyShop(Shop):
    images = load_images(["moneyshop.png"])
    funcdict = {
        pygame.K_1: 'buy_y',
        pygame.K_2: 'buy_b',
        pygame.K_3: 'buy_r',
        pygame.K_4: 'buy_g'
    }
    msgs = [
        "Press 1 to buy a yellow key, $ 20.",
        "Press 2 to buy a blue key, $ 30.", "Press 3 to buy a red key, $ 50.",
        "Press 4 to buy a green key, $ 80.", "Press other key to quit."
    ]
Exemplo n.º 19
0
class SecondExp(Shop):
    images = load_images(["secondexp.png"])
    funcdict = {
        pygame.K_1: 'buy_largedr',
        pygame.K_2: 'buy_largedef',
        pygame.K_3: 'buy_magic',
        pygame.K_4: 'buy_level2'
    }
    msgs = [
        "Press 1 to buy a large drug, EXP 70.",
        "Press 2 to buy a large defence, EXP 150.",
        "Press 3 to buy a magic jewer, EXP 80.",
        "Press 4 to buy three levels, EXP 270.", "Press other key to quit."
    ]
Exemplo n.º 20
0
class SecondMoney(Shop):
    images = load_images(["secondmoney.png"])
    funcdict = {
        pygame.K_1: 'buy_y2',
        pygame.K_2: 'buy_b2',
        pygame.K_3: 'buy_r2',
        pygame.K_4: 'buy_g2'
    }
    msgs = [
        "Press 1 to buy five yellow keys, $ 80.",
        "Press 2 to buy five blue keys, $ 130.",
        "Press 3 to buy five red keys, $ 220.",
        "Press 4 to buy five green keys, $ 360.", "Press other key to quit."
    ]
Exemplo n.º 21
0
class ExpShop(Shop):
    images = load_images(["expshop.png"])
    funcdict = {
        pygame.K_1: 'buy_smalldr',
        pygame.K_2: 'buy_defrk',
        pygame.K_3: 'buy_snakerk',
        pygame.K_4: 'buy_level'
    }
    msgs = [
        "Press 1 to buy a small drug, EXP 20.",
        "Press 2 to buy a defencerock, EXP 20.",
        "Press 3 to buy a snakerock, EXP 20.",
        "Press 4 to buy a level, EXP 100.", "Press other key to quit."
    ]
Exemplo n.º 22
0
class Soldier(MidSoldier):
    images = load_images(["soldier.png", "soldier2.png"])
    counter = 0
    hp = 320
    money = 9
    exp = 9
    feature = 'None'
    skill = "NO"
    condition = "NORMAL"

    def do_collide(self, player):
        super(Soldier, self).do_collide(player)
        Soldier.counter -= 1
        if Soldier.counter == 0:
            player.currentfloor.show_greenkeys()
Exemplo n.º 23
0
class Oldman(Talkable):
    images = load_images(["oldman.png"])
    msgs = [
        "Do not think about everything is so easy. Mind traps.",
    ]

    def do_collide(self, player):
        if player.currentfloor.floornum == 5:
            super(Oldman, self).do_collide(player)
        elif player.currentfloor.floornum == 17:
            self.msgs = [
                "Oldman: The fairy on the 23rd floor is waiting for you.",
                "Worior: What? Waiting for me?",
                "Oldman: Right. She is looking for something.",
                "Oldman: And she need you to bring it.",
                "Worior: And could you tell me the thing?",
                "Oldman: Sorry, I don't know. You can go and ask her yourself.",
                "Worior: Can you help me to beat the monsters above us?",
                "Oldman: No, it is your stuff. Do it yourself.",
                "Oldman: But it's really difficult. Really. So good luck, boy.",
                "Worior: OK. Thanks...",
            ]
            super(Oldman, self).do_collide(player)
Exemplo n.º 24
0
class LightButterfly(Butterfly):
    images = load_images(["lightbutterfly.png", "lightbutterfly2.png"])
    hp = 960
    money = 20
    exp = 19
    feature = 'LIGHT'
    skill = "LIGHTNING-BOMB"
    condition = "NORMAL"

    def do_collide(self, player):
        Msgbox("Skill: Lightning-Bomb! Be careful!").show()
        miss = random.randint(1, 10)
        if miss == 1:
            Msgbox("The skill missed!").show()
        else:
            Msgbox("The skill hit!").show()
            if player.feature in ["GRASS", "SOIL"]:
                player.weaken(120)
            elif player.feature in ["WATER", "SKY", "DARK"]:
                player.weaken(480)
                player.hurt(100)
            else:
                player.weaken(240)
        super(LightButterfly, self).do_collide(player)
Exemplo n.º 25
0
class Largedprock(Defencerock):
    images = load_images(["largedprock.png"])
    dp = 60
Exemplo n.º 26
0
class Fakewall(Wall):
    images = load_images(["wall.png"])

    def do_collide(self, player):
        self.kill()
Exemplo n.º 27
0
class Exlargedrug(Smalldrug):
    images = load_images(["exlargedrug.png"])
    heal = 650
Exemplo n.º 28
0
class Largedrug(Smalldrug):
    images = load_images(["largedrug.png"])
    heal = 500
Exemplo n.º 29
0
class Middledrug(Smalldrug):
    images = load_images(["middledrug.png"])
    heal = 300
Exemplo n.º 30
0
class Wall(Npc):
    images = load_images(["wall.png"])

    def do_collide(self, player):
        player.undo()