I am trying to model some probabilities for a pretty basic tabletop RPG mechanic. I have been searching for two days and trying to make this work myself, but my function-fu is weak, so I seek the aid of the masters.
Here is the situation:
First: ATTACKER fires a gun, rolling 1d10 and adding STAT. -- If he meets or exceeds TARGETNUMBER he has hit the target and rolls again to wound.
Next: If Model scores a hit, he makes an opposed roll!
-- ATTACKER now rolls 1d10 and adds WPNSTR
-- DEFENDER rolls 1d10 and add DEF
---- If ATTACKER's roll meets or exceeds DEFENDER's roll, he is successful, and DEFENDER takes a wound.
I've been able to calculate this with a very basic formula using fixed stats, here (AIM 4, TN10, STR7, DEF6):
function: shootwound SHOT:s on HIT:n to WOUNDROLL:d {
if [SHOT contains HIT] {
result: WOUNDROLL
}
result: -1
}
output [shootwound {6..10} on d10 to (d10+7)] >= (1d10+6) named "Chance for an AIM 4 model to take a DEF 6 model out-of-action by shooting him with a rifle"
This works well enough, provided I manually change the numbers in the formula when I want to change variables. It's ugly, but gets me the answer I am looking for.
Here is where I have hit a brick wall:
Some weapons will let you shoot multiple times! For instance, an Assault Rifle allows two shots. It seems obvious that the odds should be better, and it's not as simple as "Well, shooting twice should double your odds!" because when rolling two dice, you have a chance to score two successes! I've got a basic probably of the number of hits you are likely to generate (assuming the same AIM4 and TN10) firing twice here:
output [highest 2 of 2d{0,1}]
So now, when shooting twice, there is a likelihood of scoring 0, 1, or 2 hits (25%-50%-25%, respectively).
I have not been able to figure out how to incorporate this distribution into the first formula.
I would appreciate any bumps in the right direction here, and any tips to make this work with changeable variables.
Thanks!