Damage calculator

#9
Here you go. I copied the formula from the Excel. Now you can't ever say you had to do everything yourself.
Damage =
ROUNDDOWN
(IF(ATK<1,0,
IF(DEF<1,ATK+(STR/5),
IF(((((ATK+(STR/5))+DEF)/DEF-(DEF+DEF)/(ATK+(STR/5)))+1)*(ATK+(STR/5))/2<1,1,
[otherwise](((((ATK+(STR/5))+DEF)/DEF-(DEF+DEF)/(ATK+(STR/5)))+1)*(ATK+(STR/5))/2))))
,0) [round down end]

MAG would be substituted for ATK for Magic damage types. Now aren't you glad you asked? Personally, I wouldn't "bake in" any damage formula. I would set up a simple default formula which is loaded from an external configuration text document. Thus letting users insert their own formula if they want.
Reply



Messages In This Thread
Damage calculator - by HolyDiver - 2013-03-28, 08:10 PM
Re: Damage calculator - by Verdite - 2013-03-28, 09:18 PM
Re: Damage calculator - by HolyDiver - 2013-03-28, 10:30 PM
Re: Damage calculator - by Verdite - 2013-03-29, 12:02 AM
Re: Damage calculator - by HwitVlf - 2013-03-29, 12:18 AM
Re: Damage calculator - by HolyDiver - 2013-03-29, 02:21 AM
Re: Damage calculator - by HolyDiver - 2013-03-29, 03:05 PM
Re: Damage calculator - by HolyDiver - 2013-03-29, 04:52 PM
Re: Damage calculator - by HwitVlf - 2013-03-29, 05:35 PM
Re: Damage calculator - by HolyDiver - 2013-03-29, 07:53 PM
Re: Damage calculator - by HolyDiver - 2013-03-29, 09:08 PM
Re: Damage calculator - by HolyDiver - 2013-04-01, 03:12 AM
Re: Damage calculator - by Verdite - 2013-04-01, 03:33 PM
Re: Damage calculator - by HolyDiver - 2013-04-01, 10:16 PM
Re: Damage calculator - by HolyDiver - 2013-04-01, 10:27 PM
Re: Damage calculator - by HolyDiver - 2013-04-02, 12:17 AM
Re: Damage calculator - by HolyDiver - 2013-04-11, 04:15 AM
Re: Damage calculator - by HolyDiver - 2013-04-11, 04:30 AM
Re: Damage calculator - by HolyDiver - 2013-06-13, 02:15 PM
Re: Damage calculator - by HwitVlf - 2013-06-13, 07:54 PM
Re: Damage calculator - by HolyDiver - 2013-06-13, 10:50 PM
Re: Damage calculator - by HwitVlf - 2013-06-14, 07:23 PM
Re: Damage calculator - by HolyDiver - 2013-06-14, 10:25 PM
Re: Damage calculator - by HwitVlf - 2013-06-14, 11:51 PM
Re: Damage calculator - by HolyDiver - 2013-06-15, 02:26 AM
Re: Damage calculator - by HwitVlf - 2013-06-15, 03:13 AM
Re: Damage calculator - by HolyDiver - 2013-06-15, 03:58 AM
Re: Damage calculator - by HolyDiver - 2013-06-15, 04:59 AM
Re: Damage calculator - by HolyDiver - 2013-06-23, 01:15 AM
Re: Damage calculator - by HolyDiver - 2013-06-24, 12:52 AM
Re: Damage calculator - by HolyDiver - 2013-07-02, 05:19 PM
Re: Damage calculator - by HwitVlf - 2013-07-02, 07:49 PM
Re: Damage calculator - by HolyDiver - 2013-07-03, 06:52 AM
Re: Damage calculator - by HwitVlf - 2013-07-04, 07:41 PM
Re: Damage calculator - by HolyDiver - 2013-07-05, 09:25 AM
Re: Damage calculator - by HwitVlf - 2013-07-05, 10:51 AM
Re: Damage calculator - by HolyDiver - 2013-07-05, 11:15 AM
Re: Damage calculator - by HolyDiver - 2013-07-05, 02:05 PM
Re: Damage calculator - by HwitVlf - 2013-07-05, 07:00 PM
Re: Damage calculator - by HolyDiver - 2013-07-05, 08:59 PM
Re: Damage calculator - by HwitVlf - 2013-07-05, 10:11 PM
Re: Damage calculator - by HolyDiver - 2013-07-06, 10:17 AM
Re: Damage calculator - by HolyDiver - 2013-07-06, 10:41 AM
Re: Damage calculator - by HolyDiver - 2013-07-06, 10:52 AM
Re: Damage calculator - by HolyDiver - 2013-07-06, 11:05 AM
Re: Damage calculator - by HolyDiver - 2013-07-06, 11:36 AM
Re: Damage calculator - by HolyDiver - 2013-07-06, 06:45 PM
Re: Damage calculator - by HwitVlf - 2013-07-06, 09:50 PM
Re: Damage calculator - by HolyDiver - 2013-07-07, 08:10 AM
Re: Damage calculator - by HolyDiver - 2013-07-07, 12:34 PM
Re: Damage calculator - by HolyDiver - 2013-07-07, 02:49 PM
Re: Damage calculator - by HolyDiver - 2013-07-07, 05:38 PM
Re: Damage calculator - by HwitVlf - 2013-07-07, 10:41 PM
Re: Damage calculator - by HolyDiver - 2013-07-08, 04:50 AM
Re: Damage calculator - by HolyDiver - 2013-07-08, 08:34 AM
Re: Damage calculator - by HolyDiver - 2013-07-08, 11:07 AM
Re: Damage calculator - by HolyDiver - 2013-07-08, 11:49 AM
Re: Damage calculator - by HolyDiver - 2013-07-08, 12:11 PM
Re: Damage calculator - by HolyDiver - 2013-07-08, 04:56 PM
Re: Damage calculator - by HolyDiver - 2013-07-08, 07:14 PM
Re: Damage calculator - by HwitVlf - 2013-07-08, 09:25 PM
Re: Damage calculator - by HolyDiver - 2013-07-09, 11:27 AM
Re: Damage calculator - by HolyDiver - 2013-07-09, 01:46 PM



Users browsing this thread:
5 Guest(s)