Any ability, that have an effect on figures, heroes and the overlord.
Example #1
0
 public void Apply211()
 {
     Ability ability;
     ability = new Ability();
     ability.Apply((global::Descent.Model.Player.Figure.Figure)null);
     this.Apply(ability, (global::Descent.Model.Player.Figure.Figure)null);
     Assert.IsNotNull((object)ability);
     Assert.AreEqual<bool>(false, ability.Triggered);
 }
 public void AvailableGet726()
 {
     Ability ability;
     bool b;
     ability = new Ability();
     ability.Apply((global::Descent.Model.Player.Figure.Figure)null);
     b = this.AvailableGet(ability);
     Assert.AreEqual<bool>(true, b);
     Assert.IsNotNull((object)ability);
     Assert.AreEqual<bool>(false, ability.Triggered);
 }
 public void ToString01287()
 {
     Ability ability;
     string s;
     ability = new Ability();
     ability.Apply((global::Descent.Model.Player.Figure.Figure)null);
     s = this.ToString01(ability);
     Assert.AreEqual<string>("None", s);
     Assert.IsNotNull((object)ability);
     Assert.AreEqual<bool>(false, ability.Triggered);
 }
 public void Constructor27()
 {
     List<SurgeAbility> list;
     List<Ability> list1_;
     Equipment equipment;
     PotionMarker potionMarker;
     SurgeAbility[] surgeAbilitys = new SurgeAbility[0];
     list = new List<SurgeAbility>((IEnumerable<SurgeAbility>)surgeAbilitys);
     Ability[] abilitys = new Ability[0];
     list1_ = new List<Ability>((IEnumerable<Ability>)abilitys);
     equipment = new Equipment(0, (string)null,
                       EquipmentType.Weapon, EAttackType.NONE, EquipmentRarity.Common,
                       0, list, 0, list1_, (List<Dice>)null);
     potionMarker = this.Constructor(0, "\0", (Texture2D)null, 0, equipment);
     Assert.IsNotNull((object)potionMarker);
     Assert.AreEqual<int>
     (0, ((global::Descent.Model.Board.Marker.Marker)potionMarker).Id);
     Assert.AreEqual<string>
     ("\0", ((global::Descent.Model.Board.Marker.Marker)potionMarker).Name);
     Assert.IsNull(((global::Descent.Model.Board.Marker.Marker)potionMarker).Texture);
     Assert.AreEqual<int>
     (0, ((global::Descent.Model.Board.Marker.Marker)potionMarker).MovementPoints);
 }
Example #5
0
 public Ability Constructor()
 {
     Ability target = new Ability();
     return target;
     // TODO: add assertions to method AbilityTest.Constructor()
 }
Example #6
0
 /// <summary>
 /// Adds an ability to the list of abilities for this figure
 /// </summary>
 /// <param name="ability">
 /// The ability to be added
 /// </param>
 public void AddAbility(Ability ability)
 {
     Contract.Requires(ability != null);
     Contract.Ensures(abilities.Count == Contract.OldValue(abilities.Count) + 1);
     abilities.Add(ability);
 }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SurgeAbility"/> class.
 /// </summary>
 /// <param name="cost">
 /// The cost of the ability
 /// </param>
 /// <param name="ability">
 /// The ability to be bought
 /// </param>
 public SurgeAbility(int cost, Ability ability)
 {
     this.cost = cost;
     this.ability = ability;
 }
Example #8
0
        /// <summary>
        /// Creates an ability by parsing a string
        /// </summary>
        /// <param name="abilityString">
        /// An ability as a string
        /// </param>
        /// <returns>
        /// An ability
        /// </returns>
        public static Ability GetAbility(string abilityString)
        {
            Ability ability = new Ability();

            if (abilityString == null || abilityString == string.Empty) return ability;

            string[] data = abilityString.Split(' ');

            for (int i = 0; i < data.Length; i++)
            {
                switch (data[i])
                {
                    case "When":
                        ability.triggered = true;
                        break;
                    case "MakingAttacking":
                        ability.trigger += ability.WhenAttacking;
                        break;
                    case "IfType":
                        EAttackType.TryParse(data[++i], true, out ability.type);
                        ability.trigger += ability.IfType;
                        break;
                    case "Armor":
                        ability.bonus = AbilityBonus.Armor;
                        ability.amount = int.Parse(data[++i]);
                        break;
                    case "Aura":
                        ability.bonus = AbilityBonus.Aura;
                        break;
                    case "Breath":
                        ability.bonus = AbilityBonus.Breath;
                        break;
                    case "Burn":
                        ability.bonus = AbilityBonus.Burn;
                        break;
                    case "Command":
                        ability.bonus = AbilityBonus.Command;
                        break;
                    case "Damage":
                        ability.bonus = AbilityBonus.Damage;
                        ability.amount = int.Parse(data[++i]);
                        break;
                    case "Fear":
                        ability.bonus = AbilityBonus.Fear;
                        ability.amount = int.Parse(data[++i]);
                        break;
                    case "Fly":
                        ability.bonus = AbilityBonus.Fly;
                        break;
                    case "Grapple":
                        ability.bonus = AbilityBonus.Grapple;
                        break;
                    case "Knockback":
                        ability.bonus = AbilityBonus.Grapple;
                        break;
                    case "Pierce":
                        ability.bonus = AbilityBonus.Pierce;
                        ability.amount = int.Parse(data[++i]);
                        break;
                    case "Poison":
                        ability.bonus = AbilityBonus.Poison;
                        break;
                    case "QuickShot":
                        ability.bonus = AbilityBonus.QuickShot;
                        break;
                    case "Range":
                        ability.bonus = AbilityBonus.Range;
                        ability.amount = int.Parse(data[++i]);
                        break;
                    case "Reach":
                        ability.bonus = AbilityBonus.Reach;
                        break;
                    case "Sorcery":
                        ability.bonus = AbilityBonus.Sorcery;
                        ability.amount = int.Parse(data[++i]);
                        break;
                    case "Stun":
                        ability.bonus = AbilityBonus.Stun;
                        break;
                    case "Surge":
                        ability.bonus = AbilityBonus.Surge;
                        ability.amount = int.Parse(data[++i]);
                        break;
                    case "Sweep":
                        ability.bonus = AbilityBonus.Sweep;
                        break;
                    case "Undying":
                        ability.bonus = AbilityBonus.Undying;
                        break;
                }
            }

            return ability;
        }
Example #9
0
        private static Func<bool> GetTrigger(string trigger, Ability ability)
        {
            bool triggerFunc;

            if (trigger.StartsWith("WhenAttacking"))
            {
                return ability.WhenAttacking;
            }

            return isTrue;
        }