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


C# Playfield.ENEMYactivateAbility方法代码示例

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


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

示例1: simulateEnemysTurn


//.........这里部分代码省略.........
                    // attacked with minions done
                    // attack with hero
                    if (p.enemyHeroReady)
                    {
                        List<targett> trgts = p.getAttackTargets(false);

                        havedonesomething = true;

                        if (true)//(this.useCutingTargets)
                        {
                            trgts = Ai.Instance.cutAttackTargets(trgts, p, false);
                        }

                        foreach (targett trgt in trgts)
                        {
                            Playfield pf = new Playfield(p);
                            pf.ENEMYattackWithWeapon(trgt.target, trgt.targetEntity, 0);
                            posmoves.Add(pf);
                        }
                    }

                    // use ability
                    /// TODO check if ready after manaup

                    if (p.enemyAbilityReady && p.enemyHeroAblility.canplayCard(p, 0))
                    {
                        int abilityPenality = 0;

                        havedonesomething = true;
                        // if we have mage or priest, we have to target something####################################################
                        if (p.enemyHeroName == HeroEnum.mage || p.enemyHeroName == HeroEnum.priest)
                        {

                            List<targett> trgts = p.enemyHeroAblility.getTargetsForCard(p);
                            foreach (targett trgt in trgts)
                            {
                                    Playfield pf = new Playfield(p);
                                    havedonesomething = true;
                                    pf.ENEMYactivateAbility(p.enemyHeroAblility, trgt.target, trgt.targetEntity);
                                    posmoves.Add(pf);
                            }
                        }
                        else
                        {
                            // the other classes dont have to target####################################################
                            Playfield pf = new Playfield(p);

                                havedonesomething = true;
                                pf.ENEMYactivateAbility(p.enemyHeroAblility, -1, -1);
                                posmoves.Add(pf);
                        }

                    }

                    p.endEnemyTurn();

                    if (Ai.Instance.botBase.getPlayfieldValue(p) < bestoldval) // want the best enemy-play-> worst for us
                    {
                        bestoldval = Ai.Instance.botBase.getPlayfieldValue(p);
                        bestold = p;
                    }
                    posmoves.Remove(p);

                    if (posmoves.Count >= maxwide) break;
                }

                if ( bestoldval <= 10000 && bestold != null)
                {
                    posmoves.Add(bestold);
                }

                deep++;
                if (posmoves.Count >= maxwide) break;
            }

            foreach (Playfield p in posmoves)
            {
                if (!p.complete) p.endEnemyTurn();
            }

            int bestval = int.MaxValue;
            Playfield bestplay = posmoves[0];
            foreach (Playfield p in posmoves)
            {
                int val = Ai.Instance.botBase.getPlayfieldValue(p);
                if (bestval > val)// we search the worst value
                {
                    bestplay = p;
                    bestval = val;
                }
            }

            this.value = bestplay.value;
            if (simulateTwoTurns)
            {
                bestplay.prepareNextTurn();
                MiniSimulator ms = new MiniSimulator();
                this.value = (int)(0.5 * bestval + 0.5 * ms.doallmoves(bestplay));
            }
        }
开发者ID:RyukOP,项目名称:HRCustomClasses,代码行数:101,代码来源:action.cs


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