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


C# Playfield.getRandomNumber_SERVER方法代码示例

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


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

示例1: onCardPlay

//    fügt zwei zufälligen feindlichen dienern $2 schaden zu.

		public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
		{
            if (p.isServer)
            {
                int damageS = (ownplay) ? p.getSpellDamageDamage(2) : p.getEnemySpellDamageDamage(2);
                List<Minion> temp22 = (ownplay) ? new List<Minion>(p.enemyMinions) : new List<Minion>(p.ownMinions);
                if (temp22.Count < 2) return;
                int random1 = p.getRandomNumber_SERVER(0, temp22.Count - 1);
                int random2 = p.getRandomNumber_SERVER(0, temp22.Count - 2);
                if (random2 >= random1) random2++;

                p.minionGetDamageOrHeal(temp22[random1], damageS);
                p.minionGetDamageOrHeal(temp22[random2], damageS);

                return;
            }

            //TODO delete new list
            int damage = (ownplay) ? p.getSpellDamageDamage(2) : p.getEnemySpellDamageDamage(2);
            List<Minion> temp2 = (ownplay) ? new List<Minion>(p.enemyMinions) : new List<Minion>(p.ownMinions) ;
            temp2.Sort((a, b) => a.Hp.CompareTo(b.Hp));
            int i = 0;
            foreach (Minion enemy in temp2)
            {
                p.minionGetDamageOrHeal(enemy, damage);
                i++;
                if (i == 2) break;
            }


		}
开发者ID:cookiezeater,项目名称:silverfish,代码行数:33,代码来源:Sim_CS2_114.cs

示例2: onCardPlay

        //    Deal $4-$5 damage to all minions. Overload: (5)

        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            if (ownplay) { p.owedRecall += 5; } else { p.enemyRecall += 5; };
            if (p.isServer)
            {

                foreach (Minion m in p.ownMinions)
                {
                    int dmgr = p.getRandomNumber_SERVER(4, 5);
                    dmgr = (ownplay) ? p.getSpellDamageDamage(dmgr) : p.getEnemySpellDamageDamage(dmgr);
                    p.minionGetDamageOrHeal(m, dmgr);
                }

                foreach (Minion m in p.enemyMinions)
                {
                    int dmgr = p.getRandomNumber_SERVER(4, 5);
                    dmgr = (ownplay) ? p.getSpellDamageDamage(dmgr) : p.getEnemySpellDamageDamage(dmgr);
                    p.minionGetDamageOrHeal(m, dmgr);
                }

                return;
            }

            int dmg = (ownplay) ? p.getSpellDamageDamage(5) : p.getEnemySpellDamageDamage(5);
            p.allMinionsGetDamage(dmg);
            
        }
开发者ID:spanos123,项目名称:silverfish,代码行数:29,代码来源:Sim__AT_051.cs

示例3: onCardPlay

        CardDB.Card copymin = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.CS2_182); // we take a icewindjety :D

		public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
		{

            if (p.isServer)
            {
                List<Handmanager.Handcard> temp = new List<Handmanager.Handcard>();
                List<Handmanager.Handcard> cards = (ownplay)? p.enemyDeck : p.myDeck;

                foreach (Handmanager.Handcard hc in cards)
                {
                    if (hc.card.type == CardDB.cardtype.MOB)
                    {
                        temp.Add(hc);
                    }
                }

                if (temp.Count >= 1)
                {

                    int rand = p.getRandomNumber_SERVER(0, temp.Count - 1);
                    int posi = (ownplay) ? p.ownMinions.Count : p.enemyMinions.Count;
                    p.callKid(cards[rand].card, posi, true);
                }
                else
                {
                    int posi = (ownplay) ? p.ownMinions.Count : p.enemyMinions.Count;
                    p.callKid(shadow, posi, true);
                }
                return;
            }
            p.callKid(copymin, p.ownMinions.Count, true);
		}
开发者ID:cookiezeater,项目名称:silverfish,代码行数:34,代码来源:Sim_EX1_345.cs

