I want this class where every skill has a chance to apply a state, but I don't want to make a copy of every skill for them because they share skills with other classes
Make a class' skills all have a chance to apply a state
● ARCHIVED · READ-ONLY
-
-
You would need to put a statement in the damage formula that checks if the user is X class and then adds a state.
Someone with better JS skills than me can probably help more, but to check if an actor is a specific class, you need to use to write:
Code:a._classId === x ?
Where x = the class ID you want to check for.
And then you need to generate a random number to add the state:
Code:(Math.random()>X)?(a.addState(Y));damage formula goes here
Where X is a number between 0 and 1, representing the percent chance to add the state (.1 = 10%, .5 = 50%, 1 =100% etc.)
And Y is the ID of the state that you want to add.
If I had to guess, your damage formula would look something like this:
Code:a._classId === x ? (Math.random()>X)?(a.addState(Y));damage formula for specific class : damage formula for general class
But that may be slightly off somewhere.
Alternatively, you can just make copies of the skills and use the second statement I posted to add the state. -
Alright thanks I'll look into this
-
sounds like you might want to poke into the function for applying skills to target, and add a state on top of that.
if *all* skills apply states, then you might want to take the "applying state per skill" out of the equation and pass it to the final process to be added after the "applying skill" part happens. -
Go to database -> Classes -> Feature -> Attack state.
That will add a state to any attack that class uses. The only reason I could see this not working is if the class has magical attacks too.