当前位置: 首页>>代码示例>>C#>>正文


C# Playfield.minionGetDamageOrHeal方法代码示例

本文整理汇总了C#中HRSim.Playfield.minionGetDamageOrHeal方法的典型用法代码示例。如果您正苦于以下问题:C# Playfield.minionGetDamageOrHeal方法的具体用法?C# Playfield.minionGetDamageOrHeal怎么用?C# Playfield.minionGetDamageOrHeal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HRSim.Playfield的用法示例。


在下文中一共展示了Playfield.minionGetDamageOrHeal方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: getBattlecryEffect

        //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);
            }
		}
开发者ID:shuyi3,项目名称:AIPJ,代码行数:27,代码来源:Sim_EX1_082.cs

示例2: onTurnEndsTrigger

        //    stellt am ende eures zuges bei einem verletzten charakter 6 leben wieder her.

        public override void onTurnEndsTrigger(Playfield p, Minion triggerEffectMinion, bool turnEndOfOwner)
        {
            if (turnEndOfOwner == triggerEffectMinion.own)
            {

                Minion tm = null;
                int hl = p.getMinionHeal(6, triggerEffectMinion.own);
                int heal = 0;
                foreach (Minion m in p.playerFirst.ownMinions)
                {
                    if (m.maxHp - m.Hp > heal)
                    {
                        tm = m;
                        heal = m.maxHp - m.Hp;
                    }
                }
                foreach (Minion m in p.playerSecond.ownMinions)
                {
                    if (m.maxHp - m.Hp > heal)
                    {
                        tm = m;
                        heal = m.maxHp - m.Hp;
                    }
                }
                if (heal >= 1)
                {
                    p.minionGetDamageOrHeal(tm, -hl);
                }
                else
                {
                    p.minionGetDamageOrHeal(p.playerFirst.ownHero.Hp < 30 ? p.playerFirst.ownHero : p.playerSecond.ownHero, -hl);
                }

            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:37,代码来源:Sim_Mekka2.cs

示例3: onCardPlay

//    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);
                }
                
            }
		}
开发者ID:shuyi3,项目名称:AIPJ,代码行数:31,代码来源:Sim_CS2_012.cs

示例4: onTurnStartTrigger

        // <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);
                }

            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:32,代码来源:Sim_EX1_341.cs

示例5: onCardPlay

        //    verursacht $5 schaden. stellt bei eurem helden #5 leben wieder her.
        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            int dmg = p.getSpellDamageDamage(5, ownplay);
            p.minionGetDamageOrHeal(target, dmg);
            int heal = p.getSpellHeal(5, ownplay);

            p.minionGetDamageOrHeal(ownplay ? p.playerFirst.ownHero : p.playerSecond.ownHero, -heal);
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:9,代码来源:Sim_EX1_624.cs

示例6: onCardPlay

        //   Deal $3 damage to a minion and the enemy hero.

        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            int dmg = p.getSpellDamageDamage(3, ownplay);

            p.minionGetDamageOrHeal(target, dmg);

            if (ownplay) p.minionGetDamageOrHeal(p.playerSecond.ownHero, dmg);
            else p.minionGetDamageOrHeal(p.playerFirst.ownHero, dmg);
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:11,代码来源:Sim_GvG_073.cs

示例7: onCardPlay

//    fügt einem diener $5 schaden und benachbarten dienern $2 schaden zu.

		public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
		{
            int dmg1 = p.getSpellDamageDamage(5, ownplay);
            int dmg2 = p.getSpellDamageDamage(2, ownplay);
            List<Minion> temp = (target.own) ? p.playerFirst.ownMinions : p.playerSecond.ownMinions;
            p.minionGetDamageOrHeal(target, dmg1);
            foreach (Minion m in temp)
            {
                if (m.zonepos + 1 == target.zonepos || m.zonepos - 1 == target.zonepos) p.minionGetDamageOrHeal(m, dmg2);
            }
		}
开发者ID:shuyi3,项目名称:AIPJ,代码行数:13,代码来源:Sim_EX1_537.cs

示例8: onCardPlay

        //    verursacht $8 schaden, der zufällig auf feindliche charaktere verteilt wird.
        //todo for enemy
        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            // optimistic

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

            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++;
                }
            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:56,代码来源:Sim_EX1_384.cs

