--- Dale Kingston <[EMAIL PROTECTED]> wrote:
> Ok well in the start of the combat system it locates like if your hand to
> hand melee or ranged.
> 
> It finds that and then sends you to that function now for melee and ranged
> that will locate your weapon and then pass you to a like attack_melee
> function that figurs the damage and everything. That then passes all the
> info to a (not sure what to call it) a function in the victims struct called
> attacked that gives it
> ch->fighting->attacked(ch, sn, dam_type, dam, ATTACK_MELEE, wield);
> 
> ok then that will call all the like block dodge all that and then call
> damage. All the while it just kind of keeps stock pilling on all these
> parameters that it's sending. So what I was wondering is rather then
> collecting all this info and passing it as I go. Would it be smarter to make
> like an attack object that had all this infor to it. And then just run
> through the functions with a pointer on the char to the attack object?

Yes, it would be better for 2 reasons:

The first is that it saves you a lot of typing when you call all these
functions ;p

The second is that when you've decided that you want to add Yet Another
Variable (tm) to you're "attack" proceedure, you'll have to go back through and
add it to all the function calls, etc. Much easiser to just add it to the
attack object, and just use what you need from the various functions.

Easily maintainable code == A Good Thing(tm)


~Kender


=====
-----BEGIN GEEK CODE BLOCK-----
Version 3.1
GCS/L/C/O d-(+) s++: a-- C+++$>++++ UBLS++++$ 
P+++(--)$ L+++>++++ E--- W+>++$ N !o K? w(--) !O 
M- !V PS+ PE(++) Y+ PGP->+ t+ 5 X+() R(+) tv+@ 
b++(+++) !DI+++ D G(-) e>+++$ h---() r+++ y+++
------END GEEK CODE BLOCK------

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Reply via email to