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


C# Playfield.searchRandomMinion方法代码示例

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


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

示例1: onCardPlay

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

示例2: onMinionIsSummoned

        //   Whenever you summon a Pirate, deal 2 damage to a random enemy.

        public override void onMinionIsSummoned(Playfield p, Minion triggerEffectMinion, Minion summonedMinion)
        {
            if (triggerEffectMinion.own == summonedMinion.own)
            {
                List<Minion> temp = (triggerEffectMinion.own) ? p.playerSecond.ownMinions : p.playerFirst.ownMinions;
                Minion m = p.searchRandomMinion(temp, Playfield.searchmode.searchHighestHP);
                if (m != null)
                {
                    p.minionGetDamageOrHeal(m, 2, true);
                }
            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:14,代码来源:Sim_GvG_075.cs

示例3: onCardPlay

 public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
 {
     p.equipWeapon(w, ownplay);
     List<Minion> temp = (ownplay) ? p.playerFirst.ownMinions : p.playerSecond.ownMinions;
     if (temp.Count <= 0) return;
     Minion m = p.searchRandomMinion(temp, Playfield.searchmode.searchLowestHP);
     if (m != null)
     {
         m.divineshild = true;
         m.taunt = true;
     }
 }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:12,代码来源:Sim_GvG_059.cs

示例4: 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

示例5: onTurnEndsTrigger

        // Can't Attack. At the end of your turn, deal 8 damage to a random enemy.

        public override void onTurnEndsTrigger(Playfield p, Minion triggerEffectMinion, bool turnEndOfOwner)
        {
            if (triggerEffectMinion.own == turnEndOfOwner)
            {
                Minion target = new Minion();
                if (turnEndOfOwner)
                {
                    if (p.playerSecond.ownMinions.Count > 0)
                    {
                        target = p.searchRandomMinion(p.playerSecond.ownMinions, Playfield.searchmode.searchLowestHP); //damage the lowest (pessimistic variant)
                        if (target == null) {
                            target = p.searchRandomMinion(p.playerSecond.ownMinions, Playfield.searchmode.searchLowestHP); //damage the lowest (pessimistic variant)
                        }
                    }
                    else
                    {
                        target = p.playerSecond.ownHero;
                    }
                }
                else
                {
                    if (p.playerFirst.ownMinions.Count > 0)
                    {
                        target = p.searchRandomMinion(p.playerFirst.ownMinions, Playfield.searchmode.searchHighestAttack); //damage the Highest (pessimistic variant)
                        if (target == null) {
                            target = p.searchRandomMinion(p.playerFirst.ownMinions, Playfield.searchmode.searchHighestAttack); //damage the Highest (pessimistic variant)
                        }
                    }
                    else
                    {
                        target = p.playerFirst.ownHero;
                    }
                }           
                p.minionGetDamageOrHeal(target, 8);
                triggerEffectMinion.stealth = false;
                //Implementation is this right?
                //p.doDmgTriggers();
            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:41,代码来源:Sim_EX1_298.cs

示例6: onCardPlay

        //   Destroy a random enemy minion. Combo: And your opponent's weapon.


        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            List<Minion> temp = (ownplay)? p.playerSecond.ownMinions : p.playerFirst.ownMinions;
            if (temp.Count >= 1)
            {
                // Drew: Null check for searchRandomMinion.
                var found = p.searchRandomMinion(temp, Playfield.searchmode.searchLowestHP);
                if (found != null)
                {
                    p.minionGetDestroyed(found);
                }
            }
            if (p.playerFirst.cardsPlayedThisTurn >= 1) p.lowerWeaponDurability(1000, !ownplay);
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:17,代码来源:Sim_GvG_047.cs

示例7: onCardPlay

        //    Give your weapon +3 Attack. Combo: Give a random friendly minion +3 Attack.

        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            if (ownplay)
            {
                if (p.playerFirst.ownWeaponDurability >= 1)
                {
                    p.playerFirst.ownWeaponAttack += 3;
                    p.minionGetBuffed(p.playerFirst.ownHero, 3, 0);
                }
                if (p.playerFirst.cardsPlayedThisTurn >= 1 && p.playerFirst.ownMinions.Count >= 1)
                {
                    // Drew: Null check for searchRandomMinion.
                    var found = p.searchRandomMinion(p.playerFirst.ownMinions, Playfield.searchmode.searchLowestAttack);
                    if (found != null)
                    {
                        p.minionGetBuffed(found, 3, 0);
                    }
                }
            }
            else
            {
                if (p.playerSecond.ownWeaponDurability >= 1)
                {
                    p.playerSecond.ownWeaponAttack += 3;
                    p.minionGetBuffed(p.playerSecond.ownHero, 3, 0);
                }
                if (p.playerFirst.cardsPlayedThisTurn >= 1 && p.playerSecond.ownMinions.Count >= 1)
                {
                    // Drew: Null check for searchRandomMinion.
                    var found = p.searchRandomMinion(p.playerSecond.ownMinions, Playfield.searchmode.searchLowestAttack);
                    if (found != null)
                    {
                        p.minionGetBuffed(found, 3, 0);
                    }
                }
            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:39,代码来源:Sim_GvG_022.cs

示例8: onCardPlay

//  Hero Power (Heroic): Fire a missile for each card in your opponent's hand.

        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            int dmg = 1;
			int cardCount = 0;
            if (ownplay)
            {
				cardCount = p.playerFirst.owncards.Count;
                if (p.playerFirst.doublepriest >= 1) dmg *= (2 * p.playerFirst.doublepriest);
            }
            else
            {
				cardCount = p.playerSecond.owncards.Count;
                if (p.playerSecond.doublepriest >= 1) dmg *= (2 * p.playerSecond.doublepriest);
            }
						
            for (int i = 0; i < cardCount; i++)
            {
				var found = (ownplay)? p.searchRandomMinion(p.playerFirst.ownMinions, Playfield.searchmode.searchHighAttackLowHP) : p.searchRandomMinion(p.playerSecond.ownMinions, Playfield.searchmode.searchHighAttackLowHP);
				if (found != null)
				{
					p.minionGetDamageOrHeal(found, dmg);
				}
            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:26,代码来源:Sim_NAX2_03H.cs

示例9: onTurnEndsTrigger

        //   At the end of your turn, give another friendly Mech +2/+2.

        public override void onTurnEndsTrigger(Playfield p, Minion triggerEffectMinion, bool turnEndOfOwner)
        {
            if (turnEndOfOwner == triggerEffectMinion.own)
            {
                List<Minion> temp = (turnEndOfOwner) ? p.playerFirst.ownMinions : p.playerSecond.ownMinions;
                if (temp.Count >= 1)
                {
                    // Drew: Null check for searchRandomMinion.
                    var found = p.searchRandomMinion(temp, Playfield.searchmode.searchHighestAttack);
                    if (found != null)
                    {
                        p.minionGetBuffed(found, 2, 2);
                    }
                }
            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:18,代码来源:Sim_GvG_027.cs

示例10: onDeathrattle

        //  Deathrattle: Deal 1-4 damage to a random enemy.

        

        public override void onDeathrattle(Playfield p, Minion m)
        {
            List<Minion> temp = (m.own) ? p.playerSecond.ownMinions : p.playerFirst.ownMinions;
            if (temp.Count >= 1 && temp.Count >=1 )
            {
                var found = p.searchRandomMinion(temp, Playfield.searchmode.searchHighestHP);
                if (found != null)
                {
                    p.minionGetDamageOrHeal(found, 2);
                }
            }
            else
            {
                p.minionGetDamageOrHeal(((m.own)?p.playerSecond.ownHero : p.playerFirst.ownHero), 2);
            }

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


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