diff --git a/src/shapes/aerial.js b/src/shapes/aerial.js new file mode 100644 index 0000000..f2ac5d0 --- /dev/null +++ b/src/shapes/aerial.js @@ -0,0 +1,79 @@ +import { FORM_AERIAL, SIZE_MEDIUM, SIZE_HUGE, SIZE_LARGE } from "./constants" +import { getDexAttackModifier } from "./utils" + +const baseAerialForms = [{ + id: 'Bat', + speed: 20, + fly: 30, + senses: { + echolocation: 40, + }, + diceDamage: 9, + agileDiceDamage: 7, +}, { + id: 'Bird', + speed: 10, + fly: 50, + diceDamage: 9, + agileDiceDamage: 5.5, +}, { + id: 'Pterosaur', + speed: 10, + fly: 40, + senses: { + impreciseScent: 30, + }, + diceDamage: 10.5, +}, { + id: 'Wasp', + speed: 20, + fly: 40, + diceDamage: 11.5, +}] + +function scaleAerialForm (baseForm, level, attackModifier, athleticsModifer) { + const form = { + type: FORM_AERIAL, + size: SIZE_MEDIUM, + armorClass: 18 + level, + tempHitPoints: 5, + senses: { + lowLight: true, + ...(baseForm.senses || {}), + }, + attackModifier: getDexAttackModifier(attackModifier, 16), + athletics: athleticsModifer, + damageBonus: 5, + reach: 5, + ...baseForm, + } + + switch (true) { + case level >= 11: + form.size = SIZE_HUGE + form.fly += 15 + form.reach = 10 + form.armorClass = 21 + level + form.tempHitPoints = 15 + form.attackModifier = getDexAttackModifier(attackModifier, 21) + form.damageBonus = 4 + form.diceDamage *= 2 + if (form.agileDiceDamage) { + form.agileDiceDamage *= 2 + } + break; + case level >= 9: + form.size = SIZE_LARGE + form.fly += 10 + form.tempHitPoints = 10 + form.attackModifier = getDexAttackModifier(attackModifier, 18) + form.damageBonus = 8 + break; + } + + return form +} + +export default function scaleAerialForms (level, attackModifier, athleticsModifer) { + return baseAerialForms.map(form => scaleAerialForm(form, level, attackModifier, athleticsModifer)) +} \ No newline at end of file diff --git a/src/shapes/animal.js b/src/shapes/animal.js index 398e023..7da84fa 100644 --- a/src/shapes/animal.js +++ b/src/shapes/animal.js @@ -11,11 +11,40 @@ const baseAnimalForms = [{ speed: 30, diceDamage: 9, agileDiceDamage: 4.5, +}, { + id: 'Bull', + speed: 30, + diceDamage: 9, +}, { + id: 'Canine', + speed: 40, + diceDamage: 9, }, { id: 'Cat', speed: 40, diceDamage: 7, agileDiceDamage: 5.5, +}, { + id: 'Deer', + speed: 50, + diceDamage: 7, +}, { + id: 'Frog', + speed: 25, + swim: 25, + reach: 15, + diceDamage: 7, + agileDiceDamage: 5, +}, { + id: 'Shark', + speed: 0, + swim: 35, + diceDamage: 9, +}, { + id: 'Snake', + speed: 20, + climb: 20, + diceDamage: 8.5, }] function scaleAnimalForm (baseForm, level, attackModifier, athleticsModifer) { diff --git a/src/shapes/constants.js b/src/shapes/constants.js index df9240e..9d57d79 100644 --- a/src/shapes/constants.js +++ b/src/shapes/constants.js @@ -1,6 +1,8 @@ export const FORM_ANIMAL = 'animal' +export const FORM_AERIAL = 'aerial' export const FORM_DINOSAUR = 'dinosaur' export const FORM_DRAGON = 'dragon' +export const SIZE_MEDIUM = 'medium' export const SIZE_LARGE = 'large' export const SIZE_HUGE = 'huge' export const SIZE_GARGANTUAN = 'gargantuan' \ No newline at end of file diff --git a/src/shapes/dinosaur.js b/src/shapes/dinosaur.js index 8a1e1ad..285e7e3 100644 --- a/src/shapes/dinosaur.js +++ b/src/shapes/dinosaur.js @@ -2,16 +2,38 @@ import { FORM_DINOSAUR, SIZE_GARGANTUAN, SIZE_HUGE } from "./constants" import { getAttackModifier, getAthleticsModifier } from "./utils" const baseDinosaurForms = [{ + id: 'Ankylosaurus', + speed: 25, + reach: 10, + diceDamage: 7, +}, { + id: 'Brontosaurus', + speed: 25, + reach: 15, + diceDamage: 7, +}, { + id: 'Deinonychus', + speed: 40, + diceDamage: 7, + agileDiceDamage: 7, +}, { id: 'Stegosaurus', speed: 30, + reach: 10, + diceDamage: 9, +}, { + id: 'Triceratops', + speed: 30, diceDamage: 9, agileDiceDamage: 7, + criticalDamage: 7, }, { id: 'Tyrannosaurus', speed: 30, reach: 10, diceDamage: 6.5, agileDiceDamage: 5.5, + criticalDamage: 6.5, }] function scaleDinosaurForm (baseForm, level, attackModifier, athleticsModifer) { @@ -34,7 +56,7 @@ function scaleDinosaurForm (baseForm, level, attackModifier, athleticsModifer) { case level >= 13: form.size = SIZE_GARGANTUAN form.reach = form.Reach >= 15 ? 25 : 20 - form.tempHitPoints = 15 + form.tempHitPoints = 25 form.armorClass = 21 + level form.attackModifier = getAttackModifier(attackModifier, 25) form.damageBonus = 15 diff --git a/src/shapes/index.js b/src/shapes/index.js index ccfc2c9..582a091 100644 --- a/src/shapes/index.js +++ b/src/shapes/index.js @@ -1,5 +1,6 @@ import scaleDinosaurForms from "./dinosaur" import scaleAnimalForms from "./animal" +import scaleAerialForms from "./aerial" import scaleDragonForm from "./dragon" function getBaseAttackModifiers (level) { @@ -36,6 +37,7 @@ export default function listForms (level) { return [ ...scaleAnimalForms(level, attackModifier, athleticsModifier), + ...scaleAerialForms(level, attackModifier, athleticsModifier), ...scaleDinosaurForms(level, attackModifier, athleticsModifier), scaleDragonForm(level, attackModifier, athleticsModifier), ] diff --git a/src/shapes/utils.js b/src/shapes/utils.js index a51549e..c736827 100644 --- a/src/shapes/utils.js +++ b/src/shapes/utils.js @@ -5,6 +5,13 @@ export function getAttackModifier (attackModifier, base) { return base } +export function getDexAttackModifier (attackModifier, base) { + if (attackModifier - 1 > base) { + return attackModifier + 1 + } + return base +} + export function getAthleticsModifier (modifier, base) { return modifier > base ? modifier : base }