NBA ALL STAR DAY 1


so im adding all star weekend only the 2nd great event for the nba beind the finals

import random
import time

class Player:
    def __init__(self, name, team, ovr, origin="USA", skill_3pt=80, dunk_rating=80):
        self.name = name
        self.team = team
        self.ovr = ovr
        self.origin = origin
        self.skill_3pt = skill_3pt
        self.dunk_rating = dunk_rating

# --- 2026 Season Official Star Pool ---
all_players = [
    Player("Damian Lillard", "POR", 92, "USA", 99, 82),
    Player("Devin Booker", "PHX", 94, "USA", 94, 85),
    Player("Kon Knueppel", "CHA", 83, "USA", 93, 75),
    Player("Tyrese Maxey", "PHI", 91, "USA", 91, 88),
    Player("Donovan Mitchell", "CLE", 92, "USA", 93, 94),
    Player("Jamal Murray", "DEN", 90, "World", 90, 84),
    Player("Keshad Johnson", "MIA", 78, "USA", 72, 98),
    Player("Jaxson Hayes", "LAL", 79, "USA", 65, 96),
    Player("Jase Richardson", "ORL", 77, "USA", 82, 97),
    Player("Carter Bryant", "SAS", 78, "USA", 80, 95),
    Player("Luka Dončić", "LAL", 98, "World", 95, 78),
    Player("Nikola Jokić", "DEN", 98, "World", 88, 75),
    Player("Victor Wembanyama", "SAS", 95, "World", 86, 96),
    Player("Anthony Edwards", "MIN", 95, "USA", 89, 97),
    Player("LeBron James", "LAL", 94, "USA", 85, 92),
    Player("Kevin Durant", "HOU", 94, "USA", 92, 85),
    Player("Jayson Tatum", "BOS", 95, "USA", 91, 88),
    Player("Shai Gilgeous-Alexander", "OKC", 97, "World", 88, 85),
    Player("Giannis Antetokounmpo", "MIL", 96, "World", 78, 98)
]

def run_all_star_weekend():
    print("🌟 WELCOME TO ALL-STAR WEEKEND 2026 | Intuit Dome, Los Angeles 🌟")
class allstarweekendevents:
    # 1. THE 3-POINT CONTEST
      print("\n🎯 --- STATE FARM 3-POINT CONTEST ---")
      shooters = [p for p in all_players if p.skill_3pt >= 85]
      participants_3pt = random.sample(shooters, 8)
      scores_3pt = []
      for p in participants_3pt:
        score = random.randint(18, 26) + (p.skill_3pt - 85) // 2
        scores_3pt.append((p.name, score))
        print(f"{p.name} ({p.team}): {score} PTS")
        time.sleep(0.4)
    
      winner_3pt = max(scores_3pt, key=lambda x: x[1])
      print(f"🏆 3PT CHAMPION: {winner_3pt[0]} with {winner_3pt[1]} points!")

    # 2. THE SLAM DUNK CONTEST
      print("\n🐰 --- AT&T SLAM DUNK CONTEST ---")
      dunkers = [p for p in all_players if p.dunk_rating >= 94]
      participants_dunk = random.sample(dunkers, 4)
      scores_dunk = []
      for p in participants_dunk:
        score = random.randint(42, 50)
        scores_dunk.append((p.name, score))
        print(f"{p.name} ({p.team}) clears the rack! Score: {score}")
        time.sleep(0.6)
    
      winner_dunk = max(scores_dunk, key=lambda x: x[1])
      print(f"🏆 DUNK CHAMPION: {winner_dunk[0]} with a {winner_dunk[1]}!")

    # 3. ROUND-ROBIN TOURNAMENT (Sunday Main Event)
      print("\n🏟️ --- ALL-STAR ROUND-ROBIN TOURNAMENT ---")
      world = [p for p in all_players if p.origin == "World"]
      usa = [p for p in all_players if p.origin == "USA"]
    
    # Randomly assign USA players to Stars or Stripes
      random.shuffle(usa)
      stripes = usa[:len(usa)//2]
      stars = usa[len(usa)//2:]

      teams = {"Team World": world, "USA Stripes": stripes, "USA Stars": stars}
      for t_name, roster in teams.items():
        print(f"\n{t_name}: {', '.join([p.name for p in roster[:5]])}...")

    # Final result based on team OVR average
   

run_all_star_weekend()

this sims all star weekend i was thinking about adding all star weekend for a while but i wasnt sure how so i asked ai and i fixed the draft clock its 15secnds but its runs down and if it runs out the sim has the cpu make the pick for you because i was wondering what happened so i let it run out and thats what happened has you can see from this code and screenshot:

import threading
import time
import sys

class DraftTimer:
    def __init__(self, seconds):
        self.seconds = seconds
        self.stop_event = threading.Event()
        self.expired = False

    def start_countdown(self):
        """Runs in the background and prints the remaining time."""
        for i in range(self.seconds, -1, -1):
            if self.stop_event.is_set():
                return
            
            # Use \r to overwrite the same line in the console
            sys.stdout.write(f"\r⏱️  DRAFT CLOCK: {i}s remaining | 1. Pick  2. Trade: ")
            sys.stdout.flush()
            
            if i == 0:
                self.expired = True
                print("\n\n❌ TIME EXPIRED! The league office has made a pick for you.")
                # You can add logic here to auto-pick the best available player
                return
            time.sleep(1)

    def stop(self):
        self.stop_event.set()

# --- Example Usage in your Game ---
def run_draft_turn():
    # Set a 15-second clock
    timer = DraftTimer(15)
    
    # Start the clock on a separate background thread
    clock_thread = threading.Thread(target=timer.start_countdown)
    clock_thread.daemon = True # Ensures thread dies if main program closes
    clock_thread.start()

    # The main program pauses here for input while the clock runs above
    choice = input()
    
    # Once user types something, stop the background clock
    timer.stop()

    if timer.expired:
        return "AUTO_PICK"
    
    if choice == "1":
        return "MAKING_PICK"
    elif choice == "2":
        return "VIEWING_TRADES"
    else:
        return "INVALID"

print("--- NBA DRAFT 2026 ---")
result = run_draft_turn()
print(f"\nDecision made: {result}")

if you have any ideas plaese comment them in the comment area im open to ideas to make this sim better

i will add awords next week awords like:

MVP

DPOTY

OPOTY

SIXTH MAN OF THE YEAR

ROOKIE OF THE YEAR

GM OF THE YEAR

COACH OF THE YEAR

MOST INPORVED PLAYER

over the next weeks i will add all nba teams and all rookies teams as well

next week is spring break so no post next week but in 2 weeks we’re back and ill be back with more on this code

until then stay cool guys

see you in 2 weeks


Leave a Reply

Your email address will not be published. Required fields are marked *