Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an improved, experimental Pathfinder 2e Bestiary layout #11

Merged
merged 3 commits into from
Jul 13, 2024

Conversation

miscoined
Copy link
Contributor

This layout is intended to functionally appear mostly the same to the default Pathfinder 2e creature layout. The difference is primarily in the YAML required to create the layout. The intention is for this to eventually become the new default layout - see Fantasy Statblocks#436 for the overall plan.

There are a lot of differences, but the primary goal here was to make it less of a pain to manually write and edit these statblocks, and to allow plugins and scripts to access the data in reasonable ways. I've done this by:

  • avoiding as much duplication as possible - e.g. duplicating the perception bonus in the rendered text and in the modifier
  • avoiding as much boilerplate as possible - e.g. leave the titles and headings to the statblock layout, not the YAML source
  • exposing as much raw number data as possible. e.g. try to allow other plugins and scripts to work with the data in the statblocks without having to do regex hacks
  • using Fantasy Statblock layout blocks when possible rather than callbacks. This is mostly for simplicity and performance.

In particular:

  • Traits have been pretty much completely redone. The trait_01 stuff is completely gone now, replaced with a list of generic traits and the rarity/alignment/size fields.
  • Headers are provided by the layout rather than formatted within the YAML, in pretty much all cases except abilities and spells where it would have been too clunky to do so
  • Saves and Spells use the Save/Spell layout block now
  • Attacks are now named including the actual attack name, which should make resolving Fantasy Statblocks#421 easier, and also means you don't have to specify the whole description
  • Attacks have the bonuses, damage, and traits separated out into different fields. I went back and forth on this one a little but I think the extra verbosity is worth having the bonus and damage data easy to access
  • Dice roller regex has been customized so we don't need to duplicate the dice roller syntax. I've done a negative lookahead so it doesn't generate rolls for e.g. "+1 status" or "+1 bonus", but there might be some other examples here of patterns to exclude that I've missed.

There's also a few quality-of-life improvements:

  • initiative tracker encounter buttons
  • change the formatting for links within statblocks. My rationale here is that with some recent and upcoming changes there will be more links within the ability text, and it will get visually quite busy to differentiate between property text and a link. I admit there's some personal preference going on, but I found that spell lists especially get quite busy with bolded links.
  • traits can now be links, so you can link directly to the relevant note from the trait block

Abilities have been left pretty much untouched.

I'm open to feedback here if folks have other improvements that I haven't covered here.

Here's an example statblock with placeholder values using this layout:

Rendered example statblock

layout: Experimental Pathfinder 2e Layout
source: B2
sourcebook: Bestiary 2 p. 87
name: Some Name
level: Creature 1

alignment: alignment
rarity: unique
size: size
traits:
  - "[[trait]]"

modifier: 0
senses: senses
languages: languages
skills:
  - Skill: 1
  - "Lore: Lore": 2
skillsNote: skill note
abilityMods: [0, 0, 0, 0, 0, 0]
speed: speed

ac: 0
saves:
  - fort: 1
  - ref: 1
  - will: 1
savesNote: save note
hp: 0
hpNote: health note
immunities: immunities
resistances: resistances
weaknesses: weaknesses

items: items

abilities_top:
  - name: "[[Top Ability Name]]"
    desc: "([[trait]]); ability text"
abilities_mid:
  - name: Mid Ability Name
    desc: >  
      ⬲;
      **Some Text** This can be freeform text input;
      **Effect** It's markdown-rendered and no escaping is required.
abilities_bot:
  - name: Bot Ability Name
    desc: >
      ⬺ ([[trait]]); You can even use multi-line text here if you use two
      newlines and indent correctly. For example, here's a list:
      
      - List item
      
      - another item
      
      
      and here's a callout
      
      > [!note]+ FYI

      > I didn't add this, this is just YAML features :)

attacks:
  - name: ___Melee___ ⬻ name
    desc: ([[trait]])
    bonus: 0
    damage: 1d100+0 damage type plus 3d4 another type
  - name: ___Ranged___ ⬻ name
    desc: ([[trait]])
    bonus: 0
    damage: 3d8+12 slashing plus some effect

spellcasting:
  - name: Spellcasting name
    desc: >
      DC 0, attack +0;
      **1st** [[some spell]] (×3);
      **Constant (3rd)** [[constant spell]]

I've spot-checked this with statblocks generated with a local version of ttrpg-convert-cli that has Pf2e Fantasy Statblocks support.

Just for good measure, here's a statblock for an Adult Brine Dragon so you can see what it looks like with real data:

layout: Experimental Pathfinder 2e Layout
source: B2
sourcebook: Bestiary 2 p. 87
name: Adult Brine Dragon
level: Creature 12

