Skip to content

Instantly share code, notes, and snippets.

@smcabrera
Created January 7, 2021 23:12
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 smcabrera/159ec602782ba5ab966324fc2b991557 to your computer and use it in GitHub Desktop.
Save smcabrera/159ec602782ba5ab966324fc2b991557 to your computer and use it in GitHub Desktop.
PC generator for mausritter
let strength = new Roll("3d6k2").roll().total;
let dexterity = new Roll("3d6k2").roll().total;
let will = new Roll("3d6k2").roll().total;
let hp = new Roll("1d6").roll().total
let pips = new Roll("1d6").roll().total
const characterName = "New Maus"
const birthsignWithDetails = game.tables.entities.find(t => t.name === "Birthsign").roll().results[0].text
const birthsign = birthsignWithDetails.match(/(.*)\:/)[1]
const coatColor = game.tables.entities.find(t => t.name === "Coat Colour").roll().results[0].text
const coatPattern = game.tables.entities.find(t => t.name === "Coat Pattern").roll().results[0].text
const physicalDetail = game.tables.entities.find(t => t.name === "Physical Detail").roll().results[0].text
const backgrounds = [
{
"background": "Test subject",
"hp": 1,
"itemA": "Spell: Magic missile",
"itemB": "Lead coat (Heavy armour)",
"pips": 1
},
{
"background": "Kitchen forager",
"hp": 1,
"itemA": "Shield & jerkin (Light armour)",
"itemB": "Cookpots",
"pips": 2
},
{
"background": "Cage dweller",
"hp": 1,
"itemA": "Spell: Be understood",
"itemB": "Bottle of milk",
"pips": 3
},
{
"background": "Hedge witch",
"hp": 1,
"itemA": "Spell: Heal",
"itemB": "Incense stick",
"pips": 4
},
{
"background": "Leatherworker",
"hp": 1,
"itemA": "Shield & jerkin (Light armour)",
"itemB": "Shears",
"pips": 5
},
{
"background": "Street tough",
"hp": 1,
"itemA": "Dagger (Light, d6)",
"itemB": "Flask of coffee",
"pips": 6
},
{
"background": "Mendicant priest",
"hp": 2,
"itemA": "Spell: Restore",
"itemB": "Holy symbol",
"pips": 1
},
{
"background": "Beetleherd",
"hp": 2,
"itemA": "Hireling: Loyal beetle",
"itemB": "Pole, 6",
"pips": 2
},
{
"background": "Ale brewer",
"hp": 2,
"itemA": "Hireling: Drunken torchbearer",
"itemB": "Small barrel of ale",
"pips": 3
},
{
"background": "Fishermouse",
"hp": 2,
"itemA": "Net",
"itemB": "Needle (Light, d6)",
"pips": 4
},
{
"background": "Blacksmith",
"hp": 2,
"itemA": "Hammer (Medium, d6/d8)",
"itemB": "Metal file",
"pips": 5
},
{
"background": "Wireworker",
"hp": 2,
"itemA": "Wire, spool",
"itemB": "Electric lantern",
"pips": 6
},
{
"background": "Woodcutter",
"hp": 3,
"itemA": "Axe (Medium, d6/d8)",
"itemB": "Twine, roll",
"pips": 1
},
{
"background": "Bat cultist",
"hp": 3,
"itemA": "Spell: Darkness",
"itemB": "Bag of bat teeth",
"pips": 2
},
{
"background": "Tin miner",
"hp": 3,
"itemA": "Pickaxe (Medium, d6/d8)",
"itemB": "Lantern",
"pips": 3
},
{
"background": "Trash collector",
"hp": 3,
"itemA": "Trashhook (Heavy, d10)",
"itemB": "Mirror",
"pips": 4
},
{
"background": "Wall rover",
"hp": 3,
"itemA": "Fishhook",
"itemB": "Thread spool",
"pips": 5
},
{
"background": "Merchant",
"hp": 3,
"itemA": "Hireling: Pack rat",
"itemB": "20p IOU from a noblemouse",
"pips": 6
},
{
"background": "Raft crew",
"hp": 4,
"itemA": "Hammer (Medium, d6/d8)",
"itemB": "Wooden spikes",
"pips": 1
},
{
"background": "Worm wrangler",
"hp": 4,
"itemA": "Pole, 6",
"itemB": "Soap",
"pips": 2
},
{
"background": "Sparrow rider",
"hp": 4,
"itemA": "Fishhook",
"itemB": "Goggles",
"pips": 3
},
{
"background": "Sewer guide",
"hp": 4,
"itemA": "Metal file",
"itemB": "Thread, spool",
"pips": 4
},
{
"background": "Prison guard",
"hp": 4,
"itemA": "Chain",
"itemB": "6\" Spear (Heavy, d10)",
"pips": 5
},
{
"background": "Fungus farmer",
"hp": 4,
"itemA": "Dried mushroom (as rations)",
"itemB": "Spore mask",
"pips": 6
},
{
"background": "Dam builder",
"hp": 5,
"itemA": "Shovel",
"itemB": "Wooden spikes",
"pips": 1
},
{
"background": "Cartographer",
"hp": 5,
"itemA": "Quill & ink",
"itemB": "Compass",
"pips": 2
},
{
"background": "Trap thief",
"hp": 5,
"itemA": "Block of cheese",
"itemB": "Glue",
"pips": 3
},
{
"background": "Vagabond",
"hp": 5,
"itemA": "Tent",
"itemB": "Treasure map, dubious",
"pips": 4
},
{
"background": "Grain farmer",
"hp": 5,
"itemA": "Spear (Heavy, d10)",
"itemB": "Whistle",
"pips": 5
},
{
"background": "Message runner",
"hp": 5,
"itemA": "Bedroll",
"itemB": "Documents, sealed",
"pips": 6
},
{
"background": "Troubadour",
"hp": 6,
"itemA": "Musical instrument",
"itemB": "Disguise kit",
"pips": 1
},
{
"background": "Gambler",
"hp": 6,
"itemA": "Set of loaded dice",
"itemB": "Mirror",
"pips": 2
},
{
"background": "Sap tapper",
"hp": 6,
"itemA": "Bucket Wooden",
"itemB": "spikes",
"pips": 3
},
{
"background": "Bee keeper",
"hp": 6,
"itemA": "Jar of honey",
"itemB": "Net",
"pips": 4
},
{
"background": "Librarian",
"hp": 6,
"itemA": "Scrap of obscure book",
"itemB": "Quill & ink",
"pips": 5
},
{"background": "Pauper noblemouse", "hp": 6, "itemA": "Felt hat", "pips": 6}
]
const background = backgrounds.filter( background => background.hp === hp && background.pips === pips)[0]
const actorData = {
"health": {
"value": hp,
"min": 0,
"max": hp
},
"hits": {
"value": 2,
"max": 2
},
"biography": "",
"notes": "",
"description": {
"background": background.background,
"birthsign": birthsign,
"coat": `${coatColor} ${coatPattern}`,
"look": physicalDetail
},
"level": {
"value": 1,
"xp": 0
},
"pips": {
"value": pips
},
"grit": {
"value": 0,
"ignored": ""
},
"stats": {
"strength": {
"value": strength,
"label": "Strength",
"max": strength
},
"dexterity": {
"value": dexterity,
"label": "Dexterity",
"max": dexterity
},
"will": {
"value": will,
"label": "Will",
"max": will
}
},
"other": {
"grit": {
"value": 0
}
}
}
Actor.create({
name: characterName,
type: "character",
img: "icons/svg/mystery-man.svg",
sort: 12000,
data: actorData,
token: {},
items: [],
flags: {}
});
@smcabrera
Copy link
Author

Just realized there's a bug here--the Pauper noblemouse is missing his second item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment