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;
  • 相关阅读:
    用的springboot+mybatis plus,报错bean无法实例化
    coding使用
    drop表后仍占表空间解决办法
    oracle从零开始学习笔记 三
    oracle从零开始学习笔记 二
    录制简单的自动化测试工具SlikMobile初体验
    appium 等待页面元素加载
    sdk 更新的时连接不上dl-ssl.google.com解决办法
    oracle从零开始学习笔记
    oracle: tochar(sysdate,'D')函数
  • 原文地址:https://www.cnblogs.com/dch0319/p/13461930.html
Copyright © 2011-2022 走看看