Percent Chance of Critical Hit!

0 favourites
  • 3 posts
From the Asset Store
12 unique hits, slashes and spells in transparent PNG sequences
  • 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.

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)