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


C# Handmanager.getManaCost方法代码示例

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


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

示例1: getPlayPenalty

		public override float getPlayPenalty(Playfield p, Handmanager.Handcard hc, Minion target, int choice, bool isLethal)
		{
            if (choice == 1) //deal 2 dmg
            {
                if (p.enemyMinions.Count == 0) return 25; 
            }
            if (choice == 2) // summon 2 1/1 sampling
            {
                if (p.manaTurnEnd <= hc.getManaCost(p))
                {
                    if (hc.getManaCost(p) == 1) return -2;
                }
            }
			return 0;
		}
开发者ID:ANAXRIDER,项目名称:custom,代码行数:15,代码来源:Pen_AT_037.cs

示例2: playCard

        public void playCard(Handmanager.Handcard hc, int cardpos, int cardEntity, int target, int targetEntity, int choice, int placepos, int penality)
        {
            CardDB.Card c = hc.card;
            this.evaluatePenality += penality;
            // lock at frostnova (click) / frostblitz (no click)
            this.mana = this.mana - hc.getManaCost(this);

            removeCard(hc);// remove card

            if (c.Secret)
            {
                this.ownSecretsIDList.Add(c.CardID);
                this.playedmagierinderkirintor = false;
            }
            if (c.type == CardDB.cardtype.SPELL) this.playedPreparation = false;

            //Helpfunctions.Instance.logg("play crd " + c.name + " entitiy# " + cardEntity + " mana " + hc.getManaCost(this) + " trgt " + target);
            if (logging) Helpfunctions.Instance.logg("play crd " + c.name + " entitiy# " + cardEntity + " mana " + hc.getManaCost(this) + " trgt " + target);

            if (c.type == CardDB.cardtype.MOB)
            {
                Action b = this.placeAmobSomewhere(hc, cardpos, target, choice,placepos);
                b.handcard = new Handmanager.Handcard(hc);
                b.druidchoice = choice;
                b.owntarget = placepos;
                b.enemyEntitiy = targetEntity;
                b.cardEntitiy = cardEntity;
                this.playactions.Add(b);
                this.mobsplayedThisTurn++;
                if (c.name == "kirintormage") this.playedmagierinderkirintor = true;

            }
            else
            {
                Action a = new Action();
                a.cardplay = true;
                a.handcard = new Handmanager.Handcard(hc);
                a.cardEntitiy = cardEntity;
                a.numEnemysBeforePlayed = this.enemyMinions.Count;
                a.comboBeforePlayed = (this.cardsPlayedThisTurn >= 1) ? true : false;
                a.owntarget = 0;
                if (target >= 0)
                {
                    a.owntarget = -1;
                }
                a.enemytarget = target;
                a.enemyEntitiy = targetEntity;
                a.druidchoice = choice;

                if (target == -1)
                {
                    //card with no target
                    if (c.type == CardDB.cardtype.WEAPON)
                    {
                        equipWeapon(c);
                    }
                    playCardWithoutTarget(hc, choice);
                }
                else //before : if(target >=0 && target < 20)
                {
                    if (c.type == CardDB.cardtype.WEAPON)
                    {
                        equipWeapon(c);
                    }
                    playCardWithTarget(hc, target, choice);
                }

                this.playactions.Add(a);

                if (c.type == CardDB.cardtype.SPELL)
                {
                    this.triggerPlayedASpell(c);
                }
            }

            triggerACardGetPlayed(c);

            this.ueberladung += c.recallValue;

            this.cardsPlayedThisTurn++;
        }
开发者ID:RyukOP,项目名称:HRCustomClasses,代码行数:81,代码来源:action.cs

示例3: getPlayPenalty

		public override float getPlayPenalty(Playfield p, Handmanager.Handcard hc, Minion target, int choice, bool isLethal)
		{
            int pen = 0;
            if (p.ownMaxMana <= 6 && hc.card.name == CardDB.cardName.mysteriouschallenger && hc.getManaCost(p) <= 6) pen -= 10;
			return pen;
		}
开发者ID:ANAXRIDER,项目名称:custom,代码行数:6,代码来源:Pen_AT_079.cs

