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

C# Bots.Minion类代码示例

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

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



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

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


示例2: Minion

 public Minion(Minion m)
 {
     this.id = m.id;
     this.Posix = m.Posix;
     this.Posiy = m.Posiy;
     this.Hp = m.Hp;
     this.maxHp = m.maxHp;
     this.Angr = m.Angr;
     this.Ready = m.Ready;
     this.taunt = m.taunt;
     this.wounded = m.wounded;
     this.name = m.name;
     this.handcard = m.handcard;
     this.divineshild = m.divineshild;
     this.windfury = m.windfury;
     this.frozen = m.frozen;
     this.zonepos = m.zonepos;
     this.stealth = m.stealth;
     this.immune = m.immune;
     this.exhausted = m.exhausted;
     this.numAttacksThisTurn = m.numAttacksThisTurn;
     this.playedThisTurn = m.playedThisTurn;
     this.charge = m.charge;
     this.poisonous = m.poisonous;
     this.silenced = m.silenced;
     this.entitiyID = m.entitiyID;
     this.enchantments= new List<Enchantment>(m.enchantments);
     this.cantLowerHPbelowONE = m.cantLowerHPbelowONE;
 }
开发者ID:RyukOP,项目名称:HRCustomClasses,代码行数:29,代码来源:Minion.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: getBattlecryEffect

        //Battlecry: Restore 4 Health to each hero

        public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {
           
            int heal2 = (own.own) ? p.getMinionHeal(4) : p.getEnemyMinionHeal(4);
            p.minionGetDamageOrHeal(own.own ? p.ownHero : p.enemyHero, -heal2);
            p.minionGetDamageOrHeal(own.own ? p.enemyHero : p.ownHero, -heal2);
        }
开发者ID:noHero123,项目名称:silverfish,代码行数:9,代码来源:Sim_AT_111.cs


示例5: onCardPlay

		public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
		{
            if (ownplay)
            {
                if (p.ownHeroAblility.card.cardIDenum == CardDB.cardIDEnum.CS1h_001) // lesser heal becomes mind spike
                {
                    p.ownHeroAblility.card = mindspike;
                    p.ownAbilityReady = true;
                }
                else
                {
                    p.ownHeroAblility.card = shatter;  // mindspike becomes mind shatter
                    p.ownAbilityReady = true;
                }
            }
            else
            {
                if (p.enemyHeroAblility.card.cardIDenum == CardDB.cardIDEnum.CS1h_001) // lesser heal becomes mind spike
                {
                    p.enemyHeroAblility.card = mindspike;
                }
                else
                {
                    p.enemyHeroAblility.card = shatter;  // mindspike becomes mind shatter
                }
            }
		}
开发者ID:JayMansel,项目名称:silverfish,代码行数:27,代码来源:Sim_EX1_625.cs


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


示例7: onAuraStarts

        // Your hero is Immune.

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


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


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


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


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


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


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


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


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


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


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


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


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


示例20: onDeathrattle

        //todo make it better
//    todesröcheln:/ übernehmt die kontrolle über einen zufälligen feindlichen diener.
        public override void onDeathrattle(Playfield p, Minion m)
        {
            if (p.isServer)
            {
                Minion choosen = p.getRandomMinionFromSide_SERVER(!m.own, false);
                if (choosen != null) p.minionGetControlled(choosen, m.own, false);
                return;
            }

                List<Minion> tmp = (m.own) ? p.enemyMinions : p.ownMinions;
                if (tmp.Count >= 1)
                {
                    Minion target = null;
                    int value = 10000;
                    bool found = false;

                    //search smallest minion:
                    foreach (Minion mnn in tmp)
                    {
                        if (mnn.Hp < value && mnn.Hp >= 1)
                        {
                            target = mnn;
                            value = target.Hp;
                            found = true;
                        }
                    }
                    if (found) p.minionGetControlled(target, m.own, false);
                }

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Bots.Playfield类代码示例发布时间:2022-05-26
下一篇:
C# Bots.Handmanager类代码示例发布时间: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