Skip to content

Instantly share code, notes, and snippets.

@safety-orange
Created January 23, 2018 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save safety-orange/2d6d28fb2f70c27afb66c4c856036e53 to your computer and use it in GitHub Desktop.
Save safety-orange/2d6d28fb2f70c27afb66c4c856036e53 to your computer and use it in GitHub Desktop.
Example of adding a Warlock Pact Boon to MPMB's CharSheets using a function
var AddWarlockPactBoon = function(boonName, boonObj) {
var warInv = ClassList.warlock.features["pact boon"];
if (!warInv || (warInv.choices.indexOf(boonName) !== -1 && warInv[boonName.toLowerCase()].source && boonObj.source && warInv[boonName.toLowerCase()].source.toSource() === boonObj.source.toSource())) return; // the exact same thing is being added again, so skip it
var useName = boonName;
var suffix = 1;
while (warInv.choices.indexOf(useName) !== -1) {
suffix += 1;
useName = boonName + " [" + suffix + "]";
};
warInv.choices.push(useName);
warInv[useName.toLowerCase()] = boonObj;
};
AddWarlockPactBoon("Pact of the Star Chain", {
name : "Pact of the Star Chain",
source : ["HB", 0],
description : "\n " + "My patron grants me an item of power which disappears when I die" + "\n " + "While it is on my person, I can cast Augury as a ritual (PHB 215)" + "\n " + "Additionally, once per short rest, I can get advantage on an Intelligence check" + "\n " + "If I lose this item I can perform a 1-hour ceremony to get a replacement",
usages : 1,
recovery : "short rest",
spellcastingBonus : {
name : "Pact of the Star Chain",
spells : ["augury"],
selection : ["augury"],
firstCol : "(R)"
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment