
Well, I'm no expert in mathematics and got stuck at this point the macro I am creating, maybe there's a simpler solution that also can not think. My problem: The Ten Dice Rule bonus (from L5R or 7th Sea) "No roll can ever use more than ten dice at a time. Additional rolled dice become kept dice at a ratio of one kept die per two additional rolled dice. If both rolled and kept dice already equal ten, then each additional die of both types converts to a bonus of +2 to the total of the roll. EXAMPLE: * A roll of 12k4 would become 10k5, because the two extra rolled dice that exceed the Ten Dice Rule become one extra kept die. * A roll of 13k9 would become 10k10 + 2, because the two extra rolled dice that exceed the Ten Dice Rule become one extra kept die, and the additional odd rolled die becomes a bonus of +2. * A roll of 10k12 would become 10k10 + 4, with each of the extra kept dice above the Ten Dice Rule becoming a bonus of +2. * A roll of 14k12 would become 10k10 +12. Since both rolled and kept dice exceed ten, the four additional rolled dice become a bonus of +8, and the two additional kept dice become a bonus of +4, for a total of +12." Part of the dice rolled that turn into kept dice is solved. My difficulty is added the bonus values. Now follows what I thought solution but I could not perform through my math limitation. X is the Roll X - 10 = even number, I need to result in 0. X - 10 = odd number, I need to result in 1. Both 0 and 1 It will be multiplied by 2 and will have the bonus from the Roll. The Roll bonus is add to the Kept bonus: Using my current roll formula, which turns 2 dices rolling on 1 kept, but without the "2 to 1", without transferring dividing. Example: 12k10 --> 10k12 So... I Subtract the kept by 10 and multiply the result by 2 getting the bonus from the Kept. Well, thats it. I cannot solve the part of getting 1 or 0. Hope someone can help me. I've been trying really hard to solve all system roll. Sorry the bad english, talk about mathematics in another language is not easy. Thank you!