示例4: 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.ownMinions : p.enemyMinions;
                List<Minion> tempmech = new List<Minion>();
                foreach (Minion m in temp)
                {
                    if ((TAG_RACE)m.handcard.card.race == TAG_RACE.MECHANICAL)
                    {
                        tempmech.Add(m);
                    }
                }
                if (tempmech.Count >= 1)
                {
                    if (p.isServer)
                    {
                        int random = p.getRandomNumber_SERVER(0, tempmech.Count - 1);
                        p.minionGetBuffed(tempmech[random], 2, 2);
                        return;
                    }
                    p.minionGetBuffed(p.searchRandomMinion(tempmech, (triggerEffectMinion.own ? Playfield.searchmode.searchLowestHP : Playfield.searchmode.searchHighestHP)), 2, 2);
                }
            }
        }
开发者ID:cookiezeater,项目名称:silverfish,代码行数:27,代码来源:Sim_GvG_027.cs

示例5: getBattlecryEffect

        //  Battlecry: Give your other minions Windfury Taunt or Divine Shield

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

            if (p.isServer)
            {
                List<Minion> temps = (own.own) ? p.ownMinions : p.enemyMinions;

                foreach (Minion m in temps)
                {
                    int random = p.getRandomNumber_SERVER(0, 2);
                    if(random == 0) m.taunt = true;
                    if (random == 1) m.divineshild = true;
                    if (random == 2) m.windfury = true;
                }

                return;
            }

            List<Minion> temp = (own.own) ? p.ownMinions : p.enemyMinions;

            foreach (Minion m in temp)
            {
                m.taunt = true;
            }

        }
开发者ID:cookiezeater,项目名称:silverfish,代码行数:28,代码来源:Sim_GvG_107.cs

示例6: onDeathrattle

        CardDB.Card c = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.EX1_301);//felguard
//    todesröcheln:/ legt einen zufälligen dämon aus eurer hand auf das schlachtfeld.

        public override void onDeathrattle(Playfield p, Minion m)
        {
            if (p.isServer)
            {
                List<Handmanager.Handcard> temp = new List<Handmanager.Handcard>();
                List<Handmanager.Handcard> cards = (m.own) ? p.owncards : p.EnemyCards;

                foreach (Handmanager.Handcard hc in cards)
                {
                    if ((TAG_RACE)hc.card.race == TAG_RACE.DEMON)
                    {
                        temp.Add(hc);
                    }
                }

                if (temp.Count == 0) return;

                int rand = p.getRandomNumber_SERVER(0, temp.Count - 1);

                p.callKid(cards[rand].card, p.ownMinions.Count, m.own);
                p.removeCard_SERVER(cards[rand], m.own);

                return;
            }

            if (m.own)
            {
                List<Handmanager.Handcard> temp = new List<Handmanager.Handcard>();
                foreach (Handmanager.Handcard hc in p.owncards)
                {
                    if ((TAG_RACE)hc.card.race == TAG_RACE.DEMON)
                    {
                        temp.Add(hc);
                    }
                }

                temp.Sort((x, y) => x.card.Attack.CompareTo(y.card.Attack));

                foreach (Handmanager.Handcard mnn in temp)
                {
                    p.callKid(mnn.card, p.ownMinions.Count, true);
                    p.removeCard(mnn);
                    break;
                }

            }
            else
            {
                if (p.enemyAnzCards >= 1)
                {
                    p.callKid(c, p.enemyMinions.Count , false);
                }
            }
        }
开发者ID:noHero123,项目名称:silverfish,代码行数:57,代码来源:Sim_FP1_022.cs

示例7: getBattlecryEffect

//    kampfschrei:/ verleiht beiden spielern die macht des rock! (durch eine powerakkordkarte)
		public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
		{
            if (p.isServer)
            {
                bool chooser = true;
                int random = p.getRandomNumber_SERVER(0, 2);

                if (random == 0) p.drawACard(CardDB.cardIDEnum.PRO_001a, chooser, true);
                if (random == 1) p.drawACard(CardDB.cardIDEnum.PRO_001b, chooser, true);
                if (random == 2) p.drawACard(CardDB.cardIDEnum.PRO_001c, chooser, true);

                chooser = false;
                random = p.getRandomNumber_SERVER(0, 2);
                if (random == 0) p.drawACard(CardDB.cardIDEnum.PRO_001a, chooser, true);
                if (random == 1) p.drawACard(CardDB.cardIDEnum.PRO_001b, chooser, true);
                if (random == 2) p.drawACard(CardDB.cardIDEnum.PRO_001c, chooser, true);
                return;
            }
            p.drawACard(CardDB.cardIDEnum.PRO_001b, true, true);
            p.drawACard(CardDB.cardIDEnum.PRO_001b, false, true);
		}
开发者ID:cookiezeater,项目名称:silverfish,代码行数:22,代码来源:Sim_PRO_001.cs

示例8: getBattlecryEffect

        //    Battlecry: Gain 1-4 Attack. &lt;b&gt;Overload:&lt;/b&gt; (1)
       
		public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
		{
            if (p.isServer)
            {
                if (own.own) { p.owedRecall += 1; } else { p.enemyRecall += 1; };
                int random = p.getRandomNumber_SERVER(1, 4);
                p.minionGetBuffed(own, random, 0);
                return;
            }

            if (own.own) { p.owedRecall += 1; } else { p.enemyRecall += 1; };
            p.minionGetBuffed(own, 2, 0);
		}
开发者ID:peppert,项目名称:silverfish,代码行数:15,代码来源:Sim_BRM_012.cs

示例9: onDeathrattle

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

        

        public override void onDeathrattle(Playfield p, Minion m)
        {
            if (p.isServer)
            {
                int randdmg = p.getRandomNumber_SERVER(1, 4);
                Minion poortarget = p.getRandomMinionFromSide_SERVER(!m.own, true);
                if (poortarget != null) p.minionGetDamageOrHeal(poortarget, randdmg);
                return;
            }

            int dmg = (m.own ? 2 : 3);
            p.doDmgToRandomEnemyCLIENT2(dmg, true, m.own);

        }
开发者ID:noHero123,项目名称:silverfish,代码行数:18,代码来源:Sim_GvG_110t.cs

示例10: getBattlecryEffect

//    kampfschrei:/ konstruiert eine fantastische erfindung.
		public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
		{
            if (p.isServer)
            {
                int random = p.getRandomNumber_SERVER(0, 3);
                if (random == 0) p.callKid(kid, own.zonepos, own.own, true);
                if (random == 1) p.callKid(kid1, own.zonepos, own.own, true);
                if (random == 2) p.callKid(kid2, own.zonepos, own.own, true);
                if (random == 3) p.callKid(kid3, own.zonepos, own.own, true);
                
                return;
            }
            p.callKid(kid, own.zonepos, own.own, true);
		}
开发者ID:cookiezeater,项目名称:silverfish,代码行数:15,代码来源:Sim_EX1_112.cs

示例11: onCardPlay

        //    Deal $3-$6 damage.Overload: (1)

        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            p.changeRecall(ownplay, 1);
            if (p.isServer)
            {
                int random = p.getRandomNumber_SERVER(3, 6);
                int dmgS = (ownplay) ? p.getSpellDamageDamage(random) : p.getEnemySpellDamageDamage(random);
                p.minionGetDamageOrHeal(target, dmgS);
                
                return;
            }

            int dmg = (ownplay) ? p.getSpellDamageDamage(4) : p.getEnemySpellDamageDamage(4);
            p.minionGetDamageOrHeal(target, dmg);
        }
开发者ID:noHero123,项目名称:silverfish,代码行数:17,代码来源:Sim_GvG_038.cs

示例12: onTurnStartTrigger

//    zu beginn eures zuges besteht eine chance von 50%, dass ihr eine zusätzliche karte zieht.
        public override void onTurnStartTrigger(Playfield p, Minion triggerEffectMinion, bool turnStartOfOwner)
        {
            if (triggerEffectMinion.own == turnStartOfOwner)
            {
                if (p.isServer)
                {
                    int random = p.getRandomNumber_SERVER(0, 1);
                    if (random == 0)
                    {
                        p.drawACard(CardDB.cardIDEnum.None, turnStartOfOwner);
                    }
                    return;
                }
                p.drawACard(CardDB.cardIDEnum.None, turnStartOfOwner);
            }
        }
开发者ID:cookiezeater,项目名称:silverfish,代码行数:17,代码来源:Sim_EX1_557.cs

示例13: onTurnEndsTrigger

//    zieht am ende eures zuges eine traumkarte.

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

                if (p.isServer)
                {
                    int random = p.getRandomNumber_SERVER(0, 4);
                    if (random == 0) p.drawACard(CardDB.cardIDEnum.DREAM_01, turnEndOfOwner, true);
                    if (random == 1) p.drawACard(CardDB.cardIDEnum.DREAM_02, turnEndOfOwner, true);
                    if (random == 2) p.drawACard(CardDB.cardIDEnum.DREAM_03, turnEndOfOwner, true);
                    if (random == 3) p.drawACard(CardDB.cardIDEnum.DREAM_04, turnEndOfOwner, true);
                    if (random == 4) p.drawACard(CardDB.cardIDEnum.DREAM_05, turnEndOfOwner, true);
                }
                p.drawACard(CardDB.cardIDEnum.DREAM_02, turnEndOfOwner, true);
            }
        }
开发者ID:noHero123,项目名称:silverfish,代码行数:19,代码来源:Sim_EX1_572.cs

示例14: onTurnStartTrigger

//    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 (p.isServer && triggerEffectMinion.own == turnStartOfOwner)
            {
                List<Handmanager.Handcard> temp2 = new List<Handmanager.Handcard>();
                List<Handmanager.Handcard> hand = (turnStartOfOwner) ? p.owncards : p.EnemyCards;
                foreach (Handmanager.Handcard hc in hand)
                {
                    if (hc.card.type == CardDB.cardtype.MOB) temp2.Add(hc);
                }
                if (temp2.Count == 0) return;

                int random = p.getRandomNumber_SERVER(0, temp2.Count - 1);
                p.minionTransform(triggerEffectMinion, temp2[random].card);
                p.removeCard(temp2[random]);
                p.drawACard(CardDB.cardIDEnum.EX1_006, turnStartOfOwner, true);

                return;
            }


            if (turnStartOfOwner && triggerEffectMinion.own == turnStartOfOwner)
            {
                List<Handmanager.Handcard> temp2 = new List<Handmanager.Handcard>();
                foreach (Handmanager.Handcard hc in p.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);
                    p.drawACard(CardDB.cardIDEnum.EX1_006, true, true);
                    break;
                }
                return;
            }

            if (!turnStartOfOwner && triggerEffectMinion.own == turnStartOfOwner)
            {
                p.minionGetBuffed(triggerEffectMinion, 4, 4);
                triggerEffectMinion.Hp = triggerEffectMinion.maxHp;
            }
        }
开发者ID:cookiezeater,项目名称:silverfish,代码行数:48,代码来源:Sim_EX1_006.cs

示例15: onCardPlay

 //Deal $2-$3 damage to all enemy minions. Overload: (2)
 public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
 {
     if (p.isServer)
     {
         List<Minion> temp = (!ownplay) ? p.ownMinions : p.enemyMinions;
         foreach (Minion m in temp)
         {
             int random = p.getRandomNumber_SERVER(2, 3);
             int dmgs = (ownplay) ? p.getSpellDamageDamage(random) : p.getEnemySpellDamageDamage(random);
             p.minionGetDamageOrHeal(m, dmgs, true);
         }
         if (ownplay) { p.owedRecall += 2; } else { p.enemyRecall += 2; };
         return;
     }
     int dmg = (ownplay) ? p.getSpellDamageDamage(3) : p.getEnemySpellDamageDamage(3);
     p.allMinionOfASideGetDamage(!ownplay, dmg);
     if (ownplay) { p.owedRecall += 2; } else { p.enemyRecall += 2; };
 }
开发者ID:peppert,项目名称:silverfish,代码行数:19,代码来源:Sim_EX1_259.cs


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