import time import random import sys import os def loading_bar(): print("Initiating quantum budget matrix...") for _ in range(21): time.sleep(0.03) sys.stdout.write(".") sys.stdout.flush() print("\nSystem ready.\n") def matrix_print(text, delay=0.03): for char in text: sys.stdout.write(char) sys.stdout.flush() time.sleep(delay) print() def clear_screen(): os.system('cls' if os.name == 'nt' else 'clear') class GameManager: def __init__(self): self.balance = 0.0 self.lifetime_earnings = 0.0 self.click_power = 1.0 self.click_multiplier = 1.0 # Upgrades self.upgrades = { "Auto-Clicker": {"cost": 50.0, "level": 0, "cps": 1.0, "owned": 0}, "Quantum Processor": {"cost": 250.0, "level": 0, "cps": 5.0, "owned": 0}, "Cosmic Harvester": {"cost": 1000.0, "level": 0, "cps": 25.0, "owned": 0} } # Cart/Items self.cart = [] self.base_smoothie_price = 6.5 self.base_pie_price = 6.0 self.base_wedges_price = 4.5 self.secret_items = ["gold-plated doughnut", "unicorn nugget", "quantum espresso", "pixelated taco"] def calculate_passive_income(self, elapsed_time): total_cps = sum(upg["cps"] * upg["owned"] for upg in self.upgrades.values()) earned = total_cps * elapsed_time self.balance += earned self.lifetime_earnings += earned def main_menu(self): clear_screen() print("*" * 60) print("* WELCOME TO THE ULTIMATE BUDGET ENGINE *") print("*" * 60) print(f"\n--- Balance: ${self.balance:.2f} ---") print("1. Click for Money (Manual Income)") print("2. Shop & Upgrades (Boost Income & Stats)") print("3. Casino (Gamble your money)") print("4. Quantum Cafe Cart (Spend balance)") print("5. Exit Engine") def click_game(self): clear_screen() print("=== CLICKER GAME ===") print("Press ENTER to generate money. Type 'x' to go back.") while True: choice = input(f"Current Power: ${self.click_power:.2f} per click. Press ENTER: ") if choice.lower() == 'x': break earned = self.click_power self.balance += earned self.lifetime_earnings += earned print(f"Generated ${earned:.2f}! Total Balance: ${self.balance:.2f}") def shop_menu(self): clear_screen() print("=== SHOP & UPGRADES ===") print(f"Current Balance: ${self.balance:.2f}\n") print("Upgrades:") # Display Upgrades for i, (name, data) in enumerate(self.upgrades.items(), 1): print(f"{i}. {name} | Owned: {data['owned']} | +{data['cps']} per sec | Cost: ${data['cost']:.2f}") # Click Upgrades print(f"4. Upgrade Click Power (+${self.click_multiplier:.2f} per click) | Cost: ${ (self.click_multiplier * 50.0):.2f}") print("5. Return to Main Menu") choice = input("Select an option (1-5): ") if choice in ['1', '2', '3']: upg_names = list(self.upgrades.keys()) target_name = upg_names[int(choice) - 1] upg = self.upgrades[target_name] if self.balance >= upg["cost"]: self.balance -= upg["cost"] upg["owned"] += 1 upg["level"] += 1 upg["cost"] *= 1.5 # Increase cost for next level print(f"Successfully purchased 1x {target_name}!") else: print("Insufficient funds!") time.sleep(1) elif choice == '4': cost = self.click_multiplier * 50.0 if self.balance >= cost: self.balance -= cost self.click_power += self.click_multiplier self.click_multiplier += 0.5 print("Click power upgraded!") else: print("Insufficient funds!") time.sleep(1) def casino(self): clear_screen() print("=== QUANTUM CASINO ===") print(f"Current Balance: ${self.balance:.2f}") print("1. Flip a Cosmic Coin (50/50 - Double or Nothing)") print("2. Roll the Multi-Dimensional Dice (1-100, >50 wins, cost scales with bet)") print("3. Back to Main Menu") choice = input("Select option (1-3): ") if choice == '1': try: bet = float(input("Enter bet amount: $")) if bet > self.balance or bet <= 0: print("Invalid bet amount.") else: outcome = random.choice([True, False]) if outcome: self.balance += bet print(f"You won! +${bet:.2f}") else: self.balance -= bet print(f"You lost! -${bet:.2f}") except ValueError: print("Invalid input.") time.sleep(1.5) elif choice == '2': try: bet = float(input("Enter bet amount: $")) if bet > self.balance or bet <= 0: print("Invalid bet amount.") else: matrix_print("Rolling dice...") time.sleep(1) roll = random.randint(1, 100) print(f"You rolled a {roll}!") if roll > 50: win = bet * 1.5 self.balance += win print(f"Rolled above 50! You won ${win:.2f}!") else: self.balance -= bet print(f"Rolled 50 or below. You lost your bet!") except ValueError: print("Invalid input.") time.sleep(1.5) def cafe_cart(self): while True: clear_screen() print(f"=== QUANTUM CAFE CART ===") print(f"Current Budget Balance: ${self.balance:.2f}") print("1. Standard Smoothie") print("2. Standard Pie") print("3. Standard Wedges") print("4. Access Secret Menu") print("5. Finalize quantum transaction") choice = input("Select item to add to cart (1-5): ") if choice == '1': price = self.base_smoothie_price self.cart.append(("Standard Smoothie", price)) self.balance -= price print(f"Added Standard Smoothie for ${price:.2f}") elif choice == '2': price = self.base_pie_price self.cart.append(("Standard Pie", price)) self.balance -= price print(f"Added Standard Pie for ${price:.2f}") elif choice == '3': price = self.base_wedges_price self.cart.append(("Standard Wedges", price)) self.balance -= price print(f"Added Standard Wedges for ${price:.2f}") elif choice == '4': secret_item = random.choice(self.secret_items) price = (self.base_smoothie_price + self.base_pie_price) * 3.14159 self.cart.append((secret_item, price)) self.balance -= price print(f"Secret menu accessed. Added {secret_item} for ${price:.2f}") elif choice == '5': matrix_print("\nInitiating total expenditure tally...") break else: print("Invalid choice. Try again.") if self.balance < 0: print("\nWARNING: Budget depleted! Emergency finalization initiated.") time.sleep(1) break time.sleep(1) # Checkout clear_screen() matrix_print("...Calculating quantum tax and cosmic convenience fees...") time.sleep(1) total_spent = sum(price for name, price in self.cart) tax_multiplier = random.uniform(1.05, 1.25) final_total = total_spent * tax_multiplier print(f"\nItems in your cart: {len(self.cart)}") print(f"Total spent: ${total_spent:.2f}") print(f"Cosmic Tax Applied: {((tax_multiplier - 1) * 100):.2f}%") print(f"FINAL BALANCE DUE: ${final_total:.2f}") matrix_print("\nTransaction complete. Have a productive day!") self.cart = [] # Clear cart input("\nPress ENTER to return to Main Menu.") def run_game(): clear_screen() loading_bar() matrix_print("Synchronizing with local terminal nodes...") name = input("Identify yourself, user: ") matrix_print(f"Kia ora {name}. Access granted.") time.sleep(1) manager = GameManager() last_time = time.time() while True: # Calculate passive income automatically current_time = time.time() elapsed_time = current_time - last_time manager.calculate_passive_income(elapsed_time) last_time = current_time manager.main_menu() choice = input("\nSelect an option (1-5): ") if choice == '1': manager.click_game() elif choice == '2': manager.shop_menu() elif choice == '3': manager.casino() elif choice == '4': manager.cafe_cart() elif choice == '5': clear_screen() print("System shutting down. Thanks for playing!") break else: print("Invalid choice, please select 1-5.") time.sleep(1) if __name__ == "__main__": run_game()