View Single Post
Old 01-31-2006, 11:24 AM   #7
somied
New Member
 
Join Date: Jan 2006
Posts: 28
somied is on a distinguished road
Hahaha... too funny


Anyways, truly ranged combat within a MUD generally falls under one of two categories: coordinate-based ranged combat (like GodWars), or room-based ranged combat. If you're thinking of implementing it, you'd do better to stick with room-based unless your game already uses coordinates instead, as converting your whole movement system requires a major overhaul.

In room-based ranged combat, there are really only two feasible types of attacks: projectiles and spells. You can also count traps as ranged if you'd like, but they don't require line-of-sight like the other two. Here's a run-down of the basics:

First off, ranged attacks shouldn't (and won't be able to) initiate normal combat, which means you need to have a way to detect/avoid said attacks. From my experiences, this is usually accomplished by giving a message such as 'You see a large fireball hurdling towards you from the south!', followed by impact a couple seconds later if it's not avoided.

This brings about a problem if you have immobilizing affects in your game (such as web spells, paralyzation, etc) and can lead to rampant cheasy kills. In my opinion, the best way to avoid this is to A) give the attack X% chance to miss the target (depending on dexterity/accuracy or what not) and B) allow a stationary target some way to block the attack (via a shield or spell, most likely).

In order to check who the player can/cannot attack, you simply follow the room structure (pseudo-pseudo: for r = my room->north; r != null; r = r->north) in a loop until you find the target or run out of range. Obviously this follows 'line-of-sight', but you may eventually want spells that don't - such as ones that affect an area of rooms around a target, which is left as an exercise for the reader.



EDIT: Errr.. I was assuming the original poster was interested in implementing such a system, but after re-reading it I think I may have been wrong, so, sorry!
somied is offline   Reply With Quote