
Hi! APIs still confuse me a lot, so I need a bit of help here. (Bear with my formatting, I'm on mobile).
Im working with the official dnd 5e sheets, however im currently Homebrewing my own thing. Imagine something similar to Pokemon, where each creature has a type, noted in @{type}. There are also attacks, which also have types. Since custom compendiums aren't a thing yet I decided to write macros for each attack and simply execute those using @{selected} to fill in the necessary stats. However, I'm stuck on a specific part.
If the type of @{selected} matches the type of the attack (which are simple numerical values from 1-18), I want to apply a damage bonus which is written down in @{class_resource}. If the type doesn't match the attack, this bonus isnt applied.
To somehow phrase my thoughts, I want to do something like this:
Damage = [[
If @{selected|type} = 1
Then: 2d8 + @{selected|class_resource}
Else: 2d8 ]]
Alternatively something like
If @{selected|type} = 1
Then: #macro1
Else: #macro2
What APIs would I have to use to make this happen?