• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Bots.Playfield类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Playfield类属于HREngine.Bots命名空间,在下文中一共展示了Playfield类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: onCardIsGoingToBePlayed

//    erhaltet jedes mal einen „feuerball“-zauber auf eure hand, wenn ihr einen zauber wirkt.

        public override void onCardIsGoingToBePlayed(Playfield p, CardDB.Card c, bool wasOwnCard, Minion triggerEffectMinion, Minion target, int choice)
        {
            if (wasOwnCard == triggerEffectMinion.own && c.type == CardDB.cardtype.SPELL)
            {
                p.drawACard(CardDB.cardIDEnum.CS2_029, wasOwnCard, true);
            }
        }
开发者ID:cookiezeater,项目名称:silverfish,代码行数:9,代码来源:Sim_EX1_559.cs


示例2: onCardIsGoingToBePlayed

//    wenn ein spieler einen zauber wirkt, erhält der andere spieler eine kopie desselben auf seine hand.

        public override void onCardIsGoingToBePlayed(Playfield p, CardDB.Card c, bool wasOwnCard, Minion triggerEffectMinion)
        {
            if (c.type == CardDB.cardtype.SPELL)
            {
                p.drawACard(c.cardIDenum, !wasOwnCard, true);
            }
        }
开发者ID:martdeboer,项目名称:silverfish,代码行数:9,代码来源:Sim_EX1_100.cs


示例3: onCardPlay

//    verleiht euren dienern bis zu eurem nächsten zug verstohlenheit/.

		public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
		{
            if (ownplay)
            {
                foreach (Minion m in p.ownMinions)
                {
                    if (!m.stealth)
                    {
                        m.stealth = true;
                        m.concedal = true;
                    }
                }
            }
            else
            {
                foreach (Minion m in p.enemyMinions)
                {
                    if (!m.stealth)
                    {
                        m.stealth = true;
                        m.concedal = true;
                    }
                }
            }
		}
开发者ID:JayMansel,项目名称:silverfish,代码行数:27,代码来源:Sim_EX1_128.cs


示例4: onAuraEnds

 public override void onAuraEnds(Playfield p, Minion own)
 {
     if (own.own)
     {
         p.anzOwnHorsemen--;
         if (p.anzOwnHorsemen < 1)
         {
             p.ownHero.immune = false;
             if (p.ownWeaponCard.name == CardDB.cardName.runeblade)
             {
                 int bonus = (p.ownWeaponCard.cardIDenum == CardDB.cardIDEnum.NAX9_05H) ? 6 : 3;
                 p.minionGetBuffed(p.ownHero, bonus, 0);
                 p.ownWeaponAttack += bonus;
             }
         }
     }
     else
     {
         p.anzEnemyHorsemen--;
         if (p.anzEnemyHorsemen < 1)
         {
             p.enemyHero.immune = false;
             if (p.enemyWeaponCard.name == CardDB.cardName.runeblade)
             {
                 int bonus = (p.enemyWeaponCard.cardIDenum == CardDB.cardIDEnum.NAX9_05H) ? 6 : 3;
                 p.minionGetBuffed(p.enemyHero, bonus, 0);
                 p.enemyWeaponAttack += bonus;
             }
         }
     }
 }
开发者ID:cookiezeater,项目名称:silverfish,代码行数:31,代码来源:Sim_NAX9_03.cs


