Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

How to create a Pokemon-Style type system?

1498103190

Edited 1498103654
In this targeting macro, I need @{target|type1} and @{target|type2} to result in different numbers based on the type of the attack used, how would I do this? ((2*(@{level})/5+2)*@{AType}*@{APower})/@{Target|Def})/50)+2)*@{STAB})*(@{Target|Typemod1}*@{Target|Typemod2})*(1d39+216))/255 I need both @{target|type1} and @{target|type2} to somehow result in 2, 1, 0.5 or 0 based on the type of attack used.
1498104572
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Where in the macro do @{target|type#} go? Also, you are referring to these as attributes. Attributes are simply variables that are replaced with whatever the value that is stored in them is. Or do you mean that you need some math somewhere to calculate out those possible answers? In short, need some more information on what you're looking for.
I suppose it'd be a math equation determining the value of @{target|type#} in simplest form, if an attack is a fire type attack, but the target is a water type pokemon then @{target|type1} should result as 0.5 since fire is weak against water.  Additionally, if a Pokemon has no secondary type, then @{target|type2} should default as 1.
I think that for this equation to work, move type and target type need to be compared against each other in an if statement, after which the variable typemod becomes a value of 2, 1, 0.5 or 0 depending on the if statement. For example: if mtype = fire and ttype = water typemod1 = 0.5 end something like that, though the value would have to be much more in-depth, going over each of the 18 types. I apologize if I don't make sense, I'm still learning how to use the API.