예제 #1
0
파일: map.py 프로젝트: aruse/Bludgeon
    def place_objects(self, room):
        """Place random objects in a room."""
        # Choose random number of monsters
        for i in xrange(SS.map_rand.randrange(cfg.MAX_ROOM_MONSTERS)):
            x = SS.map_rand.randrange(room.x1 + 1, room.x2 - 1)
            y = SS.map_rand.randrange(room.y1 + 1, room.y2 - 1)

            # Don't place monsters on the up stairs, as that's where the player
            # will be placed.
            if not self.blocks_movement(x, y) and (x, y) != self.upstairs:
                if SS.map_rand.randrange(0, 100) < 60:
                    mon = Monster(x, y, 'orc', ai=ai.StupidAI())
                else:
                    mon = Monster(x, y, 'troll', ai=ai.StupidAI())

                mon.place_on_map(self)

        # Choose random number of items
        for i in xrange(SS.map_rand.randrange(cfg.MAX_ROOM_ITEMS)):
            x = SS.map_rand.randrange(room.x1 + 1, room.x2 - 1)
            y = SS.map_rand.randrange(room.y1 + 1, room.y2 - 1)

            if not self.blocks_movement(x, y):
                dice = SS.map_rand.randrange(0, 100)
                if dice < 40:
                    item = Item(x, y, 'healing potion')
                elif dice < 40 + 20:
                    item = Item(x, y, 'scroll of fireball')
                elif dice < 40 + 20 + 20:
                    item = Item(x, y, 'scroll of lightning')
                else:
                    item = Item(x, y, 'scroll of confusion')

                item.place_on_map(self)
예제 #2
0
 def __possibleMonsters(self):
     return {
         "Rat":
         Monster(
             name="Rat",
             health=30,
             attack=10,
             defense=15,
             speed=50,
             reward_min=1,
             reward_max=5,
         ),
         "Gnoll":
         Monster(
             name="Gnoll",
             health=60,
             attack=30,
             defense=40,
             speed=20,
             reward_min=5,
             reward_max=10,
         ),
         "Wolf":
         Monster(
             name="Wolf",
             health=40,
             attack=25,
             defense=30,
             speed=60,
             reward_min=10,
             reward_max=15,
         ),
     }
예제 #3
0
파일: main.py 프로젝트: lucashtm/poketext
def main(argv):
    foe = Monster('scyter', 123, 0, 100, 100)
    ally = Monster('bulbasaur', 1, 0, 100, 100)
    battle = Battle(foe, ally)
    att = Attack('splash', 0, 100, False, True)
    for effect in att.effects():
        sys.stdout.write(effect(battle))
    sys.stdout.write('\n')
예제 #4
0
def start_game():
    pygame.init()
    settings = Settings()
    screen = pygame.display.set_mode(
        (settings.screen_width, settings.screen_height))
    pygame.display.set_caption("Miner by Cristhianxy")
    game_stats = GameStats(settings)

    menu_items = Group()
    title_top = Menu_Item("MINER", 70, screen, 50)
    btn_start = Menu_Item("Start", 30, screen, 135, "start")
    btn_hs = Menu_Item("High Score", 30, screen, 175, "high_score")
    btn_exit = Menu_Item("EXIT", 30, screen, 215, "exit")
    sub_title_1 = Menu_Item("Code by Cristhian Ferreira", 15, screen, 345)
    sub_title_2 = Menu_Item("Created with Pygame and Love", 15, screen, 380)

    menu_items.add(title_top, btn_start, btn_hs, btn_start, btn_exit,
                   sub_title_1, sub_title_2)

    player = Player(settings, screen)
    bullets = Group()
    ground_grid = Group()
    jewels = Group()
    gf.create_ground(settings, screen, player, ground_grid)
    brian = Monster(settings, screen, 406.6, 506.3)
    brian2 = Monster(settings, screen, 500, 403)
    brian3 = Monster(settings, screen, 744, 502)
    brian4 = Monster(settings, screen, 755, 323)
    monsters = Group()
    monsters.add(brian, brian2, brian3, brian4)
    gf.create_jewels(screen, settings, jewels)
    game_stats.reset_game()
    dashboard = Dashboard(screen, settings, game_stats)
    key_pressed = ""
    """MAIN LOOP"""
    while True:

        if not game_stats.game_status:
            gf.menu_init(menu_items)

        gf.event_listener(screen, settings, player, bullets, menu_items,
                          game_stats)

        if game_stats.game_status:

            player.update()
            brian.move_y()
            brian2.move_x()
            brian3.move_y()
            brian4.move_x()
            gf.update_bullets(settings, screen, bullets)
            gf.update_screen(settings, screen, player, bullets, ground_grid,
                             monsters, jewels, dashboard, game_stats,
                             dashboard)
예제 #5
0
    def spawn_monster(self):
        """Spawn a monster """
        """PRE:/
           POST: New object of class Monster. Add to the attribut 
        """
        monster = Monster(self)

        monster2 = Monster(self)
        monster2.rect.y = random.randint(100, 200)
        monster2.rect.x = 1300
        monster2.velocity = 1.5
        monster2.attack = 50
        monster2.image = pygame.image.load('im/dragon.png')

        self.all_monsters.add(monster, monster2)
예제 #6
0
파일: game.py 프로젝트: yalexhwang/pygame
def run_game():
    pygame.init()  #initializes pygame modules
    #create an instance of Settings class and assign it to game_settings
    game_settings = Settings()
    #set screen size, need double parenthesis, or set width and height to variable
    screen = pygame.display.set_mode(game_settings.screen_size)
    #set msg on status bar
    pygame.display.set_caption("Monster Attack")

    #music
    pygame.mixer.music.load('sounds/music.wav')
    pygame.mixer.music.play(-1)

    #create a play button and assign it to a var
    play_button = Play_button(screen, 'Start')

    #set variable equal to the class and pass it to the screen
    hero = Hero(screen)

    #set the bullets to group(built-in of pygame, upgrade to list)
    bullets = Group()
    monsters = Group()
    new_monster = Monster(screen)
    monsters.add(new_monster)
    #init counter at 0
    tick = 0

    while 1:  #1 is true, run this loop forever...
        #call gf (aliased from game_functions), get the check_event method
        gf.check_events(hero, bullets, monsters, screen, game_settings,
                        play_button)
        #call to update the screen
        gf.update_screen(game_settings, screen, hero, bullets, monsters,
                         play_button)
        tick += 1
        if game_settings.game_active:
            hero.update()  #update the hero flags
            bullets.update()
            monsters.update()
            if tick % 150 == 0:
                new_monster = Monster(screen)
                monsters.add(new_monster)
            #get rid of bullets that are off the screen
            dict = groupcollide(bullets, monsters, True, True)
            if dict:
                print "you hit a monster"
                pygame.mixer.music.load('sounds/lose.wav')
                pygame.mixer.music.play(-1)
예제 #7
0
    def addTinyBat(self):
        name = "Tiny Bat"
        desc = """A microscopic bat, as small as a grain of salt rears down before you. it looks at you with hunger in it eyes.
            /(    )\\
            |  -^^-  |
            \\_ `' _/
                \\  )
                )/
                ('     """
        attack_desc = "bites You"

        level = 1
        health = 5
        attack = 5
        damage = 1
        defense = 8
        protection = 1
        speed = 16

        xp = 10
        gold = 5
        food = 50
        basic = 1
        advanced = 0
        epic = 0

        temp = Monster(name, desc, attack_desc, level, health, attack, damage,
                       defense, protection, speed, xp, gold, food, basic,
                       advanced, epic)

        #adds to list
        self.monsters.append(temp)
예제 #8
0
def createWorld():
    manager = Room("You are in your manager's  office")
    mailroom = Room("You are in the mail room")
    customer = Room("You are the customer service room")
    janitor = Room("You are in the janitor's closet")
    accountant = Room("You are in the accountants office")
    liability = Room("You are in the liability office")
    bathroom = Room("You are in the bathroom")
    office = Room("You are in your own office")

    Room.connectRooms(manager, "mail-room", mailroom, "management")
    Room.connectRooms(manager, "accounting", accountant, "management")
    Room.connectRooms(customer, "mail-room", mailroom, "customer-service")
    Room.connectRooms(customer, "accounting", accountant, "customer-service")
    Room.connectRooms(customer, "janitors-closet", janitor, "customer-service")
    Room.connectRooms(janitor, "liability", liability, "janitors-closet")
    Room.connectRooms(liability, "accounting", accountant, "liability")
    Room.connectRooms(liability, "bathroom", bathroom, "liability")
    Room.connectRooms(accountant, "your-office", office, "accounting")

    i = Item("Rock", "This is just a rock.")
    i.putInRoom(office)
    player.location = accountant
    Monster("Bob the monster", 20, office)
    Jani("Jani", liability, player)  # this is how you make NPC's
예제 #9
0
    def generate_monster(self,floor_lvl):

        # TODO REFACTOR + CLEANUP

        dice = Dice()

        if floor_lvl > 100:
            floor_lvl = 100

        # hp
        hp_num_dice = 1
        hp_num_extra_dice = 4
        total_hp = 0
        for i in range(hp_num_dice):
            total_hp += dice.roll(1)[0]
        for i in range(hp_num_extra_dice):
            if randint(1,100) <= floor_lvl:
                total_hp += dice.roll(1)[0]

        # fs + op
        fs = randint(2,12)
        op = fs+randint(1,5)
        if op > 12:
            op = 12

        # ko
        ko_weps = ['bows','wands','swords'] 
        ko_num_dice = 1
        ko_num_extra_dice = 5
        ko = {}
        for i in range(ko_num_dice):
            wep = choice(ko_weps)
            if wep not in ko:
                ko[wep] = 0
            ko[wep] += 1
        for i in range(ko_num_extra_dice):
            if randint(1,100) <= floor_lvl:
                wep = choice(ko_weps)
                if wep not in ko:
                    ko[wep] = 0
                ko[wep] += 1

        # reward
        reward_roll = randint(0,99)
        reward = {}

        if reward_roll > 0 and reward_roll <= 9:
            # 10% key
            reward = {'keys':1}
        elif reward_roll > 9 and reward_roll <= 19:
            # 10% wep
            reward = {choice(ko_weps):1}
        elif reward_roll > 19 and reward_roll <= 49:
            # 30% nothing
            reward = {}
        else:
            # 50% gold
            reward = {'gold':SETTINGS['core_items']['gold']['find_qty']()}

        return Monster(total_hp,fs,op,ko,reward)
예제 #10
0
    def addUnicorn(self):
        name = "Unicorn"
        desc = "This mystical creature has been locked down here for ages and so it is easily angered buy the slightest movement."
        attack_desc = "Stabs You With It's Horn"

        level = 15
        health = 200
        attack = 100
        damage = 85
        defense = 75
        protection = 15
        speed = 8

        xp = 500
        gold = 250
        food = 65
        basic = 3
        advanced = 1
        epic = 1

        temp = Monster(name, desc, attack_desc, level, health, attack, damage,
                       defense, protection, speed, xp, gold, food, basic,
                       advanced, epic)

        #add list
        self.monsters.append(temp)
예제 #11
0
def init(data):
    # load data.xyz as appropriate
    data.maze = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
                 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                 [0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0],
                 [0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0],
                 [0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0],
                 [0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0],
                 [0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0],
                 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                 [0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0],
                 [0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0],
                 [0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0],
                 [0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0],
                 [0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0],
                 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
                 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
    data.gameOver = False
    data.timer = 0
    data.cellSize = 30
    data.board = Board(data.maze)
    data.rows, data.cols = len(data.maze), len(data.maze[0])
    #moves by width and height of each cell
    data.speedX, data.speedY = data.cellSize, data.cellSize
    data.counter = 0
    data.directions = ['up', 'down', 'left', 'right']
    data.mdirection = 'right'
    data.direction = 'Right'
    data.pacman = Pacman(data.cols // 2 - 1, data.rows // 2 - 1, data)
    data.center = None
    data.lives = 3
    data.score = 0
    data.monsterCenter = 0, 1
    data.monster = Monster(data)
    data.food = copy.deepcopy(data.maze)
예제 #12
0
    def addDragon(self):
        name = "Dragon"
        desc = "This mystical creature is asleep... it awakens will you be burnt to a crisp!!"
        attack_desc = "Blows Fire at you"

        level = 15
        health = 400
        attack = 200
        damage = 170
        defense = 150
        protection = 60
        speed = 0

        xp = 3000
        gold = 1000
        food = 160
        basic = 1
        advanced = 2
        epic = 5

        temp = Monster(name, desc, attack_desc, level, health, attack, damage,
                       defense, protection, speed, xp, gold, food, basic,
                       advanced, epic)

        #add list
        self.monsters.append(temp)
예제 #13
0
파일: stage2.py 프로젝트: tjun1008/2dgame
 def update(self):
     bg.update()
     global zombie_time
     #zombie_time -= gfw.delta_time
     zombie_time -= 1
     if zombie_time >= 0:
         gfw.world.add(gfw.layer.monster, Monster())
예제 #14
0
def create_monster(mi_settings, screen, monsters, number, row_number):
    monster = Monster(mi_settings, screen)
    monster_width = monster.rect.width
    monster.x = monster_width + 2 * monster_width * number
    monster.rect.x = monster.x
    monster.rect.y = monster.rect.height + 2 * monster.rect.height * row_number
    monsters.add(monster)
예제 #15
0
 def add_attack(self, type: "1=Se déplace vers la gauche sinon 2"):
     if self.mode == 1:  #attaque de monstres
         print("on ajoute un monstre")
         self.all_monsters.add(Monster(self, type))
     else:  #attaque de météorites
         print("on ajoute une météorite")
         self.all_meteorites.add(Meteorite(self))
예제 #16
0
 def create_monster(self, parentset, coord):
     hp = 0
     force = 0
     visibility = 0
     regeneration = 0
     generation = 1
     for m in parentset:
         m.children += 1
         generation = max(generation, m.generation + 1)
         hp += m.max_hp
         force += m.max_force
         visibility += m.max_visibility
         regeneration += m.max_regeneration
     l = len(parentset)
     hp = self.characteristic_formula(hp // l + 1, 10)
     force = self.characteristic_formula(force // l + 1, 1)
     visibility = self.characteristic_formula(visibility // l + 1, 4)
     regeneration = self.characteristic_formula(regeneration // l + 1, 0)
     return Monster(coord,
                    self,
                    hp=hp,
                    force=force,
                    visibility=visibility,
                    regeneration=regeneration,
                    birthday=self.move_number,
                    generation=generation)
예제 #17
0
 def parse_level(self, level: str, level_number: int) -> List[List[str]]:
     level = level.replace('-', constants.HORIZONTAL)
     level = level.replace('|', constants.VERTICAL)
     level = level.replace('+', constants.CROSS)
     level = [[char for char in row] for row in level.split('\n')]
     for y_index, row in enumerate(level):
         for x_index, value in enumerate(row):
             if x_index == 0 and y_index == 0:
                 level[y_index][x_index] = constants.BOTTOM_RIGHT
             elif x_index == 0 and y_index == len(level) - 1:
                 level[y_index][x_index] = constants.TOP_RIGHT
             elif x_index == len(row) - 1 and y_index == len(level) - 1:
                 level[y_index][x_index] = constants.TOP_LEFT
             elif x_index == len(row) - 1 and y_index == 0:
                 level[y_index][x_index] = constants.BOTTOM_LEFT
             elif y_index == 0 and value == constants.CROSS:
                 level[y_index][x_index] = constants.TOP_OUT
             elif y_index == len(level) - 1 and value == constants.CROSS:
                 level[y_index][x_index] = constants.BOTTOM_OUT
             elif x_index == 0 and value == constants.CROSS:
                 level[y_index][x_index] = constants.LEFT_OUT
             elif x_index == len(row) - 1 and value == constants.CROSS:
                 level[y_index][x_index] = constants.RIGHT_OUT
             if value == 'I':
                 self.items[(level_number, x_index, y_index)] = \
                     random.choice((Consumable, Equipment,
                                    Weapon))(level_number + 1)
             elif value == 'M':
                 self.monsters[(level_number, x_index, y_index)] = \
                     Monster(level_number + 1)
             elif value == '%':
                 self.starting_positions.append((x_index, y_index))
                 if level_number == 0:
                     level[y_index][x_index] = ' '
     return level
예제 #18
0
 def _init_(self, name, aantalMonsters=3, description):
     self.name=name
     self.aantalMonsters = []
     self.attachedRooms = [] 
     for i in range(aantalMonsters):
         self.monsters.append(Monster(OrkNameGenerator.get_random_ork_name()))
         self.description = description
예제 #19
0
def creat_monster(screen, monsters, monster_wid, monster_number, number_row):
    monster = Monster(screen)

    monster.x = monster_wid + 2 * monster_wid * monster_number
    monster.rect.x = monster.x
    monster.rect.y = monster.rect.height + 2 * monster.rect.height * number_row
    monsters.add(monster)
예제 #20
0
 def create_fleet(self):
     monster = Monster(self.settings, self.screen)
     number_monster_y = self.get_number_monsters_y(monster.rect.height)
     number_cols = self.get_number_cols(monster.rect.width)
     for col in range(number_cols):
         for row in range(number_monster_y):
             self.create_monster(col, row)
예제 #21
0
    def addGiantSpider(self):
        name = "Giant Spider"
        desc = "A hideous Spider, as big as a small child rears up before you. it looks at you with hunger in it eyes."
        attack_desc = "bites You"

        level = 1
        health = 10
        attack = 10
        damage = 5
        defense = 8
        protection = 4
        speed = 8

        xp = 30
        gold = 15
        food = 100
        basic = 2
        advanced = 0
        epic = 0

        temp = Monster(name, desc, attack_desc, level, health, attack, damage,
                       defense, protection, speed, xp, gold, food, basic,
                       advanced, epic)

        #adds to list
        self.monsters.append(temp)
예제 #22
0
 def kitchen2(self):
     room = Room()
     moldyCheese = Item('moldy cheese')
     moldyCheese.movable = True
     moldyCheese.effects['healing'] = 5
     room.inventory.add(moldyCheese)
     cat = Item('cat')
     cat.movable = False
     cat.messages['nopickup'] = 'It seems like a cat but its actually an alien.'
     room.inventory.add((cat))
     wierdThing = Item('???')
     wierdThing.movable = False
     wierdThing.messages['nopickup'] = "Its seems to be a slimy looking thing that is stuck to the floor and tried to eat your hand when you touched it."
     key2 = Item("cake key")
     key2.effects["description"] = "A key the looks like a cake but is actually the key for the kings office."
     key2.key = Key("cake key", "The king's office unlocks.")
     room.inventory.add(key2)
     room.inventory.add((wierdThing))
     room.long_description = """It's the castle kitchen but its hard to tell because it also could be a pet room, for aliens, which the room is full of."""
     room.short_description = """An old kitchen, or pet room, for aliens"""
     room.name = "Kitchen"
     room.exits = {'n': Connection(7) }        
     #room.exits = {'e': 0}
     room.monster = Monster("Musclar spoon", 6, 3, 10)
     return room
예제 #23
0
    def addCyclops(self):
        name = "Cyclops"
        desc = "A twenty foot tall ga peers menacingly at you with his single large eye."
        attack_desc = "swings his hammer at you"

        level = 10
        health = 50
        attack = 18
        damage = 20
        defense = 8
        protection = 15
        speed = -5

        xp = 300
        gold = 2000
        food = 1000
        basic = 0
        advanced = 1
        epic = 1

        temp = Monster(name, desc, attack_desc, level, health, attack, damage,
                       defense, protection, speed, xp, gold, food, basic,
                       advanced, epic)

        #add list
        self.monsters.append(temp)
예제 #24
0
    def test_is_suitable_rune_2(self):
        preset = Preset(monster=Monster('any', stats={}))
        preset.include(violent, will)

        self.assertTrue(
            preset.is_suitable_rune(make_rune(slot=1, set='Violent')))
        self.assertTrue(preset.is_suitable_rune(make_rune(slot=2, set='Will')))
예제 #25
0
    def addAngry_Zombie(self):
        name = "Angry Zombie"
        desc = "A Once Living person got lost in this dungeon with firends that angered him and he has been wondering around looking for BRAINS!!"
        attack_desc = "Swings Branch at you"

        level = 4
        health = 35
        attack = 20
        damage = 12
        defense = 10
        protection = 2
        speed = 5

        xp = 150
        gold = 150
        food = 10
        basic = 2
        advanced = 2
        epic = 0

        temp = Monster(name, desc, attack_desc, level, health, attack, damage,
                       defense, protection, speed, xp, gold, food, basic,
                       advanced, epic)

        #add list
        self.monsters.append(temp)
예제 #26
0
파일: game.py 프로젝트: dguan4/HanStory
 def __init__(self):
     """
     Sets up a game gui with the player and starts it
     :return:
     """
     pygame.init()
     self.view = View()
     self.map = Map()
     self.map.player = Player()
     self.map.player_loc = (1 * TILE_SIZE, 1 * TILE_SIZE)
     self.player = self.map.player
     self.player.set_location(self.map.player_loc)
     #self.time = pygame.time.Clock()
     self.map.set_player_location(self.map.player_loc)
     self.treasure = Treasure()
     self.inventory_button = Button("Inventory", 480, 0, 20, 20)
     self.save_button = Button("Save", 590, 0, 20, 20)
     self.load_button = Button("Load", 590, 50, 20, 20)
     self.view.draw_layers(self.map, self.treasure,
                           self.map.player.inventory, self.inventory_button,
                           self.save_button, self.load_button)
     self.monster = Monster()
     self.map.monster_loc = self.monster.loc
     while self.map.set_monster_location(self.monster.loc) is False:
         self.monster.set_location()
     self.map.treasure_loc = self.treasure.x_y
     while self.map.add_item(self.treasure.x_y) is False:
         self.treasure = Treasure()
예제 #27
0
    def addFast_Zombie(self):
        name = "Fast Zombie"
        desc = "A Once Living athlete got lost in this dungeon and has been wondering around looking for BRAINS!!"
        attack_desc = "swings his arms at you"

        level = 3
        health = 20
        attack = 5
        damage = 5
        defense = 5
        protection = 5
        speed = 20

        xp = 50
        gold = 100
        food = 10
        basic = 3
        advanced = 1
        epic = 0

        temp = Monster(name, desc, attack_desc, level, health, attack, damage,
                       defense, protection, speed, xp, gold, food, basic,
                       advanced, epic)

        #add list
        self.monsters.append(temp)
예제 #28
0
def start_fight(player):
    monster = Monster(10, 2)
    print('--- Start fight ---')
    monster.show_stats()

    while True:
        print('Choose an action : ')
        print('Tape 1 for attack')
        print('Tape 2 for show the monster stats')
        print('Tape 3 for leave the fight')
        action = input()
        if action == '':
            continue

        if int(action) == 1:
            player.attack_monster(monster)
            print('BIM !!!')
            monster.show_stats()
            print(' --- Press enter to continue ---')
            input()

        if int(action) == 2:
            monster.show_stats()

        if int(action) == 3:
            print('Your leave the fight')
            break

        if monster.life == 0:
            print("YOU WIN !!!")
            break

    return player
예제 #29
0
    def addBaby_Dragon(self):
        name = "Baby Dragon"
        desc = "This mystical creature is asleep... it awakens will you be burnt to a crisp."
        attack_desc = "Blows Fire at you"

        level = 10
        health = 200
        attack = 100
        damage = 85
        defense = 75
        protection = 30
        speed = 1

        xp = 1500
        gold = 500
        food = 80
        basic = 0
        advanced = 3
        epic = 2

        temp = Monster(name, desc, attack_desc, level, health, attack, damage,
                       defense, protection, speed, xp, gold, food, basic,
                       advanced, epic)

        #add list
        self.monsters.append(temp)
    def setUp(self):
        """ Initialize fixtures """

        self.logMonster()
        self.monster = Monster("dragon", "easy")
        self.server = CharacterManager(
            "ACIT", "test_characters.sqlite")
        self.assertIsNotNone(self.monster)