From 9ca7d28cca34891fccd665224445d58621d5da8f Mon Sep 17 00:00:00 2001 From: Matt Arnold Date: Thu, 4 Sep 2025 13:59:01 -0400 Subject: [PATCH] setup monorepo --- LICENSE | 30 ++++++++++++++++++++++ README.md | 3 +++ mythic.py | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 mythic.py diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7faf668 --- /dev/null +++ b/LICENSE @@ -0,0 +1,30 @@ + + +Copyright (c) 2025 Matt Arnold. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without modificatio +n, are permitted provided that the following conditions are met: + + 1. Redistribution of source code must retain the above copyright notice, t +his list of conditions and the following disclaimer. + 2. Redistribution in binary form must reproduce the above copyright notice +, this list of conditions and the following disclaimer in the documentation an +d/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contribut +ors may be used to endorse or promote products derived from this software with +out specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AN +D ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIE +D WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCL +AIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR AN +Y DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ( +INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LO +SS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON A +NY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUD +ING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWAR +E, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +YOU ACKNOWLEDGE THAT THIS SOFTWARE IS NOT DESIGNED, LICENSED OR INTENDED FOR U +SE IN THE DESIGN, CONSTRUCTION, OPERATION OR MAINTENANCE OF ANY MILITARY FACIL +ITY. diff --git a/README.md b/README.md new file mode 100644 index 0000000..ed033d5 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# misc + +My monorepo for misc stuff. diff --git a/mythic.py b/mythic.py new file mode 100644 index 0000000..526a299 --- /dev/null +++ b/mythic.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python3 + +# Code mostly written using llms no copyright is claimed +# but in case there is copyrightable matter here +# To the extent possible under law, Matt Arnold +# has waived all copyright and related or neighboring rights +# to Mythic Pie. This work is published from: United States. + + +import random + +# Define the Fate table from Mythic Game Master Emulator +fate_table = [ + "Exceptional Yes", + "Yes", + "Yes, but...", + "No, but...", + "No", + "Exceptional No" +] + +# Define the Chaos Factor table from Mythic Game Master Emulator +chaos_factor_table = { + 1: "Stable", + 2: "Low", + 3: "Moderate", + 4: "Elevated", + 5: "High", + 6: "Very High", + 7: "Extreme", + 8: "Absolute Chaos", + 9: "Total Chaos", + 10: "Impossible Chaos" +} + +# Define the Chaos Factor adjustments table from Mythic Game Master Emulator +chaos_factor_adjustments_table = { + "Stable": 0, + "Low": 1, + "Moderate": 2, + "Elevated": 3, + "High": 4, + "Very High": 5, + "Extreme": 6, + "Absolute Chaos": 7, + "Total Chaos": 8, + "Impossible Chaos": 9 +} + +# Function to roll Fate +def roll_fate(chaos_factor): + # Roll 2d10, one die for the Fate chart, one die for the Fate Modifier + fate_roll = random.randint(1, 10) + modifier_roll = random.randint(1, 10) + + # Calculate the final Fate roll + final_roll = fate_roll + modifier_roll + chaos_factor_adjustments_table[chaos_factor] - 6 + + # If the final roll is less than 1, set it to 1 + if final_roll < 1: + final_roll = 1 + + # If the final roll is greater than 6, set it to 6 + if final_roll > 6: + final_roll = 6 + + # Return the result + return fate_table[final_roll - 1] + +# Test the function with a Chaos Factor of "Moderate" +chaos_factor = "Moderate" +new_chaos_factor = random.randint(1, 10) + chaos_factor_adjustments_table[chaos_factor] +print("Chaos Factor:", chaos_factor_table[new_chaos_factor]) +print("Fate Roll:", roll_fate(chaos_factor))