靈魂殘片相關的添加


首先需要上一篇的牌庫修復后才能識別牌庫中的衍生卡——靈魂殘片,本文才會起作用。

Playfield.cs 的添加

添加靈魂殘片字段,並在兩處構造器中對應添加。

//HREngine.Bots.Playfield
/// <summary>
/// 靈魂殘片的數量
/// </summary>
public int AnzSoulFragments = 0;

//HREngine.Bots.Playfield.Playfield()
AnzSoulFragments = prozis.turnDeck.ContainsKey(CardDB.cardIDEnum.SCH_307t) ? prozis.turnDeck[CardDB.cardIDEnum.SCH_307t] : 0;

//HREngine.Bots.Playfield.Playfield(Playfield p)
this.AnzSoulFragments = p.AnzSoulFragments;

SIM 的添加

靈魂殘片

using System;
using System.Collections.Generic;
using System.Text;

namespace HREngine.Bots
{
	class Sim_SCH_307t : SimTemplate //* 靈魂殘片 Soul Fragment
	{
        //<b>Casts When Drawn</b>Restore #2 Health to your hero.
        //<b>抽到時施放</b>為你的英雄恢復#2點生命值。
        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            int heal = (ownplay) ? p.getSpellHeal(2) : p.getEnemySpellHeal(2);
            Minion m = ownplay ? p.ownHero : p.enemyHero;
            p.minionGetDamageOrHeal(m, -heal);
        }
    }
}

注:這個 sim 寫的是靈魂殘片從手牌中打出的一種特殊情況,而不是觸發的抽到時釋放的效果。

洗入靈魂殘片

精魂獄卒

using System;
using System.Collections.Generic;
using System.Text;

namespace HREngine.Bots
{
	class Sim_SCH_700 : SimTemplate //* 精魂獄卒 Spirit Jailer
	{
        //<b>Battlecry:</b> Shuffle 2 Soul Fragments into your deck.
        //<b>戰吼:</b>將兩張靈魂殘片洗入你的牌庫。
        public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {
            if (own.own)
            {
                p.AnzSoulFragments += 2;
                p.ownDeckSize += 2;
            }
            else
            {
                p.enemyDeckSize += 2;
            }
        }
    }
}

靈魂剝離

using System;
using System.Collections.Generic;
using System.Text;

namespace HREngine.Bots
{
	class Sim_SCH_701 : SimTemplate //* 靈魂剝離 Soul Shear
	{
        //[x]Deal $3 damage to aminion. Shuffle 2 SoulFragments into your deck.
        //對一個隨從造成$3點傷害。將兩張靈魂殘片洗入你的牌庫。
        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            if (target != null)
                if (ownplay)
                {
                    int dmg = p.getSpellDamageDamage(3);
                    p.minionGetDamageOrHeal(target, dmg);
                    p.AnzSoulFragments += 2;
                    p.ownDeckSize += 2;
                }
                else
                {
                    int dmg = p.getEnemySpellDamageDamage(3);
                    p.minionGetDamageOrHeal(target, dmg);
                    p.enemyDeckSize += 2;
                }
        }
    }
}

注:記得添加 PlayRequirement

校園精魂

using System;
using System.Collections.Generic;
using System.Text;

namespace HREngine.Bots
{
	class Sim_SCH_307 : SimTemplate //* 校園精魂 School Spirits
	{
        //[x]Deal $2 damage to allminions. Shuffle 2 SoulFragments into your deck.
        //對所有隨從造成$2點傷害。將兩張靈魂殘片洗入你的牌庫。
        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            if (ownplay)
            {
                int dmg = p.getSpellDamageDamage(2);
                p.allMinionsGetDamage(dmg);
                p.AnzSoulFragments += 2;
                p.ownDeckSize += 2;
            }
            else
            {
                int dmg = p.getEnemySpellDamageDamage(2);
                p.allMinionsGetDamage(dmg);
                p.enemyDeckSize += 2;
            }
        }
    }
}

切髓之刃

using System;
using System.Collections.Generic;
using System.Text;

namespace HREngine.Bots
{
	class Sim_SCH_252 : SimTemplate //* 切髓之刃 Marrowslicer
	{
        //<b>Battlecry:</b> Shuffle 2 Soul Fragments into your deck.
        //<b>戰吼:</b>將兩張靈魂殘片洗入你的牌庫。
        public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
        {
            if (ownplay)
            {
                p.AnzSoulFragments += 2;
                p.ownDeckSize += 2;
            }
            else
            {
                p.enemyDeckSize += 2;
            }
        }
    }
}

