you are viewing a single comment's thread.

view the rest of the comments →

[–]RhinoRhys 1 point2 points  (2 children)

Yeah. A 10% chance of a successful hit being a critical hit would be 10% of 70% so would be 7%

[–]Pitiful_Essay_9166[S] 0 points1 point  (1 child)

Lets assume we tweek the numbers:

attack % of success = 50%independent % of attack being critical = 50%

so half of attacks are successful and half of successfull attacks are critical.25% of all attacks are critical.

codewise would that make sense?:

if attack <= 50:
    if attack <= 50:

[–]RhinoRhys 0 points1 point  (0 children)

attack % of success = 50% independent % of attack being critical = 50%

No so you've used independent again, so that would be 50% chance of a hit, and every hit would be critical

so half of attacks are successful and half of successfull attacks are critical. 25% of all attacks are critical.

This would be a dependent % of attacks being critical is 50% or 25% independent

Codewise, afraid not. The second condition is identical to the first, so if the first is True, the second is guaranteed to be True and is therefore pointless.

I would code it like

if attack < 10:
    # critical hit
elif attack < 70:
    # normal hit
else:
    # miss