posted 25-02-2003 07:52 GMT
Hi againAs you are saying 'a player attacks another player' - I assume you are referring to QuestNet, the multi player version of Quest. (It makes quite a difference to the coding requirements)
Anyway, yes it is perfectly possible to have an attack on another player coded so as to reduce the attacked player's "health" or whatever by either a fixed or a random amount. I don't personally get involved in this style of game, but I would assume the correct approach would be to vary the 'damage' over a range of randomly generated points according to the weapon used in the attack.
e.g. Hitting the other player with a stick might cause 3 to 15 (randomly chosen) points of damage, while using a sword might cause 30 to 100 points worth of damage.
Actually coding this piecemeal for just a couple of weapons isn't particularly tricky, but I would think a much better approach would be to code a set of general purpose 'fighting' routines and maybe even implement them as a library.
Al