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


C# GameLiving.StartInterruptTimer方法代码示例

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


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

示例1: ApplyEffectOnTarget

        /// <summary>
        /// Apply effect on target or do spell action if non duration spell
        /// </summary>
        /// <param name="target">target that gets the effect</param>
        /// <param name="effectiveness">factor from 0..1 (0%-100%)</param>
        public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
        {
            if (target == null || target.CurrentRegion == null)
                return;

            if (target.Realm == 0 || Caster.Realm == 0)
            {
                target.LastAttackedByEnemyTickPvE = target.CurrentRegion.Time;
                Caster.LastAttackTickPvE = Caster.CurrentRegion.Time;
            }
            else
            {
                target.LastAttackedByEnemyTickPvP = target.CurrentRegion.Time;
                Caster.LastAttackTickPvP = Caster.CurrentRegion.Time;
            }

            base.ApplyEffectOnTarget(target, effectiveness);

            if (Spell.CastTime > 0)
            {
                target.StartInterruptTimer(target.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster);
            }
            if (target is GameNPC)
            {
                IOldAggressiveBrain aggroBrain = ((GameNPC)target).Brain as IOldAggressiveBrain;
                if (aggroBrain != null)
                    aggroBrain.AddToAggroList(Caster, 1);
            }
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:34,代码来源:ImmunityEffectSpellHandler.cs

示例2: OnSpellResisted

        /// <summary>
        /// When spell was resisted
        /// </summary>
        /// <param name="target">the target that resisted the spell</param>
        protected override void OnSpellResisted(GameLiving target)
        {
            base.OnSpellResisted(target);

            // Interrupt only if target is actually casting
            if (target.IsCasting && Spell.Target.ToLower() != "cone")
                target.StartInterruptTimer(target.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster);
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:12,代码来源:TauntSpellHandler.cs

示例3: OnDirectEffect

        public override void OnDirectEffect(GameLiving target, double effectiveness)
        {
            if (target == null) return;
            if (!target.IsAlive || target.ObjectState != GameLiving.eObjectState.Active) return;

            //spell damage shood be 50-100 (thats the amount power tapped on use) i recommend 90 i think thats it but cood be wrong
            int mana = (int)(Spell.Damage);
            target.ChangeMana(target, GameLiving.eManaChangeType.Spell, (-mana));

            target.StartInterruptTimer(target.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster);
        }
开发者ID:Refizul,项目名称:DOL-Kheldron,代码行数:11,代码来源:Battlemaster.cs

示例4: OnDirectEffect

        /// <summary>
        /// Execute direct effect.
        /// </summary>
        /// <param name="target">Target that takes the damage.</param>
        /// <param name="effectiveness">Effectiveness of the spell (0..1, equalling 0-100%).</param>
        public override void OnDirectEffect(GameLiving target, double effectiveness)
        {
            if (target == null) return;
            if (!target.IsAlive || target.ObjectState != GameLiving.eObjectState.Active) return;

            // Calculate damage to the target.

            AttackData ad = CalculateDamageToTarget(target, effectiveness);
            SendDamageMessages(ad);
            DamageTarget(ad, true);
            DrainPower(ad);
            target.StartInterruptTimer(target.SpellInterruptDuration, ad.AttackType, Caster);
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:18,代码来源:PowerDrain.cs

示例5: DealDamage

        protected override void DealDamage(GameLiving target, double effectiveness)
        {
            if (target == null || !target.IsAlive || target.ObjectState != GameLiving.eObjectState.Active) return;

            if (target is GamePlayer || target is GameNPC)
            {
                // calc damage and healing
                AttackData ad = CalculateDamageToTarget(target, effectiveness);
                SendDamageMessages(ad);
                DamageTarget(ad, true);
                StealLife(ad);
                target.StartInterruptTimer(target.SpellInterruptDuration, ad.AttackType, Caster);
            }
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:14,代码来源:LifedrainSpellHandler.cs

示例6: OnDirectEffect

        /// <summary>
        /// execute non duration spell effect on target
        /// </summary>
        /// <param name="target"></param>
        /// <param name="effectiveness"></param>
        public override void OnDirectEffect(GameLiving target, double effectiveness)
        {
            if (target == null) return;
            if (!target.IsAlive || target.ObjectState != GameLiving.eObjectState.Active) return;

            // no animation on stealthed players
            if (target is GamePlayer)
                if (target.IsStealthed)
                    return;

            SendEffectAnimation(target, 0, false, 1);

            // Create attack data.
            AttackData ad = CalculateDamageToTarget(target, effectiveness);
            DamageTarget(ad, false);

            // Interrupt only if target is actually casting
            if (target.IsCasting && Spell.Target.ToLower() != "cone")
                target.StartInterruptTimer(target.SpellInterruptDuration, ad.AttackType, Caster);
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:25,代码来源:TauntSpellHandler.cs

示例7: ApplyEffectOnTarget

        /// <summary>
        /// Apply effect on target or do spell action if non duration spell
        /// </summary>
        /// <param name="target">target that gets the effect</param>
        /// <param name="effectiveness">factor from 0..1 (0%-100%)</param>
        public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
        {
            if (target.Realm == 0 || Caster.Realm == 0)
            {
                target.LastAttackedByEnemyTickPvE = target.CurrentRegion.Time;
                Caster.LastAttackTickPvE = Caster.CurrentRegion.Time;
            }
            else
            {
                target.LastAttackedByEnemyTickPvP = target.CurrentRegion.Time;
                Caster.LastAttackTickPvP = Caster.CurrentRegion.Time;
            }
            if (target.HasAbility(Abilities.CCImmunity))
            {
                MessageToCaster(target.Name + " is immune to this effect!", eChatType.CT_SpellResisted);
                return;
            }
            if (target.TempProperties.getProperty("Charging", false))
            {
                MessageToCaster(target.Name + " is moving to fast for this spell to have any effect!", eChatType.CT_SpellResisted);
                return;
            }
            base.ApplyEffectOnTarget(target, effectiveness);

            if (Spell.CastTime > 0)
            {
                target.StartInterruptTimer(target.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster);
            }
            if(target is GameNPC)
            {
                GameNPC npc = (GameNPC)target;
                IOldAggressiveBrain aggroBrain = npc.Brain as IOldAggressiveBrain;
                if (aggroBrain != null)
                    aggroBrain.AddToAggroList(Caster, 1);
            }
        }
开发者ID:mynew4,项目名称:DAoC,代码行数:41,代码来源:HereticSpeedDecrease.cs

示例8: ApplyEffectOnTarget

        /// <summary>
        /// Apply effect on target or do spell action if non duration spell
        /// </summary>
        /// <param name="target">target that gets the effect</param>
        /// <param name="effectiveness">factor from 0..1 (0%-100%)</param>
        public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
        {
            //TODO: correct effectiveness formula
            // invoke direct effect if not resisted for DD w/ debuff spells
            if (Spell.Level > 0)
            {
                int specLevel = 0;
                if (Caster is GamePlayer)
                {
                    specLevel = ((GamePlayer)Caster).GetModifiedSpecLevel(m_spellLine.Spec);
                }
                effectiveness = 0.75 + (specLevel - 1) * 0.5 / Spell.Level;
                effectiveness = Math.Max(0.75, effectiveness);
                effectiveness = Math.Min(1.25, effectiveness);
            }

            base.ApplyEffectOnTarget(target, effectiveness);

            if (target.Realm == 0 || Caster.Realm == 0)
            {
                target.LastAttackedByEnemyTickPvE = target.CurrentRegion.Time;
                Caster.LastAttackTickPvE = Caster.CurrentRegion.Time;
            }
            else
            {
                target.LastAttackedByEnemyTickPvP = target.CurrentRegion.Time;
                Caster.LastAttackTickPvP = Caster.CurrentRegion.Time;
            }
            if (target is GameNPC)
            {
                IOldAggressiveBrain aggroBrain = ((GameNPC)target).Brain as IOldAggressiveBrain;
                if (aggroBrain != null)
                    aggroBrain.AddToAggroList(Caster, 1);
            }
            if (Spell.CastTime > 0) target.StartInterruptTimer(target.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster);
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:41,代码来源:ResistDebuff.cs

示例9: DealDamage

        private void DealDamage(GameLiving target, double effectiveness)
        {
            if (!target.IsAlive || target.ObjectState != GameLiving.eObjectState.Active) return;

            // calc damage
            AttackData ad = CalculateDamageToTarget(target, effectiveness);
            DamageTarget(ad, true);
            SendDamageMessages(ad);
            target.StartInterruptTimer(target.SpellInterruptDuration, ad.AttackType, Caster);
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:10,代码来源:BainsheePulseDmgSpellHandler.cs

示例10: ApplyEffectOnTarget

        public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
        {
            GameSpellEffect neweffect = CreateSpellEffect(target, effectiveness);
            if (target == null) return;
            if (!target.IsAlive || target.ObjectState != GameLiving.eObjectState.Active) return;
            neweffect.Start(target);

            // calc damage
            AttackData ad = CalculateDamageToTarget(target, effectiveness);
            DamageTarget(ad, true);
            SendDamageMessages(ad);
            target.StartInterruptTimer(target.SpellInterruptDuration, ad.AttackType, Caster);
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:13,代码来源:Stormlord.cs

示例11: ApplyEffectOnTarget

 public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
 {
     base.ApplyEffectOnTarget(target, effectiveness);
     target.StartInterruptTimer(target.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster);
 }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:5,代码来源:bracerofzo.cs

示例12: StartSpellResistInterruptTimer

 /// <summary>
 /// Start Spell Interrupt Timer when Spell is Resisted
 /// </summary>
 /// <param name="target"></param>
 public virtual void StartSpellResistInterruptTimer(GameLiving target)
 {
     // Spells that would have caused damage or are not instant will still
     // interrupt a casting player.
     if(!(Spell.SpellType.IndexOf("debuff", StringComparison.OrdinalIgnoreCase) >= 0 && Spell.CastTime == 0))
         target.StartInterruptTimer(target.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster);
 }
开发者ID:mynew4,项目名称:DOLSharp,代码行数:11,代码来源:SpellHandler.cs

示例13: ApplyEffectOnTarget

        public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
        {
            if (target.HasAbility(Abilities.MezzImmunity))
            {
                MessageToCaster(target.Name + " is immune to this effect!", eChatType.CT_SpellResisted);
                SendEffectAnimation(target, 0, false, 0);
                target.StartInterruptTimer(target.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster);
                return;
            }
            if (FindStaticEffectOnTarget(target, typeof(MezzRootImmunityEffect)) != null)
            {
                MessageToCaster("Your target is immune!", eChatType.CT_System);
                SendEffectAnimation(target, 0, false, 0);
                target.StartInterruptTimer(target.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster);
                return;
            }
            //Do nothing when already mez, but inform caster
            GameSpellEffect mezz = SpellHandler.FindEffectOnTarget(target, "Mesmerize");
            if (mezz != null)
            {
                MessageToCaster("Your target is already mezzed!", eChatType.CT_SpellResisted);
                SendEffectAnimation(target, 0, false, 0);
                return;
            }
            GameSpellEffect mezblock = SpellHandler.FindEffectOnTarget(target, "CeremonialBracerMezz");
            if (mezblock != null)
            {
                mezblock.Cancel(false);
                if (target is GamePlayer)
                    (target as GamePlayer).Out.SendMessage("Your item effect intercepts the mesmerization spell and fades!", eChatType.CT_SpellResisted, eChatLoc.CL_SystemWindow);
                //inform caster
                MessageToCaster("Ceremonial Bracer intercept your mez!", eChatType.CT_SpellResisted);
                SendEffectAnimation(target, 0, false, 0);
                target.StartInterruptTimer(target.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster);
                return;
            }

            base.ApplyEffectOnTarget(target, effectiveness);
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:39,代码来源:CCSpellHandler.cs

示例14: OnDirectEffect

        /// <summary>
        /// execute non duration spell effect on target
        /// </summary>
        /// <param name="target"></param>
        /// <param name="effectiveness"></param>
        public override void OnDirectEffect(GameLiving target, double effectiveness)
        {
            base.OnDirectEffect(target, effectiveness);
            if (target == null) return;
            if (!target.IsAlive || target.ObjectState != GameLiving.eObjectState.Active) return;

            target.StartInterruptTimer(target.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster);
            if (target is GameNPC)
            {
                GameNPC npc = (GameNPC)target;
                IOldAggressiveBrain aggroBrain = npc.Brain as IOldAggressiveBrain;
                if (aggroBrain != null)
                    aggroBrain.AddToAggroList(Caster, 1);
            }

            //check for spell.
            foreach (GameSpellEffect effect in target.EffectList.GetAllOfType<GameSpellEffect>())
            {
                foreach (Type buffType in buffs)
                {
                    if (effect.SpellHandler.GetType().Equals(buffType))
                    {
                        SendEffectAnimation(target, 0, false, 1);
                        effect.Cancel(false);
                        MessageToCaster("Your spell rips away some of your target's enhancing magic.", eChatType.CT_Spell);
                        MessageToLiving(target, "Some of your enhancing magic has been ripped away by a spell!", eChatType.CT_Spell);
                        return;
                    }
                }
            }

            SendEffectAnimation(target, 0, false, 0);
            MessageToCaster("No enhancement of that type found on the target.", eChatType.CT_SpellResisted);

            /*
            if (!noMessages)
            {
                MessageToLiving(effect.Owner, effect.Spell.Message3, eChatType.CT_SpellExpires);
                Message.SystemToArea(effect.Owner, Util.MakeSentence(effect.Spell.Message4, effect.Owner.GetName(0, false)), eChatType.CT_SpellExpires, effect.Owner);
            }
            */
        }
开发者ID:uvbs,项目名称:Dawn-of-Light-core,代码行数:47,代码来源:BuffShear.cs

示例15: OnSpellResisted

 /// <summary>
 /// When spell was resisted
 /// </summary>
 /// <param name="target">the target that resisted the spell</param>
 protected override void OnSpellResisted(GameLiving target)
 {
     base.OnSpellResisted(target);
     if (Spell.CastTime == 0)
     {
         // start interrupt even for resisted instant amnesia
         target.StartInterruptTimer(target.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster);
     }
 }
开发者ID:mynew4,项目名称:DAoC,代码行数:13,代码来源:AmnesiaSpellHandler.cs


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