Jump to content

guide for random damage numbers


kp420

Recommended Posts

Hello,

 

<PhysicalDamage>Random(((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * 1.075, ((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * 1.925) * (100 / (100 + V_Defense))</PhysicalDamage>
 <MagicDamage>Random(((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * 1.075, ((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * 1.925) * (100 / (100 + V_MagicResist))</MagicDamage>
<TrueDamage>Random(((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * 1.075, ((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * 1.925)</TrueDamage>

 

Change this :) and test in game.

It's my formulas for my game.

Link to comment
Share on other sites

I have a question, a math question actually. This is the curren formula I'm using on my test project:

 

<PhysicalDamage>Random(((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * .975 / (V_Defense * 1.5), ((BaseDamage + (ScalingStat * ScaleFactor))) * CritFactor * 1.025 / (V_Defense * 1.25))</PhysicalDamage>

 

The issue is that, when using the victim's defense as the divider, this defense may be 0 after using weaken defense skills, and this probably(didn't tested it) will throw some kind of math exception. Is there any mathematical way to avoiding this and keep the victim's defense on the divider? I could do this by using conditional branches, but don't know if I can use them on there.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...