Ejemplo n.º 1
0
        public override Card spawnCard()
        {
            string methodName = name, callMethodName = "";

            for (int i = 0; i < methodName.Length; ++i)
            {
                if (alphabet.IndexOf(methodName[i]) >= 0)
                {
                    callMethodName += methodName[i];
                }
            }
            SpawnSpecial spun = new SpawnSpecial();
            PropertyInfo m    = spun.GetType().GetProperty(callMethodName);

            return(m.GetMethod.Invoke(spun, null) as Special);
        }
Ejemplo n.º 2
0
        public static Unit weatherMage(string Name, string description, Clan clan, Card option1, Card option2, Card option3, params Tag[] tags)
        {
            Unit self = new Unit();

            self.setAttributes(clan, Rarity.silver, Name);
            self.setUnitAttributes(4, tags);
            self.setOnDeploy((s, f) =>
            {
                List <Card> vars = new List <Card>()
                {
                    option1, option2, option3
                };
                s.host.playCard(SpawnSpecial.addSpecialToGame(s.host.selectCard(vars, s.QestionString()) as Special, s));
                s._show.redrawCausedChangeValue();
            }, description);
            return(self);
        }
Ejemplo n.º 3
0
        public static void applyHazzardOnDeployWithoutCard(Card s, Special analogCard, TriggerTurnRowEffect hazzardEffect)
        {
            Player enemy = s.host.chooseEnemy(s.context, s.QestionString());
            int    row   = s.host.chooseEnemyRow(enemy, s.QestionString());

            // there is a little trick
            // instead of creating unique birna roweffect,
            // we create a DOOMed version of skelligian storm
            // and apply (DO NOT PLAY) it to choosen row
            // after it it will dissappear in banish

            Special st = SpawnSpecial.addSpecialToGame(analogCard, s);

            st.move(Place.banish);
            RowEffect hazz = new RowEffect(st, enemy, row);

            hazz.SetBehaviour(hazzardEffect);
        }
Ejemplo n.º 4
0
        public static List <Card> invokeAllCards()
        {
            SpawnUnit    su = new SpawnUnit();
            SpawnSpecial ss = new SpawnSpecial();
            SpawnLeader  sl = new SpawnLeader();

            List <Type> tps = new List <Type>()
            {
                su.GetType(), ss.GetType(), sl.GetType()
            };
            List <Card> allCardsInGame = new List <Card>();
            int         tIndex         = 0;

            foreach (Type t in tps)
            {
                ++tIndex;
                foreach (var m in t.GetMethods())
                {
                    try
                    {
                        Card c = null;
                        if (tIndex == 1)
                        {
                            c = m.Invoke(su, null) as Card;
                        }
                        if (tIndex == 2)
                        {
                            c = m.Invoke(ss, null) as Card;
                        }
                        if (tIndex == 3)
                        {
                            c = m.Invoke(sl, null) as Card;
                        }
                        if (c != null)
                        {
                            allCardsInGame.Add(c);
                        }
                    }
                    catch (Exception e) { }
                }
            }
            return(allCardsInGame);
        }
Ejemplo n.º 5
0
        public override Card spawnDefaultCopy(Player newHost, Card sourceOfMakeingCopy)
        {
            Special copy = this.spawnCard() as Special;

            return(SpawnSpecial.addSpecialToGame(copy, sourceOfMakeingCopy));
        }