def display_status(self): print(f"\nFunds: ${self.funds}") print("Resources:") for resource, amount in self.resources.items(): print(f"- {resource}: {amount}") print("Equipment:") for item, amount in self.equipment.items(): print(f"- {item}: {amount}") print("Tech Level:") for area, level in self.tech_level.items(): print(f"- {area}: Level {level}")
class WarfareTycoon: def __init__(self): self.funds = 10000 self.resources = {"Steel": 1000, "Electronics": 500} self.equipment = {"Tanks": 0, "Jets": 0} self.tech_level = {"Research": 1, "Production": 1} warfare tycoon script
def buy_resources(self): print("\nBuy Resources:") print("1. Steel ($100/ton)") print("2. Electronics ($200/unit)") choice = input("Enter choice (1/2): ") if choice == "1": amount = int(input("Enter tons of steel to buy: ")) cost = amount * 100 if cost <= self.funds: self.funds -= cost self.resources["Steel"] += amount print(f"Bought {amount} tons of steel.") else: print("Insufficient funds.") elif choice == "2": amount = int(input("Enter units of electronics to buy: ")) cost = amount * 200 if cost <= self.funds: self.funds -= cost self.resources["Electronics"] += amount print(f"Bought {amount} units of electronics.") else: print("Insufficient funds.") def display_status(self): print(f"\nFunds: ${self