alignment: LN
rarity: uncommon
size: huge
traits:
  - "[amphibious](rules/traits/amphibious-b1.md)"
  - "[dragon](rules/traits/dragon.md)"
  - "[elemental](rules/traits/elemental.md)"
  - "[water](rules/traits/water.md)"

modifier: 23
senses: darkvision, scent (imprecise) 60
languages: aquan, common, draconic, sylvan
skills:
  - Acrobatics: 20
  - Athletics: 25
  - Deception: 24
  - Intimidation: 24
  - Nature: 21
  - Society: 21
  - Survival: 21
abilityMods: [7, 2, 5, 3, 5, 6]
speed: 40 feet, fly 120 feet, walk 40 feet, swim 60 feet

ac: 33
saves:
  - fort: 25
  - ref: 20
  - will: 21
hp: 222
immunities: "[acid](rules/traits/acid.md), paralyzed, [sleep](rules/traits/sleep.md)"

abilities_mid:
  - name: "[Frightful Presence](rules/abilities/frightful-presence.md)"
    desc: "([aura](rules/traits/aura.md), [emotion](rules/traits/emotion.md), [fear](rules/traits/fear.md), [mental](rules/traits/mental.md)); 90 feet, DC 30"
  - name: Brine Spit
    desc: >  
      ⬲;
      **Trigger** A creature the brine dragon observes within 30 feet uses a concentrate action;
      **Effect** The dragon spits a glob of caustic salt water at the creature. The creature takes 5d6 acid damage (DC 30 basic Reflex save). On a failure, the concentrate action is disrupted.

abilities_bot:
  - name: Breath Weapon
    desc: >
      ⬺ ([acid](rules/traits/acid.md), [evocation](rules/traits/evocation.md), [primal](rules/traits/primal.md)); The dragon breathes a spray of acidic salt water that deals 13d6 acid damage in a 100-foot line (DC 32 basic Reflex save). They can't use Breath Weapon again for 1d4 rounds.
  - name: Draconic Frenzy
    desc: >
      ⬺ The dragon makes two claw [Strikes](rules/actions/strike.md) and one wing [Strike](rules/actions/strike.md) in any order.
  - name: Draconic Momentum
    desc: >
      The dragon recharges their Breath Weapon whenever they score a critical hit with a [Strike](rules/actions/strike.md).
  - name: Desiccating Bite
    desc: >
      ⬺ The dragon makes a jaws [Strike](rules/actions/strike.md). On a hit, the target takes 4d6 [persistent acid damage](rules/conditions.md#Persistent%20Damage), and is [sickened](rules/conditions.md#Sickened) from the pain of salt and brine in its wounds.

attacks:
  - name: ___Melee___ ⬻ jaws
    desc: ([acid](rules/traits/acid.md), [magical](rules/traits/magical.md), [reach 15 feet](rules/traits/reach-15-feet.md))
    bonus: 26
    damage: "3d10+12 piercing plus 3d4 acid"
  - name: ___Melee___ ⬻ claw
    desc: ([agile](rules/traits/agile.md), [magical](rules/traits/magical.md), [reach 10 feet](rules/traits/reach-10-feet.md))
    bonus: 26
    damage: "3d8+12 slashing"
  - name: ___Melee___ ⬻ tail
    desc: ([magical](rules/traits/magical.md), [reach 20 feet](rules/traits/reach-20-feet.md))
    bonus: 24
    damage: "3d12+12 bludgeoning"
  - name: ___Melee___ ⬻ wing
    desc: ([magical](rules/traits/magical.md), [reach 15 feet](rules/traits/reach-15-feet.md))
    bonus: 24
    damage: "1d12+12 piercing"

spellcasting:
  - name: Primal Innate Spells
    desc: >
      DC 32, attack +24;
      **4th** [hydraulic torrent](compendium/spells/hydraulic-torrent.md); **3rd** [hydraulic push](compendium/spells/hydraulic-push.md) (×3); **2nd** [obscuring mist](compendium/spells/obscuring-mist.md);

Here's what it looks like rendered:
Rendered Adult Brine Dragon statblock

This is named differently as an "Experimental" layout while I work on
having this be included and output from other tools. Later, I plan to
change this to the default layout and rename the other one to the Legacy
layout.
Copy link
Member

@sigrunixia sigrunixia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. @mProjectsCode, no problems with the esbuild changes?

Copy link
Member

@mProjectsCode mProjectsCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create named variables for the command line arguments at the top of the file and provide some documentation for the arguments. All in an effort to improve readability and maintainability.

esbuild.config.mjs Outdated Show resolved Hide resolved
@miscoined
Copy link
Contributor Author

done. also fixed the watch functionality and restructured it a bit.

Copy link
Member

@mProjectsCode mProjectsCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to use a proper argument parser with dashes and so on where the order of arguments does not matter, but I can do that, no need for you to do that in this PR.

@miscoined miscoined merged commit 2af7548 into Obsidian-TTRPG-Community:master Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants