Ejemplo n.º 1
0
        public SecretItem(SecretItem sec)
        {
            this.triggered = sec.triggered;

            /*not in use temporarily 1
             * this.canbeTriggeredWithAttackingHero = sec.canbeTriggeredWithAttackingHero;
             * this.canbeTriggeredWithAttackingMinion = sec.canbeTriggeredWithAttackingMinion;
             * this.canbeTriggeredWithPlayingMinion = sec.canbeTriggeredWithPlayingMinion;
             * this.canbeTriggeredWithPlayingHeroPower = sec.canbeTriggeredWithPlayingHeroPower;*/

            this.canBe_avenge         = sec.canBe_avenge;
            this.canBe_counterspell   = sec.canBe_counterspell;
            this.canBe_duplicate      = sec.canBe_duplicate;
            this.canBe_effigy         = sec.canBe_effigy;
            this.canBe_explosive      = sec.canBe_explosive;
            this.canBe_beartrap       = sec.canBe_beartrap;
            this.canBe_eyeforaneye    = sec.canBe_eyeforaneye;
            this.canBe_freezing       = sec.canBe_freezing;
            this.canBe_icebarrier     = sec.canBe_icebarrier;
            this.canBe_iceblock       = sec.canBe_iceblock;
            this.canBe_cattrick       = sec.canBe_cattrick;
            this.canBe_mirrorentity   = sec.canBe_mirrorentity;
            this.canBe_missdirection  = sec.canBe_missdirection;
            this.canBe_darttrap       = sec.canBe_darttrap;
            this.canBe_noblesacrifice = sec.canBe_noblesacrifice;
            this.canBe_redemption     = sec.canBe_redemption;
            this.canBe_repentance     = sec.canBe_repentance;
            this.canBe_snaketrap      = sec.canBe_snaketrap;
            this.canBe_snipe          = sec.canBe_snipe;
            this.canBe_spellbender    = sec.canBe_spellbender;
            this.canBe_vaporize       = sec.canBe_vaporize;
            this.canBe_sacredtrial    = sec.canBe_sacredtrial;

            this.entityId = sec.entityId;
        }
Ejemplo n.º 2
0
        public bool isEqual(SecretItem s)
        {
            bool result = this.entityId == s.entityId;

            if (!result)
            {
                result = result && this.canBe_avenge == s.canBe_avenge && this.canBe_counterspell == s.canBe_counterspell && this.canBe_duplicate == s.canBe_duplicate && this.canBe_effigy == s.canBe_effigy && this.canBe_explosive == s.canBe_explosive;
                result = result && this.canBe_eyeforaneye == s.canBe_eyeforaneye && this.canBe_freezing == s.canBe_freezing && this.canBe_icebarrier == s.canBe_icebarrier && this.canBe_iceblock == s.canBe_iceblock;
                result = result && this.canBe_mirrorentity == s.canBe_mirrorentity && this.canBe_missdirection == s.canBe_missdirection && this.canBe_noblesacrifice == s.canBe_noblesacrifice && this.canBe_redemption == s.canBe_redemption;
                result = result && this.canBe_repentance == s.canBe_repentance && this.canBe_snaketrap == s.canBe_snaketrap && this.canBe_snipe == s.canBe_snipe && this.canBe_spellbender == s.canBe_spellbender && this.canBe_vaporize == s.canBe_vaporize;
                result = result && this.canBe_sacredtrial == s.canBe_sacredtrial && this.canBe_darttrap == s.canBe_darttrap && this.canBe_beartrap == s.canBe_beartrap && this.canBe_cattrick == s.canBe_cattrick;
            }
            return(result);
        }
Ejemplo n.º 3
0
        public void setEnemySecretGuesses(Dictionary <int, TAG_CLASS> enemySecretList)
        {
            List <SecretItem> newlist = new List <SecretItem>();

            foreach (KeyValuePair <int, TAG_CLASS> eSec in enemySecretList)
            {
                if (eSec.Key >= 1000)
                {
                    continue;
                }
                LogHelper.WriteCombatLog("detect secret with id" + eSec.Key);
                SecretItem sec = getNewSecretGuessedItem(eSec.Key, eSec.Value);

                newlist.Add(new SecretItem(sec));
            }

            this.enemySecrets.Clear();
            this.enemySecrets.AddRange(newlist);
        }
