-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jbblanchet
committed
May 20, 2024
1 parent
191a404
commit 4c47f89
Showing
6 changed files
with
142 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters