예제 #1
0
파일: Sim_GvG_083.cs 프로젝트: shuyi3/AIPJ
        //   Battlecry:</b> Give a friendly Mech +4 Health.

        public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {
            if (target != null)
            {
                p.minionGetBuffed(target, 0, 4);
            }
        }
예제 #2
0
파일: Sim_EX1_006.cs 프로젝트: shuyi3/AIPJ
//    tauscht zu beginn eures zuges diesen diener gegen einen zufälligen diener auf eurer hand aus.

        public override void onTurnStartTrigger(Playfield p, Minion triggerEffectMinion, bool turnStartOfOwner)
        {
            if (turnStartOfOwner && triggerEffectMinion.own == turnStartOfOwner)
            {
                List<Handmanager.Handcard> temp2 = new List<Handmanager.Handcard>();
                foreach (Handmanager.Handcard hc in p.playerFirst.owncards)
                {
                    if (hc.card.type == CardDB.cardtype.MOB) temp2.Add(hc);
                }
                temp2.Sort((a, b) => -a.card.Attack.CompareTo(b.card.Attack));//damage the stronges
                foreach (Handmanager.Handcard mins in temp2)
                {
                    CardDB.Card c = CardDB.Instance.getCardDataFromID(mins.card.cardIDenum);
                    p.minionTransform(triggerEffectMinion, c);
                    p.removeCard(mins, true);
                    p.drawACard(CardDB.cardName.alarmobot, true, true);
                    break;
                }
                return;
            }

            if (!turnStartOfOwner && triggerEffectMinion.own == turnStartOfOwner)
            {
                p.minionGetBuffed(triggerEffectMinion, 4, 4);
                triggerEffectMinion.Hp = triggerEffectMinion.maxHp;
            }
        }
예제 #3
0
파일: Sim_EX1_341.cs 프로젝트: shuyi3/AIPJ
        // <deDE>Stellt zu Beginn Eures Zuges bei einem verletzten befreundeten Charakter 3 Leben wieder her.</deDE>
        public override void onTurnStartTrigger(Playfield p, Minion triggerEffectMinion, bool turnStartOfOwner)
        {
            if (turnStartOfOwner == triggerEffectMinion.own)
            {
                int heal = p.getMinionHeal(3, turnStartOfOwner);
                List<Minion> temp = (turnStartOfOwner) ? p.playerFirst.ownMinions : p.playerSecond.ownMinions;
                if (temp.Count >= 1)
                {
                    bool healed = false;
                    foreach (Minion mins in temp)
                    {
                        if (mins.wounded)
                        {
                            p.minionGetDamageOrHeal(mins, -heal);
                            healed = true;
                            break;
                        }
                    }

                    if (!healed)
                    {
                        p.minionGetDamageOrHeal(turnStartOfOwner ? p.playerFirst.ownHero : p.playerSecond.ownHero, -heal);
                    }
                }
                else
                {
                    p.minionGetDamageOrHeal(turnStartOfOwner ? p.playerFirst.ownHero : p.playerSecond.ownHero, -heal);
                }

            }
        }
예제 #4
0
파일: Sim_EX1_131.cs 프로젝트: shuyi3/AIPJ
//    combo:/ ruft einen banditen der defias (2/1) herbei.
		public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
		{
            if (p.playerFirst.cardsPlayedThisTurn >= 1)
            {
                p.callKid(card, own.zonepos, own.own);
            }
		}
예제 #5
0
파일: Sim_EX1_083.cs 프로젝트: shuyi3/AIPJ
        CardDB.Card card2 = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.EX1_tk28); // squirrel
        //todo better
//    kampfschrei:/ verwandelt einen anderen zufälligen diener in einen teufelssaurier (5/5) oder ein eichhörnchen (1/1).
		public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
		{
            int oc = p.playerFirst.ownMinions.Count;
            int ec = p.playerSecond.ownMinions.Count;
            if (oc == 0 && ec == 0) return;
            if (oc > ec)
            {
                List<Minion> temp = new List<Minion>(p.playerFirst.ownMinions);
                temp.AddRange(p.playerSecond.ownMinions);
                temp.Sort((a, b) => a.Hp.CompareTo(b.Hp));//transform the weakest
                foreach (Minion m in temp)
                {
                    p.minionTransform(m, card1);
                    break;
                }
            }
            else
            {
                List<Minion> temp = new List<Minion>(p.playerFirst.ownMinions);
                temp.AddRange(p.playerSecond.ownMinions);
                temp.Sort((a, b) => -a.Hp.CompareTo(b.Hp));//transform the strongest
                foreach (Minion m in temp)
                {
                    p.minionTransform(m, card2);
                    break;
                }
            }
		}
예제 #6
0
파일: Sim_GvG_067.cs 프로젝트: shuyi3/AIPJ
        //   Whenever your opponent casts a spell, gain +1 Attack.

        public override void onCardIsGoingToBePlayed(Playfield p, CardDB.Card c, bool wasOwnCard, Minion triggerEffectMinion)
        {
            if (c.type == CardDB.cardtype.SPELL && wasOwnCard != triggerEffectMinion.own)
            {
                p.minionGetBuffed(triggerEffectMinion, 1, 0);
            }
        }
예제 #7
0
파일: Sim_CS2_077.cs 프로젝트: shuyi3/AIPJ
//    zieht 4 karten.
		public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
		{
            p.drawACard(p.getArandomCardFromDeck(ownplay), ownplay);
            p.drawACard(p.getArandomCardFromDeck(ownplay), ownplay);
            p.drawACard(p.getArandomCardFromDeck(ownplay), ownplay);
            p.drawACard(p.getArandomCardFromDeck(ownplay), ownplay);
		}
예제 #8
0
파일: Sim_EX1_575.cs 프로젝트: shuyi3/AIPJ
//    zieht am ende eures zuges eine karte.
        public override void onTurnEndsTrigger(Playfield p, Minion triggerEffectMinion, bool turnEndOfOwner)
        {
            if (turnEndOfOwner == triggerEffectMinion.own)
            {
                p.drawACard(p.getArandomCardFromDeck(turnEndOfOwner), turnEndOfOwner);
            }
        }
예제 #9
0
파일: Sim_GvG_110.cs 프로젝트: shuyi3/AIPJ
        CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.GVG_110t);//chillwind

        public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {
            int pos = (own.own) ? p.playerFirst.ownMinions.Count : p.playerSecond.ownMinions.Count;
            p.callKid(kid, pos, own.own);
            pos = (own.own) ? p.playerFirst.ownMinions.Count : p.playerSecond.ownMinions.Count;
            p.callKid(kid, pos, own.own);
        }
예제 #10
0
파일: Sim_CS2_037.cs 프로젝트: shuyi3/AIPJ
//    fügt einem feindlichen charakter $1 schaden zu und friert/ ihn ein.
		public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
		{
            int dmg = p.getSpellDamageDamage(1, ownplay);
            target.frozen = true;
            p.minionGetDamageOrHeal(target, dmg);
            
		}
예제 #11
0
파일: Sim_EX1_350.cs 프로젝트: shuyi3/AIPJ
//    verdoppelt den schaden und die heilung eurer zauber und heldenfähigkeiten.
		public override void onAuraStarts(Playfield p, Minion own)
		{
            if (own.own)
            {
                p.playerFirst.doublepriest++;
            }
		}
예제 #12
0
파일: Sim_EX1_350.cs 프로젝트: shuyi3/AIPJ
 public override void onAuraEnds(Playfield p, Minion m)
 {
     if (m.own)
     {
         p.playerFirst.doublepriest--;
     }
 }
예제 #13
0
파일: Sim_Mekka3.cs 프로젝트: shuyi3/AIPJ
//    verleiht am ende eures zuges einem zufälligen diener +1/+1.

        public override void onTurnEndsTrigger(Playfield p, Minion triggerEffectMinion, bool turnEndOfOwner)
        {
            if (triggerEffectMinion.own == turnEndOfOwner)
            {
                Minion tm = null;
                int ges = 1000;
                foreach (Minion m in p.playerFirst.ownMinions)
                {
                    if (m.Angr + m.Hp < ges)
                    {
                        tm = m;
                        ges = m.Angr + m.Hp;
                    }
                }
                foreach (Minion m in p.playerSecond.ownMinions)
                {
                    if (m.Angr + m.Hp < ges)
                    {
                        tm = m;
                        ges = m.Angr + m.Hp;
                    }
                }
                if (ges <= 999)
                {
                    p.minionGetBuffed(tm, 1, 1);
                }
            }
        }
예제 #14
0
파일: Sim_EX1_409.cs 프로젝트: shuyi3/AIPJ
        CardDB.Card wcard = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.EX1_409t);//heavyaxe
//    wenn ihr eine waffe habt, erhält sie +1/+1. legt anderenfalls eine waffe (1/3) an.
		public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
		{
            if (ownplay)
            {
                if (p.playerFirst.ownWeaponName != CardDB.cardName.unknown)
                {
                    p.playerFirst.ownWeaponAttack++;
                    p.playerFirst.ownWeaponDurability++;
                    p.minionGetBuffed(p.playerFirst.ownHero, 1, 0);
                }
                else
                {

                    p.equipWeapon(wcard, true);
                }
            }
            else
            {
                if (p.playerSecond.ownWeaponName != CardDB.cardName.unknown)
                {
                    p.playerSecond.ownWeaponAttack++;
                    p.playerSecond.ownWeaponDurability++;
                    p.minionGetBuffed(p.playerSecond.ownHero, 1, 0);
                }
                else
                {

                    p.equipWeapon(wcard, false);
                }
            }
		}
예제 #15
0
파일: Sim_FP1_005.cs 프로젝트: shuyi3/AIPJ
//    verstohlenheit/. erhält zu beginn eures zuges +1/+1.

        public override void onTurnStartTrigger(Playfield p, Minion triggerEffectMinion, bool turnStartOfOwner)
        {
            if (triggerEffectMinion.own == turnStartOfOwner)
            {
                p.minionGetBuffed(triggerEffectMinion,1,1);
            }
        }
예제 #16
0
파일: Sim_EX1_258.cs 프로젝트: shuyi3/AIPJ
 // erhält jedes Mal +1/+1, wenn Ihr eine Karte mit uberladung&lt; ausspielt.
 public override void onCardIsGoingToBePlayed(Playfield p, CardDB.Card c, bool wasOwnCard, Minion triggerEffectMinion)
 {
     if (wasOwnCard == triggerEffectMinion.own && c.Recall)
     {
         p.minionGetBuffed(triggerEffectMinion, 1, 1);
     }
 }
예제 #17
0
파일: Sim_GvG_032b.cs 프로젝트: shuyi3/AIPJ
        //    Give each player a Mana Crystal.

        public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {

            p.drawACard(p.getArandomCardFromDeck(true), true);
            p.drawACard(p.getArandomCardFromDeck(false), false);
           
        }
예제 #18
0
파일: Sim_BRM_027p.cs 프로젝트: shuyi3/AIPJ
		// Hero PowerDeal 8 damage to a random enemy.
		
        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            int dmg = 8;
            if (ownplay)
            {
                if (p.playerFirst.doublepriest >= 1) dmg *= (2 * p.playerFirst.doublepriest);
				if (p.playerSecond.ownMinions.Count > 0)
				{
					target = p.searchRandomMinion(p.playerSecond.ownMinions, Playfield.searchmode.searchLowestHP); //damage the lowest (pessimistic variant)
				}
				else
				{
					target = p.playerSecond.ownHero;
				}
            }
            else
            {
                if (p.playerSecond.doublepriest >= 1) dmg *= (2 * p.playerSecond.doublepriest);
				if (p.playerFirst.ownMinions.Count > 0)
				{
					target = p.searchRandomMinion(p.playerFirst.ownMinions, Playfield.searchmode.searchHighestAttack); //damage the Highest (pessimistic variant)
				}
				else
				{
					target = p.playerFirst.ownHero;
				}
            }			
            p.minionGetDamageOrHeal(target, dmg);
        }
예제 #19
0
파일: Sim_EX1_084.cs 프로젝트: shuyi3/AIPJ
//    jedes mal, wenn ihr einen diener mit max. 3 angriff herbeiruft, erhält dieser ansturm/.

        public override void onMinionIsSummoned(Playfield p, Minion triggerEffectMinion, Minion summonedMinion)
        {
            if (triggerEffectMinion.own == summonedMinion.own && summonedMinion.handcard.card.Attack <= 3 )
            {
                p.minionGetCharge(summonedMinion);
            }
        }
예제 #20
0
파일: Sim_EX1_133.cs 프로젝트: shuyi3/AIPJ
 public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
 {
     int dmg = p.getSpellDamageDamage(1, ownplay);
     if (p.playerFirst.cardsPlayedThisTurn >= 1) dmg = p.getSpellDamageDamage(2, ownplay);
     p.minionGetDamageOrHeal(target, dmg);
     p.equipWeapon(w, ownplay);
 }
예제 #21
0
파일: Sim_EX1_130.cs 프로젝트: shuyi3/AIPJ
        public override void onSecretPlay(Playfield p, bool ownplay, Minion attacker, Minion target, out int number)
        {
            number = 0;
            if (ownplay)
            {
                int posi = p.playerFirst.ownMinions.Count;
                p.callKid(kid, posi, true);
                if (p.playerFirst.ownMinions.Count >= 1)
                {
                    if (p.playerFirst.ownMinions[p.playerFirst.ownMinions.Count - 1].name == CardDB.cardName.defender)
                    {
                        number = p.playerFirst.ownMinions[p.playerFirst.ownMinions.Count - 1].entitiyID;
                    }
                }
            }
            else
            {
                int posi = p.playerSecond.ownMinions.Count;
                p.callKid(kid, posi, false);

                if (p.playerSecond.ownMinions.Count >= 1)
                {
                    if (p.playerSecond.ownMinions[p.playerSecond.ownMinions.Count - 1].name == CardDB.cardName.defender)
                    {
                        number = p.playerSecond.ownMinions[p.playerSecond.ownMinions.Count - 1].entitiyID;
                    }
                }
            }

        }
예제 #22
0
파일: Sim_GvG_087.cs 프로젝트: shuyi3/AIPJ
 public override void  onAuraEnds(Playfield p, Minion m)
 {
     if (m.own && p.playerFirst.ownHeroName == HeroEnum.hunter)
     {
         bool hasss = false;
         foreach (Minion mnn in p.playerFirst.ownMinions)
         {
             if (!mnn.silenced && m.name == CardDB.cardName.steamwheedlesniper)
             {
                 hasss = true;
             }
         }
         p.playerFirst.weHaveSteamwheedleSniper = hasss;
        
     }
     if (!m.own && p.playerSecond.ownHeroName == HeroEnum.hunter)
     {
         bool hasss = false;
         foreach (Minion mnn in p.playerSecond.ownMinions)
         {
             if (!mnn.silenced && m.name == CardDB.cardName.steamwheedlesniper)
             {
                 hasss = true;
             }
         }
         p.playerSecond.weHaveSteamwheedleSniper = hasss;
     }
 }
예제 #23
0
파일: Sim_CS2_027.cs 프로젝트: shuyi3/AIPJ
//    ruft zwei diener (0/2) mit spott/ herbei.
		public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
		{
            int posi = (ownplay) ? p.playerFirst.ownMinions.Count : p.playerSecond.ownMinions.Count;
            
            p.callKid(kid, posi, ownplay);
            p.callKid(kid, posi, ownplay);
		}
예제 #24
0
파일: Sim_EX1_365.cs 프로젝트: shuyi3/AIPJ
        // todo ask the posibility manager!
//    zieht eine karte und verursacht schaden, der ihren kosten entspricht.
		public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
		{
            p.drawACard(p.getArandomCardFromDeck(ownplay), ownplay);

            int dmg = p.getSpellDamageDamage(3, ownplay);
            p.minionGetDamageOrHeal(target, dmg);
		}
예제 #25
0
파일: Sim_CS2_012.cs 프로젝트: shuyi3/AIPJ
//    fügt einem feind $4 schaden und allen anderen feinden $1 schaden zu.
		public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
		{
            int dmg = p.getSpellDamageDamage(1, ownplay);
            int dmg1 = p.getSpellDamageDamage(4, ownplay);

            List<Minion> temp = (ownplay) ? p.playerSecond.ownMinions : p.playerFirst.ownMinions;
            p.minionGetDamageOrHeal(target, dmg1);
            foreach (Minion m in temp)
            {
                if (m.entitiyID != target.entitiyID)
                {
                    p.minionGetDamageOrHeal(m, dmg);
                }
            }
            if (ownplay)
            {
                if (p.playerSecond.ownHero.entitiyID != target.entitiyID)
                {
                    p.minionGetDamageOrHeal(p.playerSecond.ownHero, dmg);
                }
            }
            else
            {
                if (p.playerFirst.ownHero.entitiyID != target.entitiyID)
                {
                    p.minionGetDamageOrHeal(p.playerFirst.ownHero, dmg);
                }
                
            }
		}
예제 #26
0
파일: Sim_EX1_082.cs 프로젝트: shuyi3/AIPJ
        //todo make it better
//    kampfschrei:/ verursacht 3 schaden, der zufällig auf alle anderen charaktere aufgeteilt wird.
		public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
		{
            int anz = 3;
            for (int i = 0; i < anz; i++)
            {
                if (p.playerFirst.ownHero.Hp <= anz)
                {
                    p.minionGetDamageOrHeal(p.playerFirst.ownHero, 1);
                    continue;
                }
                List<Minion> temp = new List<Minion>(p.playerSecond.ownMinions);
                if (temp.Count == 0)
                {
                    temp.AddRange(p.playerFirst.ownMinions);
                }
                temp.Sort((a, b) => a.Hp.CompareTo(b.Hp));//destroys the weakest

                foreach (Minion m in temp)
                {
                    p.minionGetDamageOrHeal(m, 1);
                    break;
                }
                p.minionGetDamageOrHeal(p.playerSecond.ownHero, 1);
            }
		}
예제 #27
0
파일: Sim_GvG_094.cs 프로젝트: shuyi3/AIPJ
        //   At the end of each player's turn, that player draws until they have 3 cards.

        public override void onTurnEndsTrigger(Playfield p, Minion triggerEffectMinion, bool turnEndOfOwner)
        {
            if (triggerEffectMinion.own == turnEndOfOwner)
            {
                Player mPlayer;
                if (turnEndOfOwner)
                {
                    mPlayer = p.playerFirst;
                }
                else
                {
                    mPlayer = p.playerSecond;
                }

                int cardstodraw = 0;
                if (mPlayer.owncards.Count <= 2)
                {
                    cardstodraw = 3 - mPlayer.owncards.Count;
                }

                for (int i = 0; i < cardstodraw; i++)
                {
                    p.drawACard(p.getArandomCardFromDeck(turnEndOfOwner), turnEndOfOwner);
                }
            }
        }
예제 #28
0
파일: Sim_CS2_013.cs 프로젝트: shuyi3/AIPJ
//    erhaltet einen leeren manakristall.
		public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
		{
            if (ownplay)
            {
                if (p.playerFirst.ownMaxMana < 10)
                {
                    p.playerFirst.ownMaxMana++;
                }
                else
                {
                    p.drawACard(CardDB.cardName.excessmana, true, true);
                }

            }
            else
            {
                if (p.playerSecond.ownMaxMana < 10)
                {
                    p.playerSecond.ownMaxMana++;
                }
                else
                {
                    p.drawACard(CardDB.cardName.excessmana, false, true);
                }
            }
		}
예제 #29
0
파일: Sim_NAX8_04t.cs 프로젝트: shuyi3/AIPJ
        //    At the start of your turn, deal 1 damage to your hero.

        public override void onTurnStartTrigger(Playfield p, Minion triggerEffectMinion, bool turnStartOfOwner)
        {
            if (triggerEffectMinion.own == turnStartOfOwner)
            {
				p.minionGetDamageOrHeal(turnStartOfOwner ? p.playerFirst.ownHero : p.playerSecond.ownHero, 1);
            }
        }
예제 #30
0
파일: Sim_CS2_075.cs 프로젝트: shuyi3/AIPJ
        //    fügt dem feindlichen helden $3 schaden zu.
        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            int dmg = p.getSpellDamageDamage(3, ownplay);

            p.minionGetDamageOrHeal(ownplay ? p.playerSecond.ownHero : p.playerFirst.ownHero, dmg);

        }
예제 #31
0
파일: Sim_EX1_295.cs 프로젝트: shuyi3/AIPJ
        //todo secret
//    geheimnis:/ wenn euer held tödlichen schaden erleidet, wird dieser verhindert und der held wird immun/ in diesem zug.
        public override void onSecretPlay(Playfield p, bool ownplay, Minion target, int number)
        {
            target.Hp    += number;
            target.immune = true;
        }
예제 #32
0
파일: Sim_EX1_577.cs 프로젝트: shuyi3/AIPJ
        CardDB.Card c = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.EX1_finkle);//finkleeinhorn
        public override void onDeathrattle(Playfield p, Minion m)
        {
            int place = (m.own) ? p.playerSecond.ownMinions.Count : p.playerFirst.ownMinions.Count;

            p.callKid(c, place, !m.own);
        }
