diff --git a/Input.js b/Input.js index e2389f1..da485e1 100644 --- a/Input.js +++ b/Input.js @@ -592,6 +592,12 @@ function handleSetupEnemyStep(text) { } return text case 4: + if (!isNaN(text)) { + state.tempEnemy.hitModifier = Math.max(0, parseInt(text)) + state.setupEnemyStep++ + } + return text + case 5: if (/^\d*d\d+((\+|-)\d+)?$/gi.test(text)) { state.tempEnemy.damage = text state.setupEnemyStep++ @@ -600,7 +606,7 @@ function handleSetupEnemyStep(text) { state.setupEnemyStep++ } return text - case 5: + case 6: if (/^\d*d\d+((\+|-)\d+)?$/gi.test(text)) { state.tempEnemy.initiative = calculateRoll(text) state.setupEnemyStep++ @@ -609,7 +615,7 @@ function handleSetupEnemyStep(text) { state.setupEnemyStep++ } return text - case 6: + case 7: if (text.toLowerCase() == "s") { state.setupEnemyStep = 500 } @@ -618,7 +624,7 @@ function handleSetupEnemyStep(text) { state.setupEnemyStep++ } return text - case 7: + case 8: if (text.toLowerCase() == "s") { state.setupEnemyStep = 500 } @@ -632,79 +638,79 @@ function handleSetupEnemyStep(text) { switch (parseInt(text)) { case 1: - state.tempEnemy = createEnemy("Animated Armor", calculateRoll("6d8+6"), 18, "1d6+2", "d20") + state.tempEnemy = createEnemy("Animated Armor", calculateRoll("6d8+6"), 18, 6, "1d6+2", "d20") break case 2: - state.tempEnemy = createEnemy("Awakened Shrub", calculateRoll("2d+6"), 9, "1d4-1", "d20-1") + state.tempEnemy = createEnemy("Awakened Shrub", calculateRoll("2d+6"), 9, -3, "1d4-1", "d20-1") break case 3: - state.tempEnemy = createEnemy("Brigand", calculateRoll("5d8+10"), 11, "1d6+2", "d20") + state.tempEnemy = createEnemy("Brigand", calculateRoll("5d8+10"), 11, 6, "1d6+2", "d20") break case 4: - state.tempEnemy = createEnemy("Black Bear", calculateRoll("3d8+6"), 11, "2d4+2", "d20") + state.tempEnemy = createEnemy("Black Bear", calculateRoll("3d8+6"), 11, 6, "2d4+2", "d20") break case 5: - state.tempEnemy = createEnemy("Boar", calculateRoll("2d8+2"), 11, "1d6+1", "d20") + state.tempEnemy = createEnemy("Boar", calculateRoll("2d8+2"), 11, 4, "1d6+1", "d20") break case 6: - state.tempEnemy = createEnemy("Cockatrice", calculateRoll("6d6+6"), 11, "1d4+1", "d20+1", "Petrifying Bite1d4+1") + state.tempEnemy = createEnemy("Cockatrice", calculateRoll("6d6+6"), 11, 1, "1d4+1", "d20+1", "Petrifying Bite1d4+1") break case 7: - state.tempEnemy = createEnemy("Snake", calculateRoll("2d10+2"), 12, "1d8+2", "d20+2", "Poison Bite2d4+1") + state.tempEnemy = createEnemy("Snake", calculateRoll("2d10+2"), 12, 6, "1d8+2", "d20+2", "Poison Bite2d4+1") break case 8: - state.tempEnemy = createEnemy("Dire Wolf", calculateRoll("5d10+10"), 14, "2d6+3", "d20+2") + state.tempEnemy = createEnemy("Dire Wolf", calculateRoll("5d10+10"), 14, 8, "2d6+3", "d20+2") break case 9: - state.tempEnemy = createEnemy("Ghoul", calculateRoll("5d8"), 12, "2d6+2", "d20+2") + state.tempEnemy = createEnemy("Ghoul", calculateRoll("5d8"), 12, 3, "2d6+2", "d20+2") break case 10: - state.tempEnemy = createEnemy("Giant Centipede", calculateRoll("1d6+1"), 13, "1d4+2", "d20+2") + state.tempEnemy = createEnemy("Giant Centipede", calculateRoll("1d6+1"), 13, 1, "1d4+2", "d20+2") break case 11: - state.tempEnemy = createEnemy("Giant Rat", calculateRoll("2d6"), 12, "1d4+2", "d20+2") + state.tempEnemy = createEnemy("Giant Rat", calculateRoll("2d6"), 12, 2, "1d4+2", "d20+2") break case 12: - state.tempEnemy = createEnemy("Giant Wolf Spider", calculateRoll("2d8+2"), 13, "1d6+1", "d20+3", "Poison Bite1d6+8") + state.tempEnemy = createEnemy("Giant Wolf Spider", calculateRoll("2d8+2"), 13, 4, "1d6+1", "d20+3", "Poison Bite1d6+8") break case 13: - state.tempEnemy = createEnemy("Gnoll", calculateRoll("5d8"), 15, "1d8+2", "d20+1") + state.tempEnemy = createEnemy("Gnoll", calculateRoll("5d8"), 15, 6, "1d8+2", "d20+1") break case 14: - state.tempEnemy = createEnemy("Goblin", calculateRoll("2d6"), 15, "1d6+2", "d20+2") + state.tempEnemy = createEnemy("Goblin", calculateRoll("2d6"), 15, 3, "1d6+2", "d20+2") break case 15: - state.tempEnemy = createEnemy("Harpy", calculateRoll("7d8+7"), 11, "2d4+1", "d20+1", "Luring Song") + state.tempEnemy = createEnemy("Harpy", calculateRoll("7d8+7"), 11, 4, "2d4+1", "d20+1", "Luring Song") break case 16: - state.tempEnemy = createEnemy("Hobgoblin", calculateRoll("2d8+2"), 18, "1d8+1", "d20+1") + state.tempEnemy = createEnemy("Hobgoblin", calculateRoll("2d8+2"), 18, 4, "1d8+1", "d20+1") break case 17: - state.tempEnemy = createEnemy("Kobold", calculateRoll("2d6-2"), 12, "1d4+2", "d20+2") + state.tempEnemy = createEnemy("Kobold", calculateRoll("2d6-2"), 12, 2, "1d4+2", "d20+2") break case 18: - state.tempEnemy = createEnemy("Orc", calculateRoll("2d8+6"), 13, "1d12+3", "d20+1") + state.tempEnemy = createEnemy("Orc", calculateRoll("2d8+6"), 13, 8, "1d12+3", "d20+1") break case 19: - state.tempEnemy = createEnemy("Satyr", calculateRoll("5d8"), 15, "1d8+2", "d20+3") + state.tempEnemy = createEnemy("Satyr", calculateRoll("5d8"), 15, 4, "1d8+2", "d20+3") break case 20: - state.tempEnemy = createEnemy("Skeleton", calculateRoll("2d8+4"), 13, "1d6+2", "d20+2") + state.tempEnemy = createEnemy("Skeleton", calculateRoll("2d8+4"), 13, 5, "1d6+2", "d20+2") break case 21: - state.tempEnemy = createEnemy("Strige", calculateRoll("1d4"), 14, "1d4+3", "d20+1", "Blood Drain2d4+6") + state.tempEnemy = createEnemy("Stirge", calculateRoll("1d4"), 14, 2, "1d4+3", "d20+1", "Blood Drain2d4+6") break case 22: - state.tempEnemy = createEnemy("Warhorse", calculateRoll("3d10+3"), 11, "2d6+4", "d20+1", "Charge") + state.tempEnemy = createEnemy("Warhorse", calculateRoll("3d10+3"), 11, 10, "2d6+4", "d20+1", "Charge") break case 23: - state.tempEnemy = createEnemy("Wolf", calculateRoll("2d+2"), 13, "2d4+2", "d20+2") + state.tempEnemy = createEnemy("Wolf", calculateRoll("2d+2"), 13, 6, "2d4+2", "d20+2") break case 24: - state.tempEnemy = createEnemy("Worg", calculateRoll("4d10+4"), 13, "2d6+3", "d20+1") + state.tempEnemy = createEnemy("Worg", calculateRoll("4d10+4"), 13, 8, "2d6+3", "d20+1") break case 25: - state.tempEnemy = createEnemy("Zombie", calculateRoll("3d8+9"), 8, "1d6+1", "d20-2") + state.tempEnemy = createEnemy("Zombie", calculateRoll("3d8+9"), 8, 4, "1d6+1", "d20-2") break } } @@ -713,7 +719,7 @@ function handleSetupEnemyStep(text) { state.show = null state.setupEnemyStep = null - var enemy = createEnemy(state.tempEnemy.name, state.tempEnemy.health, state.tempEnemy.ac, state.tempEnemy.damage, state.tempEnemy.initiative) + var enemy = createEnemy(state.tempEnemy.name, state.tempEnemy.health, state.tempEnemy.ac, state.tempEnemy.hitModifier, state.tempEnemy.damage, state.tempEnemy.initiative) enemy.spells = [...state.tempEnemy.spells] var enemyMatches = state.enemies.filter(x => x.name.toLowerCase() == enemy.name.toLowerCase() || x.name.toLowerCase() == `${enemy.name.toLowerCase()} a`) @@ -851,7 +857,7 @@ function doCreate(command) { function doSetupEnemy(command) { state.setupEnemyStep = 0 - state.tempEnemy = createEnemy("enemy", 20, 10, "2d6", 10) + state.tempEnemy = createEnemy("enemy", 20, 10, 0, "2d6", 10) state.show = "setupEnemy" return " " } @@ -1972,7 +1978,16 @@ function doAddEnemy(command) { } ac = parseInt(ac) - var damage = getArgument(command, 3) + var hitModifier = getArgument(command, 3) + if (hitModifier == null) { + state.show = "none" + return "\n[Error: Not enough parameters. See #help]\n" + } else if (isNaN(hitModifier)) { + state.show = "none" + return "\n[Error: Expected a number. See #help]\n" + } + + var damage = getArgument(command, 4) if (damage == null) { state.show = "none" return "\n[Error: Not enough parameters. See #help]\n" @@ -1981,7 +1996,7 @@ function doAddEnemy(command) { return "\n[Error: Expected a number. See #help]\n" } - var initiative = getArgument(command, 4) + var initiative = getArgument(command, 5) if (initiative == null) { state.show = "none" return "\n[Error: Not enough parameters. See #help]\n" @@ -1995,13 +2010,13 @@ function doAddEnemy(command) { var spells = [] var spell = null - var index = 5 + var index = 6 do { spell = getArgument(command, index++) if (spell != null) spells.push(spell) } while (spell != null) - var enemy = createEnemy(name, health, ac, damage, initiative) + var enemy = createEnemy(name, health, ac, hitModifier, damage, initiative) enemy.spells = spells var enemyMatches = state.enemies.filter(x => x.name.toLowerCase() == enemy.name.toLowerCase() || x.name.toLowerCase() == `${enemy.name.toLowerCase()} a`) @@ -2129,27 +2144,33 @@ function doTurn(command) { var target = characters[getRandomInteger(0, characters.length - 1)] var areWord = target.name == "You" ? "are" : "is" var targetNameAdjustedCase = target.name == "You" ? "you" : toTitleCase(target.name) + var hit = calculateRoll(`1d20${activeCharacter.hitModifier > 0 ? "+" + activeCharacter.hitModifier : activeCharacter.hitModifier < 0 ? activeCharacter.hitModifier : ""}`) >= target.ac var text = `\n[It is ${possessiveName} turn.]\n` if (getRandomBoolean() || activeCharacter.spells.length == 0) { - var damage = isNaN(activeCharacter.damage) ? calculateRoll(activeCharacter.damage) : activeCharacter.damage - target.health = Math.max(target.health - damage, 0) - - text += `${activeCharacterName} attacks ${targetNameAdjustedCase} for ${damage} damage! \n` - if (target.health == 0) text += `${target.name} ${areWord} unconscious!\n` - else text += `${target.name} ${areWord} at ${target.health} health.\n` + if (hit) { + var damage = isNaN(activeCharacter.damage) ? calculateRoll(activeCharacter.damage) : activeCharacter.damage + target.health = Math.max(target.health - damage, 0) + text += `${activeCharacterName} attacks ${targetNameAdjustedCase} for ${damage} damage! \n` + + if (target.health == 0) text += `${toTitleCase(target.name)} ${areWord} unconscious!\n` + else text += `${toTitleCase(target.name)} ${areWord} at ${target.health} health.\n` + } else text += `${activeCharacterName} attacks ${targetNameAdjustedCase} but misses!\n` } else { var spell = activeCharacter.spells[getRandomInteger(0, activeCharacter.spells.length)] var diceMatches = spell.match(/(?<=^.*)\d*d\d+((\+|-)\d+)?$/gi) if (diceMatches == null) text += `${activeCharacterName} casts spell ${spell}!` else { - var damage = calculateRoll(diceMatches[0]) - var spell = spell.substring(0, spell.length - diceMatches[0].length) - target.health = Math.max(target.health - damage, 0) + if (hit) { + var damage = calculateRoll(diceMatches[0]) + var spell = spell.substring(0, spell.length - diceMatches[0].length) + target.health = Math.max(target.health - damage, 0) - text += `${activeCharacterName} casts spell ${spell} at ${targetNameAdjustedCase} for ${damage} damage!` - if (target.health == 0) text += `${target.name} ${areWord} unconscious!\n` - else text += `${target.name} ${areWord} at ${target.health} health.\n` + text += `${activeCharacterName} casts spell ${spell} at ${targetNameAdjustedCase} for ${damage} damage!` + + if (target.health == 0) text += `${toTitleCase(target.name)} ${areWord} unconscious!\n` + else text += `${toTitleCase(target.name)} ${areWord} at ${target.health} health.\n` + } else text += `${activeCharacterName} casts spell ${spell} at ${targetNameAdjustedCase} but misses!` } } return text diff --git a/Library.js b/Library.js index 9ef639d..e9cdc64 100644 --- a/Library.js +++ b/Library.js @@ -496,351 +496,356 @@ function createEncounter(listName) { case 51: encounter.text = "A team of mal-intended turkeys approach!" encounter.enemies = [ - createEnemy("Turkey Prime", calculateRoll("5d10+10"), 14, "2d6+3", "d20+2"), - createEnemy("Turkey Lackey A", calculateRoll("5d10+10"), 14, "2d6+3", "d20+2"), - createEnemy("Turkey Lackey B", calculateRoll("5d10+10"), 14, "2d6+3", "d20+2"), + createEnemy("Turkey Prime", calculateRoll("5d10+10"), 14, 0, "2d6+3", "d20+2"), + createEnemy("Turkey Lackey A", calculateRoll("5d10+10"), 14, 0, "2d6+3", "d20+2"), + createEnemy("Turkey Lackey B", calculateRoll("5d10+10"), 14, 0, "2d6+3", "d20+2"), ] break case 52: encounter.text = "A calculator is someone who calculates. One such person is here and they mean no good." encounter.enemies = [ - createEnemy("The Calculator", calculateRoll("5d8"), 13, "2d4+2", "d20-1", "Calculate Demise1d20") + createEnemy("The Calculator", calculateRoll("5d8"), 13, 0, "2d4+2", "d20-1", "Calculate Demise1d20") ] break case 53: encounter.text = "An ensorcelled fountain pen is on its way to write you out of existence!" encounter.enemies = [ - createEnemy("Fountain Pen", calculateRoll("6d10+6"), 13, "1d10+2", "d20+3", "Ink Blot2d4+6") + createEnemy("Fountain Pen", calculateRoll("6d10+6"), 13, 0, "1d10+2", "d20+3", "Ink Blot2d4+6") ] break case 54: encounter.text = "Oh no! Your childhood bully has come back and he's joined by a gang of bad dudes." encounter.enemies = [ - createEnemy("Bully", calculateRoll("5d10+10"), 12, "1d8", "d20-5"), - createEnemy("Lackey A", calculateRoll("2d8+2"), 12, "1d8", "d20+1"), - createEnemy("Lackey B", calculateRoll("2d8+2"), 12, "1d8", "d20+1"), - createEnemy("Lackey C", calculateRoll("2d8+2"), 12, "1d8", "d20+1"), + createEnemy("Bully", calculateRoll("5d10+10"), 12, 0, "1d8", "d20-5"), + createEnemy("Lackey A", calculateRoll("2d8+2"), 12, 0, "1d8", "d20+1"), + createEnemy("Lackey B", calculateRoll("2d8+2"), 12, 0, "1d8", "d20+1"), + createEnemy("Lackey C", calculateRoll("2d8+2"), 12, 0, "1d8", "d20+1"), ] break case 55: encounter.text = "It's a giant, living pimple and it's ready to burst at you." encounter.enemies = [ - createEnemy("Pimple", calculateRoll("4d8+4"), 14, "1d8+2", "d20+1", "Burst Fire3d6") + createEnemy("Pimple", calculateRoll("4d8+4"), 14, 0, "1d8+2", "d20+1", "Burst Fire3d6") ] break case 56: encounter.text = "An evil breath fills the room. You must defeat it before you can't breathe anymore." encounter.enemies = [ - createEnemy("Evil Breath", calculateRoll("4d10+4"), 14, "2d6+3", "d20+1", "Stank2d10+5") + createEnemy("Evil Breath", calculateRoll("4d10+4"), 14, 0, "2d6+3", "d20+1", "Stank2d10+5") ] break case 57: encounter.text = "A racoon suddenly appears and slaps you in the face. It's clear that it is challenging you to a duel." encounter.enemies = [ - createEnemy("Racoon", calculateRoll("3d10+3"), 13, "1d8+2", "d20+1", "Slap1d5+2") + createEnemy("Racoon", calculateRoll("3d10+3"), 13, 0, "1d8+2", "d20+1", "Slap1d5+2") ] break case 58: encounter.text = "A water bottle sprouts legs. Its unnatural gait betrays it's perverse intentions." encounter.enemies = [ - createEnemy("Water Bottle", calculateRoll("2d10+4"), 12, "1d4", "d20-1", "Drench5d3"), + createEnemy("Water Bottle", calculateRoll("2d10+4"), 12, 0, "1d4", "d20-1", "Drench5d3"), ] break case 59: encounter.text = "A sleeping guard is here. He is alerted once you start farting uncontrollably." encounter.enemies = [ - createEnemy("Guard", calculateRoll("3d10+3"), 14, "1d8+2", "d20+2", "Yawn") + createEnemy("Guard", calculateRoll("3d10+3"), 14, 0, "1d8+2", "d20+2", "Yawn") ] break case 60: encounter.text = "Your best friend from way back has come around. Sadly you have nothing in common with each other and now you're at odds." encounter.enemies = [ - createEnemy("Best Friend", calculateRoll("3d10+3"), 14, "2d4+4", "d20+4"), - createEnemy("Your Replacement", calculateRoll("5d6"), 14, "1d8+1", "d20+2"), - createEnemy("The New Bestie", calculateRoll("5d6"), 14, "1d8+1", "d20+2"), + createEnemy("Best Friend", calculateRoll("3d10+3"), 14, 0, "2d4+4", "d20+4"), + createEnemy("Your Replacement", calculateRoll("5d6"), 14, 0, "1d8+1", "d20+2"), + createEnemy("The New Bestie", calculateRoll("5d6"), 14, 0, "1d8+1", "d20+2"), ] break case 61: encounter.text = "Your shadow has become jealous of all that moving around freely thing you do. It attacks!" encounter.enemies = [ - createEnemy("Shadow", calculateRoll("4d10"), 14, "1d6+2", "d20+3") + createEnemy("Shadow", calculateRoll("4d10"), 14, 0, "1d6+2", "d20+3") ] break case 62: encounter.text = "You encounter an accident prone ninja! It clumsily brandishes its weapon but sends it clattering onto the floor before it. The ninja apologizes profusely as it scrambles back into attack position." encounter.enemies = [ - createEnemy("Ninja", calculateRoll("6d10+12"), 14, "2d6+3", "d20+2", "Shuriken3d6+3") + createEnemy("Ninja", calculateRoll("6d10+12"), 14, 0, "2d6+3", "d20+2", "Shuriken3d6+3") ] break case 63: encounter.text = "The AI Dungeon has become sentient and sends its minions forth to destroy you!" encounter.enemies = [ - createEnemy("Mixtral", calculateRoll("3d10+3"), 12, "2d6+1", "d20+2"), - createEnemy("MythoMax", calculateRoll("2d6"), 12, "1d4+2", "d20+2"), - createEnemy("Wizard", calculateRoll("2d6"), 12, "1d4+2", "d20+2"), - createEnemy("Pegasus", calculateRoll("2d6"), 12, "1d4+2", "d20+2") + createEnemy("Mixtral", calculateRoll("3d10+3"), 12, 0, "2d6+1", "d20+2"), + createEnemy("MythoMax", calculateRoll("2d6"), 12, 0, "1d4+2", "d20+2"), + createEnemy("Wizard", calculateRoll("2d6"), 12, 0, "1d4+2", "d20+2"), + createEnemy("Pegasus", calculateRoll("2d6"), 12, 0, "1d4+2", "d20+2") ] break case 64: encounter.text = "The evil wizard has conjured enemies to slay you. He did not send his best." encounter.enemies = [ - createEnemy("Enthusiastic Intern", calculateRoll("6d10+6"), 10, "1d10+2", "d20+1"), - createEnemy("Retirement Aged Fighter", calculateRoll("6d10+6"), 10, "1d10+2", "d20+1"), - createEnemy("A Common Fool", calculateRoll("6d10+6"), 10, "1d10+2", "d20+1", "Contagious Laughter") + createEnemy("Enthusiastic Intern", calculateRoll("6d10+6"), 10, 0, "1d10+2", "d20+1"), + createEnemy("Retirement Aged Fighter", calculateRoll("6d10+6"), 10, 0, "1d10+2", "d20+1"), + createEnemy("A Common Fool", calculateRoll("6d10+6"), 10, "1d10+2", 0, "d20+1", "Contagious Laughter") ] break case 65: encounter.text = "The Grammar Nazis attck in fool force!" encounter.enemies = [ - createEnemy("Grammar Nazi A", calculateRoll("2d8"), 13, "1d4+3", "d20+3", "Correct Grammar"), - createEnemy("Grammar Nazi B", calculateRoll("2d8"), 13, "1d4+3", "d20+3", "Correct Grammar"), - createEnemy("Grammar Nazi C", calculateRoll("2d8"), 13, "1d4+3", "d20+3", "Correct Grammar") + createEnemy("Grammar Nazi A", calculateRoll("2d8"), 13, 0, "1d4+3", "d20+3", "Correct Grammar"), + createEnemy("Grammar Nazi B", calculateRoll("2d8"), 13, 0, "1d4+3", "d20+3", "Correct Grammar"), + createEnemy("Grammar Nazi C", calculateRoll("2d8"), 13, 0, "1d4+3", "d20+3", "Correct Grammar") ] break case 66: encounter.text = "The mini-people have contracted their deadliest assassin to assault you. The twelve-inch pianist is on the move!" encounter.enemies = [ - createEnemy("Pianist", calculateRoll("5d10+10"), 12, "2d6+3", "d20+2", "Deadly Tune5d4") + createEnemy("Pianist", calculateRoll("5d10+10"), 12, 0, "2d6+3", "d20+2", "Deadly Tune5d4") ] break case 67: encounter.text = "Take it easy this time. A rude tortoise is slowly coming this way and it has foul plans for the party." encounter.enemies = [ - createEnemy("Rude Tortoise", calculateRoll("5d10+10"), 11, "2d6+3", "d20+2", "Shell Up") + createEnemy("Rude Tortoise", calculateRoll("5d10+10"), 11, 0, "2d6+3", "d20+2", "Shell Up") ] break case 68: encounter.text = "The ninja-mime attacks! Why won't he say anything?" encounter.enemies = [ - createEnemy("Ninja Mime", calculateRoll("2d6"), 15, "1d6+2", "d20+2", "Pantomime3d6") + createEnemy("Ninja Mime", calculateRoll("2d6"), 15, 0, "1d6+2", "d20+2", "Pantomime3d6") ] break case 69: encounter.text = "A disgusting fashion faux pas presents itself in front of the party. Defend yourself." encounter.enemies = [ - createEnemy("Ill Fitting Clothes", calculateRoll("3d8+9"), 8, "1d6+1", "d20-2"), - createEnemy("Color Clash", calculateRoll("3d8+9"), 8, "1d6+1", "d20-2"), - createEnemy("Pleated Pants", calculateRoll("3d8+9"), 8, "1d6+1", "d20-2"), - createEnemy("Black and White Stripes", calculateRoll("3d8+9"), 8, "1d6+1", "d20-2") + createEnemy("Ill Fitting Clothes", calculateRoll("3d8+9"), 8, 0, "1d6+1", "d20-2"), + createEnemy("Color Clash", calculateRoll("3d8+9"), 8, 0, "1d6+1", "d20-2"), + createEnemy("Pleated Pants", calculateRoll("3d8+9"), 8, 0, "1d6+1", "d20-2"), + createEnemy("Black and White Stripes", calculateRoll("3d8+9"), 8, 0, "1d6+1", "d20-2") ] break case 70: encounter.text = "A miserable plate of unfinished food reveals itself. \"Waste not, want not,\" it says menacingly." encounter.enemies = [ - createEnemy("Food Plate", calculateRoll("2d8+2"), 12, "1d6+1", "d20+1", "Glutton") + createEnemy("Food Plate", calculateRoll("2d8+2"), 12, 0, "1d6+1", "d20+1", "Glutton") ] break case 71: encounter.text = "A spork is a multifunctional utensil. It turns its malicious gaze towards you." encounter.enemies = [ - createEnemy("Spork", calculateRoll("2d8+2"), 16, "1d8+1", "d20+1", "Transform into Fork", "Transform into Spoon") + createEnemy("Spork", calculateRoll("2d8+2"), 16, 0, "1d8+1", "d20+1", "Transform into Fork", "Transform into Spoon") ] break case 72: encounter.text = "An angry mother-in-law nags into your general area." encounter.enemies = [ - createEnemy("Mother-In-Law", calculateRoll("6d10+18"), 13, "2d10+4", "d20+1", "Nag", "Verbal Assault3d10") + createEnemy("Mother-In-Law", calculateRoll("6d10+18"), 13, 0, "2d10+4", "d20+1", "Nag", "Verbal Assault3d10") ] break case 73: encounter.text = "A squad of trick motorcyclists wheel into your area! They're doing dastardly maneuvers in front of your face." encounter.enemies = [ - createEnemy("Motorcyclist A", calculateRoll("6d10+12"), 12, "2d6+4", "d20+2", "Trick"), - createEnemy("Motorcyclist B", calculateRoll("6d10+12"), 12, "2d6+4", "d20+2", "Trick"), - createEnemy("Motorcyclist C", calculateRoll("6d10+12"), 12, "2d6+4", "d20+2", "Trick"), - createEnemy("Ring Leader", calculateRoll("7d8+21"), 15, "1d6+2", calculateRoll("d20"), "Command") + createEnemy("Motorcyclist A", calculateRoll("6d10+12"), 12, 0, "2d6+4", "d20+2", "Trick"), + createEnemy("Motorcyclist B", calculateRoll("6d10+12"), 12, 0, "2d6+4", "d20+2", "Trick"), + createEnemy("Motorcyclist C", calculateRoll("6d10+12"), 12, 0, "2d6+4", "d20+2", "Trick"), + createEnemy("Ring Leader", calculateRoll("7d8+21"), 15, 0, "1d6+2", calculateRoll("d20"), "Command") ] break case 74: encounter.text = "Some stressed out people are here and they misinterpret your casual greeting as a taunt. Emotions are on high." encounter.enemies = [ - createEnemy("Angry Guy", calculateRoll("8d12+8"), 12, "2d8+4", "d20+2"), - createEnemy("Stressed Pal", calculateRoll("8d12+8"), 12, "2d8+4", "d20+2"), - createEnemy("The Instigator", calculateRoll("8d12+8"), 12, "2d8+4", calculateRoll("d20+10"), "Instigate"), + createEnemy("Angry Guy", calculateRoll("8d12+8"), 12, 0, "2d8+4", "d20+2"), + createEnemy("Stressed Pal", calculateRoll("8d12+8"), 12, 0, "2d8+4", "d20+2"), + createEnemy("The Instigator", calculateRoll("8d12+8"), 12, 0, "2d8+4", calculateRoll("d20+10"), "Instigate"), ] break case 75: encounter.text = "An ominous stop sign is placed here at odds with your sensibility. It directs you to cease moving at once." encounter.enemies = [ - createEnemy("Stop Sign", calculateRoll("6d8"), 14, "2d6+2", "d20+2", "Red Light", "Green Light") + createEnemy("Stop Sign", calculateRoll("6d8"), 14, 0, "2d6+2", "d20+2", "Red Light", "Green Light") ] break case 76: encounter.text = "Elliot Carver, the villain from Tomorrow Never Dies, ridicules your martial ability. You will not let this stand." encounter.enemies = [ - createEnemy("Elliot Carver", calculateRoll("6d10+12"), 12, "2d8+4", "d20+1", "Berate3d10"), - createEnemy("Goon A", calculateRoll("3d10+3"), 11, "3d10+5", "d20-1"), - createEnemy("Goon B", calculateRoll("3d10+3"), 11, "3d10+5", "d20-1"), + createEnemy("Elliot Carver", calculateRoll("6d10+12"), 12, 0, "2d8+4", "d20+1", "Berate3d10"), + createEnemy("Goon A", calculateRoll("3d10+3"), 11, 0, "3d10+5", "d20-1"), + createEnemy("Goon B", calculateRoll("3d10+3"), 11, 0, "3d10+5", "d20-1"), ] break case 77: encounter.text = "So, you accidentally punched yourself while carrying a load and picking up something off the ground at the same time. Pissed off, you decide to fight yourself." encounter.enemies = [ - createEnemy("Yourself", calculateRoll("6d8+18"), 15, "1d6+3", "d20+3") + createEnemy("Yourself", calculateRoll("6d8+18"), 15, 0, "1d6+3", "d20+3") ] break case 78: encounter.text = "A suspension of bad feelings waddles toward you. You have no choice but to take to arms." encounter.enemies = [ - createEnemy("Sad", calculateRoll("6d10+12"), 8, "2d6+2", "d20-2"), - createEnemy("Mad", calculateRoll("6d10+12"), 8, "2d6+3", "d20-2"), - createEnemy("Depressed", calculateRoll("6d10+12"), 8, "2d6+3", "d20-2"), - createEnemy("Upset", calculateRoll("6d10+12"), 8, "2d6+3", "d20-2") + createEnemy("Sad", calculateRoll("6d10+12"), 8, 0, "2d6+2", "d20-2"), + createEnemy("Mad", calculateRoll("6d10+12"), 8, 0, "2d6+3", "d20-2"), + createEnemy("Depressed", calculateRoll("6d10+12"), 8, 0, "2d6+3", "d20-2"), + createEnemy("Upset", calculateRoll("6d10+12"), 8, 0, "2d6+3", "d20-2") ] break case 79: encounter.text = "A gambler is here. Feeling cheated, he directs his misfortune at you." encounter.enemies = [ - createEnemy("A gambler", calculateRoll("7d10+21"), 13, "2d8+5", "d20+1", "Even the Odds") + createEnemy("A gambler", calculateRoll("7d10+21"), 13, 0, "2d8+5", "d20+1", "Even the Odds") ] break case 80: encounter.text = "You know how they say, \"You miss 100% of the shots you don't take?\" Well here's that shot you didn't take." encounter.enemies = [ - createEnemy("The Shot", calculateRoll("5d10+5"), 13, "1d10+2", "d20+2") + createEnemy("The Shot", calculateRoll("5d10+5"), 13, 0, "1d10+2", "d20+2") ] break case 81: encounter.text = "You know how they say, \"The path to hell is paved with good intentions?\" Here are those good intentions." encounter.enemies = [ - createEnemy("Good Intention A", calculateRoll("6d8+12"), 14, "1d6-1", "d20+2"), - createEnemy("Good Intention B", calculateRoll("6d8+12"), 14, "1d6-1", "d20+2"), - createEnemy("Good Intention C", calculateRoll("6d8+12"), 14, "1d6-1", "d20+2") + createEnemy("Good Intention A", calculateRoll("6d8+12"), 14, 0, "1d6-1", "d20+2"), + createEnemy("Good Intention B", calculateRoll("6d8+12"), 14, 0, "1d6-1", "d20+2"), + createEnemy("Good Intention C", calculateRoll("6d8+12"), 14, 0, "1d6-1", "d20+2") ] break case 82: encounter.text = "It's the AI from AI Dungeon! Man your battle stations." encounter.enemies = [ - createEnemy("AI", calculateRoll("5d10+10"), 12, "2d4+2", "d20+1", "Hallucinate") + createEnemy("AI", calculateRoll("5d10+10"), 12, 0, "2d4+2", "d20+1", "Hallucinate") ] break case 83: encounter.text = "You shouldn't have kicked that puppy when you were a kid because it's all grown up and it remembers." encounter.enemies = [ - createEnemy("Vengeance Dog", calculateRoll("6d8+18"), 14, "1d8+2", "d20+2", "Intimidating Growl") + createEnemy("Vengeance Dog", calculateRoll("6d8+18"), 14, 0, "1d8+2", "d20+2", "Intimidating Growl") ] break case 84: encounter.text = "Hah! You're screwed now! Your worst fear is actualized in front of you. It's a thing!" encounter.enemies = [ - createEnemy("Thing You Fear Most", calculateRoll("10d10+20"), 13, "2d6+4", "d20+1", "Morph") + createEnemy("Thing You Fear Most", calculateRoll("10d10+20"), 13, 0, "2d6+4", "d20+1", "Morph") ] break case 85: encounter.text = "Well, if it isn't the consequences of your actions." encounter.enemies = [ - createEnemy("Consequence A", calculateRoll("3d8+9"), 8, "1d6+1", "d20-2"), - createEnemy("Consequence B", calculateRoll("3d8+9"), 8, "1d6+1", "d20-2"), - createEnemy("Consequence C", calculateRoll("3d8+9"), 8, "1d6+1", "d20-2"), - createEnemy("Consequence D", calculateRoll("3d8+9"), 8, "1d6+1", "d20-2"), - createEnemy("Consequence E", calculateRoll("3d8+9"), 8, "1d6+1", "d20-2") + createEnemy("Consequence A", calculateRoll("3d8+9"), 8, 0, "1d6+1", "d20-2"), + createEnemy("Consequence B", calculateRoll("3d8+9"), 8, 0, "1d6+1", "d20-2"), + createEnemy("Consequence C", calculateRoll("3d8+9"), 8, 0, "1d6+1", "d20-2"), + createEnemy("Consequence D", calculateRoll("3d8+9"), 8, 0, "1d6+1", "d20-2"), + createEnemy("Consequence E", calculateRoll("3d8+9"), 8, 0, "1d6+1", "d20-2") ] break case 86: encounter.text = "A thousand armies of the Persian empire descend upon you. They will drink the rivers dry. Their arrows will blot out the sun." encounter.enemies = [ - createEnemy("One Thousand", calculateRoll("8d12+16"), 15, "4d6+4", calculateRoll("d20")), - createEnemy("Two Thousand", calculateRoll("8d12+16"), 15, "4d6+4", calculateRoll("d20")), - createEnemy("Three Thousand", calculateRoll("8d12+16"), 15, "4d6+4", calculateRoll("d20")) + createEnemy("One Thousand", calculateRoll("8d12+16"), 15, 0, "4d6+4", calculateRoll("d20")), + createEnemy("Two Thousand", calculateRoll("8d12+16"), 15, 0, "4d6+4", calculateRoll("d20")), + createEnemy("Three Thousand", calculateRoll("8d12+16"), 15, 0, "4d6+4", calculateRoll("d20")) ] break case 87: encounter.text = "The embodiment of really poor decisions and a hangover approaches you in a disturbing pattern." encounter.enemies = [ - createEnemy("Hangover", calculateRoll("8d8+16"), 15, "2d6+3", "d20-1", "Head Pain3d6"), - createEnemy("Poor Decision A", calculateRoll("8d8+16"), 15, "2d6+3", "d20-1"), - createEnemy("Poor Decision B", calculateRoll("8d8+16"), 15, "2d6+3", "d20-1") + createEnemy("Hangover", calculateRoll("8d8+16"), 15, 0, "2d6+3", "d20-1", "Head Pain3d6"), + createEnemy("Poor Decision A", calculateRoll("8d8+16"), 15, 0, "2d6+3", "d20-1"), + createEnemy("Poor Decision B", calculateRoll("8d8+16"), 15, 0, "2d6+3", "d20-1") ] break case 88: encounter.text = "An annoying sales-person is using hard-sale tactics at you. Resist!" encounter.enemies = [ - createEnemy("Sales-Person", calculateRoll("8d8+16"), 14, "1d6+4", "d20+4", "Big Sale") + createEnemy("Sales-Person", calculateRoll("8d8+16"), 14, 0, "1d6+4", "d20+4", "Big Sale") ] break case 89: encounter.text = "A group of Reddit mods are here. This is not a good sign." encounter.enemies = [ - createEnemy("Reddit Mod A", calculateRoll("2d6"), 12, "1d4+2", "d20+2"), - createEnemy("Reddit Mod B", calculateRoll("2d6"), 12, "1d4+2", "d20+2"), - createEnemy("Reddit Mod C", calculateRoll("2d6"), 12, "1d4+2", "d20+2"), - createEnemy("Reddit Mod D", calculateRoll("2d6"), 12, "1d4+2", "d20+2"), - createEnemy("Grand Reddit Mod", calculateRoll("7d10+14"), 15, "1d10+2", "d20+1") + createEnemy("Reddit Mod A", calculateRoll("2d6"), 12, 0, "1d4+2", "d20+2"), + createEnemy("Reddit Mod B", calculateRoll("2d6"), 12, 0, "1d4+2", "d20+2"), + createEnemy("Reddit Mod C", calculateRoll("2d6"), 12, 0, "1d4+2", "d20+2"), + createEnemy("Reddit Mod D", calculateRoll("2d6"), 12, 0, "1d4+2", "d20+2"), + createEnemy("Grand Reddit Mod", calculateRoll("7d10+14"), 15, 0, "1d10+2", "d20+1") ] break case 90: encounter.text = "An expert in bulshiddo beckoms toward you. You have no other choice but to engage." encounter.enemies = [ - createEnemy("Bulshiddo Expert", calculateRoll("7d10+14"), 15, "1d10+2", "d20+1", "Focus Chit") + createEnemy("Bulshiddo Expert", calculateRoll("7d10+14"), 15, 0, "1d10+2", "d20+1", "Focus Chit") ] break case 91: encounter.text = "You know how they say \"Hope springs eternal?\" Well, Hope is springing her way to your direction." encounter.enemies = [ - createEnemy("Hope", calculateRoll("7d8+14"), 15, "1d8+3", "d20+1", "Spring Eternal5d4") + createEnemy("Hope", calculateRoll("7d8+14"), 15, 0, "1d8+3", "d20+1", "Spring Eternal5d4") ] break case 92: encounter.text = "An immodest pixie points and laughs at you. She thinks you're funny looking. Battle is inevitable." encounter.enemies = [ - createEnemy("Pixie", calculateRoll("12d12+12"), 12, "2d6+3", calculateRoll("d20"), "Shameless Magic2d10") + createEnemy("Pixie", calculateRoll("12d12+12"), 12, 0, "2d6+3", calculateRoll("d20"), "Shameless Magic2d10") ] break case 93: encounter.text = "A touring squad of basketball players send a stray rebound right to your head. It's on now!" encounter.enemies = [ - createEnemy("Scottie P", calculateRoll("6d10+12"), 8, "2d6+2", "d20-2"), - createEnemy("M Jordan", calculateRoll("6d10+12"), 8, "2d6+2", "d20-2"), - createEnemy("L Bird", calculateRoll("6d10+12"), 8, "2d6+2", "d20-2"), - createEnemy("Magic J", calculateRoll("6d10+12"), 8, "2d6+2", "d20-2"), - createEnemy("C Barkley", calculateRoll("6d10+12"), 8, "2d6+2", "d20-2"), + createEnemy("Scottie P", calculateRoll("6d10+12"), 8, 0, "2d6+2", "d20-2"), + createEnemy("M Jordan", calculateRoll("6d10+12"), 8, 0, "2d6+2", "d20-2"), + createEnemy("L Bird", calculateRoll("6d10+12"), 8, 0, "2d6+2", "d20-2"), + createEnemy("Magic J", calculateRoll("6d10+12"), 8, 0, "2d6+2", "d20-2"), + createEnemy("C Barkley", calculateRoll("6d10+12"), 8, 0, "2d6+2", "d20-2"), ] break case 94: encounter.text = "What happens if you fight the void? Let's see." encounter.enemies = [ - createEnemy("The Void", calculateRoll("5d10+5"), 13, "1d10+2", "d20+2", "Darkness") + createEnemy("The Void", calculateRoll("5d10+5"), 13, 0, "1d10+2", "d20+2", "Darkness") ] break case 95: encounter.text = "Oh god, I've written so many encounters at this point. Just use your imagination." encounter.enemies = [ - createEnemy("Your Imagination", calculateRoll("6d8+12"), 14, "1d6-1", "d20+2", "Detect Thoughts") + createEnemy("Your Imagination", calculateRoll("6d8+12"), 14, 0, "1d6-1", "d20+2", "Detect Thoughts") ] break case 96: encounter.text = "A tachometer is revving up!" encounter.enemies = [ - createEnemy("Tachometer", calculateRoll("5d10+10"), 14, "2d6+3", "d20+2", "Accelerate") + createEnemy("Tachometer", calculateRoll("5d10+10"), 14, 0, "2d6+3", "d20+2", "Accelerate") ] break case 97: encounter.text = "Taco Tuesdays are back and with a serious vengeance." encounter.enemies = [ - createEnemy("Taco Tuesday A", calculateRoll("9d8+18"), 11, "1d6+2", "d20+1", "Diarrhea3d10"), - createEnemy("Taco Tuesday B", calculateRoll("9d8+18"), 11, "1d6+2", "d20+1", "Diarrhea3d10") + createEnemy("Taco Tuesday A", calculateRoll("9d8+18"), 11, 0, "1d6+2", "d20+1", "Diarrhea3d10"), + createEnemy("Taco Tuesday B", calculateRoll("9d8+18"), 11, 0, "1d6+2", "d20+1", "Diarrhea3d10") ] break case 98: encounter.text = "There's like one dude screaming here. It's not clear who he's yelling at or why. Can you please shut him up?" encounter.enemies = [ - createEnemy("Screaming Dude", calculateRoll("5d10+10"), 14, "2d6+3", "d20+2", "Scream") + createEnemy("Screaming Dude", calculateRoll("5d10+10"), 14, 0, "2d6+3", "d20+2", "Scream") ] break case 99: encounter.text = "Magneto has somehow entered your world. He blames you for this injustice." encounter.enemies = [ - createEnemy("Magneto", calculateRoll("6d8+18"), 14, "1d8+2", "d20+2", "Manipulate Metal", "Shield"), - createEnemy("The Juggernaut", calculateRoll("6d8+18"), 14, "1d8+2", "d20+2", "Charge3d10"), - createEnemy("Sabretooth", calculateRoll("6d8+18"), 14, "1d8+2", "d20+2"), + createEnemy("Magneto", calculateRoll("6d8+18"), 14, 0, "1d8+2", "d20+2", "Manipulate Metal", "Shield"), + createEnemy("The Juggernaut", calculateRoll("6d8+18"), 14, 0, "1d8+2", "d20+2", "Charge3d10"), + createEnemy("Sabretooth", calculateRoll("6d8+18"), 14, 0, "1d8+2", "d20+2"), ] break case 100: encounter.text = "A banker has come to collect on your debts." encounter.enemies = [ - createEnemy("The Banker", calculateRoll("10d10+20"), 13, "2d6+4", "d20+1", "Prisoner's Dilemma", "PMT Function3d6", "Tax Break") + createEnemy("The Banker", calculateRoll("10d10+20"), 13, 0, "2d6+4", "d20+1", "Prisoner's Dilemma", "PMT Function3d6", "Tax Break") ] break + case 101: + encounter.text = "The mouse from If You Give a Mouse a Cookie... Attack!" + encounter.enemies = [ + createEnemy("Mouse", calculateRoll("10d10+20"), 13, 0, "2d6+4", "d20+1", "Take Cookie") + ] } break case "easy": @@ -1000,327 +1005,327 @@ function createEncounter(listName) { case 50: encounter.text = "A vengeful spirit is disturbed by your presence!" encounter.enemies = [ - createEnemy("Specter", calculateRoll("5d8"), 12, "1d10", "d20+2") + createEnemy("Specter", calculateRoll("5d8"), 12, 4, "1d10", "d20+2", "Life Drain1d10") ] break case 51: encounter.text = "An awakened shrub shifts towards you. It seems like it was guarding this place." encounter.enemies = [ - createEnemy("Awakened Shrub", calculateRoll("2d+6"), 9, "1d4-1", "d20-1") + createEnemy("Awakened Shrub", calculateRoll("2d+6"), 9, -3, "1d4-1", "d20-1") ] break case 52: encounter.text = "Brigands are attacking!" encounter.enemies = [ - createEnemy("Brigand A", calculateRoll("5d8+10"), 11, "1d6+2", "d20"), - createEnemy("Brigand B", calculateRoll("5d8+10"), 11, "1d6+2", "d20"), - createEnemy("Brigand C", calculateRoll("5d8+10"), 11, "1d6+2", "d20") + createEnemy("Brigand A", calculateRoll("5d8+10"), 11, 6, "1d6+2", "d20"), + createEnemy("Brigand B", calculateRoll("5d8+10"), 11, 6, "1d6+2", "d20"), + createEnemy("Brigand C", calculateRoll("5d8+10"), 11, 6, "1d6+2", "d20") ] break case 53: encounter.text = "A wounded black bear is here. Baring its teeth, it seems to consider you as a threat." encounter.enemies = [ - createEnemy("Black Bear", calculateRoll("3d8+6"), 11, "2d4+2", "d20") + createEnemy("Black Bear", calculateRoll("3d8+6"), 11, 6, "2d4+2", "d20") ] break case 54: encounter.text = "An angry boar is charging at you!" encounter.enemies = [ - createEnemy("Boar", calculateRoll("2d8+2"), 11, "1d6+1", "d20") + createEnemy("Boar", calculateRoll("2d8+2"), 11, 4, "1d6+1", "d20") ] break case 55: encounter.text = "Two cockatrices have somehow flanked you on both sides. Prepare for battle!" encounter.enemies = [ - createEnemy("Cockatrice A", calculateRoll("6d6+6"), 11, "1d4+1", "d20+1", "Petrifying Bite1d4+1"), - createEnemy("Cockatrice B", calculateRoll("6d6+6"), 11, "1d4+1", "d20+1", "Petrifying Bite1d4+1") + createEnemy("Cockatrice A", calculateRoll("6d6+6"), 11, 1, "1d4+1", "d20+1", "Petrifying Bite1d4+1"), + createEnemy("Cockatrice B", calculateRoll("6d6+6"), 11, 1, "1d4+1", "d20+1", "Petrifying Bite1d4+1") ] break case 56: encounter.text = "You've fallen into a pit of snakes. A group of them slither up to you, winding up to strike." encounter.enemies = [ - createEnemy("Snake", calculateRoll("2d10+2"), 12, "1d8+2", "d20+2", "Poison Bite2d4+1") + createEnemy("Snake", calculateRoll("2d10+2"), 12, 6, "1d8+2", "d20+2", "Poison Bite2d4+1") ] break case 57: encounter.text = "A dire wolf has caught your scent. It's going to make its move!" encounter.enemies = [ - createEnemy("Dire Wolf", calculateRoll("5d10+10"), 14, "2d6+3", "d20+2") + createEnemy("Dire Wolf", calculateRoll("5d10+10"), 14, 8, "2d6+3", "d20+2") ] break case 58: encounter.text = "The remarkable pattern on the skin of this giant frog is a clear indication that it's poisonous. Watch out!" encounter.enemies = [ - createEnemy("Giant Frog", calculateRoll("4d8"), 11, "1d6+1", "d20+1", "Poison2d4+1") + createEnemy("Giant Frog", calculateRoll("4d8"), 11, 4, "1d6+1", "d20+1", "Poison2d4+1") ] break case 59: encounter.text = "A very intricate gargoyle statue has been placed here as a centerpiece in an altar. Without warning, it turns its head toward you and its lips turn upwards into an evil grin." encounter.enemies = [ - createEnemy("Gargoyle", calculateRoll("7d8+21"), 15, "1d6+2", "d20") + createEnemy("Gargoyle", calculateRoll("7d8+21"), 15, 6, "1d6+2", "d20") ] break case 60: encounter.text = "You have disturbed an ancient burial ground! Ghouls have risen from their eternal sleep." encounter.enemies = [ - createEnemy("Ghoul A", calculateRoll("5d8"), 12, "2d6+2", "d20+2"), - createEnemy("Ghoul B", calculateRoll("5d8"), 12, "2d6+2", "d20+2"), - createEnemy("Ghoul C", calculateRoll("5d8"), 12, "2d6+2", "d20+2"), - createEnemy("Ghoul D", calculateRoll("5d8"), 12, "2d6+2", "d20+2") + createEnemy("Ghoul A", calculateRoll("5d8"), 12, 3, "2d6+2", "d20+2"), + createEnemy("Ghoul B", calculateRoll("5d8"), 12, 3, "2d6+2", "d20+2"), + createEnemy("Ghoul C", calculateRoll("5d8"), 12, 3, "2d6+2", "d20+2"), + createEnemy("Ghoul D", calculateRoll("5d8"), 12, 3, "2d6+2", "d20+2") ] break case 61: encounter.text = "A giant badger has claimed this plot of land and he'll be damned if he lets the likes of you tread all over it." encounter.enemies = [ - createEnemy("Giant Badger", calculateRoll("2d8+4"), 10, "1d6+1", "d20") + createEnemy("Giant Badger", calculateRoll("2d8+4"), 10, 4, "1d6+1", "d20") ] break case 62: encounter.text = "A giant centipede crawls into view. Its terrifying shriek makes your skin crawl. Prepare yourself!" encounter.enemies = [ - createEnemy("Giant Centipede", calculateRoll("1d6+1"), 13, "1d4+2", "d20+2") + createEnemy("Giant Centipede", calculateRoll("1d6+1"), 13, 1, "1d4+2", "d20+2") ] break case 63: encounter.text = "A feral pack of hyenas have nested here. They smell your blood..." encounter.enemies = [ - createEnemy("Hyena A", calculateRoll("1d8+1"), 11, "1d6", "d20+1"), - createEnemy("Hyena B", calculateRoll("1d8+1"), 11, "1d6", "d20+1"), - createEnemy("Giant Hyena", calculateRoll("6d10+12"), 12, "2d6+3", "d20+2") + createEnemy("Hyena A", calculateRoll("1d8+1"), 11, 2, "1d6", "d20+1"), + createEnemy("Hyena B", calculateRoll("1d8+1"), 11, 2, "1d6", "d20+1"), + createEnemy("Giant Hyena", calculateRoll("6d10+12"), 12, 5, "2d6+3", "d20+2") ] break case 64: encounter.text = "A swarm of rats are sweeping across the ground and heading toward you!" encounter.enemies = [ - createEnemy("Swarm of Rats", calculateRoll("7d8-7"), 10, "2d6", "d20") + createEnemy("Swarm of Rats", calculateRoll("7d8-7"), 10, 1, "2d6", "d20") ] break case 65: encounter.text = "A group of gnolls have coalesced here. Your arrival has activated their senses." encounter.enemies = [ - createEnemy("Gnoll A", calculateRoll("5d8"), 15, "1d8+2", "d20+1"), - createEnemy("Gnoll B", calculateRoll("5d8"), 15, "1d8+2", "d20+1"), - createEnemy("Gnoll C", calculateRoll("5d8"), 15, "1d8+2", "d20+1") + createEnemy("Gnoll A", calculateRoll("5d8"), 15, 6, "1d8+2", "d20+1"), + createEnemy("Gnoll B", calculateRoll("5d8"), 15, 6, "1d8+2", "d20+1"), + createEnemy("Gnoll C", calculateRoll("5d8"), 15, 6, "1d8+2", "d20+1") ] break case 66: encounter.text = "The group of goblins are as surprised to see you as you are to see them. Get ready!" encounter.enemies = [ - createEnemy("Goblin A", calculateRoll("2d6"), 15, "1d6+2", "d20+2"), - createEnemy("Goblin B", calculateRoll("2d6"), 15, "1d6+2", "d20+2"), - createEnemy("Goblin C", calculateRoll("2d6"), 15, "1d6+2", "d20+2"), - createEnemy("Goblin D", calculateRoll("2d6"), 15, "1d6+2", "d20+2") + createEnemy("Goblin A", calculateRoll("2d6"), 15, 3, "1d6+2", "d20+2"), + createEnemy("Goblin B", calculateRoll("2d6"), 15, 3, "1d6+2", "d20+2"), + createEnemy("Goblin C", calculateRoll("2d6"), 15, 3, "1d6+2", "d20+2"), + createEnemy("Goblin D", calculateRoll("2d6"), 15, 3, "1d6+2", "d20+2") ] break case 67: encounter.text = "A sweet lullaby carries through the air. You are enchanted by its melody. But wait! It's a harpy's luring song. Resist!" encounter.enemies = [ - createEnemy("Harpy", calculateRoll("7d8+7"), 11, "2d4+1", "d20+1", "Luring Song") + createEnemy("Harpy", calculateRoll("7d8+7"), 11, 4, "2d4+1", "d20+1", "Luring Song") ] break case 68: encounter.text = "You spot a hobgoblin crouched over his battle axe. As he sharpens its blade, he menaces at you, \"You shouldn't have come here, meat.\"" encounter.enemies = [ - createEnemy("Hobgoblin", calculateRoll("2d8+2"), 18, "1d8+1", "d20+1") + createEnemy("Hobgoblin", calculateRoll("2d8+2"), 18, 4, "1d8+1", "d20+1") ] break case 69: encounter.text = "A kobold sticks his head out from barrel. Aware of your presence, it signals to the rest of the pack." encounter.enemies = [ - createEnemy("Kobold A", calculateRoll("2d6-2"), 12, "1d4+2", "d20+2"), - createEnemy("Kobold B", calculateRoll("2d6-2"), 12, "1d4+2", "d20+2"), - createEnemy("Kobold C", calculateRoll("2d6-2"), 12, "1d4+2", "d20+2"), - createEnemy("Kobold D", calculateRoll("2d6-2"), 12, "1d4+2", "d20+2") + createEnemy("Kobold A", calculateRoll("2d6-2"), 12, 2, "1d4+2", "d20+2"), + createEnemy("Kobold B", calculateRoll("2d6-2"), 12, 2, "1d4+2", "d20+2"), + createEnemy("Kobold C", calculateRoll("2d6-2"), 12, 2, "1d4+2", "d20+2"), + createEnemy("Kobold D", calculateRoll("2d6-2"), 12, 2, "1d4+2", "d20+2") ] break case 70: encounter.text = "A magically entranced Satyr has come into view. Some dark force is compelling it to attack you!" encounter.enemies = [ - createEnemy("Satyr", calculateRoll("5d8"), 15, "1d8+2", "d20+3") + createEnemy("Satyr", calculateRoll("5d8"), 15, 4, "1d8+2", "d20+3") ] break case 71: encounter.text = "A skeleton archer has the drop on you! It looses a bolt that very narrowly misses its mark. Get ready for a fight!" encounter.enemies = [ - createEnemy("Skeleton", calculateRoll("2d8+4"), 13, "1d6+2", "d20+2") + createEnemy("Skeleton", calculateRoll("2d8+4"), 13, 5, "1d6+2", "d20+2") ] break case 72: encounter.text = "A group of stirge descend on you. Their stink should have given them away." encounter.enemies = [ - createEnemy("Strige A", calculateRoll("1d4"), 14, "1d4+3", "d20+1", "Blood Drain2d4+6"), - createEnemy("Strige B", calculateRoll("1d4"), 14, "1d4+3", "d20+1", "Blood Drain2d4+6"), - createEnemy("Strige C", calculateRoll("1d4"), 14, "1d4+3", "d20+1", "Blood Drain2d4+6") + createEnemy("Strige A", calculateRoll("1d4"), 14, 2, "1d4+3", "d20+1", "Blood Drain2d4+6"), + createEnemy("Strige B", calculateRoll("1d4"), 14, 2, "1d4+3", "d20+1", "Blood Drain2d4+6"), + createEnemy("Strige C", calculateRoll("1d4"), 14, 2, "1d4+3", "d20+1", "Blood Drain2d4+6") ] break case 73: encounter.text = "You have never seen a Worg this large before. Its snarling teeth glint in the light." encounter.enemies = [ - createEnemy("Worg", calculateRoll("4d10+4"), 13, "2d6+3", "d20+1") + createEnemy("Worg", calculateRoll("4d10+4"), 13, 8, "2d6+3", "d20+1") ] break case 74: encounter.text = "Everywhere you look... Zombies! You are surrounded as they shuffle towards you, drawn by the heat of your flesh." encounter.enemies = [ - createEnemy("Zombie A", calculateRoll("3d8+9"), 8, "1d6+1", "d20-2"), - createEnemy("Zombie B", calculateRoll("3d8+9"), 8, "1d6+1", "d20-2"), - createEnemy("Zombie C", calculateRoll("3d8+9"), 8, "1d6+1", "d20-2"), - createEnemy("Zombie D", calculateRoll("3d8+9"), 8, "1d6+1", "d20-2"), - createEnemy("Zombie E", calculateRoll("3d8+9"), 8, "1d6+1", "d20-2") + createEnemy("Zombie A", calculateRoll("3d8+9"), 8, 4, "1d6+1", "d20-2"), + createEnemy("Zombie B", calculateRoll("3d8+9"), 8, 4, "1d6+1", "d20-2"), + createEnemy("Zombie C", calculateRoll("3d8+9"), 8, 4, "1d6+1", "d20-2"), + createEnemy("Zombie D", calculateRoll("3d8+9"), 8, 4, "1d6+1", "d20-2"), + createEnemy("Zombie E", calculateRoll("3d8+9"), 8, 4, "1d6+1", "d20-2") ] break case 75: encounter.text = "Your arrival has interrupted a dark acolyte's ritual. His eyes go steely as he plans his retribution." encounter.enemies = [ - createEnemy("Dark Acolyte", calculateRoll("2d8"), 10, "1d4", "d20", "Sacred Flame2d6", "Bless") + createEnemy("Dark Acolyte", calculateRoll("2d8"), 10, 2, "1d4", "d20", "Sacred Flame2d6", "Bless") ] break case 76: encounter.text = "A bandit duo eyes your gear. A combination of greed and desperation drive them to attack you." encounter.enemies = [ - createEnemy("Bandit A", calculateRoll("5d8+10"), 11, "1d6+2", "d20"), - createEnemy("Bandit B", calculateRoll("5d8+10"), 11, "1d6+2", "d20") + createEnemy("Bandit A", calculateRoll("5d8+10"), 11, 6, "1d6+2", "d20"), + createEnemy("Bandit B", calculateRoll("5d8+10"), 11, 6, "1d6+2", "d20") ] break case 77: encounter.text = "A crowd of cultists walk into view. Their aim is clear: to sacrifice you as an offering to their god. Attack before you are torn limb from limb!" encounter.enemies = [ - createEnemy("name", calculateRoll("health"), 8, "damage", "d20+") + createEnemy("name", calculateRoll("health"), 8, 3, "damage", "d20+") ] break case 78: encounter.text = "A gnoll has strayed from its herd. You take the opportunity to attack before it alerts the others." encounter.enemies = [ - createEnemy("name", calculateRoll("health"), 8, "damage", "d20+") + createEnemy("name", calculateRoll("health"), 8, 6, "damage", "d20+") ] break case 79: encounter.text = "A majestic white wolf has been tracking you for some time. It can no longer ignore its hunger pangs and begins racing at you." encounter.enemies = [ - createEnemy("name", calculateRoll("health"), 8, "damage", "d20+") + createEnemy("White Wolf", calculateRoll("health"), 8, 6, "damage", "d20+") ] break case 80: encounter.text = "An orc looks up from his fire. You're spotted!" encounter.enemies = [ - createEnemy("name", calculateRoll("health"), 8, "damage", "d20+") + createEnemy("Orc", calculateRoll("health"), 8, 8, "damage", "d20+") ] break case 81: encounter.text = "A wyrmling is spotted circling around you. It's coming in for an attack!" encounter.enemies = [ - createEnemy("name", calculateRoll("health"), 8, "damage", "d20+") + createEnemy("Wyrmling", calculateRoll("health"), 8, 8, "damage", "d20+") ] break case 82: encounter.text = "A pack of death dogs are directly ahead. There is no avoiding their dark gaze. Prepare for combat!" encounter.enemies = [ - createEnemy("Death Dog A", calculateRoll("6d8+12"), 12, "1d6+2", "d20+2", "Diseased Bite2d6+2"), - createEnemy("Death Dog B", calculateRoll("6d8+12"), 12, "1d6+2", "d20+2", "Diseased Bite2d6+2"), - createEnemy("Death Dog C", calculateRoll("6d8+12"), 12, "1d6+2", "d20+2", "Diseased Bite2d6+2"), - createEnemy("Death Dog D", calculateRoll("6d8+12"), 12, "1d6+2", "d20+2", "Diseased Bite2d6+2") + createEnemy("Death Dog A", calculateRoll("6d8+12"), 12, 6, "1d6+2", "d20+2", "Diseased Bite2d6+2"), + createEnemy("Death Dog B", calculateRoll("6d8+12"), 12, 6, "1d6+2", "d20+2", "Diseased Bite2d6+2"), + createEnemy("Death Dog C", calculateRoll("6d8+12"), 12, 6, "1d6+2", "d20+2", "Diseased Bite2d6+2"), + createEnemy("Death Dog D", calculateRoll("6d8+12"), 12, 6, "1d6+2", "d20+2", "Diseased Bite2d6+2") ] break case 83: encounter.text = "The deep gnome mercenary looks at you with a sinister scowl. \"I don't very much like you.\" He brandishes a sword and prepares to attack you." encounter.enemies = [ - createEnemy("Deep Gnome Merc", calculateRoll("3d6+6"), 15, "1d8+2", "d20+2", "Poison Dart1d4+2", "Stone Camoflage") + createEnemy("Deep Gnome Merc", calculateRoll("3d6+6"), 15, 6, "1d8+2", "d20+2", "Poison Dart1d4+2", "Stone Camoflage") ] break case 84: encounter.text = "That stink! What is it? A dretch raises its head, clearly alarmed by your presence. It's going to rush you!" encounter.enemies = [ - createEnemy("Dretch", calculateRoll("4d6+4"), 11, "2d4", "d20") + createEnemy("Dretch", calculateRoll("4d6+4"), 11, 2, "2d4", "d20") ] break case 85: encounter.text = "A drow raider! Take cover!" encounter.enemies = [ - createEnemy("Drow Raider", calculateRoll("3d8"), 15, "1d6+2", "d20+2") + createEnemy("Drow Raider", calculateRoll("3d8"), 15, 4, "1d6+2", "d20+2") ] break case 86: encounter.text = "It's not your imagination: a gray ooze is seeping through the cracks. It coalesces into a hideous aberration before you." encounter.enemies = [ - createEnemy("Gray Ooze", calculateRoll("3d8+9"), 8, "1d6+1", "d20-2", "Corrode Metal") + createEnemy("Gray Ooze", calculateRoll("3d8+9"), 8, 4, "1d6+1", "d20-2", "Corrode Metal") ] break case 87: encounter.text = "You catch a Grimlock tearing meat from the leg of some hapless victim. It drops it immediately once it spots you." encounter.enemies = [ - createEnemy("Grimlock", calculateRoll("2d8+2"), 11, "1d4+3", "d20+1") + createEnemy("Grimlock", calculateRoll("2d8+2"), 11, 8, "1d4+3", "d20+1") ] break case 88: encounter.text = "Who summoned these homunculi? They don't look friendly. Suddenly, a loud shriek!" encounter.enemies = [ - createEnemy("Homunculus A", calculateRoll("2d4"), 13, "1d10", "d20+2", "Poison Bite1d10"), - createEnemy("Homunculus B", calculateRoll("2d4"), 13, "1d10", "d20+2", "Poison Bite1d10"), - createEnemy("Homunculus C", calculateRoll("2d4"), 13, "1d10", "d20+2", "Poison Bite1d10"), - createEnemy("Homunculus D", calculateRoll("2d4"), 13, "1d10", "d20+2", "Poison Bite1d10") + createEnemy("Homunculus A", calculateRoll("2d4"), 13, 1, "1d10", "d20+2", "Poison Bite1d10"), + createEnemy("Homunculus B", calculateRoll("2d4"), 13, 1, "1d10", "d20+2", "Poison Bite1d10"), + createEnemy("Homunculus C", calculateRoll("2d4"), 13, 1, "1d10", "d20+2", "Poison Bite1d10"), + createEnemy("Homunculus D", calculateRoll("2d4"), 13, 1, "1d10", "d20+2", "Poison Bite1d10") ] break case 89: encounter.text = "A group of lemures block the way. Their hideous forms disgust you." encounter.enemies = [ - createEnemy("Lemure", calculateRoll("3d8"), 7, "1d4", "d20-3") + createEnemy("Lemure", calculateRoll("3d8"), 7, 3, "1d4", "d20-3") ] break case 90: encounter.text = "The sulfur stink reaches your nose first, then the sight of them: a group of Magmin are on approach." encounter.enemies = [ - createEnemy("Magmin A", calculateRoll("2d6+2"), 14, "2d6", "d20+2", "Fire Touch3d6"), - createEnemy("Magmin B", calculateRoll("2d6+2"), 14, "2d6", "d20+2", "Fire Touch3d6"), - createEnemy("Magmin C", calculateRoll("2d6+2"), 14, "2d6", "d20+2", "Fire Touch3d6") + createEnemy("Magmin A", calculateRoll("2d6+2"), 14, 2, "2d6", "d20+2", "Fire Touch3d6"), + createEnemy("Magmin B", calculateRoll("2d6+2"), 14, 2, "2d6", "d20+2", "Fire Touch3d6"), + createEnemy("Magmin C", calculateRoll("2d6+2"), 14, 2, "2d6", "d20+2", "Fire Touch3d6") ] break case 91: encounter.text = "Out of the corner of your eye you spot a dark figure moving. \"Quasits!\" You prepare for the ambush." encounter.enemies = [ - createEnemy("Quasit A", calculateRoll("3d4"), 13, "1d4+3", "d20+", "Invisibility", "Scare"), - createEnemy("Quasit B", calculateRoll("3d4"), 13, "1d4+3", "d20+", "Invisibility", "Scare"), - createEnemy("Quasit C", calculateRoll("3d4"), 13, "1d4+3", "d20+", "Invisibility", "Scare"), - createEnemy("Quasit D", calculateRoll("3d4"), 13, "1d4+3", "d20+", "Invisibility", "Scare"), - createEnemy("Quasit E", calculateRoll("3d4"), 13, "1d4+3", "d20+", "Invisibility", "Scare") + createEnemy("Quasit A", calculateRoll("3d4"), 13, 2, "1d4+3", "d20+", "Invisibility", "Scare"), + createEnemy("Quasit B", calculateRoll("3d4"), 13, 2, "1d4+3", "d20+", "Invisibility", "Scare"), + createEnemy("Quasit C", calculateRoll("3d4"), 13, 2, "1d4+3", "d20+", "Invisibility", "Scare"), + createEnemy("Quasit D", calculateRoll("3d4"), 13, 2, "1d4+3", "d20+", "Invisibility", "Scare"), + createEnemy("Quasit E", calculateRoll("3d4"), 13, 2, "1d4+3", "d20+", "Invisibility", "Scare") ] break case 92: encounter.text = "A rust monster! A killing blow will corrode any common weapons." encounter.enemies = [ - createEnemy("Rust Monster", calculateRoll("5d8+5"), 14, "1d8+1", "d20+1") + createEnemy("Rust Monster", calculateRoll("5d8+5"), 14, 4, "1d8+1", "d20+1") ] break case 93: encounter.text = "An undead specter reveals itself. It's malevolence can be felt in your bones." encounter.enemies = [ - createEnemy("Specter", calculateRoll("5d8"), 12, "3d6", "d20+2", "Life Drain3d6", "Incorporeal Movement") + createEnemy("Specter", calculateRoll("5d8"), 12, 4, "3d6", "d20+2", "Life Drain3d6", "Incorporeal Movement") ] break case 94: encounter.text = "Enchanted weasels are commanded to attack you. Oh god, they're everywhere!" encounter.enemies = [ - createEnemy("Weasel A", calculateRoll("1d4-1"), 13, "1", "d20+3"), - createEnemy("Weasel B", calculateRoll("1d4-1"), 13, "1", "d20+3"), - createEnemy("Weasel C", calculateRoll("1d4-1"), 13, "1", "d20+3"), - createEnemy("Weasel D", calculateRoll("1d4-1"), 13, "1", "d20+3"), - createEnemy("Weasel E", calculateRoll("1d4-1"), 13, "1", "d20+3"), - createEnemy("Weasel F", calculateRoll("1d4-1"), 13, "1", "d20+3"), - createEnemy("Weasel G", calculateRoll("1d4-1"), 13, "1", "d20+3"), - createEnemy("Weasel H", calculateRoll("1d4-1"), 13, "1", "d20+3"), - createEnemy("Weasel I", calculateRoll("1d4-1"), 13, "1", "d20+3"), - createEnemy("Weasel J", calculateRoll("1d4-1"), 13, "1", "d20+3") + createEnemy("Weasel A", calculateRoll("1d4-1"), 13, 1, "1", "d20+3"), + createEnemy("Weasel B", calculateRoll("1d4-1"), 13, 1, "1", "d20+3"), + createEnemy("Weasel C", calculateRoll("1d4-1"), 13, 1, "1", "d20+3"), + createEnemy("Weasel D", calculateRoll("1d4-1"), 13, 1, "1", "d20+3"), + createEnemy("Weasel E", calculateRoll("1d4-1"), 13, 1, "1", "d20+3"), + createEnemy("Weasel F", calculateRoll("1d4-1"), 13, 1, "1", "d20+3"), + createEnemy("Weasel G", calculateRoll("1d4-1"), 13, 1, "1", "d20+3"), + createEnemy("Weasel H", calculateRoll("1d4-1"), 13, 1, "1", "d20+3"), + createEnemy("Weasel I", calculateRoll("1d4-1"), 13, 1, "1", "d20+3"), + createEnemy("Weasel J", calculateRoll("1d4-1"), 13, 1, "1", "d20+3") ] break case 95: encounter.text = "An awakened tree lumbers toward you. Apparently, this is sacred ground that you tarnish with your presence." encounter.enemies = [ - createEnemy("Awakened Tree", calculateRoll("7d12+14"), 13, "3d6+4", "d20-2") + createEnemy("Awakened Tree", calculateRoll("7d12+14"), 13, 10, "3d6+4", "d20-2") ] break case 96: encounter.text = "A centaur is leading up to you. It may have been tracking your for some time. Get ready!" encounter.enemies = [ - createEnemy("Centaur", calculateRoll("6d10+12"), 12, "2d6+4", "d20+2", "Charge3d6") + createEnemy("Centaur", calculateRoll("6d10+12"), 12, 10, "2d6+4", "d20+2", "Charge3d6") ] break case 97: @@ -1332,16 +1337,16 @@ function createEncounter(listName) { case 98: encounter.text = "A ghast curls its disgusting tongue, tasting the air. Suddenly, it turns toward you!" encounter.enemies = [ - createEnemy("Ghast", calculateRoll("8d8"), 13, "2d8+3", "d20+3") + createEnemy("Ghast", calculateRoll("8d8"), 13, 6, "2d8+3", "d20+3") ] break case 99: encounter.text = "An orc war party comes upon you!" encounter.enemies = [ - createEnemy("Orc A", calculateRoll("2d8+6"), 13, "1d12+3", "d20+1"), - createEnemy("Orc B", calculateRoll("2d8+6"), 13, "1d12+3", "d20+1"), - createEnemy("Orc C", calculateRoll("2d8+6"), 13, "1d12+3", "d20+1"), - createEnemy("Orc D", calculateRoll("2d8+6"), 13, "1d12+3", "d20+1") + createEnemy("Orc A", calculateRoll("2d8+6"), 13, 8, "1d12+3", "d20+1"), + createEnemy("Orc B", calculateRoll("2d8+6"), 13, 8, "1d12+3", "d20+1"), + createEnemy("Orc C", calculateRoll("2d8+6"), 13, 8, "1d12+3", "d20+1"), + createEnemy("Orc D", calculateRoll("2d8+6"), 13, 8, "1d12+3", "d20+1") ] break } @@ -1380,11 +1385,12 @@ function createEncounter(listName) { return encounter } -function createEnemy(name, health, ac, damage, initiative, ...spells) { +function createEnemy(name, health, ac, hitModifier, damage, initiative, ...spells) { var enemy = { name: name, health: health, ac: ac, + hitModifier: hitModifier, damage: damage, initiative: initiative, spells: spells diff --git a/Output.js b/Output.js index 23f1337..39fb19d 100644 --- a/Output.js +++ b/Output.js @@ -51,22 +51,25 @@ const modifier = (text) => { text += `What is the enemy's armor class (AC)? This can be any positive integer with 10 being easy and 20 being incredibly difficult. It can also be a dice roll (ie. 2d4+5). Type q to quit\n` break case 4: - text += `What is the enemy's damage? This can be any positive integer or a dice roll (ie. 2d6+5). The dice roll is calculated at the time of each attack. Type q to quit.\n` + text += `What is the enemy's hit modifier? This affects how accurate their attacks are. This can be any integer. 0 is normal accuracy. Type q to quit\n` break case 5: - text += `What is the enemy's initiative? Initiative controls turn order. This can be any positive integer with higher numbers going first in battle. This can also be a dice roll (ie. 1d20+3). Type q to quit.\n` + text += `What is the enemy's damage? This can be any positive integer or a dice roll (ie. 2d6+5). The dice roll is calculated at the time of each attack. Type q to quit.\n` break case 6: - text += "Enter the name of a spell that the enemy knows. If it can target this spell at a player character, add a dice roll for the damage calculation after it (ie. Ray of Frost3d6+2). Type s to stop entering spells or type q to quit.\n" + text += `What is the enemy's initiative? Initiative controls turn order. This can be any positive integer with higher numbers going first in battle. This can also be a dice roll (ie. 1d20+3). Type q to quit.\n` break case 7: + text += "Enter the name of a spell that the enemy knows. If it can target this spell at a player character, add a dice roll for the damage calculation after it (ie. Ray of Frost3d6+2). Type s to stop entering spells or type q to quit.\n" + break + case 8: text += "Enter the name of another spell that the enemy knows. If it can target this spell at a player character, add a dice roll for the damage calculation after it (ie. Ray of Frost3d6+2). Type s to stop entering spells or type q to quit.\n" break case 100: text += `What enemy preset will you choose?\nLevel 1 or lesser\n1. Animated Armor\n2. Awakened Shrub\n3. Brigand\n4. Black Bear\n5. Boar\n6. Cockatrice\n7. Constrictor Snake\n8. Dire Wolf\n9. Ghoul\n10. Giant Centipede\n11. Giant Rat\n12. Giant Wolf Spider\n13. Gnoll\n14. Goblin\n15. Harpy\n16. Hobgoblin\n17. Kobold\n18. Orc\n19. Satyr\n20. Skeleton\n21. Strige\n22. Warhorse\n23. Wolf\n24. Worg\n25. Zombie\n\nEnter the number or q to quit.\n` break case 500: - var hashtag = `#addenemy "${state.tempEnemy.name}" ${state.tempEnemy.health} ${state.tempEnemy.ac} ${state.tempEnemy.damage} ${state.tempEnemy.initiative}` + var hashtag = `#addenemy "${state.tempEnemy.name}" ${state.tempEnemy.health} ${state.tempEnemy.ac} ${state.tempEnemy.hitModifier} ${state.tempEnemy.damage} ${state.tempEnemy.initiative}` for (var spell of state.tempEnemy.spells) { hashtag += ` "${spell}"` }