示例#1
0
 def setUp(self):
     self.WIDTH = 100
     self.HEIGHT = 80
     self.fillx = [10,20]
     self.filly = [10,20]
     self.identifier = 0
     self.scenario = poke.Scenario(1, self.WIDTH,self.HEIGHT)
     self.item1 = items.TMs(name="Thundershock", id=33, img = 0, description="lalal",  TM_number=33, location = [5,5])
     self.item2 = items.TMs(name="Thunder", id=50, img=0, description="lalal", TM_number=50, location=[5000, 5])
示例#2
0
def create_all_TM():
    TMs = {}
    tm33 = items.TMs(name="Thundershock",
                     id=33,
                     img=0,
                     description="lalal",
                     TM_number=33,
                     location=[5, 5])
    TMs.add({tm33.TM_number: tm33})
    return TMs
示例#3
0
def load_player(name):
    db = database.Database("pokemon.db")
    player_chosen = db.take_player(name)
    bag = db.take_bag()
    party = db.take_party()
    if len(player_chosen) == 1:
        new_player = poke.Player(name=player_chosen[0][0],
                                 img=player_chosen[0][1])
        new_player.position = [player_chosen[0][2], player_chosen[0][3]]
        new_player.crachas = player_chosen[0][4]
    else:
        return False

    for each in bag:
        item = items.TMs(name=each[0],
                         id=33,
                         img=0,
                         description="Prepare to get electrified",
                         TM_number=33)
        new_player.add_item(item)

    for p in party:
        att1 = Pokemon.Attack(name=p[3], damage=40, pp=15)
        att2 = Pokemon.Attack(name=p[4], damage=40, pp=15)
        att3 = Pokemon.Attack(name=p[5], damage=40, pp=15)
        att4 = Pokemon.Attack(name=p[6], damage=40, pp=15)
        pok = Pokemon.Pokemon(name=p[0],
                              types=[p[1], p[2]],
                              level=p[7],
                              nature=p[9],
                              gender=p[8],
                              attacks=[att1, att2, att3, att4])
        pok.add_stats(sp_att=p[10],
                      sp_def=p[11],
                      speed=p[12],
                      defense=[13],
                      att=p[14],
                      acc=p[15],
                      hp=p[16],
                      max_hp=p[17],
                      xp=p[18],
                      xp2next=p[19])
        new_player.add_pokemon(pok)
    return new_player
示例#4
0
    # db.update_bag(player1)
    # db.new_player(player2)
    # a = db.delete_player(player3)
    # b = db.delete_player(player1)
    player = db.take_player("teste123")
    bag = db.take_bag()
    party = db.take_party()

    if len(player) == 1:
        new_player = poke.Player(name=player[0][0], img=player[0][1])
        new_player.position = [player[0][2], player[0][3]]
        new_player.crachas = player[0][4]
    for each in bag:
        item = items.TMs(name=each[0],
                         id=33,
                         img=0,
                         description="Prepare to get electrified",
                         TM_number=33)
        new_player.add_item(item)
    for p in party:
        att1 = Pokemon.Attack(name=p[3], damage=40, pp=15)
        att2 = Pokemon.Attack(name=p[4], damage=40, pp=15)
        att3 = Pokemon.Attack(name=p[5], damage=40, pp=15)
        att4 = Pokemon.Attack(name=p[6], damage=40, pp=15)
        poke = Pokemon.Pokemon(name=p[0],
                               types=[p[1], p[2]],
                               level=p[7],
                               nature=p[9],
                               gender=p[8],
                               attacks=[att1, att2, att3, att4])
        poke.add_stats(sp_att=p[10],
示例#5
0
    pygame.init()
    display = pygame.display.set_mode((WIDTH, HEIGHT))
    clock = pygame.time.Clock()

    player = initialization()

    x_change = 0
    y_change = 0
    #t1 = threading.Thread(target=detect_keyboard, args= (x_change,y_change))
    #t1.start()

    mapa = create_map(player)
    tm33 = items.TMs(name="Thundershock",
                     id=33,
                     img=0,
                     description="lalal",
                     TM_number=33,
                     location=[13 * SQ_SIZE, 14 * SQ_SIZE])

    Thundershock = Pokemon.Attack(name="Thundershock", damage=40, pp=15)
    TailWhip = Pokemon.Attack(name="Tail Whip", damage=0, pp=40)
    Tackle = Pokemon.Attack(name="Tackle", damage=20, pp=40)
    pika = Pokemon.Pokemon(name="pika",
                           types="Electric",
                           level=5,
                           nature="Calm",
                           gender='M',
                           attacks=[Thundershock, TailWhip])
    eevee = Pokemon.Pokemon(name="eevee",
                            types="Normal",
                            level=5,