public override void OnRoundEndTheLast()
 {
     if (this.owner.emotionDetail.EmotionLevel >= 1 && Collect1 < 1)
     {
         if (WhiteNight)
         {
             this.owner.emotionDetail.ApplyEmotionCard(Singleton <EmotionCardXmlList> .Instance.GetData(90911, SephirahType.None));
         }
         else
         {
             string             name    = RandomUtil.SelectOne <EmotionCardXmlInfo>(Harmony_Patch.emotion1).Name + "_Enemy";
             EmotionCardXmlInfo emotion = Harmony_Patch.enermy.Find((Predicate <EmotionCardXmlInfo>)(x => x.Name == name));
             //emotion = RandomUtil.SelectOne<EmotionCardXmlInfo>(Singleton<EmotionCardXmlList>.Instance.GetDataList(SephirahType.None, 10, 1));
             if (emotion == null)
             {
                 return;
             }
             //emotion = Singleton<EmotionCardXmlList>.Instance.GetData(90813, SephirahType.None);
             this.owner.emotionDetail.ApplyEmotionCard(emotion);
         }
         Collect1 += 1;
     }
     if (this.owner.emotionDetail.EmotionLevel >= 2 && Collect1 < 2)
     {
         string name = RandomUtil.SelectOne <EmotionCardXmlInfo>(Harmony_Patch.emotion1).Name + "_Enemy";
         while (SearchEmotion(owner, name) != null)
         {
             name = RandomUtil.SelectOne <EmotionCardXmlInfo>(Harmony_Patch.emotion1).Name + "_Enemy";
         }
         EmotionCardXmlInfo emotion = Harmony_Patch.enermy.Find((Predicate <EmotionCardXmlInfo>)(x => x.Name == name));
         //emotion = RandomUtil.SelectOne<EmotionCardXmlInfo>(Singleton<EmotionCardXmlList>.Instance.GetDataList(SephirahType.None, 10, 1));
         if (emotion == null)
         {
             return;
         }
         //emotion = Singleton<EmotionCardXmlList>.Instance.GetData(90813, SephirahType.None);
         this.owner.emotionDetail.ApplyEmotionCard(emotion);
         Collect1 += 1;
     }
     if (this.owner.emotionDetail.EmotionLevel >= 3 && Collect2 < 1)
     {
         if (WhiteNight)
         {
             this.owner.emotionDetail.ApplyEmotionCard(Singleton <EmotionCardXmlList> .Instance.GetData(90912, SephirahType.None));
         }
         else
         {
             string             name    = RandomUtil.SelectOne <EmotionCardXmlInfo>(Harmony_Patch.emotion2).Name + "_Enemy";
             EmotionCardXmlInfo emotion = Harmony_Patch.enermy.Find((Predicate <EmotionCardXmlInfo>)(x => x.Name == name));
             //emotion = RandomUtil.SelectOne<EmotionCardXmlInfo>(Singleton<EmotionCardXmlList>.Instance.GetDataList(SephirahType.None, 10, 2));
             if (emotion == null)
             {
                 return;
             }
             //emotion = Singleton<EmotionCardXmlList>.Instance.GetData(90913, SephirahType.None);
             this.owner.emotionDetail.ApplyEmotionCard(emotion);
         }
         Collect2 += 1;
     }
     if (this.owner.emotionDetail.EmotionLevel >= 4 && Collect2 < 2)
     {
         string name = RandomUtil.SelectOne <EmotionCardXmlInfo>(Harmony_Patch.emotion2).Name + "_Enemy";
         while (SearchEmotion(owner, name) != null)
         {
             name = RandomUtil.SelectOne <EmotionCardXmlInfo>(Harmony_Patch.emotion1).Name + "_Enemy";
         }
         EmotionCardXmlInfo emotion = Harmony_Patch.enermy.Find((Predicate <EmotionCardXmlInfo>)(x => x.Name == name));
         //emotion = RandomUtil.SelectOne<EmotionCardXmlInfo>(Singleton<EmotionCardXmlList>.Instance.GetDataList(SephirahType.None, 10, 2));
         if (emotion == null)
         {
             return;
         }
         //emotion = Singleton<EmotionCardXmlList>.Instance.GetData(90813, SephirahType.None);
         this.owner.emotionDetail.ApplyEmotionCard(emotion);
         Collect2 += 1;
     }
     if (this.owner.emotionDetail.EmotionLevel >= 5 && !Collect3)
     {
         if (WhiteNight)
         {
             this.owner.emotionDetail.ApplyEmotionCard(Singleton <EmotionCardXmlList> .Instance.GetData(90915, SephirahType.None));
         }
         else
         {
             string             name    = RandomUtil.SelectOne <EmotionCardXmlInfo>(Harmony_Patch.emotion3).Name + "_Enemy";
             EmotionCardXmlInfo emotion = Harmony_Patch.enermy.Find((Predicate <EmotionCardXmlInfo>)(x => x.Name == name));
             //emotion = RandomUtil.SelectOne<EmotionCardXmlInfo>(Singleton<EmotionCardXmlList>.Instance.GetDataList(SephirahType.None, 10, 3));
             if (emotion == null)
             {
                 return;
             }
             //emotion = Singleton<EmotionCardXmlList>.Instance.GetData(90914, SephirahType.None);
             this.owner.emotionDetail.ApplyEmotionCard(emotion);
         }
         Collect3 = true;
     }
 }
Example #2
0
        public override void OnSelectEmotion()
        {
            base.OnSelectEmotion();
            BattleEmotionCardModel Long  = SearchEmotion(this._owner, "ApocalypseBird_LongArm_Enemy");
            BattleEmotionCardModel Big   = SearchEmotion(this._owner, "ApocalypseBird_BigEye_Enemy");
            BattleEmotionCardModel Small = SearchEmotion(this._owner, "ApocalypseBird_SmallPeak_Enemy");

            if (Long != null)
            {
                foreach (EmotionCardAbilityBase ability in Long.GetAbilityList())
                {
                    MethodInfo destroy = ability.GetType().GetMethod("Destroy");
                    if (destroy != null)
                    {
                        try
                        {
                            destroy.Invoke(ability, new object[] { });
                        }
                        catch (Exception ex)
                        {
                            Debug.Error(ability.GetType().Name + "Destroy", ex);
                        }
                    }
                }
                this._owner.emotionDetail.PassiveList.Remove(Long);
                string             name    = RandomUtil.SelectOne <EmotionCardXmlInfo>(Harmony_Patch.emotion1).Name + "_Enemy";
                EmotionCardXmlInfo emotion = Harmony_Patch.enermy.Find((Predicate <EmotionCardXmlInfo>)(x => x.Name == name));
                this._owner.emotionDetail.ApplyEmotionCard(emotion);
            }
            if (Big != null)
            {
                foreach (EmotionCardAbilityBase ability in Big.GetAbilityList())
                {
                    MethodInfo destroy = ability.GetType().GetMethod("Destroy");
                    if (destroy != null)
                    {
                        try
                        {
                            destroy.Invoke(ability, new object[] { });
                        }
                        catch (Exception ex)
                        {
                            Debug.Error(ability.GetType().Name + "Destroy", ex);
                        }
                    }
                }
                this._owner.emotionDetail.PassiveList.Remove(Big);
                string             name    = RandomUtil.SelectOne <EmotionCardXmlInfo>(Harmony_Patch.emotion2).Name + "_Enemy";
                EmotionCardXmlInfo emotion = Harmony_Patch.enermy.Find((Predicate <EmotionCardXmlInfo>)(x => x.Name == name));
                this._owner.emotionDetail.ApplyEmotionCard(emotion);
            }
            if (Small != null)
            {
                foreach (EmotionCardAbilityBase ability in Small.GetAbilityList())
                {
                    MethodInfo destroy = ability.GetType().GetMethod("Destroy");
                    if (destroy != null)
                    {
                        try
                        {
                            destroy.Invoke(ability, new object[] { });
                        }
                        catch (Exception ex)
                        {
                            Debug.Error(ability.GetType().Name + "Destroy", ex);
                        }
                    }
                }
                this._owner.emotionDetail.PassiveList.Remove(Small);
                string             name    = RandomUtil.SelectOne <EmotionCardXmlInfo>(Harmony_Patch.emotion2).Name + "_Enemy";
                EmotionCardXmlInfo emotion = Harmony_Patch.enermy.Find((Predicate <EmotionCardXmlInfo>)(x => x.Name == name));
                this._owner.emotionDetail.ApplyEmotionCard(emotion);
            }
            SingletonBehavior <SoundEffectManager> .Instance.PlayClip("Creature/BossBird_Birth", false, 4f);

            this._aura = SingletonBehavior <DiceEffectManager> .Instance.CreateNewFXCreatureEffect("8_B/FX_IllusionCard_8_B_MonsterAura", 1f, _owner.view, _owner.view);

            this._owner.bufListDetail.AddBuf(new EmotionCardAbility_bossbird1.Longbird_Enemy());
            this._owner.bufListDetail.AddBuf(new EmotionCardAbility_bossbird2.Bigbird_Enemy());
            this._owner.bufListDetail.AddBuf(new EmotionCardAbility_bossbird3.Smallbird_Enemy());
            DiceCardXmlInfo bigbirdxml = ItemXmlDataList.instance.GetCardItem(910041).Copy(true);

            bigbirdxml.optionList.Clear();
            DiceCardSpec bigbirdspec = bigbirdxml.Spec.Copy();

            bigbirdspec.Cost    = 0;
            bigbirdxml.Spec     = bigbirdspec;
            bigbirdxml.Priority = 100;
            bigbirdxml.Keywords.Clear();
            BattleDiceCardModel BigBirdEgo = BattleDiceCardModel.CreatePlayingCard(bigbirdxml);

            Ego.Add(BigBirdEgo);
            DiceCardXmlInfo smallbirdxml = ItemXmlDataList.instance.GetCardItem(910043).Copy(true);

            smallbirdxml.optionList.Clear();
            DiceCardSpec smallbirdspec = smallbirdxml.Spec.Copy();

            smallbirdspec.Cost    = 0;
            smallbirdxml.Spec     = smallbirdspec;
            smallbirdxml.Priority = 100;
            smallbirdxml.Keywords.Clear();
            BattleDiceCardModel SmallBirdEgo = BattleDiceCardModel.CreatePlayingCard(smallbirdxml);

            Ego.Add(SmallBirdEgo);
            DiceCardXmlInfo longbirdxml = ItemXmlDataList.instance.GetCardItem(910042).Copy(true);

            longbirdxml.optionList.Clear();
            DiceCardSpec longbirdspec = longbirdxml.Spec.Copy();

            longbirdspec.Cost    = 0;
            longbirdxml.Spec     = longbirdspec;
            longbirdxml.Priority = 100;
            longbirdxml.Keywords.Clear();
            BattleDiceCardModel LongBirdEgo = BattleDiceCardModel.CreatePlayingCard(bigbirdxml);

            Ego.Add(LongBirdEgo);
            this._owner.allyCardDetail.AddCardToDeck(Ego);
            this._owner.allyCardDetail.Shuffle();
        }
            public override void OnRoundEndTheLast()
            {
                try
                {
                    base.OnRoundEndTheLast();
                    SoundEffectPlayer.PlaySound("Creature/Nihil_Effect");
                    foreach (BattleEmotionCardModel emotion in this._owner.emotionDetail.PassiveList)
                    {
                        switch (emotion.XmlInfo.EmotionLevel)
                        {
                        case 1:
                            level1 += 1;
                            break;

                        case 2:
                            level2 += 1;
                            break;

                        case 3:
                            level3 += 1;
                            break;
                        }
                        foreach (EmotionCardAbilityBase ability in emotion.GetAbilityList())
                        {
                            MethodInfo destroy = ability.GetType().GetMethod("Destroy");
                            if (destroy != null)
                            {
                                try
                                {
                                    destroy.Invoke(ability, new object[] { });
                                }
                                catch (Exception ex)
                                {
                                    Debug.Error(ability.GetType().Name + "Destroy", ex);
                                }
                            }
                        }
                    }
                    this._owner.emotionDetail.PassiveList.Clear();
                    for (; level1 > 0; level1--)
                    {
                        if (this._owner.faction == Faction.Player)
                        {
                            EmotionCardXmlInfo emotion = RandomUtil.SelectOne <EmotionCardXmlInfo>(Harmony_Patch.emotion1);
                            if (this._owner.emotionDetail.CheckPassiveDuplicate(emotion))
                            {
                                level1 += 1;
                                continue;
                            }
                            this._owner.emotionDetail.ApplyEmotionCard(emotion);
                            Debug.Log(string.Format("添加新的情感卡{0}成功", emotion.Name));
                        }
                        if (this._owner.faction == Faction.Enemy)
                        {
                            string             name    = RandomUtil.SelectOne <EmotionCardXmlInfo>(Harmony_Patch.emotion1).Name + "_Enemy";
                            EmotionCardXmlInfo emotion = Harmony_Patch.enermy.Find((Predicate <EmotionCardXmlInfo>)(x => x.Name == name));
                            //emotion = RandomUtil.SelectOne<EmotionCardXmlInfo>(Singleton<EmotionCardXmlList>.Instance.GetDataList(SephirahType.None, 10, 1));
                            if (this._owner.emotionDetail.CheckPassiveDuplicate(emotion))
                            {
                                level1 += 1;
                                continue;
                            }
                            this._owner.emotionDetail.ApplyEmotionCard(emotion);
                        }
                    }
                    for (; level2 > 0; level2--)
                    {
                        if (this._owner.faction == Faction.Player)
                        {
                            EmotionCardXmlInfo emotion = RandomUtil.SelectOne <EmotionCardXmlInfo>(Harmony_Patch.emotion2);
                            if (this._owner.emotionDetail.CheckPassiveDuplicate(emotion))
                            {
                                level2 += 1;
                                continue;
                            }
                            this._owner.emotionDetail.ApplyEmotionCard(emotion);
                            Debug.Log(string.Format("添加新的情感卡{0}成功", emotion.Name));
                        }
                        if (this._owner.faction == Faction.Enemy)
                        {
                            string             name    = RandomUtil.SelectOne <EmotionCardXmlInfo>(Harmony_Patch.emotion2).Name + "_Enemy";
                            EmotionCardXmlInfo emotion = Harmony_Patch.enermy.Find((Predicate <EmotionCardXmlInfo>)(x => x.Name == name));
                            //emotion = RandomUtil.SelectOne<EmotionCardXmlInfo>(Singleton<EmotionCardXmlList>.Instance.GetDataList(SephirahType.None, 10, 2));
                            if (this._owner.emotionDetail.CheckPassiveDuplicate(emotion))
                            {
                                level2 += 1;
                                continue;
                            }
                            this._owner.emotionDetail.ApplyEmotionCard(emotion);
                        }
                    }
                    for (; level3 > 0; level3--)
                    {
                        if (this._owner.faction == Faction.Player)
                        {
                            EmotionCardXmlInfo emotion = RandomUtil.SelectOne <EmotionCardXmlInfo>(Harmony_Patch.emotion3);
                            if (this._owner.emotionDetail.CheckPassiveDuplicate(emotion))
                            {
                                level3 += 1;
                                continue;
                            }
                            this._owner.emotionDetail.ApplyEmotionCard(emotion);
                            Debug.Log(string.Format("添加新的情感卡{0}成功", emotion.Name));
                        }
                        if (this._owner.faction == Faction.Enemy)
                        {
                            string             name    = RandomUtil.SelectOne <EmotionCardXmlInfo>(Harmony_Patch.emotion3).Name + "_Enemy";
                            EmotionCardXmlInfo emotion = Harmony_Patch.enermy.Find((Predicate <EmotionCardXmlInfo>)(x => x.Name == name));
                            //emotion = RandomUtil.SelectOne<EmotionCardXmlInfo>(Singleton<EmotionCardXmlList>.Instance.GetDataList(SephirahType.None, 10, 3));
                            if (this._owner.emotionDetail.CheckPassiveDuplicate(emotion))
                            {
                                level3 += 1;
                                continue;
                            }
                            this._owner.emotionDetail.ApplyEmotionCard(emotion);
                        }
                    }
                }
                catch (Exception ex)
                {
                    Debug.Error("ClownAddBuff", ex);
                }
            }