示例5: getBattlecryEffect

        //Battlecry: Give all minions in your hand and deck +1/+1.

        public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {
            if (p.isServer)
            {
                if (own.own)
                {
                    foreach (Handmanager.Handcard hc in p.owncards)
                    {
                        if (hc.card.type == CardDB.cardtype.MOB)
                        {
                            hc.addattack++;
                            hc.addHp++;
                        }
                    }

                    foreach (Handmanager.Handcard hc in p.myDeck)
                    {
                        if (hc.card.type == CardDB.cardtype.MOB)
                        {
                            hc.addattack++;
                            hc.addHp++;
                        }
                    }
                }
                else
                {
                    foreach (Handmanager.Handcard hc in p.EnemyCards)
                    {
                        if (hc.card.type == CardDB.cardtype.MOB)
                        {
                            hc.addattack++;
                            hc.addHp++;
                        }
                    }

                    foreach (Handmanager.Handcard hc in p.enemyDeck)
                    {
                        if (hc.card.type == CardDB.cardtype.MOB)
                        {
                            hc.addattack++;
                            hc.addHp++;
                        }
                    }
                }
                return;
            }

            if (own.own)
            {
                foreach (Handmanager.Handcard hc in p.owncards)
                {
                    if (hc.card.type == CardDB.cardtype.MOB)
                    {
                        hc.addattack++;
                        hc.addHp++;
                    }
                }
            }

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


示例6: onSecretPlay

        public override void onSecretPlay(Playfield p, bool ownplay, Minion attacker, Minion target, out int number)
        {
            number = 0;
            if (ownplay)
            {
                int posi = p.ownMinions.Count;
                p.callKid(kid, posi, true);
                if (p.ownMinions.Count >= 1)
                {
                    if (p.ownMinions[p.ownMinions.Count - 1].name == CardDB.cardName.spellbender)
                    {
                        number = p.ownMinions[p.ownMinions.Count - 1].entityID;
                    }
                }
            }
            else
            {
                int posi = p.enemyMinions.Count;
                p.callKid(kid, posi, false);

                if (p.enemyMinions.Count >= 1)
                {
                    if (p.enemyMinions[p.enemyMinions.Count - 1].name == CardDB.cardName.spellbender)
                    {
                        number = p.enemyMinions[p.enemyMinions.Count - 1].entityID;
                    }
                }
            }

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


示例7: getBattlecryEffect

        //todo: what happens if the target is damaged?
       //Battlecry: Swap Health with another minion.

        public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {
            if (target == null) return;

            int volMHp = own.maxHp;
            int tarMHp = target.maxHp;


            target.maxHp = volMHp;
            if (tarMHp < volMHp)//minion has lower maxHp as his card -> heal his hp
            {
                target.Hp += volMHp - tarMHp; //heal minion
            }
            if (target.Hp > target.maxHp) 
            {
                target.Hp = target.maxHp;
            }

            own.maxHp = tarMHp;
            if (volMHp < tarMHp)//minion has lower maxHp as his card -> heal his hp
            {
                own.Hp += tarMHp - volMHp; //heal minion
            }
            if (own.Hp > own.maxHp)
            {
                own.Hp = own.maxHp;
            }



        }
开发者ID:martdeboer,项目名称:silverfish,代码行数:34,代码来源:Sim_GvG_014.cs


示例8: onCardPlay

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

            List<Minion> temp = (ownplay) ? p.ownMinions : p.enemyMinions;
            bool hasmech = false;
            foreach (Minion m in temp)
            {
                //if we have allready a mechanical, we are buffed
                if ((TAG_RACE)m.handcard.card.race == TAG_RACE.MECHANICAL) hasmech=true;
            }
            if (hasmech)
            {
                if (ownplay)
                {
                    p.ownWeaponAttack += 2;
                    p.minionGetBuffed(p.ownHero, 2, 0);
                }
                else
                {
                    p.enemyWeaponAttack += 2;
                    p.minionGetBuffed(p.enemyHero, 2, 0);
                }
            }


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


示例9: onMinionIsSummoned

        public override void onMinionIsSummoned(Playfield p, Minion triggerEffectMinion, Minion summonedMinion)
        {
            if ((TAG_RACE)summonedMinion.handcard.card.race == TAG_RACE.MECHANICAL)
            {
                List<Minion> temp = (triggerEffectMinion.own) ? p.ownMinions : p.enemyMinions;

                foreach (Minion m in temp)
                {
                    //if we have allready a mechanical, we are buffed
                    if ((TAG_RACE)m.handcard.card.race == TAG_RACE.MECHANICAL) return; 
                }

                //we had no mechanical, but now!
                if (triggerEffectMinion.own)
                {
                    p.ownWeaponAttack += 2;
                    p.minionGetBuffed(p.ownHero, 2, 0);
                }
                else
                {
                    p.enemyWeaponAttack += 2;
                    p.minionGetBuffed(p.enemyHero, 2, 0);
                }
            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:25,代码来源:Sim_GvG_024.cs


示例10: onCardPlay

        CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.CS2_101t);//silverhandrecruit

        //    Summon two 1/1 Recruits.
        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            int posi = (ownplay) ? p.ownMinions.Count : p.enemyMinions.Count;

            p.callKid(kid, posi, ownplay);
            p.callKid(kid, posi, ownplay);
        }
开发者ID:cookiezeater,项目名称:silverfish,代码行数:10,代码来源:Sim_AT_132_PALADIN.cs


示例11: getPlayPenalty

//    kampfschrei:/ fügt einem diener 1 schaden zu und verleiht ihm +2 angriff.
		public override int getPlayPenalty(Playfield p, Minion m, Minion target, int choice, bool isLethal)
		{
            if (target.own)
            {
                if (m.Hp == 1) return 50;
                if (!m.Ready)
                {
                    return 50;
                }
            }
            else
            {
                if (m.handcard.card.type == CardDB.cardtype.MOB && p.ownMinions.Count == 0) return 0;
                //allow it if you have biggamehunter
                foreach (Handmanager.Handcard hc in p.owncards)
                {
                    if (hc.card.name == CardDB.cardName.biggamehunter || hc.card.name == CardDB.cardName.shadowworddeath) return 0;
                }

                if (m.Hp == 1)
                {
                    return 0;
                }

                if (!m.wounded && (m.Angr >= 4 || m.Hp >= 5))
                {
                    foreach (Handmanager.Handcard hc in p.owncards)
                    {
                        if (hc.card.name == CardDB.cardName.execute) return 0;
                    }
                }
                return base.getValueOfMinion(4,5);
            }
            return 0;
		}
开发者ID:JayMansel,项目名称:silverfish,代码行数:36,代码来源:Pen_EX1_603.cs


示例12: 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.doublepriest >= 1) dmg *= (2 * p.doublepriest);
				if (p.enemyMinions.Count > 0)
				{
					target = p.searchRandomMinion(p.enemyMinions, Playfield.searchmode.searchLowestHP); //damage the lowest (pessimistic variant)
				}
				else
				{
					target = p.enemyHero;
				}
            }
            else
            {
                if (p.enemydoublepriest >= 1) dmg *= (2 * p.enemydoublepriest);
				if (p.ownMinions.Count > 0)
				{
					target = p.searchRandomMinion(p.ownMinions, Playfield.searchmode.searchHighestAttack); //damage the Highest (pessimistic variant)
				}
				else
				{
					target = p.ownHero;
				}
            }			
            p.minionGetDamageOrHeal(target, dmg);
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:31,代码来源:Sim_BRM_027p.cs


示例13: onCardIsGoingToBePlayed

 // 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, Minion target, int choice)
 {
     if (wasOwnCard == triggerEffectMinion.own && c.Recall)
     {
         p.minionGetBuffed(triggerEffectMinion, 1, 1);
     }
 }
开发者ID:cookiezeater,项目名称:silverfish,代码行数:8,代码来源:Sim_EX1_258.cs


示例14: getBattlecryEffect

        // Battlecry: Deal 4 damage to a random enemy minion.  

        public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {
            if (p.isServer)
            {
                Minion choosen = p.getRandomMinionFromSide_SERVER(!own.own, false);
                if (choosen != null) p.minionGetDamageOrHeal(choosen, 4);
                return;
            }

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

            if (temp.Count >= 1)
            {
                //search Minion with lowest hp
                Minion enemy = temp[0];
                int minhp = 10000;
                foreach (Minion m in temp)
                {
                    if (m.Hp >= times + 1 && minhp > m.Hp)
                    {
                        enemy = m;
                        minhp = m.Hp;
                    }
                }

                p.minionGetDamageOrHeal(enemy, times);

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


示例15: getBattlecryEffect

        //Battlecry: Give a friendly Beast Immune this turn.

        public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {
            if (target != null && target.handcard.card.race == TAG_RACE.PET)
            {
                target.immune = true;
            }
        }
开发者ID:cookiezeater,项目名称:silverfish,代码行数:9,代码来源:Sim_AT_057.cs


示例16: onMinionDiedTrigger

		public override void onMinionDiedTrigger(Playfield p, Minion m, Minion diedMinion)
        {
			int diedMinions = (m.own)? p.tempTrigger.ownMechanicDied : p.tempTrigger.enemyMechanicDied;
            if (diedMinions >= 1)
			{
				List<Minion> temp = (m.own) ? p.ownMinions : p.enemyMinions;
				bool hasmechanics = false;
                foreach (Minion mTmp in temp) //check if we have more mechanics, or debuff him
                {
                    if (mTmp.Hp >=1 && (TAG_RACE)mTmp.handcard.card.race == TAG_RACE.MECHANICAL) hasmechanics = true;
                }
				
                if (!hasmechanics)
                {
					if(m.own)
					{
						p.ownWeaponAttack -= 2;
						p.minionGetBuffed(p.ownHero, -2, 0);
					}
					else
					{
                        p.enemyWeaponAttack -= 2;
                        p.minionGetBuffed(p.enemyHero, -2, 0);
					}
                }
            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:27,代码来源:Sim_GvG_024.cs


示例17: getPlayPenalty

		public override float getPlayPenalty(Playfield p, Handmanager.Handcard hc, Minion target, int choice, bool isLethal)
		{
            int pen = 0;
            foreach(Handmanager.Handcard hcc in p.owncards)
            {
                if (hcc.getManaCost(p) == 2 && hcc.card.type == CardDB.cardtype.MOB && hcc.card.type != CardDB.cardtype.HEROPWR && hcc.card.name != CardDB.cardName.ironbeakowl) pen += 2;
                //if (p.manaTurnEnd >= hcc.getManaCost(p)) pen -= 2;
            }
            bool ablilityready = false;
            foreach(Minion mnn in p.ownMinions)
            {
                if (mnn.name == CardDB.cardName.knifejuggler && p.ownHeroAblility.card.getManaCost(p, 2) <= p.manaTurnEnd) ablilityready = true;
            }
            bool targetready = false;
            foreach (Minion mnn in p.ownMinions)
            {
                if (mnn.name != CardDB.cardName.grimpatron && mnn.Hp == 1) targetready = true;
            }

            if (ablilityready && targetready) pen = 0;

            foreach (Minion mnn in p.enemyMinions)
            {
                if (mnn.Angr >= 2 && mnn.Hp == 1 && p.ownMaxMana <= 2 && p.enemyHeroName != HeroEnum.druid && p.enemyHeroName != HeroEnum.thief && p.enemyHeroName != HeroEnum.mage) return -5;
            }

			return pen;
		}
开发者ID:ANAXRIDER,项目名称:custom,代码行数:28,代码来源:Pen_CS2_101.cs


示例18: onCardPlay

//    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 = (ownplay) ? p.getSpellDamageDamage(1) : p.getEnemySpellDamageDamage(1);
            target.frozen = true;
            p.minionGetDamageOrHeal(target, dmg);
            
		}
开发者ID:JayMansel,项目名称:silverfish,代码行数:8,代码来源:Sim_CS2_037.cs


示例19: onTurnEndsTrigger

//    zieht am ende eures zuges eine karte.
        public override void onTurnEndsTrigger(Playfield p, Minion triggerEffectMinion, bool turnEndOfOwner)
        {
            if (turnEndOfOwner == triggerEffectMinion.own)
            {
                p.drawACard(CardDB.cardName.unknown, turnEndOfOwner);
            }
        }
开发者ID:JayMansel,项目名称:silverfish,代码行数:8,代码来源:Sim_EX1_575.cs


示例20: onCardPlay

//    verursacht $5 schaden. zieht eine karte.

		public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
		{
            int dmg = (ownplay) ? p.getSpellDamageDamage(5) : p.getEnemySpellDamageDamage(5);
            p.minionGetDamageOrHeal(target, dmg);
            //this.owncarddraw++;
            p.drawACard(CardDB.cardName.unknown, ownplay);
		}
开发者ID:JayMansel,项目名称:silverfish,代码行数:9,代码来源:Sim_EX1_173.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Domain.Hre_ProfileServices类代码示例发布时间:2022-05-26
下一篇:
C# Bots.Minion类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap