当前位置: 首页>>代码示例>>C#>>正文


C# Playfield.secretTrigger_HeroGotDmg方法代码示例

本文整理汇总了C#中HREngine.Bots.Playfield.secretTrigger_HeroGotDmg方法的典型用法代码示例。如果您正苦于以下问题:C# Playfield.secretTrigger_HeroGotDmg方法的具体用法?C# Playfield.secretTrigger_HeroGotDmg怎么用?C# Playfield.secretTrigger_HeroGotDmg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HREngine.Bots.Playfield的用法示例。


在下文中一共展示了Playfield.secretTrigger_HeroGotDmg方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: getDamageOrHeal

        public void getDamageOrHeal(int dmg, Playfield p, bool isMinionAttack, bool dontCalcLostDmg)
        {
            if (this.Hp <= 0) return;

            if (this.immune && dmg > 0) return;

            if (this.isHero)
            {
                int copy = this.Hp;
                if (dmg < 0 || this.armor <= 0)
                {
                    //if (dmg < 0) return;

                    //heal
                    bool BolfRamshield = false;
                    if (dmg > 0)
                    {

                        foreach (Minion m in (this.own) ? p.ownMinions : p.enemyMinions)
                        {
                            if (m.name == CardDB.cardName.bolframshield)
                            {
                                BolfRamshield = true;
                                m.getDamageOrHeal(dmg, p, isMinionAttack, dontCalcLostDmg);
                            }
                        }
                    }

                    if (!BolfRamshield)
                    {
                        this.Hp = Math.Min(30, this.Hp - dmg);
                    }
                    if (copy < this.Hp)
                    {
                        p.tempTrigger.charsGotHealed++;
                    }
                    if (copy - this.Hp >= 1)
                    {
                        p.secretTrigger_HeroGotDmg(this.own, copy - this.Hp);
                    }
                }
                else
                {
                    if (this.armor > 0 && dmg > 0)
                    {

                        int rest = this.armor - dmg;
                        if (rest < 0)
                        {
                            bool BolfRamshield = false;
                            foreach (Minion m in (this.own) ? p.ownMinions : p.enemyMinions)
                            {
                                if (m.name == CardDB.cardName.bolframshield)
                                {
                                    BolfRamshield = true;
                                    m.getDamageOrHeal(-rest, p, isMinionAttack, dontCalcLostDmg);
                                }
                            }
                            if (!BolfRamshield)
                            {
                                this.Hp += rest;
                                p.secretTrigger_HeroGotDmg(this.own, rest);
                            }
                        }
                        this.armor = Math.Max(0, this.armor - dmg);

                    }
                }
                if (this.cantLowerHPbelowONE && this.Hp <= 0) this.Hp = 1;


                if (this.Hp < copy)
                {
                    this.anzGotDmg++;
                    this.gotDmgRaw += dmg;
                }
                return;
            }

            //its a Minion--------------------------------------------------------------


            int damage = dmg;
            int heal = 0;
            if (dmg < 0) heal = -dmg;

            bool woundedbefore = this.wounded;
            if (heal < 0) // heal was shifted in damage
            {
                damage = -1 * heal;
                heal = 0;
            }

            if (damage >= 1) this.allreadyAttacked = true;

            if (damage >= 1 && this.divineshild)
            {
                this.divineshild = false;
                if (!own && !dontCalcLostDmg && p.turnCounter == 0)
                {
//.........这里部分代码省略.........
开发者ID:davidmann4,项目名称:silverfish,代码行数:101,代码来源:Minion.cs


注:本文中的HREngine.Bots.Playfield.secretTrigger_HeroGotDmg方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。