Jump to content
  • 0

Question

Posted

about this source:

skillratio += -50+10*skill_lv;

why -50 and 10 is separate

in normal computation it can be merge the -50 and 10 so it be 40.

like this:

skillratio += 40*skill_lv;

is anyone can explain how the computation of source works.

also this one:

md.damage = 1100 + 700 * skill_lv + sstatus->int_;

why it needs to be separate?

8 answers to this question

Recommended Posts

Posted
skillratio += -50+10*skill_lv;

suppose to be calculate in this way

skillratio = skillratio + ( -50 + ( 10 * skill_lv ) );

not

skillratio = skillratio + ( ( -50 + 10 ) * skill_lv  );

the calculation is from RIGHT to LEFT

hope i am not mistaken about this...

Posted

because of arithmetic rules such as MDAS(Multiplication Division Addition and Subtraction)...

skillratio += -50+10*skill_lv;

remember skillratio holds a default value 100 so we need to negate 50 from it before/after processing the other integer....

Posted

so if I try to increase a Skill Damage it better to adjust/increase this 10*skill_lv;

from this:

skillratio += -50+10*skill_lv;

to this:

skillratio += -50+20*skill_lv;

Posted

@Euphy

hahaha...exactly...

@jharick

if your adjustment is greater than 100 @ level 1 there is no need to add -50..

but if you still confuse better use skillratio = X...

example

skilratio += 20 * skilll_lv = 20% per skill level = 120 @ lvl1, 140 @ lvl2

or

skillratio = 100 + 20 * skilll_lv = 20% per skill level = 120 @ lvl1, 140 @ lvl2

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...