|
||
|
|
#26 (permalink) | |
|
Forum Expert
Join Date: Sep 2002
Location: Houston, Texas
Age: 22
Posts: 3,933
|
Quote:
|
|
|
|
|
|
|
#27 (permalink) | |
|
Forum Expert
|
Quote:
t_hitsmax = ( ((1 / speed) * 3000) + 0.5 ); hitsmax = (int)t_hitsmax; correct?
__________________
|
|
|
|
|
|
|
#29 (permalink) | |
|
Forum Expert
|
Quote:
And, yes, there is a Math.Round(), however most of his examples of code earlier were all C++, thus I gave an answer that would work in a managed or unmanaged environment. Would you have preferred I wrote it as "round" instead of round? Last edited by Sep102; 11-25-2006 at 07:21 PM. |
|
|
|
|
|
|
#30 (permalink) | |
|
Forum Expert
Join Date: Sep 2002
Location: Houston, Texas
Age: 22
Posts: 3,933
|
Quote:
|
|
|
|
|
|
|
#31 (permalink) | |
|
Forum Expert
|
Quote:
Code:
int hitsmax = 0, hitsmin = 0, maxdamage = 0, mindamage = 0, weight = 0;
double t_hitsmax = 0, t_hitsmin = 0, t_maxdamage = 0, t_mindamage = 0, t_weight = 0.0;
t_hitsmax = (1 / wep[sub].speed) * 3000; //sub would be 0, and this is equal to 37
t_hitsmin = t_hitsmax - 30;
t_maxdamage = (wep[sub].strreq + wep[sub].speed + t_hitsmax) / 20; //strreq is 35, speed is 37
t_mindamage = t_maxdamage - ((1 / wep[sub].speed) * 150); //speed is 37
t_weight = (t_maxdamage + t_mindamage) / 2;
hitsmax = (int)(t_hitsmax + 0.5);
hitsmin = (int)(t_hitsmin + 0.5);
maxdamage = (int)(t_maxdamage + 0.5);
mindamage = (int)(t_mindamage + 0.5);
weight = (int)(t_weight + 0.5);
I think that's what you were saying. lmao *smacks head* I'll go try this out. Edit... Still didn't work. I'm guessing it may have to do with them being integers to say the least? (unless I was supposed to floor them in a different location? Like in the t_xxx...) So, NOW I have this: Code:
t_hitsmax = (1 / wep[sub].speed) * 3000;
t_hitsmin = t_hitsmax - 30;
t_maxdamage = (wep[sub].strreq + wep[sub].speed + t_hitsmax) / 20;
t_mindamage = t_maxdamage - ((1 / wep[sub].speed) * 150);
t_weight = (t_maxdamage + t_mindamage) / 2;
hitsmax = floor(t_hitsmax + 0.5);
hitsmin = floor(t_hitsmin + 0.5);
maxdamage = floor(t_maxdamage + 0.5);
mindamage = floor(t_mindamage + 0.5);
weight = (t_weight); //weight in UO is a double...
__________________
Last edited by IHaveRegistered; 11-25-2006 at 07:57 PM. |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|