Skip to content

Instantly share code, notes, and snippets.

@safety-orange
safety-orange / Weapon of Speed.js
Created April 5, 2019 14:25
Weapon of Speed (same as Scimitar of Speed, but than for any type of weapon)
var iFileName = "Weapon of Speed.js";
RequiredSheetVersion(13);
MagicItemsList["weapon of speed"] = {
name : "Weapon of Speed",
nameAlt : "of Speed",
source : [["HB", 0]],
type : "weapon (any)",
rarity : "very rare",
description : "I gain a +2 bonus to attack and damage rolls made with this magic weapon. In addition, I can make one attack with it as a bonus action on each of my turns.",
@safety-orange
safety-orange / AddWarlockPactBoon.js
Created January 23, 2018 09:00
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);