jharick Posted July 22, 2012 Posted July 22, 2012 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? Quote
Emistry Posted July 22, 2012 Posted July 22, 2012 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... Quote
Euphy Posted July 22, 2012 Posted July 22, 2012 Order of operations... -50 is a constant, 10*skill_lv is done first. Edit: lol, 3 responses at the same time. xD Quote
malufett Posted July 22, 2012 Posted July 22, 2012 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.... Quote
jharick Posted July 22, 2012 Author Posted July 22, 2012 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; Quote
Emistry Posted July 22, 2012 Posted July 22, 2012 any value behind the skillratio += will also affect it... Quote
malufett Posted July 22, 2012 Posted July 22, 2012 @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 Quote
jharick Posted July 22, 2012 Author Posted July 22, 2012 I get it now. thanks to all of you for clearing about my question Quote
Question
jharick
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.