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;
  • 相关阅读:
    yocto/bitbake 学习资源
    QEMU/KVM学习资源
    ubuntu 中创建和删除用户
    git 重命名本地和远程分支
    Ubuntu 上搭建 FTP 服务器
    gdb 常见用法
    git log 显示与特定文件相关的 commit 信息
    基于 qemu system mode 运行 arm 程序
    基于 qemu user mode 运行 aarch64 程序
    checking in(airport)
  • 原文地址:https://www.cnblogs.com/dch0319/p/13461930.html
Copyright © 2011-2022 走看看