var = math.randomint(x)
var == 20 ? setcritical
result = var+user.atk-target.def
return result
use a pivot variable.
Sorry, not fully understand the meaning of "setcritical"
Is it mean that set user.cri=100 ?
Also, I also want to set if the roll equal to 1, it represents always miss.
Is the simplest way is to set user attack=0 and target defense greather than 0 ? Like:
if math.randomint(x)+1 ==1 then user.atk=0 & target.def=100 ?
you do whatever you need to calculate that critical.
my point was, use an auxiliary variable, evaluate that variable, and then use it to construct a result.
If so, will the character have a chance to deal double critical?
e.g. A character base critical change is 5%.
If he rolls 20, his attack is guarantee critical, and more damage is applied.
But he still have a chance to get a extra 5% critical.
Is the logic works in this way?