Skip to content

Instantly share code, notes, and snippets.

@Tordek
Last active August 19, 2016 07:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Tordek/592f7d0006a907a541123cb6e9b9d873 to your computer and use it in GitHub Desktop.
# Original Idea by Never Engine
# https://neverengine.wordpress.com/2016/08/17/espionage-mission-generator/
import random
TEMPLATE = """The mission is to {mission} via {method} in {locale}. Resistance will come from {enemy}, but an ally can be found in {ally}. Potential Intelligence can be uncovered via {intelligence_source}, revealing {intelligence}. Completion of this mission will result in the gain of {reward}. Possible Twists and Turns include: {twists_and_turns}."""
MISSION = [
"Turn Enemies", "Prevent Allies from Turning",
"Implicate Enemies", "Prevent Allies from being Implicated",
"Plant Intelligence", "Prevent Intelligence from being Planted",
"Gather Intelligence", "Prevent Intelligence from being Gathered",
"Silence Witnesses", "Protect Witnesses",
"Steal/Destroy Supplies", "Prevent Supplies from being Stolen/Destroyed",
"Kidnap or Kill Target", "Prevent a VIP from being Kidnapped/Killed",
"Rescue a Target", "Guard a Prisoner",
"Uncover Traitors", "Prevent an Agent's Cover being Blown",
"Cause Chaos", "Maintain Order",
"Deliver Intelligence", "Intercept Intelligence",
"Reconnaissance", "Prevent Reconnaissance"
]
METHOD = (
["Infiltration"] * 35 +
["Socializing"] * 25 +
["Investigation"] * 25 +
["Escorting a Target"] * 10 +
["a Direct Assault"] * 5
)
LOCALE = (
["a City"] * 35 +
["a Town"] * 25 +
["the Civilized Countryside"] * 20 +
["the Wilderness"] * 5 +
["a Fort"] * 5 +
["an Estate"] * 5 +
["a Ship"] * 5
)
ENEMY = (
["Regular Military"] * 35 +
["Mercenaries"] * 20 +
["a Civic Leader"] * 15 +
["Loyalist Civilians"] * 15 +
["Deserters"] * 5 +
["Rebel Military"] * 5 +
["Counter-Spies"] * 5
)
ALLY = (
["CIVILIAN"] * 60 +
["a Regular Soldier"] * 10 +
["a Rebel Soldier"] * 10 +
["a Criminal"] * 10 +
["a Mercenary"] * 10
)
INTELLIGENCE_SOURCE = (
["Interrogation"] * 25 +
["Reconnaissance"] * 20 +
["a Journal Entry"] * 15 +
["a Refugee"] * 15 +
["a Personal Letter"] * 10 +
["Sealed Orders"] * 10 +
["a Traitor"] * 5
)
INTELLIGENCE = (
["Troop Details"] * 25 +
["Enemy Orders"] * 20 +
["Supply Details"] * 20 +
["Damning Documents"] * 15 +
["Grand Strategy"] * 10 +
["a Cypher"] * 5 +
["Spy Network Info"] * 5
)
REWARD = (
["a Cache of Supplies"] * 15 +
["Rebellion Influence"] * 15 +
["Enchantments"] * 15 +
["a Magical Item"] * 15 +
["Recruits"] * 15 +
["Officer Information"] * 15 +
["a Unique Item"] * 5 +
["NPC Rumors"] * 5
)
TWISTS_AND_TURNS = (
["Ambush"] * 3 +
["Another Enemy, hostile to all, appears"] * 3 +
["Assemble and/or train a force to help"] * 3 +
["Bad intelligence"] * 3 +
["Commander KIA"] * 3 +
["Conflicting orders from two superiors"] * 3 +
["Cowardice"] * 3 +
["Enemy's cause is sympathetic"] * 3 +
["False Flag Operation"] * 3 +
["Family in danger"] * 3 +
["Greed"] * 3 +
["Local militia helps or hinders"] * 3 +
["Midway through, PCs are replaced"] * 3 +
["Mistaken Identity"] * 3 +
["No collateral damage allowed"] * 3 +
["Personal Rivalry"] * 3 +
["Red Herring"] * 3 +
["Reinforcements"] * 3 +
["Revenge"] * 3 +
["Sickness"] * 3 +
["Stranded"] * 3 +
["Supplies sabotaged"] * 3 +
["Terrible weather"] * 3 +
["The enemy can't be beaten directly"] * 3 +
["The goal has moved"] * 3 +
["Must be done without alerting anyone"] * 3 +
["PCs and ally have conflicting orders"] * 3 +
["Traitor"] * 3 +
["Traps"] * 3 +
["Two bad things, only one can be stopped"] * 3 +
["Unwanted Ally"] * 3 +
["Urgent new mission arises"] * 3
)
CIVILIAN = [
"an Accountant",
"an Acrobat",
"an Actor",
"an Animal Trainer",
"an Apothecary",
"an Arbiter",
"an Armorer",
"an Artist",
"a Baker",
"a Barber",
"a Beekeeper",
"a Beggar",
"a Blacksmith",
"a Brewer",
"a Butcher",
"a Candlemaker",
"a Carpenter",
"a Cartographer",
"a Charcoalmaker",
"a Cheesemaker",
"a Chimney Sweep",
"a City Official",
"a Clergyman",
"a Cook",
"a Courtesan",
"a Crier",
"a Dancer",
"a Diplomat",
"a Dockmaster",
"a Dockworker",
"a Doctor",
"a Driver",
"a Duelist",
"an Executioner",
"a Falconer",
"a Farmer",
"a Farmhand",
"a Fence",
"a Fisherman",
"a Forester",
"a Fortuneteller",
"a Fugitive",
"a Gardener",
"a Glassblower",
"a Gravedigger",
"a Guardsman",
"a Healer",
"a Herbalist",
"a Herder",
"a Horse Breeder",
"a Houndsman",
"a Hunter",
"a Jailor",
"a Jeweler",
"a Laborer",
"a Lawyer",
"a Leatherworker",
"a Librarian",
"a Locksmith",
"a Maid",
"a Mason",
"a Mercenary",
"a Merchant",
"a Midwife",
"a Military Officer",
"a Military Scout",
"a Miner",
"a Missionary",
"a Moneylender",
"a Musician",
"a Naturalist",
"a Painter",
"a Perfume Maker",
"a Preacher",
"a Prostitute",
"a Quack Doctor",
"a Sailor",
"a Scholar",
"a Scientist",
"a Scribe",
"a Servant",
"a Shepherd",
"a Ship Captain",
"a Shipwright",
"a Shopkeeper",
"a Smuggler",
"a Soldier",
"a Squire",
"a Stableman",
"a Tattoist",
"a Tavern Wench",
"a Tavern Keeper",
"a Tax Collector",
"a Taxidermist",
"a Teacher",
"a Torturer",
"a Treasure Hunter",
"a Vermin Catcher",
"a Weaponsmith",
"a Woodsman",
]
def generate():
mission = random.choice(MISSION)
method = random.choice(METHOD)
locale = random.choice(LOCALE)
enemy = random.choice(ENEMY)
ally = random.choice(ALLY)
if ally == "CIVILIAN":
ally = random.choice(CIVILIAN)
intelligence_source = random.choice(INTELLIGENCE_SOURCE)
intelligence = random.choice(INTELLIGENCE)
reward = random.choice(REWARD)
twists_and_turns = random.choice(TWISTS_AND_TURNS)
return TEMPLATE.format(
mission=mission,
method=method,
locale=locale,
enemy=enemy,
ally=ally,
intelligence_source=intelligence_source,
intelligence=intelligence,
reward=reward,
twists_and_turns=twists_and_turns
)
if __name__ == '__main__':
print(generate())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment