Ejemplo n.º 1
0
 def print_reward(self,click=False):
     display = pygame.Surface((500,250))
     display.blit(pygame.transform.scale(img_inventaire,(500,250)),(0,0))
     draw_text(str(self.reward_gold),ColderWeather_small,WHITE,display,380,180)
     display.blit(pygame.transform.scale(GoldCoin.wpn_img,(50,50)),(430,180))
     draw_text("Recompense : ",ColderWeather_small,WHITE,display,30,20)
     i=0
     for x in self.reward_items:
         display.blit(pygame.transform.scale(x.wpn_img,(50,50)),(30+i*50,70))
         i+=1
     screen.blit(display,(self.pos_x+500,self.pos_y))
Ejemplo n.º 2
0
 def caracter_sheet(self):
     screenS = screenSave()
     board = pygame.transform.scale(board_init(), (900, 780))
     board_icon = pygame.transform.scale(
         board_init(), (board.get_width() // 5, board.get_height() // 5))
     iconew = pygame.transform.scale(
         wizard_icon,
         (board_icon.get_width() // 2, board_icon.get_height()))
     board_icon.blit(
         iconew, (board_icon.get_width() // 2 - iconew.get_width() // 2, 0))
     board_icon2 = pygame.transform.scale(
         board_init(), (board.get_width() // 5, board.get_height() // 5))
     iconen = pygame.transform.scale(
         neutre_icon, (trunc(board_icon2.get_width() // 1.2),
                       trunc(board_icon2.get_height() // 1.2)))
     board_icon2.blit(
         iconen, (board_icon2.get_width() // 2 - iconen.get_width() // 2,
                  board_icon2.get_height() // 2 - iconen.get_height() // 2))
     draw_text("Sorcerer", title, "bl", board,
               board.get_width() // 8,
               board.get_height() // 20)
     perso = pygame.transform.scale(
         wizard_hide['idle_1.png'],
         (board.get_width() // 3, board.get_height() // 2))
     board.blit(perso, (board.get_width() // 14, board.get_height() // 7))
     """initialisation de tous les boards avec les choix correspondants aux 5 differents lvl"""
     rect_choices = list()
     draw_text("Sorcery Points : " + str(self.sPoints), text, 'b', board,
               board.get_width() // 18, trunc(board.get_height() * 0.65))
     draw_text("Spells Slots lvl 1 : " + str(self.spells_slots[0]), text,
               'b', board,
               board.get_width() // 18,
               trunc(board.get_height() * 0.65) + 50)
     draw_text("Spells Slots lvl 2 : " + str(self.spells_slots[1]), text,
               'b', board,
               board.get_width() // 18,
               trunc(board.get_height() * 0.65) + 100)
     if self.master == False:
         draw_text("unlock master skill lvl 4", text, 'b', board,
                   board.get_width() // 18,
                   trunc(board.get_height() * 0.65) + 150)
     else:
         if self.masterAction:
             draw_text("master action : Active", text, 'b', board,
                       board.get_width() // 18,
                       trunc(board.get_height() * 0.65) + 150)
         else:
             draw_text("Master Action : Inactive", text, 'b', board,
                       board.get_width() // 18,
                       trunc(board.get_height() * 0.65) + 150)
     rectboard = pygame.Rect(
         screen.get_width() // 2 - board.get_width() // 2, 20, 0, 0)
     board_level1 = board_with_msg("Unlock at level 1")
     rect_board1 = replace_rect(
         rectboard,
         pygame.Rect(trunc(board.get_width() * 0.45),
                     trunc(board.get_height() * 0.03), 0, 0))
     rect_choices.append(
         choices_clickable(board_level1,
                           [image['S_Magic01.png'], image['S_Fire01.png']],
                           rect_board1))
     board_level1, rect_choices[0] = replace_rects_scale(
         (trunc(board.get_width() * 0.5), trunc(board.get_height() * 0.2)),
         board_level1, rect_choices[0], rect_board1)
     board_level2 = board_with_msg("Unlock at level 2")
     rect_board2 = replace_rect(
         rectboard,
         pygame.Rect(trunc(board.get_width() * 0.45),
                     trunc(board.get_height() * 0.21), 0, 0))
     rect_choices.append(
         choices_clickable(board_level2,
                           [image['S_Shadow02.png'], image['S_Buff01.png']],
                           rect_board2))
     board_level2, rect_choices[1] = replace_rects_scale(
         (trunc(board.get_width() * 0.5), trunc(board.get_height() * 0.2)),
         board_level2, rect_choices[1], rect_board2)
     board_level3 = board_with_msg("Unlock at level 3")
     rect_board3 = replace_rect(
         rectboard,
         pygame.Rect(trunc(board.get_width() * 0.45),
                     trunc(board.get_height() * 0.39), 0, 0))
     rect_choices.append(
         choices_clickable(board_level3, [image['S_Fire02.png']],
                           rect_board3))
     board_level3, rect_choices[2] = replace_rects_scale(
         (trunc(board.get_width() * 0.5), trunc(board.get_height() * 0.2)),
         board_level3, rect_choices[2], rect_board3)
     board_level4 = board_with_msg("Unlock at level 4")
     rect_board4 = replace_rect(
         rectboard,
         pygame.Rect(trunc(board.get_width() * 0.45),
                     trunc(board.get_height() * 0.57), 0, 0))
     rect_choices.append(
         choices_clickable(board_level4, [image['S_Buff09.png']],
                           rect_board4))
     board_level4, rect_choices[3] = replace_rects_scale(
         (trunc(board.get_width() * 0.5), trunc(board.get_height() * 0.2)),
         board_level4, rect_choices[3], rect_board4)
     board_level5 = board_with_msg("Unlock at level 5")
     rect_board5 = replace_rect(
         rectboard,
         pygame.Rect(trunc(board.get_width() * 0.45),
                     trunc(board.get_height() * 0.75), 0, 0))
     rect_choices.append(
         choices_clickable(board_level5,
                           [image['S_Fire04.png'], image['W_Axe001.png']],
                           rect_board5))
     board_level5, rect_choices[4] = replace_rects_scale(
         (trunc(board.get_width() * 0.5), trunc(board.get_height() * 0.2)),
         board_level5, rect_choices[4], rect_board5)
     board.blit(board_level1, (trunc(
         board.get_width() * 0.45), trunc(board.get_height() * 0.03)))
     board.blit(board_level2, (trunc(
         board.get_width() * 0.45), trunc(board.get_height() * 0.21)))
     board.blit(board_level3, (trunc(
         board.get_width() * 0.45), trunc(board.get_height() * 0.39)))
     board.blit(board_level4, (trunc(
         board.get_width() * 0.45), trunc(board.get_height() * 0.57)))
     board.blit(board_level5, (trunc(
         board.get_width() * 0.45), trunc(board.get_height() * 0.75)))
     running = True
     click = False
     if super().caracter_sheet():
         rect_icon = screen.blit(
             board_icon2, (rectboard.x - board_icon.get_width() // 1.5,
                           rectboard.y + board_icon.get_height() * 0.2))
         screen.blit(board, (rectboard.x, rectboard.y))
         screen.blit(board_icon,
                     (rectboard.x - board_icon.get_width() // 1.5,
                      rectboard.y + board_icon.get_height() // 0.8))
         ScreenS2 = screenSave()
         while running:
             screen.blit(ScreenS2, (0, 0))
             indice1 = collides(pygame.mouse.get_pos(), rect_choices[0])
             indice2 = collides(pygame.mouse.get_pos(), rect_choices[1])
             indice3 = collides(pygame.mouse.get_pos(), rect_choices[2])
             indice4 = collides(pygame.mouse.get_pos(), rect_choices[3])
             indice5 = collides(pygame.mouse.get_pos(), rect_choices[4])
             if indice1 == 0:
                 board_with_text(
                     "missile magic can be lunch at lvl 1 to lunch one missil or at level 2 to lunch 2 missil, it inflict between 1 and 5 damage"
                 )
             elif indice1 == 1:
                 board_with_text(
                     "fire bolt is a cantrip he doesn't use spell slot, it can be lunch as a bonus action, it inflicts between 1 and 10 damages"
                 )
             elif indice2 == 0:
                 board_with_text(
                     "Now you can use sorcery points, the amount is equal to your level you can use sorcery points to recover spell slots or use spell slots to recover sorcery points"
                 )
             elif indice2 == 1:
                 board_with_text(
                     "you could choose a skill, each time you will use an attribute reattach to your skill you will add your proficiency modifier to your score"
                 )
             elif indice3 == 0:
                 board_with_text(
                     "You unlock fire ball, this spell deals between 6 and 36 damages in a square area"
                 )
             elif indice4 == 0:
                 board_with_text(
                     "You unlock your mastery action quick spell, you can use this action one time between 2 rest, this bonus action allow you to lunch 2 spell in the same turn"
                 )
             elif indice5 == 0:
                 board_with_text("firebolt lunch two firebolt now")
             elif indice5 == 1:
                 board_with_text("proficiency bonus is now at 3")
             running, click = basic_checkevent(click)
             if click == True and rect_icon.collidepoint(
                     pygame.mouse.get_pos()):
                 if super().caracter_sheet() == 0:
                     running = False
             pygame.display.flip()
     screen.blit(screenS, (0, 0))
Ejemplo n.º 3
0
 def print_monster(self):
     draw_text("Monstre : ",ColderWeather_small,WHITE,screen,self.pos_x+100,self.pos_y+400)
     screen.blit(self.monster.avata,(225,400))
Ejemplo n.º 4
0
 def print_items(self):
     draw_text("Item : ",ColderWeather_small,WHITE,screen,self.pos_x+100,self.pos_y+400)
     screen.blit(self.items.wpn_img,(225,400))
Ejemplo n.º 5
0
 def caracter_sheet(self):
     screenS = screenSave()
     board = pygame.transform.scale(board_init(), (900, 780))
     board_icon = pygame.transform.scale(
         board_init(), (board.get_width() // 5, board.get_height() // 5))
     iconew = pygame.transform.scale(
         fighter_icon, (board_icon.get_width(), board_icon.get_height()))
     board_icon.blit(
         iconew, (board_icon.get_width() // 2 - iconew.get_width() // 2, 0))
     board_icon2 = pygame.transform.scale(
         board_init(), (board.get_width() // 5, board.get_height() // 5))
     iconen = pygame.transform.scale(
         neutre_icon, (trunc(board_icon2.get_width() // 1.2),
                       trunc(board_icon2.get_height() // 1.2)))
     board_icon2.blit(
         iconen, (board_icon2.get_width() // 2 - iconen.get_width() // 2,
                  board_icon2.get_height() // 2 - iconen.get_height() // 2))
     draw_text("Fighter", title, "bl", board,
               board.get_width() // 8,
               board.get_height() // 20)
     perso = pygame.transform.scale(
         fighter_img, (board.get_width() // 3, board.get_height() // 2))
     board.blit(perso, (board.get_width() // 14, board.get_height() // 7))
     """initialisation de tous les boards avec les choix correspondants aux 5 differents lvl"""
     rect_choices = list()
     if self.SW:
         draw_text("Second Wind : Active", text, 'b', board,
                   board.get_width() // 18,
                   trunc(board.get_height() * 0.65))
     else:
         draw_text("Second Wind : Inactive", text, 'b', board,
                   board.get_width() // 18,
                   trunc(board.get_height() * 0.65))
     if self.master == False:
         draw_text("unlock master skill lvl 4", text, 'b', board,
                   board.get_width() // 18,
                   trunc(board.get_height() * 0.65) + 50)
     else:
         if self.masterAction:
             draw_text("master action : Active", text, 'b', board,
                       board.get_width() // 18,
                       trunc(board.get_height() * 0.65) + 50)
         else:
             draw_text("Master Action : Inactive", text, 'b', board,
                       board.get_width() // 18,
                       trunc(board.get_height() * 0.65) + 50)
     rectboard = pygame.Rect(
         screen.get_width() // 2 - board.get_width() // 2, 20, 0, 0)
     board_level1 = board_with_msg("Unlock at level 1")
     rect_board1 = replace_rect(
         rectboard,
         pygame.Rect(trunc(board.get_width() * 0.45),
                     trunc(board.get_height() * 0.03), 0, 0))
     rect_choices.append(
         choices_clickable(board_level1, [image['S_Holy02.png']],
                           rect_board1))
     board_level1, rect_choices[0] = replace_rects_scale(
         (trunc(board.get_width() * 0.5), trunc(board.get_height() * 0.2)),
         board_level1, rect_choices[0], rect_board1)
     board_level2 = board_with_msg("Unlock at level 2")
     rect_board2 = replace_rect(
         rectboard,
         pygame.Rect(trunc(board.get_width() * 0.45),
                     trunc(board.get_height() * 0.21), 0, 0))
     rect_choices.append(
         choices_clickable(board_level2,
                           [image['W_Sword007.png'], image['S_Buff01.png']],
                           rect_board2))
     board_level2, rect_choices[1] = replace_rects_scale(
         (trunc(board.get_width() * 0.5), trunc(board.get_height() * 0.2)),
         board_level2, rect_choices[1], rect_board2)
     board_level3 = board_with_msg("Unlock at level 3")
     rect_board3 = replace_rect(
         rectboard,
         pygame.Rect(trunc(board.get_width() * 0.45),
                     trunc(board.get_height() * 0.39), 0, 0))
     rect_choices.append(
         choices_clickable(board_level3, [image['S_Holy05.png']],
                           rect_board3))
     board_level3, rect_choices[2] = replace_rects_scale(
         (trunc(board.get_width() * 0.5), trunc(board.get_height() * 0.2)),
         board_level3, rect_choices[2], rect_board3)
     board_level4 = board_with_msg("Unlock at level 4")
     rect_board4 = replace_rect(
         rectboard,
         pygame.Rect(trunc(board.get_width() * 0.45),
                     trunc(board.get_height() * 0.57), 0, 0))
     rect_choices.append(
         choices_clickable(board_level4, [image['S_Buff08.png']],
                           rect_board4))
     board_level4, rect_choices[3] = replace_rects_scale(
         (trunc(board.get_width() * 0.5), trunc(board.get_height() * 0.2)),
         board_level4, rect_choices[3], rect_board4)
     board_level5 = board_with_msg("Unlock at level 5")
     rect_board5 = replace_rect(
         rectboard,
         pygame.Rect(trunc(board.get_width() * 0.45),
                     trunc(board.get_height() * 0.75), 0, 0))
     rect_choices.append(
         choices_clickable(board_level5, [image['W_Axe001.png']],
                           rect_board5))
     board_level5, rect_choices[4] = replace_rects_scale(
         (trunc(board.get_width() * 0.5), trunc(board.get_height() * 0.2)),
         board_level5, rect_choices[4], rect_board5)
     board.blit(board_level1, (trunc(
         board.get_width() * 0.45), trunc(board.get_height() * 0.03)))
     board.blit(board_level2, (trunc(
         board.get_width() * 0.45), trunc(board.get_height() * 0.21)))
     board.blit(board_level3, (trunc(
         board.get_width() * 0.45), trunc(board.get_height() * 0.39)))
     board.blit(board_level4, (trunc(
         board.get_width() * 0.45), trunc(board.get_height() * 0.57)))
     board.blit(board_level5, (trunc(
         board.get_width() * 0.45), trunc(board.get_height() * 0.75)))
     running = True
     click = False
     if super().caracter_sheet():
         rect_icon = screen.blit(
             board_icon2, (rectboard.x - board_icon.get_width() // 1.5,
                           rectboard.y + board_icon.get_height() * 0.2))
         screen.blit(board, (rectboard.x, rectboard.y))
         screen.blit(board_icon,
                     (rectboard.x - board_icon.get_width() // 1.5,
                      rectboard.y + board_icon.get_height() // 0.8))
         ScreenS2 = screenSave()
         while running:
             screen.blit(ScreenS2, (0, 0))
             indice1 = collides(pygame.mouse.get_pos(), rect_choices[0])
             indice2 = collides(pygame.mouse.get_pos(), rect_choices[1])
             indice3 = collides(pygame.mouse.get_pos(), rect_choices[2])
             indice4 = collides(pygame.mouse.get_pos(), rect_choices[3])
             indice5 = collides(pygame.mouse.get_pos(), rect_choices[4])
             if indice1 == 0:
                 board_with_text(
                     "You unlock Second Wind, you can use it to recover between 1 and 10 hp"
                 )
             elif indice2 == 0:
                 board_with_text(
                     "Now when you wear an armor, the bonus armor is increase by 1, the damage of your weapons are increase by one too"
                 )
             elif indice2 == 1:
                 board_with_text(
                     "you could choose a skill, each time you will use an attribute reattach to your skill you will add your proficiency modifier to your score"
                 )
             elif indice3 == 0:
                 board_with_text(
                     "Second wind can heal up to 3 allies now and the amount of hp recovered is equal to your level"
                 )
             elif indice4 == 0:
                 board_with_text(
                     "You unlock your Master Action, you can use it one time between 2 rest, when you use it youcan do 2 actions in the same turn"
                 )
             elif indice5 == 0:
                 board_with_text("proficiency bonus is now at 3")
             running, click = basic_checkevent(click)
             if click == True and rect_icon.collidepoint(
                     pygame.mouse.get_pos()):
                 if super().caracter_sheet() == 0:
                     running = False
             pygame.display.flip()
     screen.blit(screenS, (0, 0))
Ejemplo n.º 6
0
 def caracter_sheet(self):
     screenS = screenSave()
     board = pygame.transform.scale(board_init(), (900, 780))
     board_icon = pygame.transform.scale(
         board_init(), (board.get_width() // 5, board.get_height() // 5))
     iconew = pygame.transform.scale(
         rogue_icon, (board_icon.get_width(), board_icon.get_height()))
     board_icon.blit(
         iconew, (board_icon.get_width() // 2 - iconew.get_width() // 2, 0))
     board_icon2 = pygame.transform.scale(
         board_init(), (board.get_width() // 5, board.get_height() // 5))
     iconen = pygame.transform.scale(
         neutre_icon, (trunc(board_icon2.get_width() // 1.2),
                       trunc(board_icon2.get_height() // 1.2)))
     board_icon2.blit(
         iconen, (board_icon2.get_width() // 2 - iconen.get_width() // 2,
                  board_icon2.get_height() // 2 - iconen.get_height() // 2))
     draw_text("Rogue", title, "bl", board,
               board.get_width() // 8,
               board.get_height() // 20)
     perso = pygame.transform.scale(
         Rogue_img, (board.get_width() // 3, board.get_height() // 2))
     board.blit(perso, (board.get_width() // 14, board.get_height() // 7))
     """initialisation de tous les boards avec les choix correspondants aux 5 differents lvl"""
     rect_choices = list()
     draw_text("You can use stealth on map", text, 'bl', board,
               board.get_width() // 18, trunc(board.get_height() * 0.65))
     rectboard = pygame.Rect(
         screen.get_width() // 2 - board.get_width() // 2, 20, 0, 0)
     board_level1 = board_with_msg("Unlock at level 1")
     rect_board1 = replace_rect(
         rectboard,
         pygame.Rect(trunc(board.get_width() * 0.45),
                     trunc(board.get_height() * 0.03), 0, 0))
     rect_choices.append(
         choices_clickable(board_level1, [image['S_Death02.png']],
                           rect_board1))
     board_level1, rect_choices[0] = replace_rects_scale(
         (trunc(board.get_width() * 0.5), trunc(board.get_height() * 0.2)),
         board_level1, rect_choices[0], rect_board1)
     board_level2 = board_with_msg("Unlock at level 2")
     rect_board2 = replace_rect(
         rectboard,
         pygame.Rect(trunc(board.get_width() * 0.45),
                     trunc(board.get_height() * 0.21), 0, 0))
     rect_choices.append(
         choices_clickable(board_level2, [image['S_Holy07.png']],
                           rect_board2))
     board_level2, rect_choices[1] = replace_rects_scale(
         (trunc(board.get_width() * 0.5), trunc(board.get_height() * 0.2)),
         board_level2, rect_choices[1], rect_board2)
     board_level3 = board_with_msg("Unlock at level 3")
     rect_board3 = replace_rect(
         rectboard,
         pygame.Rect(trunc(board.get_width() * 0.45),
                     trunc(board.get_height() * 0.39), 0, 0))
     rect_choices.append(
         choices_clickable(board_level3, [image['S_Death01.png']],
                           rect_board3))
     board_level3, rect_choices[2] = replace_rects_scale(
         (trunc(board.get_width() * 0.5), trunc(board.get_height() * 0.2)),
         board_level3, rect_choices[2], rect_board3)
     board_level4 = board_with_msg("Unlock at level 4")
     rect_board4 = replace_rect(
         rectboard,
         pygame.Rect(trunc(board.get_width() * 0.45),
                     trunc(board.get_height() * 0.57), 0, 0))
     rect_choices.append(
         choices_clickable(board_level4, [image['S_Shadow07.png']],
                           rect_board4))
     board_level4, rect_choices[3] = replace_rects_scale(
         (trunc(board.get_width() * 0.5), trunc(board.get_height() * 0.2)),
         board_level4, rect_choices[3], rect_board4)
     board_level5 = board_with_msg("Unlock at level 5")
     rect_board5 = replace_rect(
         rectboard,
         pygame.Rect(trunc(board.get_width() * 0.45),
                     trunc(board.get_height() * 0.75), 0, 0))
     rect_choices.append(
         choices_clickable(board_level5,
                           [image['S_Death01.png'], image['W_Axe001.png']],
                           rect_board5))
     board_level5, rect_choices[4] = replace_rects_scale(
         (trunc(board.get_width() * 0.5), trunc(board.get_height() * 0.2)),
         board_level5, rect_choices[4], rect_board5)
     board.blit(board_level1, (trunc(
         board.get_width() * 0.45), trunc(board.get_height() * 0.03)))
     board.blit(board_level2, (trunc(
         board.get_width() * 0.45), trunc(board.get_height() * 0.21)))
     board.blit(board_level3, (trunc(
         board.get_width() * 0.45), trunc(board.get_height() * 0.39)))
     board.blit(board_level4, (trunc(
         board.get_width() * 0.45), trunc(board.get_height() * 0.57)))
     board.blit(board_level5, (trunc(
         board.get_width() * 0.45), trunc(board.get_height() * 0.75)))
     running = True
     click = False
     if super().caracter_sheet():
         rect_icon = screen.blit(
             board_icon2, (rectboard.x - board_icon.get_width() // 1.5,
                           rectboard.y + board_icon.get_height() * 0.2))
         screen.blit(board, (rectboard.x, rectboard.y))
         screen.blit(board_icon,
                     (rectboard.x - board_icon.get_width() // 1.5,
                      rectboard.y + board_icon.get_height() // 0.8))
         ScreenS2 = screenSave()
         while running:
             screen.blit(ScreenS2, (0, 0))
             indice1 = collides(pygame.mouse.get_pos(), rect_choices[0])
             indice2 = collides(pygame.mouse.get_pos(), rect_choices[1])
             indice3 = collides(pygame.mouse.get_pos(), rect_choices[2])
             indice4 = collides(pygame.mouse.get_pos(), rect_choices[3])
             indice5 = collides(pygame.mouse.get_pos(), rect_choices[4])
             if indice1 == 0:
                 board_with_text(
                     "You unlock sneak attack, in battle if a monster is near a wall or an ally sneak attack increase your damage by 1d6"
                 )
             elif indice2 == 0:
                 board_with_text(
                     "When you take damage from a spell and you success to a dexterity saving throw the damagess are reduces to 0"
                 )
             elif indice2 == 1:
                 board_with_text(
                     "you could choose a skill, each time you will use an attribute reattach to your skill you will add your proficiency modifier to your score"
                 )
             elif indice3 == 0:
                 board_with_text("Sneak attack deals 1d12 more")
             elif indice4 == 0:
                 board_with_text(
                     " Unlock uncanny dodge, when you take damages from attack they are divide par two"
                 )
             elif indice5 == 0:
                 board_with_text("Sneak attack deals 1d12 more")
             elif indice5 == 1:
                 board_with_text("proficiency bonus is now at 3")
             running, click = basic_checkevent(click)
             if click == True and rect_icon.collidepoint(
                     pygame.mouse.get_pos()):
                 if super().caracter_sheet() == 0:
                     running = False
             pygame.display.flip()
     screen.blit(screenS, (0, 0))