예제 #33
0
파일: Sim_GvG_117.cs 프로젝트: shuyi3/AIPJ
 //   Whenever you cast a 1-mana spell, add a random Mech to your hand.
 //todo: do it right (not card.cost, we have to use current cost)
 public override void onCardIsGoingToBePlayed(Playfield p, CardDB.Card c, bool wasOwnCard, Minion triggerEffectMinion)
 {
     if (triggerEffectMinion.own == wasOwnCard)
     {
         if (c.type == CardDB.cardtype.SPELL && c.cost == 1)
         {
             p.drawACard(CardDB.cardName.shieldedminibot, wasOwnCard, true);
         }
     }
 }
예제 #34
0
파일: Sim_PART_004.cs 프로젝트: shuyi3/AIPJ
        //   Give a friendly minion Stealth until your next turn.


        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            target.stealth  = true;
            target.concedal = true;
        }
예제 #35
0
//    verleiht einem diener gottesschild/.

        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            target.divineshild = true;
        }
예제 #36
0
        //   Swap a minion's Attack and Health.


        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            p.minionSwapAngrAndHP(target);
        }
예제 #37
0
 public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
 {
     p.minionTransform(own, bear);
 }
예제 #38
0
파일: Sim_EX1_155b.cs 프로젝트: shuyi3/AIPJ
//    +4 leben und spott/.

        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            p.minionGetBuffed(target, 0, 4);
            target.taunt = true;
        }
예제 #39
0
파일: Sim_GvG_004.cs 프로젝트: shuyi3/AIPJ
        //    Battlecry: If you have a Mech, deal 4 damage randomly split among all enemies.

        public override void  getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {
            // optimistic
            bool          ownplay   = own.own;
            List <Minion> temp1     = (ownplay) ? p.playerFirst.ownMinions : p.playerSecond.ownMinions;
            bool          haveAMech = false;

            foreach (Minion m in temp1)
            {
                if ((TAG_RACE)m.handcard.card.race == TAG_RACE.MECHANICAL)
                {
                    haveAMech = true;
                    break;
                }
            }
            if (!haveAMech)
            {
                return;
            }

            int           i     = 0;
            List <Minion> temp  = (ownplay) ? p.playerSecond.ownMinions : p.playerFirst.ownMinions;
            int           times = 4;

            if ((ownplay && p.playerSecond.ownHero.Hp <= times) || (!ownplay && p.playerFirst.ownHero.Hp <= times))
            {
                if (ownplay)
                {
                    p.minionGetDamageOrHeal(p.playerSecond.ownHero, p.playerSecond.ownHero.Hp - 1);
                }
                else
                {
                    p.minionGetDamageOrHeal(p.playerFirst.ownHero, p.playerFirst.ownHero.Hp - 1);
                }
            }
            else
            {
                while (i < times)
                {
                    if (temp.Count >= 1)
                    {
                        //search Minion with lowest hp
                        Minion enemy = temp[0];
                        int    minhp = 10000;
                        bool   found = false;
                        foreach (Minion m in temp)
                        {
                            if (m.name == CardDB.cardName.nerubianegg && enemy.Hp >= 2)
                            {
                                continue;                                                         //dont attack nerubianegg!
                            }
                            if (m.Hp >= 2 && minhp > m.Hp)
                            {
                                enemy = m;
                                minhp = m.Hp;
                                found = true;
                            }
                        }

                        if (found)
                        {
                            p.minionGetDamageOrHeal(enemy, 1);
                        }
                        else
                        {
                            p.minionGetDamageOrHeal(ownplay ? p.playerSecond.ownHero : p.playerFirst.ownHero, 1);
                        }
                    }
                    else
                    {
                        p.minionGetDamageOrHeal(ownplay ? p.playerSecond.ownHero : p.playerFirst.ownHero, 1);
                    }

                    i++;
                }
            }
        }
예제 #40
0
파일: Sim_NEW1_026.cs 프로젝트: shuyi3/AIPJ
 public override void onCardIsGoingToBePlayed(Playfield p, CardDB.Card c, bool wasOwnCard, Minion triggerEffectMinion)
 {
     if (wasOwnCard == triggerEffectMinion.own && c.type == CardDB.cardtype.SPELL)
     {
         int place = (wasOwnCard)? p.playerFirst.ownMinions.Count : p.playerSecond.ownMinions.Count;
         p.callKid(card, place, wasOwnCard);
     }
 }
예제 #41
0
//    erhält jedes mal +2 angriff, wenn ein charakter geheilt wird.
        public override void onAHeroGotHealedTrigger(Playfield p, Minion triggerEffectMinion, bool ownerOfHeroGotHealed)
        {
            p.minionGetBuffed(triggerEffectMinion, 2, 0);
        }