Skip to content

Instantly share code, notes, and snippets.

@The-Code-Monkey
Last active April 3, 2025 12:53
Show Gist options
  • Save The-Code-Monkey/250928a3fe5ec7342556645d47dd4d4a to your computer and use it in GitHub Desktop.
Save The-Code-Monkey/250928a3fe5ec7342556645d47dd4d4a to your computer and use it in GitHub Desktop.
mpmb-jaguar-companion
var iFileName = 'Homebrew Syntax - CompanionList.js'
RequiredSheetVersion('13.1.0')
CompanionList['panther companion'] = {
name: 'Panther Companion',
nameMenu: 'Companion (Panther)',
nameTooltip: 'the Panther companion',
nameOrigin: 'Panther creature',
source: [
['SRD', 204],
['MM', 333],
],
defaultExcluded: false,
action: [['action', 'Pounce']],
includeCheck: function (sCrea, objCrea, iCreaCR, bIsAL) {
return objCrea.name.toLowerCase() === 'panther' ? true : false
},
attributesAdd: {
header: 'Companion',
type: 'Beast',
attacks: [
{
name: 'Bite',
ability: 2,
damage: [1, 6, 'piercing'],
range: 'Melee (5 ft)',
description: '',
},
{
name: 'Claw',
ability: 2,
damage: [1, 4, 'slashing'],
range: 'Melee (5 ft)',
description: '',
},
],
},
attributesChange: function (sCrea, objCrea) {
objCrea.attacks = [
{
name: 'Bite',
ability: 2,
damage: [1, 6, 'piercing'],
range: 'Melee (5 ft)',
description: '',
},
{
name: 'Claw',
ability: 2,
damage: [1, 4, 'slashing'],
range: 'Melee (5 ft)',
description: '',
},
]
if (objCrea.type.toLowerCase() !== 'beast') {
objCrea.type = 'Beast'
objCrea.subtype = ''
}
},
notes: [
{
name: 'Keen Smell',
description:
'The panther has advantage on Wisdom (Perception) checks that rely on smell.',
joinString: '\n ',
},
{
name: 'Pounce',
description:
'If the panther moves at least 20 feet straight toward a creature and then hits it with a claw attack on the same turn, that target must succeed on a DC 12 Strength saving throw or be knocked prone. If the target is prone, the panther can make one bite attack against it as a bonus action.',
},
{
name: 'Stealthy',
description: 'The panther has proficiency in the Stealth skill.',
addMod: [
{
type: 'skill',
field: 'Stealth',
mod: 'Prof',
text: 'The panther has proficiency in the Stealth skill.',
},
],
},
],
calcChanges: {
hp: function (totalHD, HDobj, prefix) {
var creaHP =
CurrentCompRace[prefix] && CurrentCompRace[prefix].hp
? CurrentCompRace[prefix].hp
: 0
var creaName =
CurrentCompRace[prefix] && CurrentCompRace[prefix].name
? CurrentCompRace[prefix].name
: 'the creature'
var altHp = 4 * totalHD
HDobj.alt.push(Math.max(creaHP, altHp))
HDobj.altStr.push(
' = the highest of either\n \u2022 ' +
creaHP +
' from ' +
creaName +
"'s normal maximum HP, or\n \u2022 4 \xD7 " +
totalHD +
' from four times the total hit dice (' +
altHp +
')'
)
},
setAltHp: true,
},
eval: function (prefix, lvl) {
AddString(
prefix + 'Cnote.Left',
'The panther is a loyal and stealthy companion, using its keen senses and agility to aid its master.',
true
)
},
removeeval: function (prefix, lvl) {
RemoveString(
prefix + 'Cnote.Left',
'The panther is a loyal and stealthy companion, using its keen senses and agility to aid its master.',
true
)
},
changeeval: function (prefix, lvl) {
Value(prefix + 'Comp.Use.HD.Die', lvl[1] < 15 ? 8 : 10)
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment