法術迸發(Spellburst)


全新關鍵字:法術迸發

“通靈學園”帶來了全新的關鍵字:法術迸發,在你施放法術后能產生一次性效果!當具有法術迸發的隨從或武器在場時,施放法術將激活法術迸發效果。

看描述,似乎和聖盾效果比較相似?不妨模仿聖盾來添加。但是好像武器也有法術迸發效果

1.silverfish_HB.cs

搜索getMinions方法,模仿聖盾添加:

            //法術迸發
                    m.Spellburst = entitiy.GetTag(GAME_TAG.SPELLBURST) != 0;

或者

            //法術迸發
                    m.Spellburst = entitiy.GetTag((GAME_TAG)1427) != 0;

搜索getHerostuff()方法

在if (TritonHs.DoWeHaveWeapon)和if (TritonHs.DoesEnemyHasWeapon)下仿照吸血添加

2.Minion.cs

在Minion類下添加屬性:

        /// <summary>
        /// 法術迸發
        /// </summary>
        public bool Spellburst { get; set; } = false;

Minion(Minion m)方法下:

        this.Spellburst = m.Spellburst;//法術迸發

setMinionToMinion(Minion m)方法下:

        this.Spellburst = m.Spellburst;//法術迸發

3.CardDB.cs

在Card類下添加屬性:

       /// <summary>
            /// 法術迸發
            /// </summary>
            public bool Spellburst { get; set; } = false;

搜索case 685

在下方添加

        case 1427: c.Spellburst = value == 1;break;//法術迸發

4.Playfield.cs

playACard(Handmanager.Handcard hc, Minion target, int position, int choice, int penalty)方法下

搜索c.sim_card.OnCardPlay(this, true, target, choice);

在下方添加

            #region 法術迸發效果的實現
                    foreach (Minion m in this.ownMinions)
                    {
                        if (m.Spellburst && !m.silenced)
                        {
                            m.handcard.card.sim_card.OnSpellburst(this, m, hc);
                            m.Spellburst = false;
                        }
                    }
                    if (this.ownWeapon.Spellburst)
                    {
                        this.ownWeapon.card.sim_card.OnSpellburst(this, this.ownWeapon, hc);
              this.ownWeapon.Spellburst = false;
                    }
                    #endregion

 

在createNewMinion(Handmanager.Handcard hc, int zonepos, bool own)方法下添加

        m.Spellburst = hc.card.Spellburst;//法術迸發

5.Weapon.cs

在Weapon類下添加屬性:

       /// <summary>
            /// 法術迸發
            /// </summary>
            public bool Spellburst { get; set; } = false;

在Weapon(Weapon w)方法下添加

        this.Spellburst = w.Spellburst;//法術迸發

在isEqual(Weapon w)方法下添加

        if (this.Spellburst != w.Spellburst) return false;//法術迸發

在equip(CardDB.Card c)方法下添加

        this.Spellburst = c.Spellburst;//法術迸發

6.SimTemplate.cs

在SimTemplate類下添加

OnSpellburst方法的兩個重載

     /// <summary>
        /// 法術迸發效果
        /// </summary>
        /// <param name="p">場面</param>
        /// <param name="m">具有法術迸發的隨從</param>
        /// <param name="hc">觸發法術迸發的法術牌</param>
        public virtual void OnSpellburst(Playfield p, Minion m, Handmanager.Handcard hc)
        {
            return;
        }

        /// <summary>
        /// 法術迸發(武器)
        /// </summary>
        /// <param name="p">場面</param>
        /// <param name="w">武器</param>
        /// <param name="hc">觸發法術迸發的法術牌</param>
        public virtual void OnSpellburst(Playfield p, Weapon w, Handmanager.Handcard hc)
        {
            return;
        }

 補充:由於編譯器版本較低,不能使用語法糖

屬性應寫為

            /// <summary>
            /// 法術迸發
            /// </summary>
            public bool Spellburst
            {
                get { return _spellburst; }
                set { _spellburst = value; }
            }
            private bool _spellburst = false;

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM