Advertisement
Guest User

Untitled

a guest
May 25th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. setup.createAdventure = (function(base) {
  2. // Tables used later
  3.       var location = ["dungeon", "wilderness", "other"];
  4.       var introduction = ["While traveling in the wilderness, the characters fall into a sinkhole that opens beneath their feet, dropping them into the adventure location.", "While traveling in the wilderness, the characters notice the entrance to the adventure location.", "While traveling on a road, the characters are attacked by monsters that flee into the nearby adventure location.", "The adventurers find a map on a dead body. In addition to the map setting up the adventure, the $adventureVillain.name wants the map.", "A mysterious magic item (or $adventureVillain.name) teleports the characters to the adventure location.", "A stranger approaches the characters in a tavern and urges them toward the adventure location.", "$town.name needs volunteers to go to the adventure location.", "An NPC the characters care about needs them to go to the adventure location.", "An NPC the characters must obey orders them to go to the adventure location.", "An NPC the characters respect asks them to go to the adventure location.", "One night, the characters all dream about entering the adventure location.", "A ghost appears and terrorizes a village. Research reveals that it can be put to rest only by entering the adventure location."];
  5.       var climax = ["The adventurers confront $adventureVillain.name and a group of minions in a bloody battle to the finish.", "The adventurers chase $adventureVillain.name while dodging obstacles designed to thwart them, leading to a final confrontation in or outside $adventureVillain.firstname's refuge", "The actions of the adventurers or $adventureVillain.firstname result in a cataclysmic even that the adventurers must escape", "The adventurers race to the site where $adventureVillain.name is bringing a master plan to its conclusion, arriving just as that plan is about to be completed", "$adventureVillain.name and two or three lieutenants perform seperate rites in a large room. The adventurers must disrupt all the rites at the same time. ", "An ally betrays the adventurers as they're about to achieve their goal (use this climax carefully, and don't overuse it).", "A portal opens to another plane of existence. Creatures on the other side spill out, forcing the adventurers to close the portal and deal with $adventureVillain.name at the same time.", "Traps, hazards, or animated objects turn against the adventurers while $adventureVillain.name attacks.", "The dungeon begins to collapse while the adventurers face $adventureVillain.name, who attempts to escape in the chaos. ", "A threat more powerful than the adventurers appears, destrops $adventureVillain.name, and then turns its attention on the characters. ", "The adventurers must choose whether to pursue the fleeing $adventureVillain.name or save an NPC they care about or a group of innocents. ", "The adventurers must discover $adventureVillain.firstname's secret weakness before they can hope to defeat $adventureVillain.himher"];
  6.       var otherGoal = ["Bring $adventureVillain.name to justice.", "Clear the name of an innocent NPC.", "Protect or hide an NPC.", "Protect an object.", "Discover the nature and origin of a strange phenomenon that might be $adventureVillain.firstname's doing.", "Find a wanted fugitive.", "Overthrow a tyrant.", "Uncover a conspiracy to overthrow a ruler.", "Negotiate peace between enemy nations or feuding families.", "Secure aid from a ruler or council.", "Help a villain find redemption.", "Parley with a villain.", "Smuggle weapons to rebel forces.", "Stop a band of smugglers.", "Gather intelligence on an enemy force.", "Win a tournament.", "Determine the villain's identity.", "Locate a stolen item.", "Make sure a wedding goes off without a hitch."];
  7.       var backdrop = ["anniversary of a monarch's reign", "anniversary of an important event", "arena event", "arrival of a caravan or ship", "arrival of a circus", "arrival of an important npc", "arrival of marching modrons", "artistic performance", "athletic event", "birth of a child", "birthday of an important npc", "civic festival", "comet appearance", "commemoration of a past tragedy", "consecration of a new temple", "coronation", "council meeting", "equinox or solstice", "execution", "fertility festival", "full moon", "funeral", "graduation of cadets or wizards", "harvest festival", "holy day", "investiture of a knight or other noble", "lunar eclipse", "midsummer festival", "midwinter festival", "migration of monsters", "monarch's ball", "new moon", "new year", "pardoning of a prisoner", "planar conjunction", "planetary alignment", "priestly investiture", "procession of ghosts", "remembrance for soldiers lost in war", "royal address or proclamation", "royal audience day", "signing of a treaty", "solar eclipse", "tournament", "trial", "violent uprising", "wedding or wedding anniversary"];
  8.       var quandary = ["Ally quandary", "Friend quandary", "Honor quandary", "Rescue quandary", "Respect quandary"];
  9.       var twist = ["The adventurers are racing against other creatures with the same or opposite goal.", "The adventurers become responsible for the safety of a noncombatant NPC.", "The adventurers are prohibited from killing $adventureVillain.name, but $adventureVillain.heshe has no compunctions about killing them.", "The adventurers have a time limit.", "The adventurers have received false or extraneous information.", "Completing an adventure goal fulfills a prophecy or prevents the fulfillment of a prophecy.", "The adventurers have two different goals, but they can complete only one.", "Completing the goal secretly helps $adventureVillain.name.", "The adventurers must cooperate with a known enemy to achieve the goal.", "The adventurers are under magical compulsion (such as a geas spell) to complete their goal"];
  10.       var sidequest = ["find a specific item rumored to be in the area.", "retrieve a stolen item in $adventureVillain.firstname's possession.", "receive information from an npc in the area.", "rescue a captive.", "discover the fate of a missing npc.", "slay a specific monster.", "discover the nature and origin of a strange phenomenon in the area.", "secure the aid of a character or creature in the area."];
  11.       var patron = ["retired adventurer", "local ruler", "military officer", "temple official", "sage", "respected elder", "deity or celestial", "mysterious fey", "old friend", "former teacher", "parent or other family member", "desperate commoner", "embattled merchant", "villain posing as a patron"];
  12.       var villain = ["beast or monstrosity with no particular agenda", "terrible aberration bent on corruption or domination", "fiend bent on corruption or destruction", "dragon bent on domination and plunder", "giant bent on plunder", "horrible undead with any agenda", "fey with a mysterious goal", "humanoid cultist", "humanoid conqueror", "humanoid seeking revenge", "humanoid schemer seeking to rule", "humanoid criminal mastermind", "humanoid raider or ravager", "humanoid under a curse", "misguided humanoid zealot"];
  13.       var villainActions = ["by doing one big event", "by a crime spree", "by growing corruption throughout the land", "by serial crimes", "step by step"];
  14.       var ally = ["skilled adventurer", "inexperienced adventurer", "enthusiastic commoner", "soldier", "priest", "sage", "revenge seeker", "raving lunatic adventurer", "celestial ally", "fey ally", "disguised monster", "villain posing as an ally"];
  15.  
  16.       var adventure = Object.assign({
  17.           location: location.random(),
  18.           introduction: introduction.random(),
  19.           climax: climax.random(),
  20.           otherGoal: otherGoal.random(),
  21.           backdrop: backdrop.random(),
  22.           quandary: quandary.random(),
  23.           twist: twist.random(),
  24.           sidequest: sidequest.random(),
  25.           patron: patron.random(),
  26.           villain: villain.random(),
  27.           villainActions: villainActions.random(),
  28.           ally: ally.random(),
  29.       }, base);
  30.   /*var adventure = Object.assign({
  31.       location: ["dungeon", "wilderness", "other"].random(),
  32.       introduction: ["While traveling in the wilderness, the characters fall into a sinkhole that opens beneath their feet, dropping them into the adventure location.", "While traveling in the wilderness, the characters notice the entrance to the adventure location.", "While traveling on a road, the characters are attacked by monsters that flee into the nearby adventure location.", "The adventurers find a map on a dead body. In addition to the map setting up the adventure, the $adventureVillain.name wants the map.", "A mysterious magic item (or $adventureVillain.name) teleports the characters to the adventure location.", "A stranger approaches the characters in a tavern and urges them toward the adventure location.", "$town.name needs volunteers to go to the adventure location.", "An NPC the characters care about needs them to go to the adventure location.", "An NPC the characters must obey orders them to go to the adventure location.", "An NPC the characters respect asks them to go to the adventure location.", "One night, the characters all dream about entering the adventure location.", "A ghost appears and terrorizes a village. Research reveals that it can be put to rest only by entering the adventure location."].random(),
  33.       climax: ["The adventurers confront $adventureVillain.name and a group of minions in a bloody battle to the finish.", "The adventurers chase $adventureVillain.name while dodging obstacles designed to thwart them, leading to a final confrontation in or outside $adventureVillain.firstname's refuge", "The actions of the adventurers or $adventureVillain.firstname result in a cataclysmic even that the adventurers must escape", "The adventurers race to the site where $adventureVillain.name is bringing a master plan to its conclusion, arriving just as that plan is about to be completed", "$adventureVillain.name and two or three lieutenants perform seperate rites in a large room. The adventurers must disrupt all the rites at the same time. ", "An ally betrays the adventurers as they're about to achieve their goal (use this climax carefully, and don't overuse it).", "A portal opens to another plane of existence. Creatures on the other side spill out, forcing the adventurers to close the portal and deal with $adventureVillain.name at the same time.", "Traps, hazards, or animated objects turn against the adventurers while $adventureVillain.name attacks.", "The dungeon begins to collapse while the adventurers face $adventureVillain.name, who attempts to escape in the chaos. ", "A threat more powerful than the adventurers appears, destrops $adventureVillain.name, and then turns its attention on the characters. ", "The adventurers must choose whether to pursue the fleeing $adventureVillain.name or save an NPC they care about or a group of innocents. ", "The adventurers must discover $adventureVillain.firstname's secret weakness before they can hope to defeat $adventureVillain.himher"].random(),
  34.       otherGoal: ["Bring $adventureVillain.name to justice.", "Clear the name of an innocent NPC.", "Protect or hide an NPC.", "Protect an object.", "Discover the nature and origin of a strange phenomenon that might be $adventureVillain.firstname's doing.", "Find a wanted fugitive.", "Overthrow a tyrant.", "Uncover a conspiracy to overthrow a ruler.", "Negotiate peace between enemy nations or feuding families.", "Secure aid from a ruler or council.", "Help a villain find redemption.", "Parley with a villain.", "Smuggle weapons to rebel forces.", "Stop a band of smugglers.", "Gather intelligence on an enemy force.", "Win a tournament.", "Determine the villain's identity.", "Locate a stolen item.", "Make sure a wedding goes off without a hitch."].random(),
  35.       backdrop: ["anniversary of a monarch's reign", "anniversary of an important event", "arena event", "arrival of a caravan or ship", "arrival of a circus", "arrival of an important npc", "arrival of marching modrons", "artistic performance", "athletic event", "birth of a child", "birthday of an important npc", "civic festival", "comet appearance", "commemoration of a past tragedy", "consecration of a new temple", "coronation", "council meeting", "equinox or solstice", "execution", "fertility festival", "full moon", "funeral", "graduation of cadets or wizards", "harvest festival", "holy day", "investiture of a knight or other noble", "lunar eclipse", "midsummer festival", "midwinter festival", "migration of monsters", "monarch's ball", "new moon", "new year", "pardoning of a prisoner", "planar conjunction", "planetary alignment", "priestly investiture", "procession of ghosts", "remembrance for soldiers lost in war", "royal address or proclamation", "royal audience day", "signing of a treaty", "solar eclipse", "tournament", "trial", "violent uprising", "wedding or wedding anniversary"].random(),
  36.       quandry: ["Ally quandary", "Friend quandary", "Honor quandary", "Rescue quandary", "Respect quandary"].random(),
  37.       twist: ["The adventurers are racing against other creatures with the same or opposite goal.", "The adventurers become responsible for the safety of a noncombatant NPC.", "The adventurers are prohibited from killing $adventureVillain.name, but $adventureVillain.heshe has no compunctions about killing them.", "The adventurers have a time limit.", "The adventurers have received false or extraneous information.", "Completing an adventure goal fulfills a prophecy or prevents the fulfillment of a prophecy.", "The adventurers have two different goals, but they can complete only one.", "Completing the goal secretly helps $adventureVillain.name.", "The adventurers must cooperate with a known enemy to achieve the goal.", "The adventurers are under magical compulsion (such as a geas spell) to complete their goal"].random(),
  38.       sidequest: ["find a specific item rumored to be in the area.", "retrieve a stolen item in $adventureVillain.firstname's possession.", "receive information from an npc in the area.", "rescue a captive.", "discover the fate of a missing npc.", "slay a specific monster.", "discover the nature and origin of a strange phenomenon in the area.", "secure the aid of a character or creature in the area."].random(),
  39.       patron: ["retired adventurer", "local ruler", "military officer", "temple official", "sage", "respected elder", "deity or celestial", "mysterious fey", "old friend", "former teacher", "parent or other family member", "desperate commoner", "embattled merchant", "villain posing as a patron"].random(),
  40.       villain: ["beast or monstrosity with no particular agenda", "terrible aberration bent on corruption or domination", "fiend bent on corruption or destruction", "dragon bent on domination and plunder", "giant bent on plunder", "horrible undead with any agenda", "fey with a mysterious goal", "humanoid cultist", "humanoid conqueror", "humanoid seeking revenge", "humanoid schemer seeking to rule", "humanoid criminal mastermind", "humanoid raider or ravager", "humanoid under a curse", "misguided humanoid zealot"].random(),
  41.       villainActions: ["by doing one big event", "by a crime spree", "by growing corruption throughout the land", "by serial crimes", "step by step"].random(),
  42.       ally: ["skilled adventurer", "inexperienced adventurer", "enthusiastic commoner", "soldier", "priest", "sage", "revenge seeker", "raving lunatic adventurer", "celestial ally", "fey ally", "disguised monster", "villain posing as an ally"].random(),
  43.     }, base);*/
  44.  
  45. switch (adventure.location) {
  46.     case "dungeon":
  47.          adventure.goal = adventure.goal || ["stop the dungeon's monstrous inhabitants from raiding the surface world.", "foil a villain's evil scheme.", "destroy a magical threat inside the dungeon.", "acquire treasure.", "find a particular item for a specific purpose.", "retrieve a stolen item hidden in the dungeon.", "find information needed for a special purpose.", "rescue a captive.", "discover the fate of a previous adventuring party.", "find an npc who disappeared in the area.", "slay a dragon or some other challenging monster.", "discover the nature and origin of a strange location or phenomenon.", "pursue fleeing foes taking refuge in the dungeon.", "escape from captivity in the dungeon.", "clear a ruin so it can be rebuilt and reoccupied.", "discover why a villain is interested in the dungeon.", "win a bet or complete a rite of passage by surviving in the dungeon for a certain amount of time.", "parley with a villain in the dungeon.", "hide from a threat outside the dungeon."].random();
  48.     break;
  49.     case "wilderness":
  50.          adventure.goal = adventure.goal || ["assess the scope of a natural or unnatural disaster.", "escort an npc to a destination.", "arrive at a destination without being seen by the villain's forces.", "stop monsters from raiding caravans and farms.", "establish trade with a distant town.", "protect a caravan traveling to a distant town.", "map a new land.", "find a place to establish a colony.", "find a natural resource.", "hunt a specific monster.", "return home from a distant place.", "obtain information from a reclusive hermit.", "find an object that was lost in the wilds.", "discover the fate of a missing group of explorers.", "pursue fleeing foes.", "assess the size of an approaching army.", "escape the reign of a tyrant.", "protect a wilderness site from attackers."].random();
  51.     break;
  52.     case "other":
  53.          adventure.goal = adventure.goal || ["seize control of a fortified location such as a fortress, town, or ship.", "defend a location from attackers.", "retrieve an object from inside a secure location in a settlement.", "retrieve an object from a caravan.", "salvage an object or goods from a lost vessel or caravan.", "break a prisoner out of a jail or prison camp.", "escape from a jail or prison camp.", "successfully travel through an obstacle course to gain recognition or reward.", "infiltrate a fortified location.", "find the source of strange occurrences in a haunted house or other location.", "interfere with the operation of a business.", "rescue a character, monster, or object from a natural or unnatural disaster."].random();
  54.  }
  55.  
  56. switch (adventure.goal) {
  57.   case "rescue a captive.":
  58.           var adventureGoalNPC = setup.createNPC();
  59.           State.variables.adventureGoalNPC = goalNPC;
  60.           Object.assign(adventure, {
  61.               goalNPC: goalNPC,
  62.               goal: "rescue " + adventureGoalNPC.name + ", a " + adventureGoalNPC.racenote + " who was captured and taken prisoner.",
  63.           });
  64.           break;
  65.   case "discover the fate of a previous adventuring party.":
  66.           var adventureGoalNPC = setup.createNPC();
  67.           State.variables.adventureGoalNPC = goalNPC;
  68.           Object.assign(adventure, {
  69.               goalNPC: goalNPC,
  70.               goal: "rescue " + adventureGoalNPC.name + ", a " + adventureGoalNPC.racenote + " who was captured and taken prisoner.",
  71.           });
  72.           break;
  73.   case "find an npc who disappeared in the area.":
  74.           var adventureGoalNPC = setup.createNPC();
  75.           State.variables.adventureGoalNPC = goalNPC;
  76.           Object.assign(adventure, {
  77.               goalNPC: goalNPC,
  78.               goal: "find " + adventureGoalNPC.name + ", a " + adventureGoalNPC.racenote + " who disappeared in the area.",
  79.           });
  80.           break;
  81.   case "escort an npc to a destination.":
  82.           var adventureGoalNPC = setup.createNPC();
  83.           State.variables.adventureGoalNPC = goalNPC;
  84.           Object.assign(adventure, {
  85.               goalNPC: goalNPC,
  86.               goal: "escort " + adventureGoalNPC.name + ", a " + adventureGoalNPC.racenote + " who needs protection on the way to another place.",
  87.           });
  88.           break;
  89.   case "discover the fate of a missing group of explorers.":
  90.           var adventureGoalNPC = setup.createNPC();
  91.           State.variables.adventureGoalNPC = goalNPC;
  92.           Object.assign(adventure, {
  93.               goalNPC: goalNPC,
  94.               goal: "discover the fate of " + adventureGoalNPC.name + " and " + adventureGoalNPC.hisher + " exploring party, who disappeared in the area.",
  95.           });
  96.           break;
  97.   case "break a prisoner out of a jail or prison camp.":
  98.           var adventureGoalNPC = setup.createNPC();
  99.           State.variables.adventureGoalNPC = goalNPC;
  100.           Object.assign(adventure, {
  101.               goalNPC: goalNPC,
  102.               goal: "rescue " + adventureGoalNPC.name + ", a " + adventureGoalNPC.racenote + " who was captured and taken prisoner.",
  103.           });
  104.           break;
  105.   case "rescue a character, monster, or object from a natural or unnatural disaster.":
  106.           var adventureGoalNPC = setup.createNPC();
  107.           State.variables.adventureGoalNPC = goalNPC;
  108.           Object.assign(adventure, {
  109.               goalNPC: goalNPC,
  110.               goal: "rescue " + adventureGoalNPC.name + ", a " + adventureGoalNPC.racenote + " who was caught in a natural disaster.",
  111.           });
  112.  
  113.  
  114. switch (adventure.villain) {
  115.   case "giant bent on plunder":
  116.           var adventureVillain = setup.createNPC({height: "huge", race: "giant"});
  117.           State.variables.adventureVillain = Villain;
  118.           Object.assign(adventure, {
  119.                 adventureVillain: adventureVillain,
  120.           });
  121.           break;
  122.   case "fey with a mysterious goal":
  123.           var adventureVillain = setup.createNPC({race: "fey"});
  124.           State.variables.adventureVillain = Villain;
  125.           Object.assign(adventure, {
  126.                 adventureVillain: adventureVillain,
  127.           });
  128.           break;
  129.   case "humanoid cultist":
  130.           var adventureVillain = setup.createNPC({dndclass: either("cleric", "sorcerer", "wizard")});
  131.           State.variables.adventureVillain = Villain;
  132.           Object.assign(adventure, {
  133.                 adventureVillain: adventureVillain,
  134.                 villain: "cultist called " + adventureVillain.name,
  135.           });
  136.           break;
  137.   case "humanoid conqueror":
  138.           var adventureVillain = setup.createNPC({dndclass: either("barbarian", "fighter", "paladin")});
  139.           State.variables.adventureVillain = Villain;
  140.           Object.assign(adventure, {
  141.                 adventureVillain: adventureVillain,
  142.                 villain: "fearsome conqueror called " + adventureVillain.name,
  143.           });
  144.           break;
  145.   case "humanoid seeking revenge":
  146.           var adventureVillain = setup.createNPC();
  147.           State.variables.adventureVillain = Villain;
  148.           Object.assign(adventure, {
  149.                 adventureVillain: adventureVillain,
  150.                 villain: adventureVillain.racenote + " called " + adventureVillain.name + " hellbent on revenge.",
  151.           });
  152.           break;
  153.   case "humanoid schemer seeking to rule":
  154.           var adventureVillain = setup.createNPC({dndclass: either("sorcerer", "rogue")});
  155.           State.variables.adventureVillain = Villain;
  156.           Object.assign(adventure, {
  157.                 adventureVillain: adventureVillain,
  158.                 villain: "conniving" + adventureVillain.racenote + "called " + adventureVillain.name + " who seeks power",
  159.           });
  160.           break;
  161.   case "humanoid criminal mastermind":
  162.           var adventureVillain = setup.createNPC({dndclass: either("sorcerer", "rogue")});
  163.           State.variables.adventureVillain = Villain;
  164.           Object.assign(adventure, {
  165.                 adventureVillain: adventureVillain,
  166.                 villain: "conniving" + adventureVillain.racenote + "called " + adventureVillain.name + " who seeks to build a criminal empire",
  167.           });
  168.           break;
  169.   case "humanoid raider or ravager":
  170.           var adventureVillain = setup.createNPC({dndclass: either("barbarian", "fighter")});
  171.           State.variables.adventureVillain = Villain;
  172.           Object.assign(adventure, {
  173.                 adventureVillain: adventureVillain,
  174.                 villain: "fearsome raider called " + adventureVillain.name,
  175.           });
  176.           break;
  177.   case "humanoid under a curse":
  178.           var adventureVillain = setup.createNPC();
  179.           State.variables.adventureVillain = Villain;
  180.           Object.assign(adventure, {
  181.                 adventureVillain: adventureVillain,
  182.                 villain: adventureVillain.racenote + " called " + adventureVillain.name + " who was placed under a curse"
  183.           });
  184.           break;
  185.   case "misguided humanoid zealot":
  186.           var adventureVillain = setup.createNPC({dndclass: "cleric"});
  187.           State.variables.adventureVillain = Villain;
  188.           Object.assign(adventure, {
  189.                 adventureVillain: adventureVillain,
  190.                 villain: "misguided" + adventureVillain.racenote + "zealot called " + adventureVillain.name,
  191.           });
  192.           break;
  193.   default:
  194.           var adventureVillain = setup.createNPC();
  195.           State.variables.adventureVillain = Villain;
  196.           Object.assign(adventure, {
  197.                 adventureVillain: adventureVillain,
  198.           });
  199.  
  200.  
  201. switch (adventure.ally) {
  202.           case "young adventurer":
  203.           var adventureAlly = setup.createNPC({age: "relatively young"});
  204.           State.variables.adventureAlly = Ally;
  205.             Object.assign(adventure, {
  206.                adventureAlly: adventureAlly,
  207.              });
  208.              break;
  209.           case "enthusiastic commoner":
  210.           var adventureAlly = setup.createNPC({dndclass: "peasant"});
  211.           State.variables.adventureAlly = Ally;
  212.             Object.assign(adventure, {
  213.                adventureAlly: adventureAlly,
  214.              });
  215.              break;
  216.           case "soldier":
  217.           var adventureAlly = setup.createNPC({dndclass: "fighter", background: "soldier"});
  218.           State.variables.adventureAlly = Ally;
  219.             Object.assign(adventure, {
  220.                adventureAlly: adventureAlly,
  221.              });
  222.              break;
  223.           case "priest":
  224.           var adventureAlly = setup.createNPC({dndclass: "cleric"});
  225.           State.variables.adventureAlly = Ally;
  226.             Object.assign(adventure, {
  227.                  adventureAlly: adventureAlly,
  228.              });
  229.              break;
  230.           case "sage":
  231.           var adventureAlly = setup.createNPC({dndclass: either("cleric", "monk", "druid", "wizard"), background: "sage"});
  232.           State.variables.adventureAlly = Ally;
  233.             Object.assign(adventure, {
  234.                  adventureAlly: adventureAlly,
  235.              });
  236.              break;
  237.           case "celestial ally":
  238.           var adventureAlly = setup.createNPC({race: "celestial being"});
  239.           State.variables.adventureAlly = Ally;
  240.             Object.assign(adventure, {
  241.                  adventureAlly: adventureAlly,
  242.              });
  243.              break;
  244.           case "fey ally":
  245.           var adventureAlly = setup.createNPC({race: "fey"});
  246.           State.variables.adventureAlly = Ally;
  247.             Object.assign(adventure, {
  248.                  adventureAlly: adventureAlly,
  249.              });
  250.              break;
  251.           default:
  252.           var adventureAlly = setup.createNPC();
  253.           State.variables.adventureAlly = Ally;
  254.             Object.assign(adventure, {
  255.                  adventureAlly: adventureAlly,
  256.              });
  257.              break;
  258.  };
  259.  
  260.  
  261. switch (adventure.patron) {
  262.     case "retired adventurer":
  263.       var adventurePatron = setup.createNPC({adventure: "retired"});
  264.         State.variables.adventurePatron = Patron;
  265.           Object.assign(adventure, {
  266.               adventurePatron: adventurePatron,
  267.          });
  268.          break;
  269.     case "local ruler":
  270.       var adventurePatron = setup.createNPC({dndclass: "lord"});
  271.       State.variables.adventurePatron = Patron;
  272.         Object.assign(adventure, {
  273.             adventurePatron: adventurePatron,
  274.          });
  275.          break;
  276.     case "military officer":
  277.       var adventurePatron = setup.createNPC({dndclass: either("fighter", "paladin"), background: "soldier"});
  278.       State.variables.adventurePatron = Patron;
  279.         Object.assign(adventure, {
  280.             adventurePatron: adventurePatron,
  281.          });
  282.          break;
  283.     case "temple official":
  284.       var adventurePatron = setup.createNPC({dndclass: either("cleric", "cleric", "cleric", "paladin"), background: "sage"});
  285.       State.variables.adventurePatron = Patron;
  286.         Object.assign(adventure, {
  287.             adventurePatron: adventurePatron,
  288.          });
  289.          break;
  290.     case "sage":
  291.       var adventurePatron = setup.createNPC({dndclass: either("cleric", "cleric", "cleric", "paladin"), background: "sage"});
  292.       State.variables.adventurePatron = Patron;
  293.         Object.assign(adventure, {
  294.             adventurePatron: adventurePatron,
  295.          });
  296.          break;
  297.     case "respected elder":
  298.       var adventurePatron = setup.createNPC({age: "venerable"});
  299.       State.variables.adventurePatron = Patron;
  300.         Object.assign(adventure, {
  301.             adventurePatron: adventurePatron,
  302.          });
  303.          break;
  304.     case "deity or celestial":
  305.       var adventurePatron = setup.createNPC({race: "celestial being"});
  306.       State.variables.adventurePatron = Patron;
  307.         Object.assign(adventure, {
  308.             adventurePatron: adventurePatron,
  309.          });
  310.          break;
  311.     case "mysterious fey":
  312.       var adventurePatron = setup.createNPC({race: "fey"});
  313.       State.variables.adventurePatron = Patron;
  314.         Object.assign(adventure, {
  315.             adventurePatron: adventurePatron,
  316.          });
  317.          break;
  318.     case "former teacher":
  319.       var adventurePatron = setup.createNPC({age: "venerable"});
  320.       State.variables.adventurePatron = Patron;
  321.         Object.assign(adventure, {
  322.             adventurePatron: adventurePatron,
  323.          });
  324.          break;
  325.     default:
  326.       var adventurePatron = setup.createNPC();
  327.       State.variables.adventurePatron = Patron;
  328.         Object.assign(adventure, {
  329.             adventurePatron: adventurePatron,
  330.          });
  331. }
  332.     return adventure;
  333. }}
  334. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement