zoukankan      html  css  js  c++  java
  • 法术迸发(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;
  • 相关阅读:
    GzipOutputStream及GzipInputStream的用法
    java的ZipOutputStream压缩文件的两个问题(乱码和每次zip后文件md5变化)
    HttpClient对URL编码的处理方式解惑!
    使用tmpfs缓存文件提高性能
    eclipse attach source code support folder zip & jar format
    HTTP头部详解及使用Java套接字处理HTTP请求
    curl使用总结
    cURL: win64sslsspi from Mirrors 64bit win7 version
    httpclient解析gzip网页
    使用Gzip加速网页的传输
  • 原文地址:https://www.cnblogs.com/dch0319/p/13461930.html
Copyright © 2011-2022 走看看