示例9: onCardPlay

        //    Deal damage to each minion equal to its Attack.

        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            foreach (Minion m in p.playerFirst.ownMinions)
            {
                p.minionGetDamageOrHeal(m, m.Angr, true);
            }

            foreach (Minion m in p.playerSecond.ownMinions)
            {
                p.minionGetDamageOrHeal(m, m.Angr, true);
            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:14,代码来源:Sim_GvG_008.cs

示例10: onTurnEndsTrigger

        //    At the end of your turn, deal 2 damage to a non-Mech minion.

        public override void onTurnEndsTrigger(Playfield p, Minion triggerEffectMinion, bool turnEndOfOwner)
        {
            if (triggerEffectMinion.own == turnEndOfOwner)
            {
                //count non-mechs
                int ownNonMechs = 0;
                Minion ownTemp = null;
                foreach (Minion m in p.playerFirst.ownMinions)
                {
                    if ((TAG_RACE)m.handcard.card.race != TAG_RACE.MECHANICAL)
                    {
                        if (ownTemp == null) ownTemp = m;
                        ownNonMechs++;
                    }
                }

                int enemyNonMechs = 0;
                Minion enemyTemp = null;
                foreach (Minion m in p.playerSecond.ownMinions)
                {
                    if ((TAG_RACE)m.handcard.card.race != TAG_RACE.MECHANICAL)
                    {
                        if (enemyTemp == null) enemyTemp = m;
                        enemyNonMechs++;
                    }
                }

                // dmg own minion if we have more than the enemy, in the other case dmg him!
                if (ownNonMechs >= 1 && enemyNonMechs >= 1)
                {
                    if (ownNonMechs >= enemyNonMechs)
                    {
                        p.minionGetDamageOrHeal(ownTemp, 2, true);
                        return;
                    }
                    p.minionGetDamageOrHeal(enemyTemp, 2, true);
                    return;
                }

                if (ownNonMechs >= 1)
                {
                    p.minionGetDamageOrHeal(ownTemp, 2, true);
                    return;
                }

                if (enemyNonMechs >= 1)
                {
                    p.minionGetDamageOrHeal(enemyTemp, 2, true);
                    return;
                }
            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:54,代码来源:Sim_GvG_020.cs

示例11: getBattlecryEffect

        //   Battlecry: Deal 2 damage to all minions with Deathrattle.

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

            foreach (Minion m in p.playerFirst.ownMinions)
            {
                if (m.handcard.card.deathrattle) p.minionGetDamageOrHeal(m, 2);
            }
            foreach (Minion m in p.playerSecond.ownMinions)
            {
                if (m.handcard.card.deathrattle) p.minionGetDamageOrHeal(m, 2);
            }

        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:15,代码来源:Sim_GvG_101.cs

示例12: getBattlecryEffect

        //   Battlecry: Restore 8 Health to your hero.

        public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {
            if (own.own)
            {
                int heal = p.getMinionHeal(8, own.own);
                p.minionGetDamageOrHeal(p.playerFirst.ownHero, -heal, true);
            }
            else
            {
                int heal = p.getMinionHeal(8, own.own);
                p.minionGetDamageOrHeal(p.playerSecond.ownHero, -heal, true);
            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:15,代码来源:Sim_GvG_069.cs

示例13: onCardIsGoingToBePlayed

        // After you cast a spell, deal 2 damage randomly split among all enemies.

        public override void onCardIsGoingToBePlayed(Playfield p, CardDB.Card c, bool ownplay, Minion m)
        {
            if (m.own == ownplay && c.type == CardDB.cardtype.SPELL)
            {
                Minion target = (ownplay) ? p.playerSecond.ownHero : p.playerFirst.ownHero;
                p.minionGetDamageOrHeal(target, 1);

                List<Minion> temp = (ownplay) ? p.playerSecond.ownMinions : p.playerFirst.ownMinions;
                if (temp.Count > 0) target = p.searchRandomMinion(temp, Playfield.searchmode.searchLowestHP);
                if (target == null) target = (ownplay) ? p.playerSecond.ownHero : p.playerFirst.ownHero;
                p.minionGetDamageOrHeal(target, 1);
            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:15,代码来源:Sim_BRM_002.cs

示例14: onCardPlay

		// Deal 2 damage to all non-Demon minions.
		
		public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
		{
            int dmg = p.getSpellDamageDamage(2, ownplay);
			
			foreach (Minion m in p.playerFirst.ownMinions)
            {
                if ((TAG_RACE)m.handcard.card.race != TAG_RACE.DEMON) p.minionGetDamageOrHeal(m, dmg);
            }
            foreach (Minion m in p.playerSecond.ownMinions)
            {
                if ((TAG_RACE)m.handcard.card.race != TAG_RACE.DEMON) p.minionGetDamageOrHeal(m, dmg);
            }
		}
开发者ID:shuyi3,项目名称:AIPJ,代码行数:15,代码来源:Sim_BRM_005.cs

示例15: onCardPlay

        //todo make it better :D
        //Fügt allen Feinden $2 Schaden zu. Stellt bei allen befreundeten Charakteren #2 Leben wieder her.
        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            int dmg = p.getSpellDamageDamage(2, ownplay);
            int heal = p.getSpellHeal(2, ownplay);
            if (ownplay)
            {
                p.minionGetDamageOrHeal(p.playerFirst.ownHero, -heal);
                p.minionGetDamageOrHeal(p.playerSecond.ownHero, dmg);
                foreach (Minion m in p.playerFirst.ownMinions)
                {
                    p.minionGetDamageOrHeal(m, -heal);
                }

                foreach (Minion m in p.playerSecond.ownMinions)
                {
                    p.minionGetDamageOrHeal(m, dmg);
                }
            }
            else 
            {
                p.minionGetDamageOrHeal(p.playerSecond.ownHero, -heal);
                p.minionGetDamageOrHeal(p.playerFirst.ownHero, dmg);
                foreach (Minion m in p.playerSecond.ownMinions)
                {
                    p.minionGetDamageOrHeal(m, -heal);
                }

                foreach (Minion m in p.playerFirst.ownMinions)
                {
                    p.minionGetDamageOrHeal(m, dmg);
                }
            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:35,代码来源:Sim_CS1_112.cs


注:本文中的HRSim.Playfield.minionGetDamageOrHeal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。