[ LiB ]

Throughout the game, there are items that the player can pick up and use. Previously, I've mentioned weapons and armor , and these are the majority of items found throughout the MUD. However, there are other items as wellitems that heal players and give them attribute bonuses.

There are three main item types:

  • Weapons

  • Armor

  • Healing Items

Every item will have a number of variables , some of which have meanings for some types of items, some of which don't. They are all listed in Table 7.3.

Table 7.3. Item Attributes






Min damage applied

No meaning

Min healing applied


Max damage applied

No meaning

Max healing applied


Seconds between swings

No meaning

No meaning


Cost of item

Cost of item

Cost of item

9 attributes

Temporary bonuses

Temporary bonuses

Permanent bonuses

I'll go more into detail about these in the next few sections.

Weapons of Mass Destruction

Weapons are used to harm enemies in the game. As such, they require two damage attributes: a minimum amount of damage, and a maximum amount of damage (thus using the min and max values). This is a pretty typical system, but I'm sure you've got one of your own designs already.

For example, if you have a weapon, such as a knife, and its values are 1 and 5, using a random number generator, the knife could inflict 1, 2, 3, 4, or 5 damage points on your attacker.

Weapons can also be slower or faster than one another. Obviously, with small weapons such as knives, you can attack faster, as opposed to large weapons, such as clubs. Therefore, all weapons have a value that determines the number of seconds between swings.

All values within the set of nine standard attributes are temporary , meaning that you gain those bonuses when you have the weapon armed, but you lose them when you disarm the weapon. It's usually typical to give weapons varying values of the accuracy attribute because some weapons are more accurate than others. Items can also have negative values for any of the attributes, making the game a little bit more interesting. Imagine a tradeoff in which you can make a really huge sword do lots of damage, but you can make it lower the player's accuracy because it's so huge and difficult to manage.


The SimpleMUD uses a simple linear random number generator to calculate the damage done by a weapon. This means that if you have a weapon that does 1, 2, or 3 damage points, all three values have an equal chance of being generated. You may want to experiment with other random number-generating methods , however. For ex ample, a simulated normal generator would generate num bers so that the middle values occur most often, and the lowest and highest values are generated least often. This gives you a more realistic approach, because really high and really low strikes aren't very common. I've included a special normal random number generator in the BasicLib (BasicLibRandom.h) that you can call like this: int n = BasicLib::RandomIntNormal( 1, 3 ); . How it works isn't important, however, and would require a whole book on mathematical theory to show you.

Your Knight in Shining Armor

In any MUD, you're going to need some way to clothe and protect your characters . For SimpleMUD, I provide just one type of item, called Armor . The main purpose of this kind of item is simply to be put on the player, so he can wear it for the bonuses it gives him.

Armor is a lot simpler than weapons because the only attributes that are valid for armor are the cost and the set of nine standard attributes. Basically, a piece of armor adds its attributes to a player's character when you arm it, and removes those attribute bonuses when you remove it.


Armor in the game naturally focuses mainly on the damage absorption and dodging attributes. Armor naturally absorbs shocks, which is where the DA comes from, but you can also make armor lightweight and give it higher dodging values. For example, a piece of chainmail armor would obviously have a higher dodging attribute than a full suit of platemail. Don't feel obligated to stick to these two attributes, though. It's perfectly reasonable to create magical items that increase other attributes, such as your strength or strike damage.

Heal, Brother!

Healing items serve a dual purpose in the SimpleMUD. Their main use is as simple hitpoint healers; they calculate a random number between min and max, and add that number to the player.

On the other hand, healing items cannot be equipped, although they still have a set of the nine player attributes, and it would be a shame to waste all that storage space. When healing items are used, they permanently add their attribute values to your player's character. If a healing item has a value of 1 for accuracy, your player's accuracy is permanently increased by 1 whenever the item is used.


This can work both ways, by the way. You can give healing items negative values, for substances that work like a poison to destroy your health if you use them.

To prevent rampant abuse of them, though, the game is set up so that they disappear from your inventory the moment they are used.

[ LiB ]

MUD Game Programming
MUD Game Programming (Premier Press Game Development)
ISBN: 1592000908
EAN: 2147483647
Year: 2003
Pages: 147
Authors: Ron Penton

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: