PDA

View Full Version : How do I make Damage rolls for weapons and spells do roll X and keep Y highest/lowest



lartra
September 13th, 2021, 22:43
I know that the dice roller in Unity works just fine with the command:

/roll 2d4k1
(roll two D-fours and keep the highest one)


or

/roll 3d6kl2
(roll three D-sixes and keep the lowest two)

But, when I add these details to NPC attacks or damage descriptions Unity doesn't recognize them.

Is there a special quoting system I have to use or is there a way to get this to work?

damned
September 13th, 2021, 23:48
Its not supported.

damned
September 14th, 2021, 08:15
I'd suggest rolling two random numbers: One for the chance to hit and another for the actual damage dealt. You could also combine them with player attributes. Example:

if random.uniform(0, 100) < player.chance_to_hit:
damage = random.uniform(weapon.min_damage, weapon.max_damage)

Bye bye Miss Amercican Pie...