示例4: getTauntBuffPenality

        private int getTauntBuffPenality(Handmanager.Handcard hcard, Minion target, Playfield p, int choice)
        {
            int pen = 0;
            //buff enemy?
            if (!this.tauntBuffDatabase.ContainsKey(hcard.card.name)) return 0;
            if (hcard.card.name == CardDB.cardName.markofnature && choice != 2) return 0;
            if (hcard.card.name == CardDB.cardName.darkwispers && choice != 1) return 0;
            if (target == null) return 20;
            if (!target.isHero && !target.own)
            {
                //allow it if you have black knight
                foreach (Handmanager.Handcard hc in p.owncards)
                {
                    if (hc.card.name == CardDB.cardName.theblackknight && (p.mana >= hcard.getManaCost(p) + hc.getManaCost(p))) return 0;
                }

                // allow taunting if target is priority and others have taunt
                bool enemyhasTaunts = false;
                foreach (Minion mnn in p.enemyMinions)
                {
                    if (mnn.taunt)
                    {
                        enemyhasTaunts = true;
                        break;
                    }
                }
                if (enemyhasTaunts && this.priorityDatabase.ContainsKey(target.name) && !target.silenced && !target.taunt)
                {
                    return 0;
                }

                pen = 500;
            }

            return pen;
        }
开发者ID:noHero123,项目名称:silverfish,代码行数:36,代码来源:PenalityManager.cs

示例5: getAttackBuffPenality

        private int getAttackBuffPenality(Handmanager.Handcard playhc, Minion target, Playfield p, int choice, bool lethal)
        {
            CardDB.Card card = playhc.card;
            CardDB.cardName name = card.name;
            if (name == CardDB.cardName.darkwispers && choice != 1) return 0;

            if (!lethal && (card.name == CardDB.cardName.bolster))
            {
                int targets = 0;
                foreach (Minion m in p.ownMinions)
                {
                    if (m.taunt) targets++;
                }
                if (targets < 2)
                {
                    return 10;
                }
            }

            if (!lethal && (card.name == CardDB.cardName.savageroar || card.name == CardDB.cardName.bloodlust))
            {
                int pen = 0;
                int targets = 0;
                foreach (Minion m in p.ownMinions)
                {
                    if (m.Ready) targets++;
                }

                if ((p.ownHero.Ready || p.ownHero.numAttacksThisTurn == 0) && card.name == CardDB.cardName.savageroar) targets++;

                if (targets <= 3)
                {
                    pen += 20;
                }
                return pen + (5 - p.enemyMinions.Count) * 10;
            }

            if (!this.attackBuffDatabase.ContainsKey(name)) return 0;
            if (target == null)
            {
                //if ((p.ownMaxMana <= 2 && (p.enemyHeroName == HeroEnum.mage || p.enemyHeroName == HeroEnum.hunter)))
                //    return 10;
                if (card.type == CardDB.cardtype.MOB)
                {
                    if (card.name == CardDB.cardName.metaltoothleaper && p.ownMinions.Find(mech => mech.handcard.card.race == TAG_RACE.MECHANICAL) != null) return 0;
                    return 4 * attackBuffDatabase[name];
                }

                return 60;
            }

            if (!target.isHero && !target.own)
            {
                if (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 && target.Angr <= 6 && p.mana >= (hc.getManaCost(p) + playhc.getManaCost(p))) return 5;
                    if (hc.card.name == CardDB.cardName.shadowworddeath && target.Angr <= 4 && p.mana >= (hc.getManaCost(p) + playhc.getManaCost(p))) return 5;
                }
                if (card.name == CardDB.cardName.crueltaskmaster || card.name == CardDB.cardName.innerrage)
                {
                    Minion m = target;

                    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 && p.mana >= (hc.getManaCost(p) + playhc.getManaCost(p))) return 0;
                        }
                    }

                    return 30;
                }
                else
                {
                    return 500;
                }
            }

            if (!target.isHero && target.own)
            {
                Minion m = target;
                bool hasownready = false;

                //vs mage or hunter we need board presence at early game? so we skip the minion ready-check.
                // for everyone else, we penalize buffing minions when they are not ready

                if (p.ownMaxMana > 2 || (p.enemyHeroName != HeroEnum.mage && p.enemyHeroName != HeroEnum.hunter))
                {
                    if (card.name == CardDB.cardName.clockworkknight || card.name == CardDB.cardName.screwjankclunker)
                    {
                        // hasownready can only apply to mechs
                        hasownready = p.ownMinions.Find(mnn => mnn.handcard.card.race == TAG_RACE.MECHANICAL && mnn.Ready) != null;
                    }
//.........这里部分代码省略.........
开发者ID:noHero123,项目名称:silverfish,代码行数:101,代码来源:PenalityManager.cs

示例6: getSpecialCardComboPenalitys


//.........这里部分代码省略.........
                //penalize for any own minions with health equal to potential attack amount
                //to lessen risk of losing your own minion
                int maxAtk = 3;
                if (name == CardDB.cardName.madderbomber) maxAtk = 6;
                if (maxAtk >= p.ownHero.Hp && maxAtk < p.enemyHero.Hp) return 500;//we could be killed, but not enemy >_< .. otherwise YOLO
                foreach (Minion mnn in p.ownMinions)
                {
                    if (mnn.Hp <= maxAtk)
                    {
                        if (mnn.Ready) pen += 20; 
                    }
                }

                /*
                int numTargets = 2 + p.ownMinions.Count + p.enemyMinions.Count;
                int numOwnTargets = 1 + p.ownMinions.Count;
                int numEnemyTargets = numTargets-numOwnTargets;
                double dmgpertarget = ((double)maxAtk)/((double)numTargets);
                foreach (Minion mnn in p.ownMinions)
                {
                    if (mnn.Hp <= dmgpertarget)
                    {
                        pen += 10;
                    }
                }
                */
            }



            if (name == CardDB.cardName.mechwarper)
            {
                List<Handmanager.Handcard> mechCards = p.owncards.FindAll(hc => hc != playedhcard && hc.card.race == TAG_RACE.MECHANICAL);
                mechCards.Sort((a, b) => a.getManaCost(p).CompareTo(b.getManaCost(p)));  // increasing mana cost

                int maxMechsNextTurnWithoutWarper = 0, maxMechsNextTurnWithWarper = 0;
                int manaNextTurnWithoutWarper = p.ownMaxMana + 1, manaNextTurnWithWarper = p.ownMaxMana + 1;

                for (int i = 0; i < mechCards.Count; i++)
                {
                    int cost = mechCards[i].getManaCost(p);
                    if (manaNextTurnWithoutWarper > cost)
                    {
                        maxMechsNextTurnWithoutWarper++;
                        manaNextTurnWithoutWarper -= cost;
                    }
                    if (manaNextTurnWithWarper > (cost - 1))
                    {
                        maxMechsNextTurnWithWarper++;
                        manaNextTurnWithWarper -= (cost - 1);
                    }
                }

                return -3*(maxMechsNextTurnWithWarper - maxMechsNextTurnWithoutWarper);  // +1 mana in savings per additional mech
            }

            if (name == CardDB.cardName.goblinblastmage)
            {
                bool mechOnField = false;

                foreach (Minion mnn in p.ownMinions)
                {
                    if (mnn.handcard.card.race == TAG_RACE.MECHANICAL)
                    {
                        mechOnField = true;
                        break;
开发者ID:noHero123,项目名称:silverfish,代码行数:67,代码来源:PenalityManager.cs

示例7: getPlayInspirePenalty

        private int getPlayInspirePenalty(Handmanager.Handcard playhc, Playfield p)
        {
            // Penalize for playing Inspire minions without Inspire effect

            CardDB.Card card = playhc.card;           
            CardDB.cardName name = card.name;

            if (!this.strongInspireEffectMinions.ContainsKey(name)) return 0;

            // check already used hero power
            if (p.playactions.Find(a => a.actionType == actionEnum.useHeroPower) != null)
                return 1 + (5 * strongInspireEffectMinions[name]);

            int ownplaycost = playhc.getManaCost(p);
            int heropowercost = p.ownHeroAblility.card.getManaCost(p, 2);

            // check not enough mana to gain Inspire buff
            if (p.mana < ownplaycost + heropowercost) return 2 * strongInspireEffectMinions[name];

            return 0;
        }
开发者ID:noHero123,项目名称:silverfish,代码行数:21,代码来源:PenalityManager.cs

示例8: playACard

        //play a minion trigger stuff:
        // 1 whenever you play a card whatever triggers
        // 2 Auras
        // 5 whenever you summon a minion triggers (like starving buzzard)
        // 3 battlecry
        // 3.5 place minion
        // 3.75 dmg/died/dthrttl triggers
        // 4 secret: minion is played
        // 4.5 dmg/died/dthrttl triggers
        // 5 after you summon a minion triggers
        // 5.5 dmg/died/dthrttl triggers
        public void playACard(Handmanager.Handcard hc, Minion target, int position, int choice, int penality)
        {

            CardDB.Card c = hc.card;
            this.evaluatePenality += penality;
            this.mana = this.mana - hc.getManaCost(this);
            removeCard(hc);// remove card from hand
            if (c.type == CardDB.cardtype.SPELL) this.playedPreparation = false;

            if (c.Secret)
            {
                this.ownSecretsIDList.Add(c.cardIDenum);
                this.playedmagierinderkirintor = false;
            }


            //Helpfunctions.Instance.logg("play crd " + c.name + " entitiy# " + cardEntity + " mana " + hc.getManaCost(this) + " trgt " + target);
            if (logging) Helpfunctions.Instance.logg("play crd " + c.name + " entitiy# " + hc.entity + " mana " + hc.getManaCost(this) + " trgt " + target);


            this.triggerACardWillBePlayed(c, true);

            if (c.type == CardDB.cardtype.MOB)
            {
                this.placeAmobSomewhere(hc, target, choice, position);
                this.mobsplayedThisTurn++;

            }
            else
            {
                c.sim_card.onCardPlay(this, true, target, choice);
                this.doDmgTriggers();
                //secret trigger? do here


            }

            //atm only 2 cards trigger this
            if (c.type == CardDB.cardtype.SPELL)
            {
                this.triggerACardWasPlayed(c, true);
                this.doDmgTriggers();
            }

            //this.ueberladung += c.recallValue;
            this.cardsPlayedThisTurn++;

        }
开发者ID:Zendio,项目名称:silverfish,代码行数:59,代码来源:Playfield.cs

示例9: playACard

        //play a minion trigger stuff:
        // 1 whenever you play a card whatever triggers
        // 2 Auras
        // 5 whenever you summon a minion triggers (like starving buzzard)
        // 3 battlecry
        // 3.5 place minion
        // 3.75 dmg/died/dthrttl triggers
        // 4 secret: minion is played
        // 4.5 dmg/died/dthrttl triggers
        // 5 after you summon a minion triggers
        // 5.5 dmg/died/dthrttl triggers
        public void playACard(Handmanager.Handcard hc, Minion target, int position, int choice, int penality)
        {

            CardDB.Card c = hc.card;
            this.evaluatePenality += penality;
            this.mana = this.mana - hc.getManaCost(this);
            removeCard(hc);// remove card from hand
            

            this.triggerCardsChanged(true);

            if (c.type == CardDB.cardtype.SPELL)
            {
                this.playedPreparation = false;
            }
            if (c.race == 24) //dragon
            {
                this.ownDragonConsort = 0;
            }
            if (c.Secret)
            {
                this.ownSecretsIDList.Add(c.cardIDenum);
                this.playedmagierinderkirintor = false;
            }


            //Helpfunctions.Instance.logg("play crd " + c.name + " entitiy# " + cardEntity + " mana " + hc.getManaCost(this) + " trgt " + target);
            if (logging) Helpfunctions.Instance.logg("play crd " + c.name + " entitiy# " + hc.entity + " mana " + hc.getManaCost(this) + " trgt " + target);


            this.triggerACardWillBePlayed(hc, true, target);
            int newTarget = secretTrigger_SpellIsPlayed(target, c.type == CardDB.cardtype.SPELL);
            if (newTarget >= 1)
            {
                //search new target!
                foreach (Minion m in this.ownMinions)
                {
                    if (m.entitiyID == newTarget)
                    {
                        target = m;
                        break;
                    }
                }
                foreach (Minion m in this.enemyMinions)
                {
                    if (m.entitiyID == newTarget)
                    {
                        target = m;
                        break;
                    }
                }
                if (this.ownHero.entitiyID == newTarget) target = this.ownHero;
                if (this.enemyHero.entitiyID == newTarget) target = this.enemyHero;
            }
            if (newTarget != -2) // trigger spell-secrets!
            {

                if (c.type == CardDB.cardtype.MOB)
                {
                    this.placeAmobSomewhere(hc, target, choice, position);
                    this.mobsplayedThisTurn++;

                }
                else
                {

                    c.sim_card.onCardPlay(this, true, target, choice);
                    this.doDmgTriggers();
                    //secret trigger? do here


                }

                //atm only 2 cards trigger this
                if (c.type == CardDB.cardtype.SPELL)
                {
                    this.triggerACardWasPlayed(c, true);
                    this.doDmgTriggers();
                }
            }

            //this.ueberladung += c.recallValue;
            this.cardsPlayedThisTurn++;

        }
开发者ID:John4Jobs,项目名称:silverfish,代码行数:96,代码来源:Playfield.cs


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