예제 #1
0
        public static IManaAmount Colored(ManaColor color, int count)
        {
            if (count == 0)
            return Zero;

              return new SingleColorManaAmount(color, count);
        }
예제 #2
0
 public ManaUnit(ManaColor color, int rank, IManaSource source = null, ManaUsage usageRestriction = ManaUsage.Any)
 {
     Color = color;
       Rank = rank;
       Source = source;
       _usageRestriction = usageRestriction;
 }
예제 #3
0
        public TapForMana(LazyGameObject <Card> h, ManaColor color)
        {
            Host          = h;
            Color         = color;
            IsManaAbility = true;

            MyCost.ActionParts.Add(new TapSelf(Host));
        }
예제 #4
0
파일: Mana.cs 프로젝트: callumhutchy/grove
        public static ManaAmount Colored(ManaColor color, int count)
        {
            if (count == 0)
            {
                return(Zero);
            }

            return(new SingleColorManaAmount(color, count));
        }
예제 #5
0
 public void AddMana(ManaColor color, int amount)
 {
     if (amount < 0)
         throw new Exception("Cannot add negative mana to manapool");
     if (AvailableMana.ContainsKey(color))
         AvailableMana[color] += amount;
     else
         AvailableMana.Add(color, amount);
 }
예제 #6
0
        public static ManaAttribute GetManaAttribute(ManaColor color)
        {
            MemberInfo memberInfo = typeof(ManaColor).GetMember(color.ToString()).FirstOrDefault();

            if (memberInfo != null)
            {
                return(memberInfo.GetCustomAttribute(typeof(ManaAttribute), false) as ManaAttribute);
            }
            return(null);
        }
예제 #7
0
        protected Card GetBasicLandCard(Player owner, ManaColor color, CardType[] types, string[] subtypes, bool isSnow)
        {
            var card = new Card(owner, types, subtypes, true, 0, 0, false, isSnow);

            card._attrs = CardAttrs;
            // Basic Lands tap for 1 mana of their specific color
            var cost          = new TapCost(card);
            var manaGenerated = new ManaAmount(1, color);

            card.AddAbility(new ManaAbility(card, cost, manaGenerated, $"{cost}: Add {manaGenerated}"));

            return(card);
        }
예제 #8
0
        public static String ColorToShortenedString(ManaColor col)
        {
            String res;

            switch (col)
            {
            case (ManaColor.White): res = "W"; break;

            case (ManaColor.Blue): res = "U"; break;

            case (ManaColor.Black): res = "B"; break;

            case (ManaColor.Red): res = "R"; break;

            case (ManaColor.Green): res = "G"; break;

            default: res = "1"; break;
            }

            return(res);
        }
예제 #9
0
        public int this[ManaColor color]
        {
            get
            {
                switch (color)
                {
                case ManaColor.White:
                case ManaColor.Blue:
                case ManaColor.Black:
                case ManaColor.Red:
                case ManaColor.Green:
                case ManaColor.Colorless:
                    return(_pool[color]);

                default:
                    throw new ArgumentException("Only White, Blue, Black, Red, Green, and Colorless mana can exist in the mana pool");
                }
            }
            set
            {
                switch (color)
                {
                case ManaColor.White:
                case ManaColor.Blue:
                case ManaColor.Black:
                case ManaColor.Red:
                case ManaColor.Green:
                case ManaColor.Colorless:
                    _pool[color] = value;
                    break;

                default:
                    throw new ArgumentException("Only White, Blue, Black, Red, Green, and Colorless mana can exist in the mana pool");
                }
            }
        }
예제 #10
0
 public ColorModifier(IResolvable source, string property, ModifierMode mode, ManaColor value) : base(source, property, mode)
 {
     Value = value;
 }
예제 #11
0
   public void ManaAmount(ManaColor color, Func<Card, bool> filter,
 ControlledBy controlledBy = ControlledBy.SpellOwner)
   {
       ManaOutput = new PermanentCountManaOutput(color, filter, controlledBy);
         Colors = color.Indices;
   }
예제 #12
0
 public ManaAmount(int amount, ManaColor color)
 {
     Amount = amount;
     Color  = color;
 }
예제 #13
0
 public SingleColorManaAmount(ManaColor color, int count)
 {
     Color = color;
       Count = count;
 }
예제 #14
0
 public void AddDefaultColors()
 {
     ManaColor colorless = new ManaColor("colorless");
     colorless.Default = true;
     colors.Add(colorless);
 }
예제 #15
0
파일: Land.cs 프로젝트: Veggie13/Magic
 public Land(ManaColor color)
 {
     _color = color;
 }
예제 #16
0
 public void ConsumeMana(ManaColor color, int amount)
 {
     AvailableMana[color] -= amount;
 }
예제 #17
0
 public ManaPointView(Int32 i, ManaColor c)
 {
     id    = i;
     Color = c;
 }
예제 #18
0
 public ManaCostPart(ManaColor col)
 {
     Color = col;
 }
예제 #19
0
 public Card GetBasicSnowLand(Player owner, ManaColor color, CardType[] types, string[] subtypes)
 {
     return(GetBasicLandCard(owner, color, types, subtypes, true));
 }
예제 #20
0
 public ManaAction(ManaColor color)
 {
     _color = color;
 }
예제 #21
0
 private ManaUnit CreateManaUnit(ManaColor color)
 {
     return new ManaUnit(
     color,
     _p.Priority,
     this,
     _p.UsageRestriction);
 }
예제 #22
0
 public CommandAddManaToPool(Int32 pid, ManaColor mc)
 {
     Player = new LazyGameObject <Player>(pid);
     Color  = mc;
 }