MagicMissileSpell.cs

src/Abilities/Spells/MagicMissileSpell.cs · 1.8 KB

From the archive Arthea-src-1.0.zip

Download the archive   « Back to the archive contents

#region Arthea License

/***********************************************************************
*  Arthea MUD by R. Jennings (2007)      http://arthea.googlecode.com/ *
*  By using this code you comply with the Artistic and GPLv2 Licenses. *
***********************************************************************/

#endregion

using Arthea.Abilities.Spells.Enums;
using Arthea.Collections;
using Arthea.Continents.Areas.Characters;
using Arthea.Continents.Areas.Characters.Enums;
using Arthea.Environment;

namespace Arthea.Abilities.Spells
{
    /// <summary>
    /// Implementation of a magic missile spell.
    /// </summary>
    public class MagicMissileSpell : Spell
    {
        #region [rgn] Constructors (1)

        /// <summary>
        /// Initializes a new instance of the <see cref="MagicMissileSpell"/> class.
        /// </summary>
        public MagicMissileSpell() : base("magic missile",
                                          CreateLevels("Magician", 1),
                                          Position.Standing, 3, 3, "magic missile", null, SpellTarget.Offensive, 4)
        {
        }

        #endregion [rgn]

        #region [rgn] Methods (1)

        // [rgn] Public Methods (1)

        /// <summary>
        /// Processes this ability for a character.
        /// </summary>
        /// <param name="ch">The character.</param>
        /// <param name="argument">The argument.</param>
        public override void Process(Character ch, object argument)
        {
            Character victim = argument as Character;

            int num = Randomizer.Next(1, 3);

            while (num-- >= 0)
            {
                int dam = Util.Dice(2, 6);

                Combat.Damage(this, ch, victim, dam);
            }
        }

        #endregion [rgn]
    }
}

Site Stats

Snippets: 1791
Codebases: 571