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


C# GameLiving.DealDamage方法代码示例

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


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

示例1: DamageTarget

        private void DamageTarget(GameLiving target, GameLiving caster)
        {
            double modifier = 0.5 + (caster.GetModifiedSpecLevel("Soulrending") * 0.01);
            int basedamage = (int)(250 * modifier);
            int resist = basedamage * target.GetResist(eDamageType.Spirit) / -100;
            int damage = basedamage + resist;
            int heal = (int)(damage * 0.75);
            int modheal = caster.MaxHealth - caster.Health;
            if (modheal > heal)
                modheal = heal;
            caster.Health += modheal;

            GamePlayer player = caster as GamePlayer;
            if (player != null)
                player.Out.SendMessage("You hit " + target.Name + " for " + damage + "(" + resist + ") points of damage!", eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);
            if (caster is GamePlayer && modheal > 0)
                ((GamePlayer)caster).Out.SendMessage("Your Soul Quench returns " + modheal + " lifepoints to you", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);

            GamePlayer targetPlayer = target as GamePlayer;
            if (targetPlayer != null)
            {
                if (targetPlayer.IsStealthed)
                    targetPlayer.Stealth(false);
            }

            foreach (GamePlayer p in target.GetPlayersInRadius(false, WorldMgr.VISIBILITY_DISTANCE))
            {
                p.Out.SendSpellEffectAnimation(caster, target, 1145, 0, false, 1);
                p.Out.SendCombatAnimation(caster, target, 0, 0, 0, 0, 0x14, target.HealthPercent);
            }

            //target.TakeDamage(caster, eDamageType.Spirit, damage, 0);
            AttackData ad = new AttackData();
            ad.AttackResult = GameLiving.eAttackResult.HitUnstyled;
            ad.Attacker = caster;
            ad.Target = target;
            ad.DamageType = eDamageType.Spirit;
            ad.Damage = damage;
            target.OnAttackedByEnemy(ad);
            caster.DealDamage(ad);
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:41,代码来源:SoulQuenchAbility.cs

示例2: DamageTarget

        private void DamageTarget(GameLiving target, GameLiving caster)
        {
            int resist = 251 * target.GetResist(eDamageType.Crush) / -100;
            int damage = 251 + resist;

            GamePlayer player = caster as GamePlayer;
            if (player != null)
                player.Out.SendMessage("You hit " + target.Name + " for " + damage + "(" + resist + ") points of damage!", eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);

            GamePlayer targetPlayer = target as GamePlayer;
            if (targetPlayer != null)
            {
                if (targetPlayer.IsStealthed)
                    targetPlayer.Stealth(false);
            }

            foreach (GamePlayer p in target.GetPlayersInRadius(false, WorldMgr.VISIBILITY_DISTANCE))
            {
                p.Out.SendSpellEffectAnimation(caster, target, 7043, 0, false, 1);
                p.Out.SendCombatAnimation(caster, target, 0, 0, 0, 0, 0x14, target.HealthPercent);
            }

            //target.TakeDamage(caster, eDamageType.Spirit, damage, 0);
            AttackData ad = new AttackData();
            ad.AttackResult = GameLiving.eAttackResult.HitUnstyled;
            ad.Attacker = caster;
            ad.Target = target;
            ad.DamageType = eDamageType.Crush;
            ad.Damage = damage;
            target.OnAttackedByEnemy(ad);
            caster.DealDamage(ad);

            if (target.EffectList.GetOfType<WhirlingStaffEffect>() == null)
            {
                WhirlingStaffEffect effect = new WhirlingStaffEffect();
                effect.Start(target);
            }
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:38,代码来源:WhirlingStaffAbility.cs

示例3: DamageTarget

        private void DamageTarget(GameLiving target, GameLiving caster)
        {
            int damage = 300;

            GamePlayer player = caster as GamePlayer;
            if (player != null)
                player.Out.SendMessage("You hit " + target.Name + " for " + damage + " points of damage!", eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);

            GamePlayer targetPlayer = target as GamePlayer;
            if (targetPlayer != null)
            {
                if (targetPlayer.IsStealthed)
                    targetPlayer.Stealth(false);
            }

            AttackData ad = new AttackData();
            ad.AttackResult = GameLiving.eAttackResult.HitUnstyled;
            ad.Attacker = caster;
            ad.Target = target;
            ad.DamageType = eDamageType.Crush;
            ad.Damage = damage;
            target.OnAttackedByEnemy(ad);
            caster.DealDamage(ad);
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:24,代码来源:DesperateBowmanAbility.cs

示例4: DamageTarget

        private void DamageTarget(GameLiving target, GameLiving caster, double counter)
        {
            int level = caster.GetModifiedSpecLevel("Stormcalling");
            if (level > 50)
                level = 50;
            modifier = 0.5 + (level * 0.01) * Math.Pow(0.75, counter);
            basedamage = (int)(450 * modifier);
            resist = basedamage * target.GetResist(eDamageType.Energy) / -100;
            damage = basedamage + resist;

            GamePlayer player = caster as GamePlayer;
            if (player != null)
                player.Out.SendMessage("You hit " + target.Name + " for " + damage + "(" + resist + ") points of damage!", eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);

            GamePlayer targetPlayer = target as GamePlayer;
            if (targetPlayer != null)
            {
                if (targetPlayer.IsStealthed)
                    targetPlayer.Stealth(false);
            }

            foreach (GamePlayer p in target.GetPlayersInRadius(false, WorldMgr.VISIBILITY_DISTANCE))
            {
                p.Out.SendSpellEffectAnimation(caster, target, 3505, 0, false, 1);
                p.Out.SendCombatAnimation(caster, target, 0, 0, 0, 0, 0x14, target.HealthPercent);
            }

            //target.TakeDamage(caster, eDamageType.Spirit, damage, 0);
            AttackData ad = new AttackData();
            ad.AttackResult = GameLiving.eAttackResult.HitUnstyled;
            ad.Attacker = caster;
            ad.Target = target;
            ad.DamageType = eDamageType.Energy;
            ad.Damage = damage;
            target.OnAttackedByEnemy(ad);
            caster.DealDamage(ad);
        }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:37,代码来源:ChainLightningAbilityHandler.cs


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