A surge ability is an ability with a cost
 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 #2
0
        /// <summary>
        /// Draws a visualization of a SurgeAbility on a target GUIElement. By using this method
        /// to draw the SurgeAbility, you're sure it's drawn the same way every time.
        /// </summary>
        /// <param name="target">The GUIElement to draw the SurgeAbility on.</param>
        /// <param name="ability">The SurgeAbility to display.</param>
        /// <param name="xPosition">The top-left x-coordinate to start drawing from.</param>
        /// <param name="yPosition">The top-left y-coordinate to start drawing from.</param>
        /// <param name="small">True if the surge ability should be drawn as compact as possible, else false.</param>
        public static void DrawSurgeAbility(GUIElement target, SurgeAbility ability, int xPosition, int yPosition, bool small)
        {
            Contract.Requires(target != null);
            Contract.Requires(ability != null);
            Contract.Requires(target.HasPoint(target.Bound.X + xPosition, target.Bound.Y + yPosition));

            // icons
            int cost = ability.Cost;
            int costX = target.Bound.X + xPosition;
            while (cost > 0)
            {
                Image img = new Image(target.Game.Content.Load<Texture2D>("Images/Other/surge"));
                target.AddDrawable(target.Name, img, new Vector2(costX, target.Bound.Y + yPosition));
                cost--;
                costX += img.Texture.Width + (small ? -5 : +2);
            }

            // text
            costX += 10;
            string s = ability.Ability.ToString();
            if (small) s = s.Replace("Damage", "Dmg");
            target.AddText(target.Name, ":" + s, new Vector2(costX - target.Bound.X, yPosition));
        }