[CF-Devel] RE: The journey of the attack

David Hurst dhurst at it.swin.edu.au
Mon Dec 4 16:24:17 CST 2000


Could someone do me a massive favour and tell me exactly how crossfire
currently runs when a player first attacks.
I would like to be able to trace the path so that I can add a few thing to
it (like check for multiple weaponary etc). My current plan is to add code
so that the server first checks if the players has multiple weapons, then
runs the two attacks uniquely. It would be alot more efficent to only check
once for multiple weapons, then run the attack code. Code would have to be
added so that crossfire keeps track of when a player changes his weaponary
around, and would have to check again. Ideas? As the attack speed is just
the number of times it rolls a dice each time you move into a monster, the
code will not have to be modified at all. For gameplay I also intend to tell
the client where each attack is coming from. Ie Dagger: You make a
bonecrunching sound.. axe: you atomize Goblin..... This will hopefully give
players a better idea of the differences with weapon speed (thus reducing
the need to change units).

Also, I would like some help on where I should stick the code that keeps
track of how many hands a player has free. This I would assume would be done
by running through the inventory and counting how many hands. If the player
has two many hands used it will deequip the first item that uses hands.
Seems fairly simple (although I have no idea how to do it yet ;). I would
dearly love to look at the code that currently sorts through the inventory
(there used to be one in god intervention).

Once I get the latest CVS the first target I have is living.c . The Code is
terrible I can't follow 3 lines of it before I have to refer back somewhere.
If Mark hasn't already, I will go through comment it throughly and move
things like varibles from the start to the place that they are used. For
instance in the version that I have, 7 or 8 varibles are defined at the
start, but aren't used until line 1250 and aren't really needed anyway (in
particular S). In that same area (line 1250 or so) there are formulas that
appear to have subtractions that can be removed from the fraction. I assume
they are inside the fraction because the coder wanted to use integers
instead of floats but in this case it would be faster to use floats anyway.

To Pete and Mark:
Can you guys come on IRC at around 6 oclock my time (10 oclock pm your time)
so I can discuss standards through the code (naming etc), so I don't go and
change something which is the common standard. Thanks muchly.

dnh (Darth_bob)



    
    


More information about the crossfire mailing list