Percent Chance of Critical Hit!

Get help using Construct 2

Post » 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

Post » 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
67
S
28
G
24
Posts: 970
Reputation: 18,675

Post » 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


Return to How do I....?

Who is online

Users browsing this forum: sublimate and 2 guests