摧毀靈魂碎片

影光學者

using System;
using System.Collections.Generic;
using System.Text;

namespace HREngine.Bots
{
	class Sim_SCH_517 : SimTemplate //* 影光學者 Shadowlight Scholar
	{
        //<b>Battlecry:</b> Destroy a Soul Fragment in your deck to deal 3 damage.
        //<b>戰吼:</b>摧毀一張你牌庫中的靈魂殘片,造成3點傷害。
        public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {
            if (own.own)
            {
                if (p.AnzSoulFragments > 0 && target != null)
                {
                    p.AnzSoulFragments--;
                    p.ownDeckSize--;
                    p.minionGetDamageOrHeal(target, 3);
                }
            }
            else
            {
                if(target != null)
                {
                    p.enemyDeckSize--;
                    p.minionGetDamageOrHeal(target, 3);
                }
            }
        }
    }
}

殘片震爆秘術師

using System;
using System.Collections.Generic;
using System.Text;

namespace HREngine.Bots
{
	class Sim_SCH_355 : SimTemplate //* 殘片震爆秘術師 Shardshatter Mystic
	{
        //<b>Battlecry:</b> Destroy a Soul Fragment in your deck to deal 3 damage to all other minions.
        //<b>戰吼:</b>摧毀一張你牌庫中的靈魂殘片,對所有其他隨從造成3點傷害。
        public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {
            if (own.own)
            {
                if (p.AnzSoulFragments > 0)
                {
                    p.AnzSoulFragments--;
                    p.ownDeckSize--;
                    p.allMinionsGetDamage(3, own.entitiyID);
                }
            }
            else
            {
                p.enemyDeckSize--;
                p.allMinionsGetDamage(3, own.entitiyID);
            }
        }
    }
}

鑄魂寶石匠

using System;
using System.Collections.Generic;
using System.Text;

namespace HREngine.Bots
{
	class Sim_SCH_704 : SimTemplate //* 鑄魂寶石匠 Soulshard Lapidary
	{
        //[x]<b>Battlecry:</b> Destroy a SoulFragment in your deck togive your hero +5 Attackthis turn.
        //<b>戰吼:</b>摧毀一張你牌庫中的靈魂殘片,在本回合中使你的英雄獲得+5攻擊力。
        public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {
            if (own.own)
            {
                if (p.AnzSoulFragments > 0)
                {
                    p.AnzSoulFragments--;
                    p.ownDeckSize--;
                    p.minionGetTempBuff(p.ownHero, 5, 0);
                }
            }
            else
            {
                p.enemyDeckSize--;
                p.minionGetTempBuff(p.enemyHero, 5, 0);
            }
        }
    }
}

虛空吸食者

using System;
using System.Collections.Generic;
using System.Text;

namespace HREngine.Bots
{
    class Sim_SCH_343 : SimTemplate //* 虛空吸食者 Void Drinker
    {
        //[x]<b>Taunt</b>. <b>Battlecry:</b> Destroya Soul Fragment in yourdeck to gain +3/+3.
        //<b>嘲諷,戰吼:</b>摧毀一張你牌庫中的靈魂殘片,獲得+3/+3。
        public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {
            if (own.own)
            {
                if (p.AnzSoulFragments > 0)
                {
                    p.AnzSoulFragments--;
                    p.ownDeckSize--;
                    p.minionGetBuffed(own, 3, 3);
                }
            }
            else
            {
                p.enemyDeckSize--;
                p.minionGetBuffed(own, 3, 3);
            }
        }
    }
}

讀取靈魂殘片

靈魂學家瑪麗希亞

using System;
using System.Collections.Generic;
using System.Text;

namespace HREngine.Bots
{
	class Sim_SCH_703 : SimTemplate //* 靈魂學家瑪麗希亞 Soulciologist Malicia
	{
        //<b>Battlecry:</b> For each Soul Fragment in your deck, summon a 3/3 Soul with <b>Rush</b>.@ <i>(@)</i>
        //<b>戰吼:</b>你的牌庫中每有一張靈魂殘片,召喚一個3/3並具有<b>突襲</b>的靈魂。@<i>(@)</i>
        public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
        {
            CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.SCH_703t);
            if (own.own)
            {
                for (int i = 0; i < p.AnzSoulFragments; i++)
                {
                    int pos = (i % 2 == 0) ? own.zonepos : own.zonepos - 1;
                    if (p.ownMinions.Count < 7)
                        p.callKid(kid, pos, true);
                    else return;
                }
            }
        }
    }
}


免責聲明!

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



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