thaco

Settable:
no
Arguments:
character
Return Value:
integer

Returns the roll on a d20 the given character needs to hit armor class 0. Note that even though the D&D term is "to hit armor class zero" or "T.H.A.C.0" in this case the zero is a letter 'o'. It's pronounced "THACK-oh".

A very simple approximation to a check for a hit can be made with the following function:

setproc rat 0 fn_b_checkhits_icc
] return(%1 = 20 OR (%1 != 1 AND (%1-thaco(%2)+ac(%3)/10>=0)))
@
If you wanted to use this function to check whether %c hit %a, you would say
   if(checkhits(1d20,%c,%a), ...