コード例 #1
0
ファイル: silverfish_HB.cs プロジェクト: peppert/silverfish
        private void getHandcards()
        {
            handCards.Clear();
            anzcards      = 0;
            enemyAnzCards = 0;
            List <HSCard> list = TritonHs.GetCards(CardZone.Hand);

            List <HSCard> list2 = TritonHs.GetCards(CardZone.Graveyard);

            //List<HRCard> list = HRCard.GetCards(HRPlayer.GetLocalPlayer(), HRCardZone.HAND);

            foreach (HSCard entitiy in list)
            {
                if (entitiy.ZonePosition >= 1) // own handcard
                {
                    CardDB.Card c = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(entitiy.Id));
                    //c.cost = entitiy.GetCost();
                    //c.entityID = entitiy.GetEntityId();

                    var hc = new Handmanager.Handcard();
                    hc.card      = c;
                    hc.position  = entitiy.ZonePosition;
                    hc.entity    = entitiy.EntityId;
                    hc.manacost  = entitiy.Cost;
                    hc.addattack = 0;
                    if (c.name == CardDB.cardName.bolvarfordragon)
                    {
                        hc.addattack = entitiy.GetTag(GAME_TAG.ATK) - 1;
                        // -1 because it starts with 1, we count only the additional attackvalue
                    }
                    handCards.Add(hc);
                    anzcards++;
                }
            }

            List <HSCard> allcards = TritonHs.GetAllCards();

            enemyAnzCards = 0;
            foreach (HSCard hs in allcards)
            {
                if (hs.GetTag(GAME_TAG.ZONE) == 3 && hs.ControllerId != ownPlayerController &&
                    hs.GetTag(GAME_TAG.ZONE_POSITION) >= 1)
                {
                    enemyAnzCards++;
                }
            }
            // dont know if you can count the enemys-handcars in this way :D
        }
コード例 #2
0
        private void getHandcards()
        {
            handCards.Clear();
            anzcards      = 0;
            enemyAnzCards = 0;
            List <HSCard> list = TritonHs.GetCards(CardZone.Hand);

            List <HSCard> list2 = TritonHs.GetCards(CardZone.Graveyard);

            //List<HRCard> list = HRCard.GetCards(HRPlayer.GetLocalPlayer(), HRCardZone.HAND);

            foreach (HSCard entitiy in list)
            {
                if (entitiy.ZonePosition >= 1) // own handcard
                {
                    CardDB.Card c = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(entitiy.Id));
                    //c.cost = entitiy.GetCost();
                    //c.entityID = entitiy.GetEntityId();

                    var hc = new Handmanager.Handcard();
                    hc.card      = c;
                    hc.position  = entitiy.ZonePosition;
                    hc.entity    = entitiy.EntityId;
                    hc.manacost  = entitiy.Cost;
                    hc.addattack = 0;
                    int attackchange = entitiy.GetTag(GAME_TAG.ATK) - c.Attack;
                    int hpchange     = entitiy.GetTag(GAME_TAG.HEALTH) - c.Health;
                    hc.addattack = attackchange;
                    hc.addHp     = hpchange;
                    handCards.Add(hc);
                    anzcards++;
                }
            }

            List <HSCard> allcards = TritonHs.GetAllCards();

            enemyAnzCards = 0;
            foreach (HSCard hs in allcards)
            {
                if (hs.GetTag(GAME_TAG.ZONE) == 3 && hs.ControllerId != ownPlayerController &&
                    hs.GetTag(GAME_TAG.ZONE_POSITION) >= 1)
                {
                    enemyAnzCards++;
                }
            }
            // dont know if you can count the enemys-handcars in this way :D
        }
コード例 #3
0
ファイル: silverfish_HB.cs プロジェクト: peppert/silverfish
        private void getMinions()
        {
            // ALL minions on Playfield:
            List <HSCard> list = TritonHs.GetCards(CardZone.Battlefield, true);

            list.AddRange(TritonHs.GetCards(CardZone.Battlefield, false));

            var enchantments = new List <HSCard>();

            ownMinions.Clear();
            enemyMinions.Clear();
            List <HSCard> allcards = TritonHs.GetAllCards();

            foreach (HSCard entiti in list)
            {
                int zp = entiti.GetTag(GAME_TAG.ZONE_POSITION);

                if (entiti.IsMinion && zp >= 1)
                {
                    HSCard entitiy = entiti;

                    foreach (HSCard ent in allcards)
                    {
                        if (ent.EntityId == entiti.EntityId)
                        {
                            entitiy = ent;
                            break;
                        }
                    }

                    //Helpfunctions.Instance.ErrorLog("zonepos " + zp);
                    CardDB.Card c = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(entitiy.Id));
                    Minion      m = new Minion();
                    m.name          = c.name;
                    m.handcard.card = c;

                    m.Angr  = entitiy.GetTag(GAME_TAG.ATK);
                    m.maxHp = entitiy.GetTag(GAME_TAG.HEALTH);
                    m.Hp    = entitiy.GetTag(GAME_TAG.HEALTH) - entitiy.GetTag(GAME_TAG.DAMAGE);
                    if (m.Hp <= 0)
                    {
                        continue;
                    }
                    m.wounded = false;
                    if (m.maxHp > m.Hp)
                    {
                        m.wounded = true;
                    }


                    m.exhausted = (entitiy.GetTag(GAME_TAG.EXHAUSTED) == 0) ? false : true;

                    m.taunt = (entitiy.GetTag(GAME_TAG.TAUNT) == 0) ? false : true;

                    m.numAttacksThisTurn = entitiy.GetTag(GAME_TAG.NUM_ATTACKS_THIS_TURN);

                    int temp = entitiy.GetTag(GAME_TAG.NUM_TURNS_IN_PLAY);
                    m.playedThisTurn = (temp == 0) ? true : false;

                    m.windfury = (entitiy.GetTag(GAME_TAG.WINDFURY) == 0) ? false : true;

                    m.frozen = (entitiy.GetTag(GAME_TAG.FROZEN) == 0) ? false : true;

                    m.divineshild = (entitiy.GetTag(GAME_TAG.DIVINE_SHIELD) == 0) ? false : true;

                    m.stealth = (entitiy.GetTag(GAME_TAG.STEALTH) == 0) ? false : true;

                    m.poisonous = (entitiy.GetTag(GAME_TAG.POISONOUS) == 0) ? false : true;

                    m.immune = (entitiy.GetTag(GAME_TAG.IMMUNE_WHILE_ATTACKING) == 0) ? false : true;

                    m.silenced = (entitiy.GetTag(GAME_TAG.SILENCED) == 0) ? false : true;

                    // Drew: fixed | is the tag removed when silenced, via Mass Dispel?
                    m.cantBeTargetedBySpellsOrHeroPowers = (entitiy.GetTag(GAME_TAG.CANT_BE_TARGETED_BY_HERO_POWERS) == 0) ? false : true;

                    m.charge = 0;

                    if (!m.silenced && m.name == CardDB.cardName.southseadeckhand &&
                        entitiy.GetTag(GAME_TAG.CHARGE) == 1)
                    {
                        m.charge = 1;
                    }
                    if (!m.silenced && m.handcard.card.Charge)
                    {
                        m.charge++;
                    }

                    m.zonepos = zp;

                    m.entitiyID = entitiy.EntityId;


                    //Helpfunctions.Instance.ErrorLog(  m.name + " ready params ex: " + m.exhausted + " charge: " +m.charge + " attcksthisturn: " + m.numAttacksThisTurn + " playedthisturn " + m.playedThisTurn );


                    List <miniEnch> enchs = new List <miniEnch>();
                    foreach (HSCard ent in allcards)
                    {
                        if (ent.GetTag(GAME_TAG.ATTACHED) == m.entitiyID && ent.GetTag(GAME_TAG.ZONE) == 1) //1==play
                        {
                            CardDB.cardIDEnum id = CardDB.Instance.cardIdstringToEnum(ent.Id);
                            int controler        = ent.GetTag(GAME_TAG.CONTROLLER);
                            int creator          = ent.GetTag(GAME_TAG.CREATOR);
                            enchs.Add(new miniEnch(id, creator, controler));
                        }
                    }

                    m.loadEnchantments(enchs, entitiy.GetTag(GAME_TAG.CONTROLLER));

                    m.Ready = false; // if exhausted, he is NOT ready

                    m.updateReadyness();


                    if (entitiy.GetTag(GAME_TAG.CONTROLLER) == this.ownPlayerController) // OWN minion
                    {
                        m.own = true;
                        this.ownMinions.Add(m);
                    }
                    else
                    {
                        m.own = false;
                        this.enemyMinions.Add(m);
                    }
                }
            }
        }