>>2) Change the formula to this: >> >>return (int)((-(high_val - low_val) / ((float)(top_level-1))) * (level - 1) >>+ high_val); >> >>Perhaps a bit more tweaking, and I can get it perfect. >> >>(to save you the test, results with this are 860 total, and 353 wc thing) Well...., I did a bunch of tweaking, and I think that this is as close as a straight line can come to matching the old values (if there is enuf demand, I might try and calculate out all the curved lines..., but I'm not gon worry about that yet, I think this is close enuf) I've gotten the results down to 740 total, 325 wc thing. I had to tweak a lot of values, so the whole thing is pasted below... >>Also..., if that function would round to nearest int instead of just dropping >>the decimal (I have no help files, and can't remember function name), most of >>the results of -1 (probably 100 or so) would be perfect. > >Rounding (to tens) goes like: > (result + 5) / 10 >Rounding to 1: > (result + .5) >(Since .5 + .5 = 1 and >.5 + .5 = 1+ and <.5 + .5 < 1) > >Not sure what your function would be, I'll leave it up to you to figure >out. :) I remember using a round() function before, but that is probably much more efficient, and won't require anymore .h files etc. Well..., after testing it, I discovered that not many of the -1's will round up to zero, but a LOT of zeros round up to 1 (I even tried little tests like adding .1)..., Another 1/2 or so work might strip off a couple more lines, but thats it I think. ---Begin code --- char saving_throws(int class_num, int type, int level) { int top_level, high_val, low_val; switch(class_num) { case CLASS_MAGIC_USER: switch(type) { case SAVING_PARA: high_val = 71; low_val = 29; break; case SAVING_ROD: high_val = 54; low_val = 8; break; case SAVING_PETRI: high_val = 65; low_val = 14; break; case SAVING_BREATH: high_val = 75; low_val = 24; break; case SAVING_SPELL: high_val = 60; low_val = 9; break; default: log("SYSERR: Invalid saving throw type."); return 99; } break; case CLASS_CLERIC: switch(type) { case SAVING_PARA: high_val = 58; low_val = 5; break; case SAVING_ROD: high_val = 71; low_val = 27; break; case SAVING_PETRI: high_val = 65; low_val = 22; break; case SAVING_BREATH: high_val = 80; low_val = 37; break; case SAVING_SPELL: high_val = 75; low_val = 32; break; default: log("SYSERR: Invalid saving throw type."); return 99; } break; case CLASS_THIEF: switch(type) { case SAVING_PARA: high_val = 65; low_val = 36; break; case SAVING_ROD: high_val = 70; low_val = 13; break; case SAVING_PETRI: high_val = 60; low_val = 31; break; case SAVING_BREATH: high_val = 80; low_val = 51; break; case SAVING_SPELL: high_val = 75; low_val = 17; break; default: log("SYSERR: Invalid saving throw type."); return 99; } break; case CLASS_WARRIOR: switch(type) { case SAVING_PARA: high_val = 70; low_val = 8; break; case SAVING_ROD: high_val = 80; low_val = 16; break; case SAVING_PETRI: high_val = 75; low_val = 13; break; case SAVING_BREATH: high_val = 85; low_val = 13; break; case SAVING_SPELL: high_val = 85; low_val = 21; break; default: log("SYSERR: Invalid saving throw type."); return 99; } break; default: log("SYSERR: Invalid class passed to saving throw."); return 99; } top_level = 30; if(level > top_level) return 0; else return (int)((-(high_val - low_val) / ((float)(top_level-1))) * (level - 1) + high_val); } --- End code --- Once again..., I remind everyone how much I hate web-mail and wish I could get a proper e-mail client to work behind the firewall at work... Hmm..., Afterthought(s): Did someone reconfigure the list, I never got my last message back to me like I'm used to. Could it have something to do with my e-mail change? (it's a forwarding address, I still receive on old e-mail account too, but changing ISP's soon) Hmm..., getting more and more offtopic..., but changing ISP's reminds me. Would anyone be willing to host my CircleMUD WWW page for free? I will probably have WWW space at my new ISP too, but it's kinda a pain changing addresses. It's currently at www.connect.ab.ca/~rbmstrk if anyone wants to check it out. +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST