mrombout / asciihero

An AsciiDoc.js extension to help authoring Fighting Fantasy style (and more) gamebooks.
https://mrombout.github.io/asciihero/
MIT License
0 stars 0 forks source link

Alternative combat block #52

Open mrombout opened 1 year ago

mrombout commented 1 year ago

At the moment a combat block can be defined as:

[combat]
* enemy:chaos_pirate_ogre[name="Chaos Pirate Ogre", skill=7, stamina=10]
* enemy:chaos_pirate_orc[name="Chaos pirate Orc", skill=7, stamina=7]

But this is proving to be rather inflexible, and I suspect it doesn't scale well to other more advanced formats such as Dungeons & Dragons.

Perhaps it might be a better idea to turn it into a Block extension (see https://github.com/ggrossetie/asciidoctor-chart/blob/master/src/asciidoctor-chart.js for a reference) containing YAML. This YAML must follow a dedicated schema to make sure that the code can process it, but allows much more flexibility.

Different templates (and even custom ones) could use this extra metadata to render different styles of combat blocks. For example such block could look like:

[combat]
....
enemies:
  - name: Chaos Pirate Ogre
    attributes:
      skill: 7
      stamina: 10
  - name: Chaos Pirate Orc
    attributes:
      skill: 7
      stamina: 7
....

Alternative (or additionally) it might be nicer to be able to declare the data of enemies somewhere else and just refer to them in the combat. This would allow to easily re-use enemy stats in multiple locations.

The :asciihero-combat-attributes: attribute would also have to go, because it's too restricting.

Combat block references

Fighting Fantasy

Single enemy

image

Multiple enemies

image

The World of Lone Wolf (Project Aon EPUB)

It's Fighting Fantasy style, same as the main series Lone Wolf.

image

Way of the Tiger

Single enemy

image

Multiple enemies

image

Sagas of the Demonspawn

This is effectively just a statblock.

image

Sagard the Barbarian

image

Real Life Gamebooks

image

Proteus

image

Middle-Earth Quest

image

Horror Classics

This series actually uses different types of section. It would be interesting to look at support for that too.

image

Golden Dragon

image

Fatemaster

image

Fabled Lands

image

DestinyQuest

image

5# Solo Adventures

Use D&D statblocks.

mrombout commented 1 year ago

After looking around most of the time the current solution is actually good enough since the major variation is just different number of differently named attributes. In many cases, it's even displayed in the Fighting Fantasy style as well.

Therefore, maybe let's think this over a bit before going around and changing things.

As a first start, let's get rid of the :asciihero-combat-attributes: though because I don't think attributes are a good way to track this. This dependency between and attributes and what you are able to declare in the combat block is just annoying (as long as we don't have a VSCode plugin to help with autocompletion).

When rendering the table, it should just look through all the enemies, and create a combined table of all the enemies with all the attributes. Leaving the cells empty when an enemy doesn't have a certain attribute defined.