Ejemplo n.º 4
0
        public void updateSecretList(List <SecretItem> enemySecretl)
        {
            List <SecretItem> temp = new List <SecretItem>();

            foreach (SecretItem si in this.enemySecrets)
            {
                bool       add  = false;
                SecretItem seit = null;
                foreach (SecretItem sit in enemySecretl) // enemySecrets have to be updated to latest entitys
                {
                    if (si.entityId == sit.entityId)
                    {
                        seit = sit;
                        add  = true;
                    }
                }

                temp.Add(add ? new SecretItem(seit) : new SecretItem(si));
            }

            this.enemySecrets.Clear();
            this.enemySecrets.AddRange(temp);
        }
Ejemplo n.º 5
0
        public SecretItem getNewSecretGuessedItem(int entityid, TAG_CLASS SecClass)
        {
            foreach (SecretItem si in this.enemySecrets)
            {
                if (si.entityId == entityid && entityid < 1000)
                {
                    return(si);
                }
            }

            switch (SecClass)
            {
            case TAG_CLASS.WARRIOR: break;

            case TAG_CLASS.WARLOCK: break;

            case TAG_CLASS.ROGUE: break;

            case TAG_CLASS.SHAMAN: break;

            case TAG_CLASS.PRIEST: break;

            case TAG_CLASS.PALADIN: break;

            case TAG_CLASS.MAGE: break;

            case TAG_CLASS.HUNTER: break;

            case TAG_CLASS.DRUID: break;

            default:
                Helpfunctions.Instance.ErrorLog("Problem is detected: undefined Secret class " + SecClass);
                SecClass = Hrtprozis.Instance.heroEnumtoTagClass(Hrtprozis.Instance.enemyHeroname);
                Helpfunctions.Instance.ErrorLog("attempt to restore... " + SecClass);
                break;
            }


            SecretItem sec = new SecretItem {
                entityId = entityid
            };

            if (SecClass == TAG_CLASS.HUNTER)
            {
                sec.canBe_counterspell = false;
                sec.canBe_icebarrier   = false;
                sec.canBe_iceblock     = false;
                sec.canBe_mirrorentity = false;
                sec.canBe_spellbender  = false;
                sec.canBe_vaporize     = false;
                sec.canBe_duplicate    = false;
                sec.canBe_effigy       = false;

                sec.canBe_eyeforaneye    = false;
                sec.canBe_noblesacrifice = false;
                sec.canBe_redemption     = false;
                sec.canBe_repentance     = false;
                sec.canBe_avenge         = false;
                sec.canBe_sacredtrial    = false;

                if (enemyCardsOut.ContainsKey(CardIdEnum.EX1_554) && enemyCardsOut[CardIdEnum.EX1_554] >= 2)
                {
                    sec.canBe_snaketrap = false;
                }

                if (enemyCardsOut.ContainsKey(CardIdEnum.EX1_609) && enemyCardsOut[CardIdEnum.EX1_609] >= 2)
                {
                    sec.canBe_snipe = false;
                }

                if (enemyCardsOut.ContainsKey(CardIdEnum.EX1_610) && enemyCardsOut[CardIdEnum.EX1_610] >= 2)
                {
                    sec.canBe_explosive = false;
                }

                if (enemyCardsOut.ContainsKey(CardIdEnum.AT_060) && enemyCardsOut[CardIdEnum.AT_060] >= 2)
                {
                    sec.canBe_beartrap = false;
                }

                if (enemyCardsOut.ContainsKey(CardIdEnum.EX1_611) && enemyCardsOut[CardIdEnum.EX1_611] >= 2)
                {
                    sec.canBe_freezing = false;
                }

                if (enemyCardsOut.ContainsKey(CardIdEnum.EX1_533) && enemyCardsOut[CardIdEnum.EX1_533] >= 2)
                {
                    sec.canBe_missdirection = false;
                }

                if (enemyCardsOut.ContainsKey(CardIdEnum.LOE_021) && enemyCardsOut[CardIdEnum.LOE_021] >= 2)
                {
                    sec.canBe_darttrap = false;
                }

                if (enemyCardsOut.ContainsKey(CardIdEnum.KAR_004) && enemyCardsOut[CardIdEnum.KAR_004] >= 2)
                {
                    sec.canBe_cattrick = false;
                }
            }

            if (SecClass == TAG_CLASS.MAGE)
            {
                sec.canBe_snaketrap     = false;
                sec.canBe_snipe         = false;
                sec.canBe_explosive     = false;
                sec.canBe_beartrap      = false;
                sec.canBe_freezing      = false;
                sec.canBe_missdirection = false;
                sec.canBe_darttrap      = false;
                sec.canBe_cattrick      = false;

                sec.canBe_eyeforaneye    = false;
                sec.canBe_noblesacrifice = false;
                sec.canBe_redemption     = false;
                sec.canBe_repentance     = false;
                sec.canBe_avenge         = false;
                sec.canBe_sacredtrial    = false;

                if (enemyCardsOut.ContainsKey(CardIdEnum.EX1_287) && enemyCardsOut[CardIdEnum.EX1_287] >= 2)
                {
                    sec.canBe_counterspell = false;
                }

                if (enemyCardsOut.ContainsKey(CardIdEnum.EX1_289) && enemyCardsOut[CardIdEnum.EX1_289] >= 2)
                {
                    sec.canBe_icebarrier = false;
                }

                if (enemyCardsOut.ContainsKey(CardIdEnum.EX1_295) && enemyCardsOut[CardIdEnum.EX1_295] >= 2)
                {
                    sec.canBe_iceblock = false;
                }

                if (enemyCardsOut.ContainsKey(CardIdEnum.EX1_294) && enemyCardsOut[CardIdEnum.EX1_294] >= 2)
                {
                    sec.canBe_mirrorentity = false;
                }

                if (enemyCardsOut.ContainsKey(CardIdEnum.tt_010) && enemyCardsOut[CardIdEnum.tt_010] >= 2)
                {
                    sec.canBe_spellbender = false;
                }

                if (enemyCardsOut.ContainsKey(CardIdEnum.EX1_594) && enemyCardsOut[CardIdEnum.EX1_594] >= 2)
                {
                    sec.canBe_vaporize = false;
                }

                if (enemyCardsOut.ContainsKey(CardIdEnum.FP1_018) && enemyCardsOut[CardIdEnum.FP1_018] >= 2)
                {
                    sec.canBe_duplicate = false;
                }

                if (enemyCardsOut.ContainsKey(CardIdEnum.AT_002) && enemyCardsOut[CardIdEnum.AT_002] >= 2)
                {
                    sec.canBe_effigy = false;
                }
            }

            if (SecClass == TAG_CLASS.PALADIN)
            {
                sec.canBe_snaketrap     = false;
                sec.canBe_snipe         = false;
                sec.canBe_explosive     = false;
                sec.canBe_beartrap      = false;
                sec.canBe_freezing      = false;
                sec.canBe_missdirection = false;
                sec.canBe_darttrap      = false;
                sec.canBe_cattrick      = false;

                sec.canBe_counterspell = false;
                sec.canBe_icebarrier   = false;
                sec.canBe_iceblock     = false;
                sec.canBe_mirrorentity = false;
                sec.canBe_spellbender  = false;
                sec.canBe_vaporize     = false;
                sec.canBe_duplicate    = false;
                sec.canBe_effigy       = false;

                if (enemyCardsOut.ContainsKey(CardIdEnum.EX1_132) && enemyCardsOut[CardIdEnum.EX1_132] >= 2)
                {
                    sec.canBe_eyeforaneye = false;
                }

                if (enemyCardsOut.ContainsKey(CardIdEnum.EX1_130) && enemyCardsOut[CardIdEnum.EX1_130] >= 2)
                {
                    sec.canBe_noblesacrifice = false;
                }

                if (enemyCardsOut.ContainsKey(CardIdEnum.EX1_136) && enemyCardsOut[CardIdEnum.EX1_136] >= 2)
                {
                    sec.canBe_redemption = false;
                }

                if (enemyCardsOut.ContainsKey(CardIdEnum.EX1_379) && enemyCardsOut[CardIdEnum.EX1_379] >= 2)
                {
                    sec.canBe_repentance = false;
                }

                if (enemyCardsOut.ContainsKey(CardIdEnum.FP1_020) && enemyCardsOut[CardIdEnum.FP1_020] >= 2)
                {
                    sec.canBe_avenge = false;
                }

                if (enemyCardsOut.ContainsKey(CardIdEnum.LOE_027) && enemyCardsOut[CardIdEnum.LOE_027] >= 2)
                {
                    sec.canBe_sacredtrial = false;
                }
            }

            return(sec);
        }