Percent Chance of Critical Hit!

Get help using Construct 2

» Fri Oct 03, 2014 7:50 pm

Hi everyone.
I hope this can work all in an Action (the Condition is already set), I am trying to set a Global Variable called Damage to having a 10% chance of being 150% of its own value. (Essentially a 10% chance of being a critical hit).

So it would be something like-
Set Damage to: 90% chance of being Damage and 10% chance of Damage*1.5

I would also like to do something similar for a missed attack-
Set Damage to: 90% chance of being Damage and 10% chance of Damage*0

Thank you!

Bonus challenge:
Is it possible to alter that percent chance within the same action? So:
10(+HeroDexterity -EnemyDodge) in 100 chance.

I am not very experienced at this kind of logic so I apologize if I am asking the question in a less than helpful way.
B
9
S
2
Posts: 56
Reputation: 668

» Fri Oct 03, 2014 8:48 pm

You probably want to do this in separate events. One determine the type of hit : miss, hit, critical hit. The other set the damage accordingly.
B
81
S
33
G
27
Posts: 1,029
Reputation: 21,143

» Fri Oct 03, 2014 9:27 pm

That is one option true, I would just like to avoid it if possible as I would have to undo a bunch of events. Also I feel like learning something new

The closest I have so far is this-

Set Damage Value to
random(100)<90?Damage:Damage*1.5

and with the extra variables
random(100)<90-HeroDex+EnemyDodge?Damage:Damage*1.5

Tried it with some test numbers and seems to work, but would still appreciate anyone letting me know if it needs tuning up, thank you!
B
9
S
2
Posts: 56
Reputation: 668