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


C# HRSim.Playfield类代码示例

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


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

示例1: onMinionIsSummoned

//    jedes mal, wenn ihr einen diener mit max. 3 angriff herbeiruft, erhält dieser ansturm/.

        public override void onMinionIsSummoned(Playfield p, Minion triggerEffectMinion, Minion summonedMinion)
        {
            if (triggerEffectMinion.own == summonedMinion.own && summonedMinion.handcard.card.Attack <= 3 )
            {
                p.minionGetCharge(summonedMinion);
            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:9,代码来源:Sim_EX1_084.cs

示例2: onCardPlay

//    zieht 4 karten.
		public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
		{
            p.drawACard(p.getArandomCardFromDeck(ownplay), ownplay);
            p.drawACard(p.getArandomCardFromDeck(ownplay), ownplay);
            p.drawACard(p.getArandomCardFromDeck(ownplay), ownplay);
            p.drawACard(p.getArandomCardFromDeck(ownplay), ownplay);
		}
开发者ID:shuyi3,项目名称:AIPJ,代码行数:8,代码来源:Sim_CS2_077.cs

示例3: getBattlecryEffect

        CardDB.Card card2 = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.EX1_tk28); // squirrel
        //todo better
//    kampfschrei:/ verwandelt einen anderen zufälligen diener in einen teufelssaurier (5/5) oder ein eichhörnchen (1/1).
		public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
		{
            int oc = p.playerFirst.ownMinions.Count;
            int ec = p.playerSecond.ownMinions.Count;
            if (oc == 0 && ec == 0) return;
            if (oc > ec)
            {
                List<Minion> temp = new List<Minion>(p.playerFirst.ownMinions);
                temp.AddRange(p.playerSecond.ownMinions);
                temp.Sort((a, b) => a.Hp.CompareTo(b.Hp));//transform the weakest
                foreach (Minion m in temp)
                {
                    p.minionTransform(m, card1);
                    break;
                }
            }
            else
            {
                List<Minion> temp = new List<Minion>(p.playerFirst.ownMinions);
                temp.AddRange(p.playerSecond.ownMinions);
                temp.Sort((a, b) => -a.Hp.CompareTo(b.Hp));//transform the strongest
                foreach (Minion m in temp)
                {
                    p.minionTransform(m, card2);
                    break;
                }
            }
		}
开发者ID:shuyi3,项目名称:AIPJ,代码行数:31,代码来源:Sim_EX1_083.cs

示例4: getHashkey

        public override float getHashkey(Playfield p)
        {
            Player mPlayer;
            if (p.isOwnTurn) //end turn evaluation, so opponent
            {
                mPlayer = p.playerSecond;
            }
            else
            {
                mPlayer = p.playerFirst;
            }

            float handValue = 0f;

            foreach (Handmanager.Handcard hc in p.playerFirst.owncards)
            {
                if (hc.card.type == CardDB.cardtype.MOB)
                {
                    handValue += hc.card.cost * (int)(hc.card.name);
                }
                else
                {
                    handValue += (float)Math.Sqrt(hc.card.cost) * (int)(hc.card.name);
                }
            }

            return handValue;
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:28,代码来源:HandHashTable.cs

示例5: getBattlecryEffect

        CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.GVG_110t);//chillwind

        public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {
            int pos = (own.own) ? p.playerFirst.ownMinions.Count : p.playerSecond.ownMinions.Count;
            p.callKid(kid, pos, own.own);
            pos = (own.own) ? p.playerFirst.ownMinions.Count : p.playerSecond.ownMinions.Count;
            p.callKid(kid, pos, own.own);
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:9,代码来源:Sim_GvG_110.cs

示例6: 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)
 {
     if (wasOwnCard == triggerEffectMinion.own && c.Recall)
     {
         p.minionGetBuffed(triggerEffectMinion, 1, 1);
     }
 }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:8,代码来源:Sim_EX1_258.cs

示例7: onTurnStartTrigger

        //    At the start of your turn, deal 1 damage to your hero.

        public override void onTurnStartTrigger(Playfield p, Minion triggerEffectMinion, bool turnStartOfOwner)
        {
            if (triggerEffectMinion.own == turnStartOfOwner)
            {
				p.minionGetDamageOrHeal(turnStartOfOwner ? p.playerFirst.ownHero : p.playerSecond.ownHero, 1);
            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:9,代码来源:Sim_NAX8_04t.cs

示例8: getBattlecryEffect

        //   Battlecry:&lt;/b&gt; Give a friendly Mech +4 Health.

        public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {
            if (target != null)
            {
                p.minionGetBuffed(target, 0, 4);
            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:9,代码来源:Sim_GvG_083.cs

示例9: getBattlecryEffect

//    combo:/ ruft einen banditen der defias (2/1) herbei.
		public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
		{
            if (p.playerFirst.cardsPlayedThisTurn >= 1)
            {
                p.callKid(card, own.zonepos, own.own);
            }
		}
开发者ID:shuyi3,项目名称:AIPJ,代码行数:8,代码来源:Sim_EX1_131.cs

示例10: ParetoTreeNode

    //public PlayoutInfo m_pi;

    //public ParetoTreeNode()
    //{
    //    this(null, null, -1, null, null, null, null,null);
    //}

    //public ParetoTreeNode(Game state, Roller roller, ParetoTreePolicy treePolicy, Random rnd,
    //                      Player a_player, PlayoutInfo pi) {
    //    this(state, null, -1, roller, treePolicy, rnd, a_player,pi);
    //}

    //public ParetoTreeNode(Playfield state, RandomRoller roller, ParetoTreePolicy treePolicy, Random rnd,
    //                  ParetoMCTSPlayer a_player)
    //{
    //    this(state, null, -1, roller, treePolicy, rnd, a_player);
    //}

    //public ParetoTreeNode(Game state, ParetoTreeNode parent, int childIndex, Roller roller,
    //                      TreePolicy treePolicy, Random rnd, Player a_player, PlayoutInfo pi) {
    //    this.m_player = a_player;
    //    this.state = state;
    //    this.parent = parent;
    //    this.m_rnd = rnd;
    //    children = new ParetoTreeNode[ParetoMCTSParameters.NUM_ACTIONS];
    //    totValue = new double[ParetoMCTSParameters.NUM_TARGETS];
    //    this.roller = roller;
    //    this.treePolicy = treePolicy;
    //    pa = new ParetoArchive();
    //    this.childIndex = childIndex;
    //    this.m_prunedChildren = new bool[ParetoMCTSParameters.NUM_ACTIONS];
    //    this.m_numIters = 0;
    //    this.m_pi = pi;
        
    //    if(parent == null) //This is only for the root:
    //    {
    //        this.initValueRoute();
    //    }
    //}

    public ParetoTreeNode(Playfield state, ParetoTreeNode parent, int childIndex, RandomRoller roller,
                      ParetoTreePolicy treePolicy, Random rnd, ParetoMCTSPlayer a_player)
    {
        this.m_player = a_player;
        this.state = state;
        this.parent = parent;
        this.m_rnd = rnd;
        //children = new ParetoTreeNode[ParetoMCTSParameters.NUM_ACTIONS];
        this.roller = roller;
        this.mTreePolicy = treePolicy;
        pa = new ParetoArchive();
        this.childIndex = childIndex;
        this.m_prunedChildren = new bool[ParetoMCTSParameters.NUM_ACTIONS];
        this.m_numIters = 0;
        //this.m_pi = pi;

        isTerminal = false;
        isExpanded = false;
        isExhausted = false;
        numExpandedChildren = 0;
        numExhaustedChildren = 0;
        nodeNum = GameManager.Instance.nodeCount;
        GameManager.Instance.nodeCount++;

        totValue = new double[ParetoMCTSParameters.NUM_TARGETS];
        //if (parent == null) //This is only for the root:
        //{
        //    this.initValueRoute();
        //}
    }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:70,代码来源:MOMCTS.cs

示例11: onTurnEndsTrigger

        //   At the end of each player's turn, that player draws until they have 3 cards.

        public override void onTurnEndsTrigger(Playfield p, Minion triggerEffectMinion, bool turnEndOfOwner)
        {
            if (triggerEffectMinion.own == turnEndOfOwner)
            {
                Player mPlayer;
                if (turnEndOfOwner)
                {
                    mPlayer = p.playerFirst;
                }
                else
                {
                    mPlayer = p.playerSecond;
                }

                int cardstodraw = 0;
                if (mPlayer.owncards.Count <= 2)
                {
                    cardstodraw = 3 - mPlayer.owncards.Count;
                }

                for (int i = 0; i < cardstodraw; i++)
                {
                    p.drawACard(p.getArandomCardFromDeck(turnEndOfOwner), turnEndOfOwner);
                }
            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:28,代码来源:Sim_GvG_094.cs

示例12: onCardPlay

//    fügt einem feind $4 schaden und allen anderen feinden $1 schaden zu.
		public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
		{
            int dmg = p.getSpellDamageDamage(1, ownplay);
            int dmg1 = p.getSpellDamageDamage(4, ownplay);

            List<Minion> temp = (ownplay) ? p.playerSecond.ownMinions : p.playerFirst.ownMinions;
            p.minionGetDamageOrHeal(target, dmg1);
            foreach (Minion m in temp)
            {
                if (m.entitiyID != target.entitiyID)
                {
                    p.minionGetDamageOrHeal(m, dmg);
                }
            }
            if (ownplay)
            {
                if (p.playerSecond.ownHero.entitiyID != target.entitiyID)
                {
                    p.minionGetDamageOrHeal(p.playerSecond.ownHero, dmg);
                }
            }
            else
            {
                if (p.playerFirst.ownHero.entitiyID != target.entitiyID)
                {
                    p.minionGetDamageOrHeal(p.playerFirst.ownHero, dmg);
                }
                
            }
		}
开发者ID:shuyi3,项目名称:AIPJ,代码行数:31,代码来源:Sim_CS2_012.cs

示例13: getBattlecryEffect

        //    Give each player a Mana Crystal.

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

            p.drawACard(p.getArandomCardFromDeck(true), true);
            p.drawACard(p.getArandomCardFromDeck(false), false);
           
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:9,代码来源:Sim_GvG_032b.cs

示例14: onCardPlay

 public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
 {
     int dmg = p.getSpellDamageDamage(1, ownplay);
     if (p.playerFirst.cardsPlayedThisTurn >= 1) dmg = p.getSpellDamageDamage(2, ownplay);
     p.minionGetDamageOrHeal(target, dmg);
     p.equipWeapon(w, ownplay);
 }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:7,代码来源:Sim_EX1_133.cs

示例15: onTurnStartTrigger

//    verstohlenheit/. erhält zu beginn eures zuges +1/+1.

        public override void onTurnStartTrigger(Playfield p, Minion triggerEffectMinion, bool turnStartOfOwner)
        {
            if (triggerEffectMinion.own == turnStartOfOwner)
            {
                p.minionGetBuffed(triggerEffectMinion,1,1);
            }
        }
开发者ID:shuyi3,项目名称:AIPJ,代码行数:9,代码来源:Sim_FP1_005.cs


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