Heya all, (not sure if this belongs in philosophy but it is more of a how to though) so anyway this topic is more of a how would i go about doing something then how would i actually do it.
So i decided i wanted my system to be based on stats and naturally require a weapon at all times (havnt really decided on that fully yet.)
So how would i go about making weapons all run different kinds of checks for weapons. exampling is:
wep quality will give a pre defined boost in damage and then be factored in with the rest of the damage.
Gloves = (quality = 100 + str) etc
short sword = (quality = 20)+(str+agi/2)
etc etc for a number of weps (upwards of 15) each with its own damage calculation.
So any ideas on how i would go about this, Demos, Libraries and dream maker threads welcome.
~Midget
ID:156807
Jul 22 2010, 8:30 pm
|
|
In response to GhostAnime
|
|
That switch() statement is very, very bad. Instead, just make a call to some proc for the weapon (call it calc_damage()), and override it for the different types to use different formulas.
|
In response to Garthor
|
|
A, true, true; I totally forgot about over-writing previously defined procedures... you know you haven't been programming in BYOND for a while when this type of thing slips your mind (or it could be due to a lack of sleep at 4:45 AM in the morning... though I think it's really a combination of the two).
In fact, I don't even know why I had the weapon_reference argument, could have used the weapon variable instead >_>' mob Edit: Thanks for the reminder Garthor and you're welcome Midgetbuster |
In response to GhostAnime
|
|
Arr. i thought it was something along those lines but i was WAY off.
Thanks garthor and ghost. |
For example, lets say that the base damage is 10: