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

Monster multiattacks hard to parse #116

Closed
jbhaywood opened this issue Dec 2, 2019 · 8 comments
Closed

Monster multiattacks hard to parse #116

jbhaywood opened this issue Dec 2, 2019 · 8 comments

Comments

@jbhaywood
Copy link

I'm wondering if it's possible to define multiattacks in a way that's more easily parsed in code. Right now, the only place that specifies all of the possible attacks is the "desc" field of the "Multiattack" action. For example, in trying to figure out which attacks are available to the "Bandit Captain" on their turn, the only information I have is, "The captain makes three melee attacks: two with its scimitar and one with its dagger. Or the captain makes two ranged attacks with its daggers."

This is tricky to parse out programmatically. One option I can think of is to maybe add an explicit list of "action sets", where each set is considered a potential set of actions for each turn, something like:

"action_sets": [
 	{
		"name": "Multiattack",
		"actions": [
			{
				"name": "Scimitar",
				"count":  2,
				"type": "melee"
			},
			{
				"name": "Dagger",
				"count":  1,
				"type": "melee"
			}
		]
	},
 	{
		"name": "Multiattack",
		"actions": [
			{
				"name": "Dagger",
				"count":  2,
				"type": "ranged"
			}
		]
	}
]

I wouldn't mind giving this a shot if we can agree on a format.

@ogregoire
Copy link
Collaborator

We already have a "choice" or "option" structure for similar cases, such as Half-Elf's stat option. You might want to take inspiration from those.

@bagelbits
Copy link
Collaborator

In most (if not all) cases, Multiattack is just using the already defined attacks on a monster. So you probably only need the name and count.

@jbhaywood
Copy link
Author

How would you handle the -or- case for the Bandit Captain above, where the same attack can be used two different ways?

"The captain makes three melee attacks: two with its scimitar and one with its dagger. Or the captain makes two ranged attacks with its daggers."

@bagelbits
Copy link
Collaborator

Maybe something like this:

"attacks": [
  {
    "choose": 1,
    "type": "attacks",
    "from": [
      [
        {
          "name": "Scimitar",
          "count": 2
        },
        {
          "name": "Dagger",
          "count": 1,
          "type": "melee"
        }
      ],
      [
        {
          "name": "Dagger",
          "count": 2,
          "type": "ranged"
        }
      ]
    ]
  }
]

I have a feeling type would be more than just melee or ranged though.

@jbhaywood
Copy link
Author

Sounds good. I'm going to see how far I can get with this structure. The multiattack descriptions are pretty well formatted, but some of them have a lot going on.

@bagelbits
Copy link
Collaborator

They really do. A lot of the attacks do, you should have seen some of the wild stuff I came across while trying to pull out damage and damage type from all monster attacks.

@bagelbits
Copy link
Collaborator

So, V1 for this is done. However, I guess next steps would be to handle the notes: field and convert it into something else.

@bagelbits
Copy link
Collaborator

I'm going to close this out for now as it's technically done. Feel free to open a separate issue for parsing the notes field.

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

No branches or pull requests

3 participants