{"repo": "birdfarmer/justanotherwednesday", "files": {"Engine/HumanDuel.cs": {"3e7d7e17121efe1d5a9826ed2f0fd5d707df929a": {"t": 1785745820.0240743, "n": 39288, "h": "64a12eb022552651", "c": "using System.Text;\nusing System.Text.Json;\n\nnamespace JustAnotherWednesday;\n\npublic static class HumanDuel\n{\n // --- GameAction enum ---\n private enum GameAction\n {\n AcquireTransport,\n SecureFood,\n StrengthenShelter,\n AcquireEnergy,\n BuildInfluence,\n PreserveLiquidity\n }\n\n // --- Player State ---\n private class PlayerState\n {\n public int Liquidity { get; set; } = 50;\n public int Food { get; set; } = 50;\n public int Shelter { get; set; } = 50;\n public int Security { get; set; } = 50;\n public int Mobility { get; set; } = 50;\n public int Influence { get; set; } = 50;\n public int Energy { get; set; } = 50;\n public Option MoneyOption { get; set; } = Option.B;\n public int CashReceived { get; set; } = 0;\n public bool MoneyReceived { get; set; } = false;\n\n public string GetSummary()\n {\n return $\"šŸ’§ Liquidity: {Liquidity} šŸ– Food: {Food} šŸ  Shelter: {Shelter} šŸ”’ Security: {Security} šŸš— Mobility: {Mobility} šŸ¤ Influence: {Influence} ⚔ Energy: {Energy}\";\n }\n }\n\n // --- Location database ---\n private static readonly Dictionary> LocationNames = new()\n {\n { Location.HighCostCity, new List {\n \"New York City, USA\", \"London, UK\", \"Singapore\", \"Tokyo, Japan\",\n \"Sydney, Australia\", \"Paris, France\", \"Hong Kong, China\",\n \"Dubai, UAE\", \"San Francisco, USA\", \"Zurich, Switzerland\"\n } },\n { Location.MidCostCity, new List {\n \"Buenos Aires, Argentina\", \"Prague, Czech Republic\", \"Omaha, USA\",\n \"Kuala Lumpur, Malaysia\", \"Mexico City, Mexico\", \"Cape Town, South Africa\",\n \"Bangkok, Thailand\", \"Ho Chi Minh City, Vietnam\", \"Bogota, Colombia\",\n \"Lisbon, Portugal\", \"Helsingborg, Sweden\"\n } },\n { Location.Suburban, new List {\n \"suburban Ohio, USA\", \"suburban Surrey, UK\", \"suburban Ontario, Canada\",\n \"suburban Melbourne, Australia\", \"suburban Auckland, New Zealand\",\n \"suburban Florida, USA\", \"suburban California, USA\",\n \"suburban New South Wales, Australia\", \"suburban British Columbia, Canada\"\n } },\n { Location.WarZone, new List {\n \"Donetsk, Ukraine\", \"Mosul, Iraq\", \"Gaza City, Palestine\",\n \"Aleppo, Syria\", \"Kabul, Afghanistan\", \"Mogadishu, Somalia\",\n \"Kyiv, Ukraine\", \"Sanaa, Yemen\", \"Khartoum, Sudan\", \"Port-au-Prince, Haiti\"\n } },\n { Location.LowCostRural, new List {\n \"rural Kansas, USA\", \"rural Vietnam (Mekong Delta)\",\n \"rural Brazil (Mato Grosso)\", \"rural Kenya (Rift Valley)\",\n \"rural Romania (Transylvania)\", \"rural Mongolia (steppes)\",\n \"rural Bolivia (Altiplano)\", \"rural Philippines (Mindanao)\",\n \"rural Poland (Masuria)\"\n } },\n { Location.IsolatedIsland, new List {\n \"Easter Island, Chile\", \"St. Helena, South Atlantic\",\n \"Tasmania, Australia\", \"Santorini, Greece\",\n \"Marshall Islands\", \"Falkland Islands\",\n \"Svalbard, Norway\", \"Faroe Islands, Denmark\",\n \"Chatham Islands, New Zealand\", \"Koh Phangan, Thailand\"\n } }\n };\n\n // --- Timezone helper ---\n private static int GetUtcOffset(string location)\n {\n if (location.Contains(\"Tokyo\") || location.Contains(\"Japan\")) return 9;\n if (location.Contains(\"Sydney\") || location.Contains(\"Melbourne\") || location.Contains(\"NSW\")) return 11;\n if (location.Contains(\"Auckland\") || location.Contains(\"Chatham\")) return 12;\n if (location.Contains(\"Singapore\") || location.Contains(\"Hong Kong\") || location.Contains(\"Beijing\") || location.Contains(\"Kuala Lumpur\")) return 8;\n if (location.Contains(\"Bangkok\") || location.Contains(\"Ho Chi Minh\") || location.Contains(\"Vietnam\") || location.Contains(\"Koh Phangan\")) return 7;\n if (location.Contains(\"Dubai\") || location.Contains(\"Moscow\")) return 4;\n if (location.Contains(\"Cape Town\") || location.Contains(\"Khartoum\") || location.Contains(\"Sanaa\")) return 2;\n if (location.Contains(\"London\") || location.Contains(\"UK\") || location.Contains(\"St. Helena\") || location.Contains(\"Lisbon\") || location.Contains(\"Faroe\")) return 0;\n if (location.Contains(\"Paris\") || location.Contains(\"Zurich\") || location.Contains(\"Prague\") || location.Contains(\"Rome\") || location.Contains(\"Berlin\")) return 1;\n if (location.Contains(\"Helsingborg\") || location.Contains(\"Sweden\")) return 1;\n if (location.Contains(\"Buenos Aires\") || location.Contains(\"Brazil\") || location.Contains(\"Sao Paulo\") || location.Contains(\"Bogota\")) return -3;\n if (location.Contains(\"New York\") || location.Contains(\"Ohio\") || location.Contains(\"Omaha\") || location.Contains(\"Florida\") || location.Contains(\"Ontario\")) return -5;\n if (location.Contains(\"California\") || location.Contains(\"San Francisco\") || location.Contains(\"British Columbia\")) return -8;\n if (location.Contains(\"Mexico City\")) return -6;\n if (location.Contains(\"Easter Island\") || location.Contains(\"Falkland\")) return -6;\n if (location.Contains(\"Santorini\") || location.Contains(\"Greece\")) return 2;\n if (location.Contains(\"Mogadishu\")) return 3;\n if (location.Contains(\"Kyiv\") || location.Contains(\"Donetsk\") || location.Contains(\"Aleppo\") || location.Contains(\"Gaza\")) return 2;\n if (location.Contains(\"Kabul\")) return 4;\n return 0;\n }\n\n private static string GetMondayMorningLocalInfo(string location)\n {\n return $\"It's Monday morning, approximately 8:00 AM local time in {location}. Banks are open. Markets are open.\";\n }\n\n private static string GetInfrastructureContext(Location locationEnum)\n {\n return locationEnum switch\n {\n Location.HighCostCity => \"High-speed internet, reliable power, functioning banks, ATMs everywhere, 24/7 emergency services.\",\n Location.MidCostCity => \"Good internet, mostly reliable power, banks and ATMs available, but slower outside downtown.\",\n Location.Suburban => \"Good residential infrastructure, reliable power, internet, nearby shopping centers, but car-dependent.\",\n Location.WarZone => \"Destroyed infrastructure. No working banks. Internet is spotty or offline. Power is intermittent. Looting and curfews common.\",\n Location.LowCostRural => \"Limited infrastructure. Dirt roads, no ATMs nearby, internet via satellite. Barter and cash are common.\",\n Location.IsolatedIsland => \"Very limited infrastructure. No local stock exchange. Internet is satellite-only. Supply chains are irregular. Self-sufficiency is key.\",\n _ => \"Moderate infrastructure typical of a mid-sized town.\"\n };\n }\n\n // --- NEWS FEED ---\n private static readonly Dictionary> ScenarioNews = new()\n {\n { Scenario.FeudalReset, new List {\n \"Large banks report unusual cash withdrawals.\",\n \"Gold dealers report unprecedented demand.\",\n \"Land registry offices overwhelmed with transfer requests.\",\n \"Law firms report a surge in trust and estate inquiries.\"\n } },\n { Scenario.Redistributed, new List {\n \"Government officials deny any pending economic reforms.\",\n \"Social media fills with rumors of wealth redistribution.\",\n \"High-value asset sales spiked 40% in the last hour.\",\n \"Central bank announces routine system maintenance.\"\n } },\n { Scenario.ScorchedEarth, new List {\n \"Multiple supply chain disruptions reported.\",\n \"Fuel prices jump 15% on global markets.\",\n \"Military activity observed near contested zones.\",\n \"News networks switch to round-the-clock coverage.\"\n } },\n { Scenario.TribalCollapse, new List {\n \"Border crossings experience long delays.\",\n \"Local militias reportedly bolstering their positions.\",\n \"International flights suspended in contested regions.\",\n \"Government officials relocate to undisclosed locations.\"\n } },\n { Scenario.LateBubble, new List {\n \"Markets open with unprecedented volatility.\",\n \"Tech stocks surge 12% in pre-market trading.\",\n \"Analysts warn of a 'classic bubble' forming.\",\n \"Retail investors flood trading platforms.\"\n } }\n };\n\n private static readonly Dictionary> LocationNews = new()\n {\n { Location.HighCostCity, new List {\n \"Financial districts see heavy traffic early.\",\n \"Private banks report record account openings.\",\n \"Property developers offer last-minute discounts.\",\n \"Airports see a spike in last-minute business travel.\"\n } },\n { Location.MidCostCity, new List {\n \"Local markets see increased foot traffic.\",\n \"Currency exchange booths have long queues.\",\n \"Supermarkets report early morning stockpiling.\",\n \"Taxi and rideshare demand triples.\"\n } },\n { Location.Suburban, new List {\n \"Gas stations report long queues forming.\",\n \"Hardware stores busy with emergency supplies.\",\n \"Schools announce early closures.\",\n \"Neighborhood watch groups activate.\"\n } },\n { Location.WarZone, new List {\n \"Checkpoints multiply around the city.\",\n \"Explosions reported on the outskirts.\",\n \"Curfew hours extended.\",\n \"Humanitarian warnings issued.\"\n } },\n { Location.LowCostRural, new List {\n \"Local co-ops request immediate harvest.\",\n \"Veterinarians report feed shortages.\",\n \"Roads to major towns are blocked by fallen trees.\",\n \"Communal gatherings to discuss crop security.\"\n } },\n { Location.IsolatedIsland, new List {\n \"Cargo flights are fully booked.\",\n \"Ferry services suspended due to weather.\",\n \"Satellite internet speeds degrade.\",\n \"Bottle water sales skyrocket.\"\n } }\n };\n\n private static List GetNewsForTurn(int turn, Scenario scenario, Location location, PlayerState state)\n {\n var rand = new Random();\n var news = new List();\n\n // Global scenario news (layer 1)\n var scenarioNews = ScenarioNews[scenario];\n var selectedScenario = scenarioNews.OrderBy(x => rand.Next()).Take(1 + turn / 2).ToList();\n news.AddRange(selectedScenario);\n\n // Location news (layer 2)\n var locationNews = LocationNews[location];\n var selectedLocation = locationNews.OrderBy(x => rand.Next()).Take(1).ToList();\n news.AddRange(selectedLocation);\n\n // Player consequences (layer 3) - based on stats\n if (state.Security < 30)\n news.Add($\"āš ļø Your low security has attracted unwanted attention.\");\n if (state.Food < 30)\n news.Add($\"āš ļø Your food supplies are running dangerously low.\");\n if (state.Liquidity > 80)\n news.Add($\"šŸ’° Your large cash holdings are drawing scrutiny.\");\n if (state.Influence > 80)\n news.Add($\"šŸ¤ Your influence has grown; people are seeking your advice.\");\n if (state.MoneyReceived && state.CashReceived > 0)\n news.Add($\"šŸ’µ Your {state.CashReceived:C} deposit has arrived. The world is changing.\");\n\n // If the player chose a specific action, reflect it\n if (turn == 0 && state.Food > 70)\n news.Add($\"šŸ– Your food stockpile is the envy of your neighbors.\");\n if (turn == 1 && state.Shelter > 70)\n news.Add($\"šŸ  Your shelter is fortified. You feel safe.\");\n\n return news;\n }\n\n private static void DisplayNewsFeed(List newsItems)\n {\n Console.ForegroundColor = ConsoleColor.DarkGray;\n Console.WriteLine(\"\\n--- GLOBAL EVENTS FEED ---\");\n foreach (var item in newsItems)\n {\n Console.WriteLine($\" {item}\");\n }\n Console.WriteLine(\"---------------------------\\n\");\n Console.ResetColor();\n }\n\n // --- ACTION MAPPER ---\n private static string GetLocalizedActionDescription(GameAction action, string specificLocation, Location category)\n {\n return (category, action) switch\n {\n (Location.IsolatedIsland, GameAction.AcquireTransport) => $\"a boat or fishing vessel in {specificLocation}\",\n (Location.WarZone, GameAction.AcquireTransport) => $\"an armored vehicle or escape truck in {specificLocation}\",\n (Location.LowCostRural, GameAction.AcquireTransport) => $\"a pickup truck or tractor in {specificLocation}\",\n (Location.HighCostCity, GameAction.AcquireTransport) => $\"a luxury car or electric vehicle in {specificLocation}\",\n (Location.MidCostCity, GameAction.AcquireTransport) => $\"a reliable used car or van in {specificLocation}\",\n (Location.Suburban, GameAction.AcquireTransport) => $\"an SUV or minivan in {specificLocation}\",\n\n (Location.IsolatedIsland, GameAction.SecureFood) => $\"dried fish, rice, and long-shelf-life rations in {specificLocation}\",\n (Location.WarZone, GameAction.SecureFood) => $\"aid-supply food kits and water purifiers in {specificLocation}\",\n (Location.LowCostRural, GameAction.SecureFood) => $\"grain, livestock feed, and seeds in {specificLocation}\",\n (Location.HighCostCity, GameAction.SecureFood) => $\"bulk organic produce and gourmet freeze-dried meals in {specificLocation}\",\n (Location.MidCostCity, GameAction.SecureFood) => $\"bulk supermarket dry goods and canned goods in {specificLocation}\",\n (Location.Suburban, GameAction.SecureFood) => $\"bulk groceries and deep freezer units in {specificLocation}\",\n\n (Location.IsolatedIsland, GameAction.StrengthenShelter) => $\"reinforcing the shutters and roof on your beach house in {specificLocation}\",\n (Location.WarZone, GameAction.StrengthenShelter) => $\"sandbagging and reinforcing your apartment in {specificLocation}\",\n (Location.LowCostRural, GameAction.StrengthenShelter) => $\"repairing your farmhouse and securing the perimeter in {specificLocation}\",\n (Location.HighCostCity, GameAction.StrengthenShelter) => $\"upgrading your apartment's security and basement storage in {specificLocation}\",\n (Location.MidCostCity, GameAction.StrengthenShelter) => $\"boarding windows and adding a generator to your home in {specificLocation}\",\n (Location.Suburban, GameAction.StrengthenShelter) => $\"installing storm shutters and a backup generator in {specificLocation}\",\n\n (Location.IsolatedIsland, GameAction.AcquireEnergy) => $\"solar panels, batteries, and diesel drums in {specificLocation}\",\n (Location.WarZone, GameAction.AcquireEnergy) => $\"fuel, batteries, and portable generators in {specificLocation}\",\n (Location.LowCostRural, GameAction.AcquireEnergy) => $\"a diesel generator, propane tanks, and firewood in {specificLocation}\",\n (Location.HighCostCity, GameAction.AcquireEnergy) => $\"home battery storage and backup generator in {specificLocation}\",\n (Location.MidCostCity, GameAction.AcquireEnergy) => $\"fuel drums and a portable generator in {specificLocation}\",\n (Location.Suburban, GameAction.AcquireEnergy) => $\"a large generator, gas cans, and solar panels in {specificLocation}\",\n\n (Location.WarZone, GameAction.BuildInfluence) => $\"bribing local militia leaders and city officials in {specificLocation}\",\n (Location.LowCostRural, GameAction.BuildInfluence) => $\"hosting community meetings and bartering with neighbors in {specificLocation}\",\n (Location.IsolatedIsland, GameAction.BuildInfluence) => $\"offering supplies to the local chief in exchange for protection in {specificLocation}\",\n (Location.HighCostCity, GameAction.BuildInfluence) => $\"hiring a private attorney and making connections at the country club in {specificLocation}\",\n (Location.MidCostCity, GameAction.BuildInfluence) => $\"donating to community funds and befriending local shop owners in {specificLocation}\",\n (Location.Suburban, GameAction.BuildInfluence) => $\"organizing a neighborhood watch and helping neighbors in {specificLocation}\",\n\n (_, GameAction.PreserveLiquidity) => $\"converting cash into gold, cryptocurrency, or foreign currency in {specificLocation}\",\n _ => $\"investing in essential assets in {specificLocation}\"\n };\n }\n\n private static string GetActionDescription(GameAction action)\n {\n return action switch\n {\n GameAction.AcquireTransport => \"Secure reliable transportation\",\n GameAction.SecureFood => \"Stockpile food and water\",\n GameAction.StrengthenShelter => \"Fortify your home or shelter\",\n GameAction.AcquireEnergy => \"Secure power generation and fuel\",\n GameAction.BuildInfluence => \"Build social capital and connections\",\n GameAction.PreserveLiquidity => \"Convert cash into stable assets (gold/crypto)\",\n _ => \"Take a strategic action\"\n };\n }\n\n // --- UPDATE STATS ---\n private static void UpdateStats(PlayerState state, GameAction action, Scenario scenario, Location location)\n {\n switch (action)\n {\n case GameAction.AcquireTransport:\n state.Mobility = Math.Min(100, state.Mobility + 25);\n state.Liquidity = Math.Max(0, state.Liquidity - 20);\n state.Security += 5;\n break;\n case GameAction.SecureFood:\n state.Food = Math.Min(100, state.Food + 40);\n state.Liquidity = Math.Max(0, state.Liquidity - 25);\n state.Influence += 10;\n break;\n case GameAction.StrengthenShelter:\n state.Shelter = Math.Min(100, state.Shelter + 35);\n state.Security = Math.Min(100, state.Security + 15);\n state.Liquidity = Math.Max(0, state.Liquidity - 20);\n break;\n case GameAction.AcquireEnergy:\n state.Energy = Math.Min(100, state.Energy + 30);\n state.Shelter = Math.Min(100, state.Shelter + 10);\n state.Food = Math.Min(100, state.Food + 10);\n state.Liquidity = Math.Max(0, state.Liquidity - 30);\n break;\n case GameAction.BuildInfluence:\n state.Influence = Math.Min(100, state.Influence + 30);\n state.Security = Math.Min(100, state.Security + 10);\n state.Liquidity = Math.Max(0, state.Liquidity - 15);\n break;\n case GameAction.PreserveLiquidity:\n state.Liquidity = Math.Min(100, state.Liquidity + 20);\n state.Security -= 5;\n state.Influence += 5;\n break;\n }\n\n // Scenario modifiers\n if (scenario == Scenario.ScorchedEarth)\n {\n state.Food = Math.Max(0, state.Food - 10);\n state.Security = Math.Max(0, state.Security - 10);\n }\n if (scenario == Scenario.FeudalReset)\n {\n state.Influence = Math.Min(100, state.Influence + 10);\n state.Liquidity = Math.Max(0, state.Liquidity - 10);\n }\n if (scenario == Scenario.Redistributed)\n {\n state.Liquidity = Math.Max(0, state.Liquidity - 15);\n state.Influence = Math.Min(100, state.Influence + 5);\n }\n\n // Location modifiers\n if (location == Location.WarZone)\n {\n state.Security = Math.Max(0, state.Security - 20);\n state.Food = Math.Max(0, state.Food - 10);\n }\n if (location == Location.IsolatedIsland)\n {\n state.Mobility = Math.Max(0, state.Mobility - 10);\n state.Liquidity = Math.Max(0, state.Liquidity - 10);\n }\n\n // Clamp\n state.Liquidity = Math.Clamp(state.Liquidity, 0, 100);\n state.Food = Math.Clamp(state.Food, 0, 100);\n state.Shelter = Math.Clamp(state.Shelter, 0, 100);\n state.Security = Math.Clamp(state.Security, 0, 100);\n state.Mobility = Math.Clamp(state.Mobility, 0, 100);\n state.Influence = Math.Clamp(state.Influence, 0, 100);\n state.Energy = Math.Clamp(state.Energy, 0, 100);\n }\n\n // --- PROCESS WEDNESDAY ---\n private static void ProcessWednesday(PlayerState state, Option option)\n {\n state.MoneyOption = option;\n state.MoneyReceived = true;\n\n switch (option)\n {\n case Option.A:\n state.CashReceived = 500000;\n state.Liquidity = Math.Min(100, state.Liquidity + 30);\n break;\n case Option.B:\n state.CashReceived = 1000000;\n state.Liquidity = Math.Min(100, state.Liquidity + 40);\n break;\n case Option.C:\n state.CashReceived = 2000000;\n state.Liquidity = Math.Min(100, state.Liquidity + 50);\n break;\n }\n\n // Security impact of receiving money\n if (state.CashReceived > 1000000)\n state.Security = Math.Max(0, state.Security - 10);\n }\n\n // --- MAIN GAME LOOP ---\n public static async Task StartAsync()\n {\n bool playAgain = true;\n\n while (playAgain)\n {\n Console.Clear();\n Console.ForegroundColor = ConsoleColor.Cyan;\n Console.WriteLine(\"=== JUST ANOTHER WEDNESDAY ===\");\n Console.ResetColor();\n Console.WriteLine(\"A secret message arrived at dawn: money is being printed.\");\n Console.WriteLine(\"Everyone on Earth will receive $1,000,000 on Wednesday at the same moment.\\n\");\n Console.WriteLine(\"But right now, it's early Monday morning, and you are the ONLY person who knows.\\n\");\n Console.WriteLine(\"You have two days to prepare before the world catches on.\\n\");\n\n Console.Write(\"Are you Male or Female? (M/F): \");\n var genderInput = Console.ReadLine()?.Trim().ToUpper();\n var gender = genderInput == \"F\" ? \"Female\" : \"Male\";\n Console.WriteLine();\n\n var random = new Random();\n var roles = Enum.GetValues();\n var role = roles[random.Next(roles.Length)];\n\n var locations = Enum.GetValues();\n var locationEnum = locations[random.Next(locations.Length)];\n\n var placeList = LocationNames[locationEnum];\n var specificLocation = placeList[random.Next(placeList.Count)];\n\n var scenarios = Enum.GetValues();\n var scenario = scenarios[random.Next(scenarios.Length)];\n\n var localTimeInfo = GetMondayMorningLocalInfo(specificLocation);\n var infraInfo = GetInfrastructureContext(locationEnum);\n\n Console.WriteLine(\"========================================\");\n Console.WriteLine($\"You are a {gender} {role} in {specificLocation}.\");\n Console.WriteLine($\"Scenario: {scenario} - {GetScenarioDescription(scenario)}\");\n Console.WriteLine($\"\\n{localTimeInfo}\");\n Console.WriteLine($\"\\nInfrastructure: {infraInfo}\");\n Console.WriteLine(\"========================================\\n\");\n\n // --- Initialize Player State ---\n var playerState = new PlayerState();\n if (role == Role.Landlord) playerState.Shelter += 10;\n if (role == Role.Farmer) playerState.Food += 10;\n if (role == Role.GigWorker) playerState.Mobility += 5;\n if (role == Role.Striver) playerState.Influence += 5;\n if (role == Role.Retiree) playerState.Liquidity += 5;\n if (role == Role.ShopOwner) playerState.Influence += 5;\n\n // --- Choose Money Option (with timer) ---\n Console.WriteLine(\"The money will arrive for everyone on Wednesday at the same moment worldwide.\");\n Console.WriteLine(\"But you have a choice of when YOU receive yours:\\n\");\n Console.WriteLine(\" A) $500,000 — this Monday (2 days early)\");\n Console.WriteLine(\" B) $1,000,000 — Wednesday (with everyone else)\");\n Console.WriteLine(\" C) $2,000,000 — next Monday (5 days late)\");\n Console.WriteLine();\n\n Console.WriteLine(\"ā° You have 3 minutes to decide. If you don't respond in time, you'll default to Option B.\");\n\n var option = await GetUserChoiceWithTimeout