0% found this document useful (0 votes)
8 views43 pages

Pygame Game Development Essentials

Uploaded by

Coco Do Cavalo
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views43 pages

Pygame Game Development Essentials

Uploaded by

Coco Do Cavalo
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

import pygame

import random
import json
import os
import math
from datetime import datetime, timedelta
from enum import Enum
from typing import List, Dict, Optional, Tuple

# Inicializar Pygame
[Link]()
[Link]()

# Configurações
SCREEN_WIDTH = 1366
SCREEN_HEIGHT = 768
FPS = 60

# Cores Premium
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
BLUE = (41, 128, 185)
DARK_BLUE = (27, 79, 114)
LIGHT_BLUE = (174, 214, 241)
GREEN = (46, 204, 113)
LIGHT_GREEN = (171, 235, 198)
RED = (231, 76, 60)
LIGHT_RED = (236, 112, 99)
GOLD = (241, 196, 15)
GRAY = (149, 165, 166)
DARK_GRAY = (52, 73, 94)
LIGHT_GRAY = (236, 240, 241)
PURPLE = (155, 89, 182)
ORANGE = (230, 126, 34)
CYAN = (26, 188, 156)

# Gradientes Premium
GRADIENT_DARK = [(20, 20, 40), (40, 40, 80)]
GRADIENT_BLUE = [(41, 128, 185), (27, 79, 114)]
GRADIENT_GREEN = [(46, 204, 113), (39, 174, 96)]
GRADIENT_RED = [(231, 76, 60), (192, 57, 43)]

# Estados do Jogo
class GameState(Enum):
SPLASH = "splash"
MENU = "menu"
NEW_GAME = "new_game"
TEAM_SELECT = "team_select"
DASHBOARD = "dashboard"
ROSTER = "roster"
TRAINING = "training"
MARKET = "market"
FINANCES = "finances"
MATCH = "match"
MATCH_LIVE = "match_live"
CALENDAR = "calendar"
TACTICS = "tactics"
FACILITIES = "facilities"
STATISTICS = "statistics"
SCOUT = "scout"
CONTRACTS = "contracts"
HISTORY = "history"
SETTINGS = "settings"
ACHIEVEMENTS = "achievements"

# Sistema de Partículas
class Particle:
def __init__(self, x, y, vel_x, vel_y, color, size, lifetime):
self.x = x
self.y = y
self.vel_x = vel_x
self.vel_y = vel_y
[Link] = color
[Link] = size
[Link] = lifetime
self.max_lifetime = lifetime

def update(self):
self.x += self.vel_x
self.y += self.vel_y
self.vel_y += 0.2 # Gravidade
[Link] -= 1
[Link] *= 0.98

def draw(self, screen):


if [Link] > 0:
alpha = int(255 * ([Link] / self.max_lifetime))
color = (*[Link], alpha) if len([Link]) == 3 else [Link]
[Link](screen, color[:3], (int(self.x), int(self.y)),
int([Link]))

class ParticleSystem:
def __init__(self):
[Link] = []

def emit(self, x, y, count=10, color=WHITE, speed=5):


for _ in range(count):
angle = [Link](0, 2 * [Link])
vel = [Link](1, speed)
[Link](
Particle(x, y,
vel * [Link](angle),
vel * [Link](angle),
color,
[Link](2, 5),
[Link](30, 60))
)

def update(self):
[Link] = [p for p in [Link] if [Link] > 0]
for particle in [Link]:
[Link]()

def draw(self, screen):


for particle in [Link]:
[Link](screen)

# Sistema de Animação
class Animation:
def __init__(self, start, end, duration, ease_type="linear"):
[Link] = start
[Link] = end
[Link] = duration
self.ease_type = ease_type
[Link] = 0
[Link] = False

def update(self):
if not [Link]:
[Link] += 1
if [Link] >= [Link]:
[Link] = True

def get_value(self):
if [Link]:
return [Link]

t = [Link] / [Link]

# Diferentes tipos de easing


if self.ease_type == "ease_in":
t = t * t
elif self.ease_type == "ease_out":
t = 1 - (1 - t) * (1 - t)
elif self.ease_type == "ease_in_out":
t = t * t * (3 - 2 * t)
elif self.ease_type == "bounce":
if t < 0.5:
t = 2 * t * t
else:
t = 1 - 2 * (1 - t) * (1 - t)

return [Link] + ([Link] - [Link]) * t

# Sistema de Notificações
class Notification:
def __init__(self, text, type="info", duration=180):
[Link] = text
[Link] = type
[Link] = duration
[Link] = 0
self.y = -50
self.target_y = 100
[Link] = Animation(self.y, self.target_y, 20, "ease_out")

# Cores por tipo


[Link] = {
"info": BLUE,
"success": GREEN,
"warning": ORANGE,
"error": RED,
"achievement": GOLD
}

# Ícones por tipo


[Link] = {
"info": "ℹ️",
"success": "✅",
"warning": "⚠️",
"error": "❌",
"achievement": "🏆"
}

def update(self):
if not [Link]:
[Link]()
self.y = [Link].get_value()
else:
[Link] += 1
if [Link] >= [Link]:
# Animação de saída
if self.y > -50:
self.y -= 5

def draw(self, screen, font):


color = [Link]([Link], WHITE)
icon = [Link]([Link], "")

# Fundo da notificação
text_surface = [Link](f"{icon} {[Link]}", True, WHITE)
rect = text_surface.get_rect(center=(SCREEN_WIDTH//2, self.y))

# Sombra
shadow_rect = [Link](rect.x - 20, rect.y - 10 + 5, [Link] + 40,
[Link] + 20)
shadow_surface = [Link]((shadow_rect.width, shadow_rect.height))
shadow_surface.set_alpha(100)
shadow_surface.fill(BLACK)
[Link](shadow_surface, shadow_rect)

# Caixa principal
box_rect = [Link](rect.x - 20, rect.y - 10, [Link] + 40,
[Link] + 20)
[Link](screen, color, box_rect, border_radius=10)
[Link](screen, WHITE, box_rect, 2, border_radius=10)

# Texto
[Link](text_surface, rect)

# Botão Avançado
class Button:
def __init__(self, x, y, width, height, text, color=BLUE, text_color=WHITE,
font=None, icon=None, tooltip=None, sound=None):
[Link] = [Link](x, y, width, height)
[Link] = text
[Link] = color
self.original_color = color
self.text_color = text_color
[Link] = font or [Link](None, 24)
[Link] = icon
[Link] = tooltip
[Link] = sound

# Estados
[Link] = False
[Link] = False
[Link] = True
[Link] = True

# Animações
[Link] = 1.0
self.scale_animation = None
self.color_animation = None

def handle_event(self, event):


if not [Link] or not [Link]:
return False

mouse_pos = [Link].get_pos()

if [Link](mouse_pos):
if not [Link]:
[Link] = True
self.scale_animation = Animation(1.0, 1.05, 10, "ease_out")

if [Link] == [Link] and [Link] == 1:


[Link] = True
self.scale_animation = Animation(1.05, 0.95, 5, "ease_in")

elif [Link] == [Link] and [Link] == 1:


if [Link]:
[Link] = False
self.scale_animation = Animation(0.95, 1.0, 5, "ease_out")
if [Link]:
[Link]()
return True
else:
if [Link]:
[Link] = False
self.scale_animation = Animation([Link], 1.0, 10, "ease_out")
[Link] = False

return False

def update(self):
if self.scale_animation and not self.scale_animation.finished:
self.scale_animation.update()
[Link] = self.scale_animation.get_value()

def draw(self, screen):


if not [Link]:
return

# Calcula posição e tamanho com escala


scaled_width = int([Link] * [Link])
scaled_height = int([Link] * [Link])
scaled_x = [Link].x + ([Link] - scaled_width) // 2
scaled_y = [Link].y + ([Link] - scaled_height) // 2
scaled_rect = [Link](scaled_x, scaled_y, scaled_width, scaled_height)

# Cor baseada no estado


if not [Link]:
color = GRAY
elif [Link]:
color = tuple(max(0, c - 50) for c in [Link])
elif [Link]:
color = tuple(min(255, c + 30) for c in [Link])
else:
color = [Link]

# Sombra
shadow_rect = scaled_rect.copy()
shadow_rect.x += 4
shadow_rect.y += 4
shadow_surface = [Link]((shadow_rect.width, shadow_rect.height))
shadow_surface.set_alpha(80)
shadow_surface.fill(BLACK)
[Link](shadow_surface, shadow_rect)

# Botão principal
[Link](screen, color, scaled_rect, border_radius=10)

# Gradiente
for i in range(scaled_rect.height // 2):
alpha = 255 - (i * 2)
gradient_color = tuple(min(255, c + 20) for c in color)
gradient_rect = [Link](scaled_rect.x, scaled_rect.y + i,
scaled_rect.width, 2)
gradient_surface = [Link]((gradient_rect.width, 2))
gradient_surface.set_alpha(alpha // 4)
gradient_surface.fill(gradient_color)
[Link](gradient_surface, gradient_rect)

# Borda
[Link](screen, tuple(max(0, c - 30) for c in color),
scaled_rect, 2, border_radius=10)

# Ícone e texto
text_offset = 0
if [Link]:
icon_surface = [Link]([Link], True, self.text_color)
icon_rect = icon_surface.get_rect(midleft=(scaled_rect.x + 10,
scaled_rect.centery))
[Link](icon_surface, icon_rect)
text_offset = 30

# Texto
text_surface = [Link]([Link], True, self.text_color)
text_rect = text_surface.get_rect(center=(scaled_rect.centerx +
text_offset//2,
scaled_rect.centery))
[Link](text_surface, text_rect)

# Tooltip
if [Link] and [Link]:
self.draw_tooltip(screen)

def draw_tooltip(self, screen):


font = [Link](None, 18)
tooltip_surface = [Link]([Link], True, WHITE)
tooltip_rect = tooltip_surface.get_rect(midtop=([Link],
[Link] + 5))

# Fundo do tooltip
bg_rect = [Link](tooltip_rect.x - 10, tooltip_rect.y - 5,
tooltip_rect.width + 20, tooltip_rect.height + 10)
[Link](screen, DARK_GRAY, bg_rect, border_radius=5)
[Link](screen, WHITE, bg_rect, 1, border_radius=5)

[Link](tooltip_surface, tooltip_rect)

# Card Avançado
class Card:
def __init__(self, x, y, width, height, data=None):
[Link] = [Link](x, y, width, height)
[Link] = data
[Link] = False
[Link] = False
[Link] = None
self.offset_y = 0

def handle_event(self, event):


mouse_pos = [Link].get_pos()

if [Link](mouse_pos):
if not [Link]:
[Link] = True
[Link] = Animation(0, -5, 10, "ease_out")

if [Link] == [Link] and [Link] == 1:


[Link] = not [Link]
return True
else:
if [Link]:
[Link] = False
[Link] = Animation(self.offset_y, 0, 10, "ease_out")

return False

def update(self):
if [Link] and not [Link]:
[Link]()
self.offset_y = [Link].get_value()

# Classes de Dados Avançadas


class Champion:
"""Campeão do LoL"""
def __init__(self, name, role, difficulty=5):
[Link] = name
[Link] = role
[Link] = difficulty
self.mastery_points = 0

class PlayerStats:
"""Estatísticas detalhadas do jogador"""
def __init__(self):
[Link] = {"kills": 0, "deaths": 0, "assists": 0}
self.cs_per_min = 0
self.vision_score = 0
self.damage_share = 0
self.gold_per_min = 0
self.kill_participation = 0
self.games_played = 0
[Link] = 0
[Link] = 0
[Link] = 0
[Link] = 0
self.perfect_games = 0

def calculate_kda(self):
if [Link]["deaths"] == 0:
return ([Link]["kills"] + [Link]["assists"])
return ([Link]["kills"] + [Link]["assists"]) / [Link]["deaths"]

def win_rate(self):
if self.games_played == 0:
return 0
return ([Link] / self.games_played) * 100

class Player:
"""Jogador com sistema completo"""
def __init__(self, name, position, age=20, nationality="BR"):
# Informações básicas
[Link] = self.generate_id()
[Link] = name
[Link] = name
[Link] = position
[Link] = age
[Link] = nationality
[Link] = None

# Atributos principais (0-100)


[Link] = {
"mechanics": [Link](60, 95),
"game_sense": [Link](60, 95),
"positioning": [Link](60, 95),
"teamfighting": [Link](60, 95),
"laning": [Link](60, 95),
"farming": [Link](60, 95),
"aggression": [Link](60, 95),
"vision": [Link](60, 95),
"shotcalling": [Link](60, 95),
"mental": [Link](60, 95),
"consistency": [Link](60, 95),
"clutch": [Link](60, 95),
"adaptability": [Link](60, 95),
"communication": [Link](60, 95),
"leadership": [Link](60, 95)
}

# Overall e potencial
self.calculate_overall()
[Link] = min(99, [Link] + [Link](5, 20))
self.growth_rate = [Link](["slow", "normal", "fast"])

# Champion pool
self.champion_pool = self.generate_champion_pool()
self.signature_champions = []

# Status físico e mental


[Link] = 100
[Link] = 100
[Link] = 100
[Link] = 100
[Link] = 0
[Link] = 0
[Link] = 100 # Forma atual
self.peak_age = [Link](22, 26)

# Lesões e condições
[Link] = None
self.injury_severity = 0
self.injury_recovery_days = 0
self.chronic_issues = []

# Estatísticas (AGORA INICIALIZADO ANTES DE calculate_market_value)


[Link] = PlayerStats()
self.career_stats = PlayerStats()
self.season_stats = PlayerStats()

# Sistema de popularidade automática


[Link] = self.calculate_initial_popularity()
self.social_media_followers = self.calculate_social_media_followers()

# Contrato e finanças
[Link] = self.calculate_salary()
self.contract_years = 2
self.contract_months_remaining = 24
self.buyout_clause = [Link] * 24
self.market_value = self.calculate_market_value() # Agora [Link] já
existe
self.wage_demands = [Link]
self.signing_bonus = 0
self.performance_bonus = 0
self.stream_revenue = [Link](1000, 50000)

# Histórico
[Link] = []
[Link] = []
[Link] = []
[Link] = []

# Personalidade
[Link] = self.generate_personality()
[Link] = self.generate_playstyle()
self.preferred_champions = []

# Relacionamentos
[Link] = {} # Com outros jogadores
self.fan_favorite = False

# ... (outros métodos permanecem iguais) ...

def calculate_initial_popularity(self):
"""Calcula a popularidade inicial baseada em múltiplos fatores"""
base_popularity = 30

# Bônus por overall


popularity = base_popularity + ([Link] - 70) * 1.5

# Bônus por posição (ADC e Mid são mais populares)


position_bonus = {
"Top": 0,
"Jungle": 5,
"Mid": 15,
"ADC": 20,
"Support": 10
}
popularity += position_bonus.get([Link], 0)

# Bônus por nacionalidade (Coreanos são mais populares)


nationality_bonus = {
"KR": 20,
"CN": 15,
"EU": 10,
"NA": 10,
"BR": 5,
"JP": 5,
"TR": 5
}
popularity += nationality_bonus.get([Link], 0)

# Bônus por atributos de personalidade


if hasattr(self, 'personality'):
popularity += [Link]("charisma", 0) * 2

# Aleatoriedade para variar


popularity += [Link](-10, 10)

return max(1, min(100, int(popularity)))

def calculate_social_media_followers(self):
"""Calcula seguidores baseado na popularidade"""
base_followers = [Link] * 1000

# Multiplicador por nacionalidade


country_multiplier = {
"CN": 5.0,
"KR": 3.0,
"BR": 2.5,
"NA": 2.0,
"EU": 1.8,
"JP": 1.5,
"TR": 1.2
}

multiplier = country_multiplier.get([Link], 1.0)


followers = int(base_followers * multiplier)

# Adiciona variação aleatória


followers += [Link](-5000, 5000)

return max(1000, followers)

def calculate_salary(self):
"""Calcula salário baseado em múltiplos fatores"""
base = 50000

# Modificadores
age_mod = 1.0
if [Link] < 20:
age_mod = 0.7
elif [Link] > 28:
age_mod = 0.85

# Bônus por overall


overall_mod = ([Link] / 70) ** 1.5

# Bônus por popularidade (agora usando [Link] que é calculado


automaticamente)
pop_mod = 1 + ([Link] / 200)

return int(base * age_mod * overall_mod * pop_mod)

# Desenvolvimento
self.training_focus = None
[Link] = None
self.improvement_areas = []
self.bad_habits = []

def generate_id(self):
return f"player_{[Link](10000, 99999)}"

def calculate_overall(self):
# Peso diferente para cada atributo baseado na posição
weights = self.get_position_weights()
total = sum([Link][attr] * [Link](attr, 1.0)
for attr in [Link])
[Link] = int(total / sum([Link]()))

def get_position_weights(self):
"""Retorna pesos dos atributos baseado na posição"""
position_weights = {
"Top": {
"mechanics": 1.2, "laning": 1.3, "teamfighting": 1.1,
"mental": 1.2, "consistency": 1.1, "farming": 1.2
},
"Jungle": {
"game_sense": 1.5, "vision": 1.3, "shotcalling": 1.4,
"adaptability": 1.3, "mental": 1.1, "clutch": 1.2
},
"Mid": {
"mechanics": 1.5, "laning": 1.3, "positioning": 1.2,
"farming": 1.1, "clutch": 1.3, "aggression": 1.1
},
"ADC": {
"mechanics": 1.5, "positioning": 1.4, "farming": 1.3,
"teamfighting": 1.2, "consistency": 1.3, "mental": 1.1
},
"Support": {
"vision": 1.5, "shotcalling": 1.3, "communication": 1.4,
"game_sense": 1.3, "teamfighting": 1.2, "leadership": 1.2
}
}
return position_weights.get([Link], {attr: 1.0 for attr in
[Link]})

def generate_champion_pool(self):
"""Gera pool de campeões baseado na posição"""
champions_by_role = {
"Top": ["Aatrox", "Camille", "Darius", "Fiora", "Garen", "Gnar",
"Gragas",
"Gwen", "Irelia", "Jax", "Jayce", "K'Sante", "Kennen",
"Malphite",
"Mordekaiser", "Nasus", "Ornn", "Renekton", "Rumble", "Sion"],
"Jungle": ["Bel'Veth", "Briar", "Diana", "Ekko", "Elise", "Evelynn",
"Fiddlesticks",
"Graves", "Hecarim", "Ivern", "Jarvan IV", "Karthus", "Kayn",
"Kha'Zix",
"Kindred", "Lee Sin", "Lillia", "Maokai", "Master Yi",
"Nidalee"],
"Mid": ["Ahri", "Akali", "Akshan", "Anivia", "Annie", "Aurelion Sol",
"Azir",
"Cassiopeia", "Corki", "Diana", "Fizz", "Galio", "Hwei",
"Irelia",
"Kassadin", "Katarina", "LeBlanc", "Lissandra", "Lux",
"Malzahar"],
"ADC": ["Aphelios", "Ashe", "Caitlyn", "Draven", "Ezreal", "Jhin",
"Jinx",
"Kai'Sa", "Kalista", "Kog'Maw", "Lucian", "Miss Fortune",
"Nilah",
"Samira", "Senna", "Sivir", "Tristana", "Twitch", "Varus",
"Vayne"],
"Support": ["Alistar", "Bard", "Blitzcrank", "Braum", "Janna", "Karma",
"Leona",
"Lulu", "Lux", "Milio", "Morgana", "Nami", "Nautilus",
"Pyke",
"Rakan", "Rell", "Renata Glasc", "Senna", "Seraphine",
"Sona"]
}

pool = {}
champions = champions_by_role.get([Link], [])

# Adiciona proficiência para cada campeão


for champ in champions:
# Proficiência baseada no overall e aleatoriedade
base_prof = [Link] + [Link](-20, 20)
pool[champ] = max(10, min(100, base_prof))

# Define campeões signature (melhores)


sorted_champs = sorted([Link](), key=lambda x: x[1], reverse=True)
self.signature_champions = [champ for champ, _ in sorted_champs[:3]]

return pool

def generate_personality(self):
"""Gera traços de personalidade"""
traits = {
"competitive": [Link](1, 10),
"teamwork": [Link](1, 10),
"leadership": [Link](1, 10),
"toxicity": [Link](1, 10),
"motivation": [Link](1, 10),
"discipline": [Link](1, 10),
"creativity": [Link](1, 10),
"pressure_handling": [Link](1, 10),
"learning_ability": [Link](1, 10),
"ego": [Link](1, 10)
}
return traits

def generate_playstyle(self):
"""Define estilo de jogo"""
styles = ["Aggressive", "Defensive", "Balanced", "Roamer", "Farmer",
"Playmaker", "Supportive", "Carry", "Tank", "Assassin"]
return [Link](styles)

def calculate_salary(self):
"""Calcula salário baseado em múltiplos fatores"""
base = 50000

# Modificadores
age_mod = 1.0
if [Link] < 20:
age_mod = 0.7
elif [Link] > 28:
age_mod = 0.85

# Bônus por overall


overall_mod = ([Link] / 70) ** 1.5

# Bônus por popularidade


pop_mod = 1 + ([Link] / 200)

return int(base * age_mod * overall_mod * pop_mod)

def calculate_market_value(self):
"""Calcula valor de mercado complexo"""
base = 1000000

# Idade
age_value = 1.0
if [Link] < 21:
age_value = 1.4
elif [Link] < 24:
age_value = 1.2
elif [Link] > 27:
age_value = 0.8

# Potencial
potential_value = ([Link] - [Link]) * 50000

# Performance
performance_value = [Link].win_rate() * 10000

# Popularidade
popularity_value = [Link] * 5000

return int(base * ([Link] / 75) * age_value + potential_value +


performance_value + popularity_value)

def train(self, training_type, intensity="normal", coach_bonus=1.0):


"""Sistema de treino avançado"""
if [Link]:
return False, f"{[Link]} está lesionado!"
if [Link] < 20:
return False, f"{[Link]} está muito cansado!"

if [Link] > 80:


return False, f"{[Link]} está em burnout!"

# Intensidades
intensities = {
"recovery": {"gain": 0.3, "energy_cost": 5, "stress": -10},
"light": {"gain": 0.6, "energy_cost": 10, "stress": -5},
"normal": {"gain": 1.0, "energy_cost": 20, "stress": 5},
"intensive": {"gain": 1.5, "energy_cost": 35, "stress": 15},
"extreme": {"gain": 2.0, "energy_cost": 50, "stress": 30}
}

intensity_data = [Link](intensity, intensities["normal"])

# Calcula ganhos
improvements = {}
if training_type == "specific" and self.training_focus:
# Treino específico
attr = self.training_focus
if attr in [Link]:
max_gain = self.calculate_training_gain(attr)
gain = int(max_gain * intensity_data["gain"] * coach_bonus)

old_value = [Link][attr]
[Link][attr] = min([Link], [Link][attr] +
gain)
actual_gain = [Link][attr] - old_value

if actual_gain > 0:
improvements[attr] = actual_gain

elif training_type == "team":


# Treino em equipe
team_attrs = ["teamfighting", "communication", "shotcalling"]
for attr in team_attrs:
if [Link]() < 0.5: # 50% chance para cada
gain = int([Link](1, 2) * intensity_data["gain"] *
coach_bonus)
old_value = [Link][attr]
[Link][attr] = min([Link],
[Link][attr] + gain)
if [Link][attr] > old_value:
improvements[attr] = [Link][attr] - old_value

elif training_type == "champions":


# Treino de campeões
if self.champion_pool:
champ = [Link](list(self.champion_pool.keys()))
old_prof = self.champion_pool[champ]
self.champion_pool[champ] = min(100, old_prof +
int(5 * intensity_data["gain"] *
coach_bonus))
improvements[f"{champ} mastery"] = self.champion_pool[champ] -
old_prof

else: # general
# Treino geral
for attr in [Link]:
if [Link]() < 0.3: # 30% chance para cada atributo
gain = int([Link](0, 2) * intensity_data["gain"] *
coach_bonus)
old_value = [Link][attr]
[Link][attr] = min([Link],
[Link][attr] + gain)
if [Link][attr] > old_value:
improvements[attr] = [Link][attr] - old_value

# Aplica custos
[Link] -= intensity_data["energy_cost"]
[Link] += intensity_data["stress"]
[Link] = max(0, min(100, [Link]))

# Risco de lesão
injury_risk = intensity_data["energy_cost"] / 200
if [Link] < 30:
injury_risk *= 2
if [Link] > 70:
injury_risk *= 1.5

if [Link]() < injury_risk:


self.get_injured()
return False, f"{[Link]} se lesionou durante o treino!"

# Burnout check
if [Link] > 90:
[Link] += 10

# Atualiza overall
self.calculate_overall()

if improvements:
return True, f"{[Link]} melhorou: {improvements}"
return True, f"{[Link]} treinou mas não melhorou significativamente"

def calculate_training_gain(self, attribute):


"""Calcula ganho máximo de treino baseado em vários fatores"""
base_gain = 3

# Modificador de idade
if [Link] < 20:
age_mod = 1.5
elif [Link] < 24:
age_mod = 1.2
elif [Link] < 27:
age_mod = 1.0
else:
age_mod = 0.7

# Modificador de potencial
potential_room = [Link] - [Link][attribute]
potential_mod = min(2.0, potential_room / 10)

# Modificador de growth rate


growth_mods = {"slow": 0.7, "normal": 1.0, "fast": 1.3}
growth_mod = growth_mods.get(self.growth_rate, 1.0)
return int(base_gain * age_mod * potential_mod * growth_mod)

def get_injured(self, severity=None):


"""Sistema de lesões complexo"""
if not severity:
severity = [Link](["minor", "moderate", "severe", "career-
threatening"])

injuries = {
"minor": {
"types": ["Muscle strain", "Minor sprain", "Bruise", "Fatigue"],
"days": (3, 7),
"severity": 1
},
"moderate": {
"types": ["Pulled muscle", "Ankle sprain", "Back pain",
"Tendinitis"],
"days": (7, 21),
"severity": 2
},
"severe": {
"types": ["Torn ligament", "Stress fracture", "Herniated disc",
"Severe sprain"],
"days": (21, 60),
"severity": 3
},
"career-threatening": {
"types": ["ACL tear", "Chronic wrist injury", "Severe burnout",
"Major surgery needed"],
"days": (60, 180),
"severity": 4
}
}

injury_data = injuries[severity]
[Link] = [Link](injury_data["types"])
self.injury_severity = injury_data["severity"]
self.injury_recovery_days = [Link](*injury_data["days"])

# Reduz atributos temporariamente


reduction = injury_data["severity"] * 5
for attr in [Link]:
[Link][attr] = max(1, [Link][attr] - reduction)

[Link] = 0
[Link] = max(0, [Link] - 30)

def recover_from_injury(self):
"""Recuperação de lesão"""
if self.injury_recovery_days > 0:
self.injury_recovery_days -= 1

# Recuperação gradual
if self.injury_recovery_days == 0:
[Link] = None
self.injury_severity = 0
[Link] = 50
self.calculate_overall() # Recalcula overall
return f"{[Link]} se recuperou completamente!"
elif self.injury_recovery_days < 7:
return f"{[Link]} está na fase final de recuperação
({self.injury_recovery_days} dias)"

return None

def age_progression(self):
"""Progressão com a idade"""
[Link] += 1

# Peak performance
if [Link] == self.peak_age:
# Bônus no peak
for attr in [Link]:
[Link][attr] = min(99, [Link][attr] +
[Link](1, 3))

# Declínio após o peak


elif [Link] > self.peak_age:
decline_rate = ([Link] - self.peak_age) * 0.5

# Atributos físicos declinam mais rápido


physical_attrs = ["mechanics", "positioning", "aggression"]
for attr in physical_attrs:
[Link][attr] = max(1, [Link][attr] -
int([Link](1, 3) *
decline_rate))

# Atributos mentais podem melhorar


mental_attrs = ["game_sense", "shotcalling", "leadership"]
for attr in mental_attrs:
if [Link]() < 0.3: # 30% chance de melhorar
[Link][attr] = min(99, [Link][attr] + 1)

# Jovens melhoram naturalmente


elif [Link] < 21:
for attr in [Link]:
if [Link]() < 0.2: # 20% chance
[Link][attr] = min([Link],
[Link][attr] +
[Link](1, 3))

self.calculate_overall()

def match_performance(self, team_performance, opponent_strength,


important_match=False):
"""Calcula performance em partida"""
base_performance = [Link]

# Modificadores
form_mod = [Link] / 100
energy_mod = [Link] / 100
morale_mod = [Link] / 100
stress_mod = 1 - ([Link] / 200) # Stress negativo

# Clutch em jogos importantes


clutch_mod = 1.0
if important_match:
clutch_mod = 1 + ([Link]["clutch"] / 200)

# Consistência
consistency = [Link]["consistency"] / 100
variance = [Link](1 - (1 - consistency) * 0.3, 1 + (1 -
consistency) * 0.3)

performance = (base_performance * form_mod * energy_mod * morale_mod *


stress_mod * clutch_mod * variance)

return max(0, min(100, performance))

class Team:
"""Time com sistema completo"""
def __init__(self, name, tag, region="Brazil"):
# Identidade
[Link] = self.generate_id()
[Link] = name
[Link] = tag # Abreviação (ex: "LLL" para LOUD)
[Link] = region
self.founded_year = [Link](2010, 2020)
[Link] = self.generate_colors()
[Link] = None

# Elenco
[Link] = []
self.academy_players = []
self.starting_lineup = []
[Link] = None
[Link] = None
self.max_players = 10

# Staff técnico
[Link] = {
"head_coach": None,
"strategic_coach": None,
"assistant_coach": None,
"analyst": None,
"psychologist": None,
"physical_trainer": None,
"nutritionist": None,
"manager": None
}

# Tática e estratégia
[Link] = {
"playstyle": "balanced", # aggressive, defensive, balanced, etc
"early_game_focus": 50,
"late_game_focus": 50,
"objective_focus": 50,
"teamfight_focus": 50,
"split_push_focus": 50,
"vision_priority": 50
}

# Finanças
[Link] = [Link](3000000, 15000000)
self.wage_budget = [Link] * 0.6 # 60% para salários
[Link] = []
self.prize_money = 0
self.merchandise_revenue = 0
self.streaming_revenue = 0

# Instalações
[Link] = {
"gaming_house": 1, # 1-5 estrelas
"training_facility": 1,
"bootcamp_room": False,
"streaming_setup": False,
"gym": False,
"kitchen": False,
"relaxation_area": False,
"medical_center": False,
"analytics_room": False,
"content_studio": False
}

# Torcida e popularidade
[Link] = [Link](10000, 500000)
self.fan_satisfaction = 75
[Link] = 50
self.brand_value = [Link](1000000, 10000000)
self.social_media = {
"twitter": [Link](10000, 1000000),
"instagram": [Link](10000, 1000000),
"tiktok": [Link](10000, 1000000),
"youtube": [Link](10000, 1000000)
}

# Performance e estatísticas
self.season_stats = {
"games": 0,
"wins": 0,
"losses": 0,
"win_streak": 0,
"loss_streak": 0,
"best_streak": 0,
"worst_streak": 0,
"championships": [],
"tournament_placements": {}
}

# Histórico
[Link] = []
[Link] = []
[Link] = []

# Sinergia e química
self.team_chemistry = 50
self.team_cohesion = 50
self.internal_conflicts = []

# Objetivos
self.season_objectives = []
self.long_term_objectives = []

def generate_id(self):
return f"team_{[Link](10000, 99999)}"
def generate_colors(self):
"""Gera cores do time"""
color_schemes = [
{"primary": BLUE, "secondary": WHITE, "accent": GOLD},
{"primary": RED, "secondary": BLACK, "accent": WHITE},
{"primary": GREEN, "secondary": WHITE, "accent": BLACK},
{"primary": PURPLE, "secondary": GOLD, "accent": WHITE},
{"primary": ORANGE, "secondary": BLACK, "accent": WHITE},
{"primary": BLACK, "secondary": GOLD, "accent": RED},
{"primary": CYAN, "secondary": WHITE, "accent": BLACK}
]
return [Link](color_schemes)

def calculate_team_power(self):
"""Calcula poder total do time"""
if len([Link]) < 5:
return 0

# Overall dos titulares


starters = self.get_starting_lineup()
if not starters:
return 0

base_power = sum([Link] for p in starters) / len(starters)

# Bônus por química


chemistry_bonus = self.team_chemistry / 20 # Até 5 pontos

# Bônus por coach


coach_bonus = 0
if [Link]["head_coach"]:
coach_bonus = [Link]["head_coach"].level * 2

# Bônus por instalações


facility_bonus = sum(1 for f, v in [Link]()
if isinstance(v, int) and v > 0)

# Bônus por moral média


morale_bonus = sum([Link] for p in starters) / len(starters) / 20

# Penalidade por lesões


injury_penalty = sum(5 for p in starters if [Link])

# Penalidade por conflitos


conflict_penalty = len(self.internal_conflicts) * 2

total_power = (base_power + chemistry_bonus + coach_bonus +


facility_bonus + morale_bonus - injury_penalty -
conflict_penalty)

return max(0, min(100, total_power))

def get_starting_lineup(self):
"""Retorna escalação titular"""
if self.starting_lineup:
# Verifica se todos estão disponíveis
available = []
for player_id in self.starting_lineup:
player = self.get_player_by_id(player_id)
if player and not [Link]:
[Link](player)

# Substitui lesionados
if len(available) < 5:
positions_needed = ["Top", "Jungle", "Mid", "ADC", "Support"]
for pos in positions_needed:
if not any([Link] == pos for p in available):
# Busca substituto
sub = self.find_substitute(pos)
if sub:
[Link](sub)

return available[:5]

# Auto-seleciona melhor lineup


return self.auto_select_lineup()

def auto_select_lineup(self):
"""Seleciona automaticamente o melhor lineup"""
lineup = []
positions = ["Top", "Jungle", "Mid", "ADC", "Support"]

for pos in positions:


candidates = [p for p in [Link] if [Link] == pos and not
[Link]]
if candidates:
# Escolhe o melhor disponível
best = max(candidates, key=lambda p: [Link] * ([Link] / 100))
[Link](best)

return lineup

def find_substitute(self, position):


"""Encontra substituto para uma posição"""
candidates = [p for p in [Link]
if [Link] == position and not [Link]
and p not in self.get_starting_lineup()]
if candidates:
return max(candidates, key=lambda p: [Link])
return None

def get_player_by_id(self, player_id):


"""Busca jogador por ID"""
for player in [Link]:
if [Link] == player_id:
return player
return None

def sign_player(self, player, salary=None, years=2, signing_bonus=0):


"""Contrata um jogador"""
if len([Link]) >= self.max_players:
return False, "Elenco cheio!"

# Calcula salário se não especificado


if not salary:
salary = player.wage_demands
# Verifica orçamento
total_cost = salary * 12 * years + signing_bonus
if total_cost > [Link]:
return False, f"Orçamento insuficiente! Necessário: ${total_cost:,}"

# Verifica wage budget


current_wages = sum([Link] for p in [Link])
if current_wages + salary > self.wage_budget:
return False, "Excede o limite salarial!"

# Contrata o jogador
[Link] = salary
player.contract_years = years
player.contract_months_remaining = years * 12
player.signing_bonus = signing_bonus

[Link](player)
[Link] -= signing_bonus

# Atualiza química (novo jogador reduz química inicial)


self.team_chemistry = max(0, self.team_chemistry - 10)

return True, f"{[Link]} contratado por ${salary:,}/mês por {years}


anos!"

def release_player(self, player):


"""Dispensa um jogador"""
if player not in [Link]:
return False, "Jogador não está no time!"

if len([Link]) <= 5:
return False, "Não pode dispensar! Mínimo de 5 jogadores!"

# Paga multa rescisória (50% do contrato restante)


buyout = ([Link] * player.contract_months_remaining) * 0.5
if buyout > [Link]:
return False, f"Sem orçamento para multa: ${buyout:,}"

[Link](player)
[Link] -= buyout

# Remove da escalação se necessário


if [Link] in self.starting_lineup:
self.starting_lineup.remove([Link])

return True, f"{[Link]} dispensado. Multa: ${buyout:,}"

def calculate_finances(self):
"""Calcula situação financeira"""
# Receitas
income = {
"sponsors": sum(s["value"] for s in [Link]) / 12, # Mensal
"prize_money": self.prize_money / 12,
"merchandise": self.merchandise_revenue,
"streaming": self.streaming_revenue,
"league_participation": 100000 # Participação na liga
}

# Despesas
expenses = {
"salaries": sum([Link] for p in [Link]),
"staff": sum(50000 for s in [Link]() if s),
"facilities": sum(10000 for f, v in [Link]()
if isinstance(v, int) and v > 0) * v,
"operations": 50000,
"travel": 20000,
"marketing": 30000
}

monthly_balance = sum([Link]()) - sum([Link]())

return income, expenses, monthly_balance

def update_chemistry(self):
"""Atualiza química do time"""
# Fatores que afetam química
factors = []

# Tempo jogando juntos


avg_games = sum([Link].games_played for p in [Link]) / max(1,
len([Link]))
[Link](min(20, avg_games / 5)) # Até 20 pontos

# Nacionalidades em comum
nationalities = [[Link] for p in [Link]]
most_common = max(set(nationalities), key=[Link])
common_ratio = [Link](most_common) / len([Link])
[Link](common_ratio * 20) # Até 20 pontos

# Idade similar
ages = [[Link] for p in [Link]]
age_variance = max(ages) - min(ages)
[Link](max(0, 20 - age_variance)) # Até 20 pontos

# Vitórias recentes
if self.season_stats["games"] > 0:
win_rate = self.season_stats["wins"] / self.season_stats["games"]
[Link](win_rate * 20) # Até 20 pontos

# Personalidades compatíveis
personality_conflicts = 0
for i, p1 in enumerate([Link]):
for p2 in [Link][i+1:]:
if [Link]["toxicity"] > 7 or [Link]["toxicity"] >
7:
personality_conflicts += 1
[Link](max(0, 20 - personality_conflicts * 2)) # Até 20 pontos

self.team_chemistry = min(100, sum(factors))

def train_team(self, focus="general", intensity="normal"):


"""Treina o time todo"""
results = []

# Bônus do coach
coach_bonus = 1.0
if [Link]["head_coach"]:
coach_bonus = 1 + ([Link]["head_coach"].level / 10)
for player in [Link]:
if not [Link]:
success, message = [Link](focus, intensity, coach_bonus)
[Link](([Link], success, message))

# Melhora química se treino em equipe


if focus == "team":
self.team_chemistry = min(100, self.team_chemistry + 2)

return results

# Sistema de Partidas Avançado


class Match:
"""Sistema de partida com simulação detalhada"""
def __init__(self, team1, team2, tournament=None, importance="regular"):
self.team1 = team1
self.team2 = team2
[Link] = tournament
[Link] = importance # regular, playoff, final

# Resultado
[Link] = None
[Link] = None
[Link] = {"team1": 0, "team2": 0} # Melhor de 1, 3 ou 5

# Estatísticas do jogo
self.game_stats = [] # Stats de cada jogo
self.match_duration = 0
[Link] = None

# Eventos do jogo
[Link] = []
[Link] = []

# Draft
[Link] = {
"team1": {"bans": [], "picks": []},
"team2": {"bans": [], "picks": []}
}

def simulate(self, best_of=1):


"""Simula a partida completa"""
games_needed = (best_of // 2) + 1
team1_wins = 0
team2_wins = 0

while team1_wins < games_needed and team2_wins < games_needed:


game_result = self.simulate_game()

if game_result["winner"] == self.team1:
team1_wins += 1
else:
team2_wins += 1

self.game_stats.append(game_result)

[Link]["team1"] = team1_wins
[Link]["team2"] = team2_wins
if team1_wins > team2_wins:
[Link] = self.team1
[Link] = self.team2
else:
[Link] = self.team2
[Link] = self.team1

# Escolhe MVP
self.select_mvp()

# Atualiza estatísticas dos times


self.update_team_stats()

return [Link]

def simulate_game(self):
"""Simula um jogo individual"""
# Draft phase
self.simulate_draft()

# Calcula poderes com draft


team1_power = self.calculate_team_power_with_draft(self.team1)
team2_power = self.calculate_team_power_with_draft(self.team2)

# Adiciona fatores aleatórios


team1_power += [Link](-10, 10)
team2_power += [Link](-10, 10)

# Simula eventos do jogo


game_events = self.simulate_game_events(team1_power, team2_power)

# Determina vencedor
if team1_power > team2_power:
winner = self.team1
else:
winner = self.team2

# Duração do jogo
duration = [Link](20, 45)

return {
"winner": winner,
"duration": duration,
"events": game_events,
"team1_power": team1_power,
"team2_power": team2_power
}

def simulate_draft(self):
"""Simula o draft (pick/ban)"""
# Lista de campeões meta por posição
meta_champions = {
"Top": ["K'Sante", "Aatrox", "Jax", "Gnar", "Renekton"],
"Jungle": ["Viego", "Maokai", "Vi", "Jarvan IV", "Lee Sin"],
"Mid": ["Azir", "Orianna", "Ahri", "Sylas", "Akali"],
"ADC": ["Kalista", "Xayah", "Kai'Sa", "Aphelios", "Lucian"],
"Support": ["Nami", "Lulu", "Rakan", "Thresh", "Renata"]
}
# Simula bans (3 para cada time)
all_champions = [champ for role in meta_champions.values() for champ in
role]

for _ in range(3):
if all_champions:
ban = [Link](all_champions)
[Link]["team1"]["bans"].append(ban)
all_champions.remove(ban)

if all_champions:
ban = [Link](all_champions)
[Link]["team2"]["bans"].append(ban)
all_champions.remove(ban)

# Simula picks
for position in ["Top", "Jungle", "Mid", "ADC", "Support"]:
available = [c for c in meta_champions[position] if c in all_champions]

if available:
pick = [Link](available)
[Link]["team1"]["picks"].append(pick)
all_champions.remove(pick)

if available:
available = [c for c in available if c != pick]
if available:
pick = [Link](available)
[Link]["team2"]["picks"].append(pick)
all_champions.remove(pick)

def calculate_team_power_with_draft(self, team):


"""Calcula poder considerando o draft"""
base_power = team.calculate_team_power()

# Bônus por picks meta


draft_bonus = 0
team_draft = [Link]["team1"] if team == self.team1 else
[Link]["team2"]

# Verifica proficiência nos campeões escolhidos


for player in team.get_starting_lineup():
for champ in team_draft["picks"]:
if champ in player.champion_pool:
draft_bonus += player.champion_pool[champ] / 100

return base_power + draft_bonus

def simulate_game_events(self, team1_power, team2_power):


"""Simula eventos durante o jogo"""
events = []

# First Blood
fb_time = [Link](2, 8)
if [Link]() < team1_power / (team1_power + team2_power):
[Link]({
"time": fb_time,
"type": "first_blood",
"team": [Link],
"description": f"First Blood para {[Link]}!"
})
else:
[Link]({
"time": fb_time,
"type": "first_blood",
"team": [Link],
"description": f"First Blood para {[Link]}!"
})

# Dragons
dragon_times = [5, 10, 15, 20, 25, 30]
for time in dragon_times:
if [Link]() < 0.7: # 70% chance de dragon ser feito
if [Link]() < team1_power / (team1_power + team2_power):
team = [Link]
else:
team = [Link]

[Link]({
"time": time,
"type": "dragon",
"team": team,
"description": f"{team} conquista o Dragão!"
})

# Baron (após 20 min)


if [Link]() < 0.5: # 50% chance de baron
baron_time = [Link](20, 35)
if [Link]() < team1_power / (team1_power + team2_power):
team = [Link]
else:
team = [Link]

[Link]({
"time": baron_time,
"type": "baron",
"team": team,
"description": f"{team} derrota o Baron Nashor!"
})

# Team fights
for _ in range([Link](3, 7)):
tf_time = [Link](10, 40)
if [Link]() < team1_power / (team1_power + team2_power):
team = [Link]
result = "vence"
else:
team = [Link]
result = "vence"

[Link]({
"time": tf_time,
"type": "teamfight",
"team": team,
"description": f"{team} {result} uma teamfight!"
})
# Ordena eventos por tempo
[Link](key=lambda x: x["time"])

return events

def select_mvp(self):
"""Seleciona o MVP da partida"""
# MVP geralmente vem do time vencedor
mvp_team = [Link].get_starting_lineup()

if mvp_team:
# Calcula score de cada jogador
mvp_scores = []
for player in mvp_team:
score = [Link]

# Bônus por posição (carries têm mais chance)


if [Link] in ["Mid", "ADC"]:
score += 10
elif [Link] == "Jungle":
score += 5

# Bônus por clutch em jogos importantes


if [Link] in ["playoff", "final"]:
score += [Link]["clutch"] / 10

mvp_scores.append((player, score))

# Escolhe o MVP
mvp_scores.sort(key=lambda x: x[1], reverse=True)
[Link] = mvp_scores[0][0]
[Link] += 1

def update_team_stats(self):
"""Atualiza estatísticas dos times"""
# Time vencedor
[Link].season_stats["games"] += 1
[Link].season_stats["wins"] += 1
[Link].season_stats["win_streak"] += 1
[Link].season_stats["loss_streak"] = 0

if [Link].season_stats["win_streak"] >
[Link].season_stats["best_streak"]:
[Link].season_stats["best_streak"] =
[Link].season_stats["win_streak"]

# Time perdedor
[Link].season_stats["games"] += 1
[Link].season_stats["losses"] += 1
[Link].season_stats["loss_streak"] += 1
[Link].season_stats["win_streak"] = 0

if [Link].season_stats["loss_streak"] >
[Link].season_stats["worst_streak"]:
[Link].season_stats["worst_streak"] =
[Link].season_stats["loss_streak"]

# Atualiza stats dos jogadores


for player in [Link].get_starting_lineup():
[Link].games_played += 1
[Link] += 1

for player in [Link].get_starting_lineup():


[Link].games_played += 1
[Link] += 1

# Interface Principal do Jogo


class LoLManagerUltimate:
"""Classe principal do jogo com todas as funcionalidades"""
def __init__(self):
# Configuração da tela
[Link] = [Link].set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
[Link].set_caption("LoL Manager - Ultimate Edition")

# Ícone
icon_surface = [Link]((32, 32))
[Link](icon_surface, GOLD, (16, 16), 15)
[Link].set_icon(icon_surface)

# Clock e FPS
[Link] = [Link]()
[Link] = True
[Link] = FPS
[Link] = 0

# Fontes
[Link] = {
"tiny": [Link](None, 16),
"small": [Link](None, 20),
"medium": [Link](None, 28),
"large": [Link](None, 36),
"huge": [Link](None, 48),
"title": [Link](None, 64)
}

# Estado do jogo
[Link] = [Link]
self.previous_state = None
[Link] = None

# Dados do jogo
self.user_team = None
self.all_teams = []
self.all_players = []
self.free_agents = []
self.staff_available = []

# Competições
[Link] = {}
[Link] = []
self.current_season = 1
self.current_split = "Spring"
self.current_week = 1

# Interface
[Link] = {}
[Link] = []
[Link] = []
self.scroll_offset = 0
self.selected_item = None

# Sistemas
self.particle_system = ParticleSystem()
[Link] = []
[Link] = []

# Sons
[Link] = {}
self.music_volume = 0.5
self.sfx_volume = 0.7

# Configurações
[Link] = {
"auto_save": True,
"notifications": True,
"particles": True,
"animations": True,
"tutorial": True,
"difficulty": "normal"
}

# Inicialização
self.init_sounds()
self.init_game_data()
self.create_interface()

def init_sounds(self):
"""Inicializa sistema de som"""
try:
# Sons de UI
# [Link]["click"] = [Link]("assets/sounds/[Link]")
# [Link]["hover"] = [Link]("assets/sounds/[Link]")
# [Link]["success"] =
[Link]("assets/sounds/[Link]")
# [Link]["error"] = [Link]("assets/sounds/[Link]")
pass
except:
print("Sons não encontrados, continuando sem áudio")

def init_game_data(self):
"""Inicializa todos os dados do jogo"""
# Cria times da LTA Sul
self.create_lta_teams()

# Cria free agents


self.create_free_agents()

# Cria staff disponível


self.create_available_staff()

# Cria ligas
self.create_leagues()

def create_lta_teams(self):
"""Cria times reais da LTA Sul"""
teams_data = [
{"name": "LOUD", "tag": "LLL", "budget": 15000000},
{"name": "paiN Gaming", "tag": "PNG", "budget": 12000000},
{"name": "RED Canids", "tag": "RED", "budget": 10000000},
{"name": "FURIA", "tag": "FUR", "budget": 11000000},
{"name": "INTZ", "tag": "ITZ", "budget": 8000000},
{"name": "Fluxo", "tag": "FLX", "budget": 7000000},
{"name": "Liberty", "tag": "LBR", "budget": 6000000},
{"name": "Vivo Keyd", "tag": "VKS", "budget": 5000000}
]

positions = ["Top", "Jungle", "Mid", "ADC", "Support"]

for team_data in teams_data:


team = Team(team_data["name"], team_data["tag"])
[Link] = team_data["budget"]

# Cria jogadores para o time


for i, pos in enumerate(positions):
# Titular
player = Player(
f"{team_data['tag']}_{pos}",
pos,
[Link](18, 24),
"BR"
)
team.sign_player(player)
self.all_players.append(player)

# Reservas
for i in range(2):
pos = [Link](positions)
player = Player(
f"{team_data['tag']}_Sub{i+1}",
pos,
[Link](17, 22),
"BR"
)
team.sign_player(player)
self.all_players.append(player)

self.all_teams.append(team)

def create_free_agents(self):
"""Cria jogadores livres no mercado"""
for i in range(50):
positions = ["Top", "Jungle", "Mid", "ADC", "Support"]
nationalities = ["BR", "BR", "KR", "CN", "EU", "NA", "TR", "JP"]

player = Player(
f"FreeAgent_{i+1}",
[Link](positions),
[Link](16, 28),
[Link](nationalities)
)

self.free_agents.append(player)
self.all_players.append(player)

def create_available_staff(self):
"""Cria staff disponível para contratação"""
# Implementar criação de coaches, analistas, etc
pass

def create_leagues(self):
"""Cria as ligas e competições"""
# LTA Sul
[Link]["LTA Sul"] = {
"teams": self.all_teams,
"schedule": [],
"standings": [],
"current_round": 1,
"total_rounds": 18
}

def create_interface(self):
"""Cria interface do jogo"""
self.create_menu_buttons()
self.create_dashboard_buttons()

def create_menu_buttons(self):
"""Cria botões do menu principal"""
[Link]["menu"] = [
Button(SCREEN_WIDTH//2 - 200, 320, 400, 70, "Novo Jogo", GREEN,
icon="🎮", tooltip="Começar uma nova carreira"),
Button(SCREEN_WIDTH//2 - 200, 400, 400, 70, "Carregar Jogo", BLUE,
icon="📁", tooltip="Continuar jogo salvo"),
Button(SCREEN_WIDTH//2 - 200, 480, 400, 70, "Configurações", PURPLE,
icon="⚙️", tooltip="Ajustar configurações"),
Button(SCREEN_WIDTH//2 - 200, 560, 400, 70, "Sair", RED,
icon="🚪", tooltip="Sair do jogo")
]

def create_dashboard_buttons(self):
"""Cria botões do dashboard"""
# Implementar botões do dashboard
pass

def handle_events(self):
"""Processa eventos do jogo"""
for event in [Link]():
if [Link] == [Link]:
[Link] = False

# Processa eventos por estado


if [Link] == [Link]:
self.handle_splash_events(event)
elif [Link] == [Link]:
self.handle_menu_events(event)
# Adicionar outros estados...

def handle_splash_events(self, event):


"""Processa eventos da splash screen"""
if [Link] == [Link] or [Link] == [Link]:
[Link] = [Link]

def handle_menu_events(self, event):


"""Processa eventos do menu"""
for i, button in enumerate([Link]["menu"]):
if button.handle_event(event):
if i == 0: # Novo Jogo
[Link] = GameState.NEW_GAME
elif i == 1: # Carregar
self.load_game()
elif i == 2: # Configurações
[Link] = [Link]
elif i == 3: # Sair
[Link] = False

def update(self):
"""Atualiza lógica do jogo"""
# Atualiza animações
if hasattr(self, 'animations'):
for anim in [Link]:
[Link]()

# Atualiza partículas
if [Link]["particles"]:
self.particle_system.update()

# Atualiza notificações
for notif in [Link][:]:
[Link]()
if [Link] >= [Link] and notif.y <= -50:
[Link](notif)

# Atualiza botões
for button_group in [Link]():
if isinstance(button_group, list):
for button in button_group:
[Link]()

# Atualiza cards
for card in [Link]:
[Link]()

def draw(self):
"""Desenha o jogo"""
# Desenha baseado no estado
if [Link] == [Link]:
self.draw_splash()
elif [Link] == [Link]:
self.draw_menu()
elif [Link] == GameState.NEW_GAME:
self.draw_new_game()
elif [Link] == GameState.TEAM_SELECT:
self.draw_team_select()
elif [Link] == [Link]:
self.draw_dashboard()
# Adicionar outros estados...

# Sempre desenha estes elementos


self.draw_particles()
self.draw_notifications()

def draw_splash(self):
"""Desenha splash screen"""
# Fundo gradiente
self.draw_gradient(GRADIENT_DARK[0], GRADIENT_DARK[1])
# Logo
logo_text = [Link]["title"].render("LoL MANAGER", True, GOLD)
logo_rect = logo_text.get_rect(center=(SCREEN_WIDTH//2, SCREEN_HEIGHT//2 -
50))
[Link](logo_text, logo_rect)

# Subtítulo
subtitle = [Link]["large"].render("ULTIMATE EDITION", True, WHITE)
subtitle_rect = subtitle.get_rect(center=(SCREEN_WIDTH//2, SCREEN_HEIGHT//2
+ 20))
[Link](subtitle, subtitle_rect)

# Loading ou Press Any Key


alpha = abs([Link]([Link].get_ticks() * 0.002)) * 255
press_text = [Link]["medium"].render("Pressione qualquer tecla para
continuar", True, WHITE)
press_text.set_alpha(int(alpha))
press_rect = press_text.get_rect(center=(SCREEN_WIDTH//2, SCREEN_HEIGHT -
100))
[Link](press_text, press_rect)

# Versão
version = [Link]["small"].render("v1.0.0 Ultimate", True, GRAY)
version_rect = version.get_rect(bottomright=(SCREEN_WIDTH - 10,
SCREEN_HEIGHT - 10))
[Link](version, version_rect)

def draw_menu(self):
"""Desenha menu principal"""
# Fundo
self.draw_gradient(GRADIENT_BLUE[0], GRADIENT_BLUE[1])

# Painel central
panel_rect = [Link](SCREEN_WIDTH//2 - 250, 100, 500, 550)
[Link]([Link], (*BLACK, 180), panel_rect, border_radius=20)

# Logo
logo_text = [Link]["huge"].render("LoL MANAGER", True, GOLD)
logo_rect = logo_text.get_rect(center=(SCREEN_WIDTH//2, 180))
[Link](logo_text, logo_rect)

subtitle = [Link]["medium"].render("ULTIMATE EDITION", True, WHITE)


subtitle_rect = subtitle.get_rect(center=(SCREEN_WIDTH//2, 220))
[Link](subtitle, subtitle_rect)

# Linha decorativa
[Link]([Link], GOLD,
(SCREEN_WIDTH//2 - 150, 260),
(SCREEN_WIDTH//2 + 150, 260), 2)

# Desenha botões
for button in [Link]["menu"]:
[Link]([Link])

# Informações adicionais
info_text = [Link]["small"].render("© 2024 - Desenvolvido com Pygame",
True, GRAY)
info_rect = info_text.get_rect(center=(SCREEN_WIDTH//2, SCREEN_HEIGHT -
30))
[Link](info_text, info_rect)

def draw_new_game(self):
"""Desenha tela de novo jogo"""
self.draw_gradient(GRADIENT_DARK[0], GRADIENT_DARK[1])

# Título
title = [Link]["large"].render("CONFIGURAR NOVO JOGO", True, GOLD)
title_rect = title.get_rect(center=(SCREEN_WIDTH//2, 50))
[Link](title, title_rect)

# Painel de configurações
config_panel = [Link](100, 100, SCREEN_WIDTH - 200, SCREEN_HEIGHT -
200)
[Link]([Link], (*WHITE, 240), config_panel,
border_radius=15)
[Link]([Link], DARK_GRAY, config_panel, 3, border_radius=15)

# Opções
y = 150

# Nome do técnico
name_label = [Link]["medium"].render("Nome do Técnico:", True, BLACK)
[Link](name_label, (150, y))

# Input field (simplificado)


input_rect = [Link](350, y - 5, 300, 35)
[Link]([Link], WHITE, input_rect)
[Link]([Link], DARK_GRAY, input_rect, 2)

y += 60

# Dificuldade
diff_label = [Link]["medium"].render("Dificuldade:", True, BLACK)
[Link](diff_label, (150, y))

difficulties = ["Fácil", "Normal", "Difícil", "Lendário"]


diff_x = 350
for diff in difficulties:
diff_btn = Button(diff_x, y - 5, 100, 35, diff, BLUE)
diff_btn.draw([Link])
diff_x += 110

y += 60

# Região inicial
region_label = [Link]["medium"].render("Região:", True, BLACK)
[Link](region_label, (150, y))

regions = ["Brasil", "América do Norte", "Europa", "Coreia", "China"]


region_y = y + 40
for region in regions:
region_btn = Button(150, region_y, 200, 35, region, GREEN)
region_btn.draw([Link])
region_y += 45

# Botões de ação
start_btn = Button(SCREEN_WIDTH//2 - 250, SCREEN_HEIGHT - 150, 200, 60,
"Começar", GREEN, icon="▶️")
start_btn.draw([Link])

back_btn = Button(SCREEN_WIDTH//2 + 50, SCREEN_HEIGHT - 150, 200, 60,


"Voltar", RED, icon="◀️")
back_btn.draw([Link])

def draw_team_select(self):
"""Desenha seleção de time"""
self.draw_gradient(GRADIENT_DARK[0], GRADIENT_DARK[1])

# Título
title = [Link]["large"].render("ESCOLHA SEU TIME", True, GOLD)
title_rect = title.get_rect(center=(SCREEN_WIDTH//2, 40))
[Link](title, title_rect)

# Grid de times
x, y = 100, 100
card_width, card_height = 300, 150

for i, team in enumerate(self.all_teams):


# Card do time
card_rect = [Link](x, y, card_width, card_height)

# Cor de fundo baseada nas cores do time


card_color = [Link]["primary"]
card_surface = [Link]((card_width, card_height))
card_surface.set_alpha(200)
card_surface.fill(card_color)
[Link](card_surface, card_rect)

# Borda
[Link]([Link], WHITE, card_rect, 3, border_radius=10)

# Nome do time
team_name = [Link]["large"].render([Link], True, WHITE)
name_rect = team_name.get_rect(center=(x + card_width//2, y + 30))
[Link](team_name, name_rect)

# Tag
tag_text = [Link]["medium"].render(f"[{[Link]}]", True, WHITE)
tag_rect = tag_text.get_rect(center=(x + card_width//2, y + 60))
[Link](tag_text, tag_rect)

# Informações
info_texts = [
f"Orçamento: ${[Link]:,}",
f"Jogadores: {len([Link])}",
f"Poder: {team.calculate_team_power():.1f}"
]

info_y = y + 85
for info in info_texts:
info_surface = [Link]["small"].render(info, True, WHITE)
info_rect = info_surface.get_rect(center=(x + card_width//2,
info_y))
[Link](info_surface, info_rect)
info_y += 20
# Próximo card
x += card_width + 20
if (i + 1) % 4 == 0:
x = 100
y += card_height + 20

def draw_dashboard(self):
"""Desenha dashboard principal"""
if not self.user_team:
return

# Fundo
[Link](DARK_GRAY)

# Header
self.draw_header()

# Menu lateral
self.draw_side_menu()

# Conteúdo principal
self.draw_main_content()

# Widgets
self.draw_widgets()

def draw_header(self):
"""Desenha cabeçalho do dashboard"""
header_rect = [Link](0, 0, SCREEN_WIDTH, 80)
[Link]([Link], BLACK, header_rect)

# Gradiente
for i in range(header_rect.height):
alpha = 255 - (i * 3)
color = (*self.user_team.colors["primary"], min(255, alpha))
line_rect = [Link](0, i, SCREEN_WIDTH, 1)
[Link]([Link], color[:3], (0, i), (SCREEN_WIDTH, i))

# Logo/Nome do time
team_name = [Link]["large"].render(self.user_team.name, True, WHITE)
[Link](team_name, (20, 20))

# Tag
tag_text = [Link]["medium"].render(f"[{self.user_team.tag}]", True,
GOLD)
[Link](tag_text, (team_name.get_width() + 30, 25))

# Informações rápidas
quick_info = [
f"💰 ${self.user_team.budget:,}",
f"🏆 {self.user_team.season_stats['wins']}V-
{self.user_team.season_stats['losses']}D",
f"⚡ {self.user_team.calculate_team_power():.1f}",
f"📅 Semana {self.current_week}"
]

x = SCREEN_WIDTH - 400
for info in quick_info:
info_surface = [Link]["small"].render(info, True, WHITE)
[Link](info_surface, (x, 30))
x += 100

def draw_side_menu(self):
"""Desenha menu lateral"""
menu_rect = [Link](0, 80, 250, SCREEN_HEIGHT - 80)
[Link]([Link], DARK_BLUE, menu_rect)

# Título do menu
menu_title = [Link]["medium"].render("MENU", True, WHITE)
title_rect = menu_title.get_rect(center=(125, 110))
[Link](menu_title, title_rect)

# Opções do menu
menu_items = [
("📊", "Dashboard", [Link]),
("👥", "Elenco", [Link]),
("💪", "Treino", [Link]),
("💰", "Mercado", [Link]),
("📈", "Finanças", [Link]),
("📅", "Calendário", [Link]),
("🎯", "Táticas", [Link]),
("🏢", "Instalações", [Link]),
("📊", "Estatísticas", [Link]),
("🔍", "Scout", [Link]),
("📝", "Contratos", [Link]),
("🏆", "Conquistas", [Link])
]

y = 150
for icon, text, state in menu_items:
# Botão do menu
btn_rect = [Link](10, y, 230, 40)

# Hover effect
mouse_pos = [Link].get_pos()
if btn_rect.collidepoint(mouse_pos):
[Link]([Link], BLUE, btn_rect, border_radius=5)
else:
[Link]([Link], (*DARK_BLUE, 200), btn_rect,
border_radius=5)

# Ícone e texto
icon_surface = [Link]["medium"].render(icon, True, WHITE)
[Link](icon_surface, (20, y + 10))

text_surface = [Link]["small"].render(text, True, WHITE)


[Link](text_surface, (55, y + 12))

y += 45

def draw_main_content(self):
"""Desenha conteúdo principal do dashboard"""
content_rect = [Link](260, 90, SCREEN_WIDTH - 270, SCREEN_HEIGHT -
100)
[Link]([Link], WHITE, content_rect, border_radius=10)

# Título da seção
section_title = [Link]["large"].render("VISÃO GERAL", True, BLACK)
[Link](section_title, (280, 110))

# Cards de informação
self.draw_info_cards()

# Gráficos
self.draw_charts()

# Próximas partidas
self.draw_upcoming_matches()

def draw_info_cards(self):
"""Desenha cards de informação"""
cards_data = [
("Posição na Liga", f"{self.user_team.season_stats.get('position',
'N/A')}º", GREEN),
("Sequência Atual", f"{self.user_team.season_stats.get('win_streak',
0)} vitórias", BLUE),
("Média de Poder", f"{self.user_team.calculate_team_power():.1f}",
PURPLE),
("Satisfação da Torcida", f"{self.user_team.fan_satisfaction}%",
ORANGE)
]

x = 280
y = 160

for title, value, color in cards_data:


# Card
card_rect = [Link](x, y, 200, 100)
[Link]([Link], color, card_rect, border_radius=10)

# Título
title_surface = [Link]["small"].render(title, True, WHITE)
title_rect = title_surface.get_rect(center=(x + 100, y + 30))
[Link](title_surface, title_rect)

# Valor
value_surface = [Link]["large"].render(value, True, WHITE)
value_rect = value_surface.get_rect(center=(x + 100, y + 60))
[Link](value_surface, value_rect)

x += 220
if x > 900:
x = 280
y += 120

def draw_charts(self):
"""Desenha gráficos de performance"""
chart_rect = [Link](280, 400, 400, 200)
[Link]([Link], LIGHT_GRAY, chart_rect, border_radius=10)
[Link]([Link], DARK_GRAY, chart_rect, 2, border_radius=10)

# Título do gráfico
chart_title = [Link]["medium"].render("Performance Recente", True,
BLACK)
[Link](chart_title, (290, 410))

# Simula dados de performance


performances = [[Link](60, 95) for _ in range(10)]

# Desenha gráfico de linha


points = []
for i, perf in enumerate(performances):
x = 300 + (i * 35)
y = 580 - (perf * 1.5)
[Link]((x, y))

# Ponto
[Link]([Link], BLUE, (int(x), int(y)), 4)

# Linha conectando pontos


if len(points) > 1:
[Link]([Link], BLUE, False, points, 2)

def draw_upcoming_matches(self):
"""Desenha próximas partidas"""
matches_rect = [Link](700, 400, 400, 200)
[Link]([Link], LIGHT_GRAY, matches_rect, border_radius=10)
[Link]([Link], DARK_GRAY, matches_rect, 2, border_radius=10)

# Título
matches_title = [Link]["medium"].render("Próximas Partidas", True,
BLACK)
[Link](matches_title, (710, 410))

# Lista de partidas (simulada)


y = 450
for i in range(3):
opponent = [Link]([t for t in self.all_teams if t !=
self.user_team])

# Texto da partida
match_text = f"Semana {self.current_week + i} vs {[Link]}"
match_surface = [Link]["small"].render(match_text, True, BLACK)
[Link](match_surface, (720, y))

# Poder do adversário
power_text = f"Poder: {opponent.calculate_team_power():.1f}"
power_surface = [Link]["small"].render(power_text, True, GRAY)
[Link](power_surface, (720, y + 20))

y += 50

def draw_widgets(self):
"""Desenha widgets do dashboard"""
# Widget de notificações
notif_rect = [Link](SCREEN_WIDTH - 320, 100, 300, 150)
[Link]([Link], (*WHITE, 240), notif_rect, border_radius=10)
[Link]([Link], ORANGE, notif_rect, 2, border_radius=10)

notif_title = [Link]["small"].render("📢 Notificações", True, BLACK)


[Link](notif_title, (SCREEN_WIDTH - 310, 110))

# Lista de notificações recentes


notif_y = 135
recent_notifs = [
"Nova oferta de patrocínio",
"Jogador recuperado de lesão",
"Janela de transferências abre em 2 semanas"
]

for notif in recent_notifs[:3]:


notif_text = [Link]["tiny"].render(f"• {notif[:35]}", True, BLACK)
[Link](notif_text, (SCREEN_WIDTH - 305, notif_y))
notif_y += 20

def draw_gradient(self, color1, color2):


"""Desenha gradiente de fundo"""
for i in range(SCREEN_HEIGHT):
ratio = i / SCREEN_HEIGHT
r = int(color1[0] * (1 - ratio) + color2[0] * ratio)
g = int(color1[1] * (1 - ratio) + color2[1] * ratio)
b = int(color1[2] * (1 - ratio) + color2[2] * ratio)
[Link]([Link], (r, g, b), (0, i), (SCREEN_WIDTH, i))

def draw_particles(self):
"""Desenha partículas"""
if [Link]["particles"]:
self.particle_system.draw([Link])

def draw_notifications(self):
"""Desenha notificações"""
for notif in [Link]:
[Link]([Link], [Link]["medium"])

def add_notification(self, text, type="info"):


"""Adiciona nova notificação"""
if [Link]["notifications"]:
[Link](Notification(text, type))

# Limita número de notificações


if len([Link]) > 5:
[Link](0)

def save_game(self, slot=1):


"""Salva o jogo"""
save_data = {
"version": "1.0.0",
"date": [Link]().isoformat(),
"user_team": self.user_team.id if self.user_team else None,
"season": self.current_season,
"split": self.current_split,
"week": self.current_week,
"teams": [team.__dict__ for team in self.all_teams],
"settings": [Link]
}

# Cria diretório de saves se não existir


[Link]("saves", exist_ok=True)

# Salva arquivo
filename = f"saves/save_slot_{slot}.json"
with open(filename, 'w') as f:
[Link](save_data, f, indent=2, default=str)

self.add_notification(f"Jogo salvo no slot {slot}", "success")


def load_game(self, slot=1):
"""Carrega o jogo"""
filename = f"saves/save_slot_{slot}.json"

if not [Link](filename):
self.add_notification(f"Nenhum save encontrado no slot {slot}",
"error")
return False

try:
with open(filename, 'r') as f:
save_data = [Link](f)

# Restaura dados
self.current_season = save_data["season"]
self.current_split = save_data["split"]
self.current_week = save_data["week"]
[Link] = save_data["settings"]

# Encontra time do usuário


for team in self.all_teams:
if [Link] == save_data["user_team"]:
self.user_team = team
break

self.add_notification(f"Jogo carregado do slot {slot}", "success")


[Link] = [Link]
return True

except Exception as e:
self.add_notification(f"Erro ao carregar: {str(e)}", "error")
return False

def run(self):
"""Loop principal do jogo"""
while [Link]:
# Delta time
[Link] = [Link]([Link]) / 1000.0

# Processa eventos
self.handle_events()

# Atualiza lógica
[Link]()

# Desenha
[Link]()

# Atualiza display
[Link]()

# FPS no título
fps_text = f"LoL Manager Ultimate - FPS: {int([Link].get_fps())}"
[Link].set_caption(fps_text)

# Cleanup
[Link]()
# Executar o jogo
if __name__ == "__main__":
print("=" * 60)
print("LOL MANAGER - ULTIMATE EDITION")
print("=" * 60)
print("\n🎮 RECURSOS ULTIMATE:")
print("✅ Interface profissional com animações e partículas")
print("✅ Sistema completo de jogadores com 15+ atributos")
print("✅ Personalidade e relacionamentos entre jogadores")
print("✅ Sistema de lesões e recuperação realista")
print("✅ Draft completo com picks e bans")
print("✅ Simulação detalhada de partidas")
print("✅ Sistema financeiro complexo")
print("✅ Instalações e melhorias")
print("✅ Sistema de scout e descoberta de talentos")
print("✅ Química e sinergia do time")
print("✅ Múltiplas competições e torneios")
print("✅ Sistema de conquistas e recordes")
print("✅ Save/Load completo")
print("✅ Notificações e feedback visual")
print("✅ Dashboard com gráficos e estatísticas")

print("\n CONTROLES:")
print("• Mouse para todos os controles")
print("• Scroll para navegar em listas")
print("• Hover para tooltips")
print("• Drag & Drop para organizar lineup")

print("\n" + "=" * 60)


print("Iniciando jogo...")
print("=" * 60 + "\n")

game = LoLManagerUltimate()
[Link]()

You might also like