コード例 #1
0
        public void OnFinishCasting(IObjAiBase owner, ISpell spell, IAttackableUnit target)
        {
            _target = (IObjAiBase)target;
            _owner  = (IChampion)owner;

            if (!_target.HasBuff("YasuoEBlock"))
            {
                AddBuff("YasuoE", 0.395f - spell.Level * 0.012f, 1, spell, _owner, _owner);
                AddBuff("YasuoEBlock", 11f - spell.Level * 1f, 1, spell, _target, _owner);
            }
        }
コード例 #2
0
ファイル: E.cs プロジェクト: egedmz/LolUrfSandbox
        public void OnFinishCasting(IObjAiBase owner, ISpell spell, IAttackableUnit target)
        {
            _target = (IObjAiBase)target;
            _owner  = (IChampion)owner;

            if (!_target.HasBuff("YasuoEBlock"))
            {
                var damage = 50f + spell.Level * 20f + _owner.Stats.AbilityPower.Total * 0.6f;
                target.TakeDamage(_owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);
                AddBuff("YasuoE", 0.4f, 1, spell, _owner, _owner);
                AddBuff("YasuoEBlock", 11f - spell.Level * 1f, 1, spell, _target, _owner);
            }
        }
コード例 #3
0
        public void OnFinishCasting(IObjAiBase owner, ISpell spell, IAttackableUnit target)
        {
            var p1      = AddParticleTarget(owner, "TaricHammerSmash_nova.troy", owner);
            var p2      = AddParticleTarget(owner, "TaricHammerSmash_shatter.troy", owner);
            var hasbuff = owner.HasBuff("Radiance");
            var ap      = owner.Stats.AbilityPower.Total * 0.5f;
            var damage  = 50 + spell.Level * 100 + ap;

            foreach (var enemyTarget in GetUnitsInRange(owner, 375, true)
                     .Where(x => x.Team == CustomConvert.GetEnemyTeam(owner.Team)))
            {
                if (enemyTarget is IAttackableUnit)
                {
                    enemyTarget.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL, false);
                    var ep1 = AddParticleTarget(owner, "Taric_GemStorm_Tar.troy", enemyTarget, 1.25f);
                    var ep2 = AddParticleTarget(owner, "Taric_GemStorm_Aura.troy", enemyTarget, 1.25f);
                    var ep3 = AddParticleTarget(owner, "Taric_ShoulderFlare.troy", enemyTarget, 1.25f);
                    CreateTimer(1f, () =>
                    {
                        RemoveParticle(ep1);
                        RemoveParticle(ep2);
                        RemoveParticle(ep3);
                    });
                }
            }

            foreach (var allyTarget in GetUnitsInRange(owner, 1100, true)
                     .Where(x => x.Team != CustomConvert.GetEnemyTeam(owner.Team)))
            {
                if (allyTarget is IObjAiBase && owner != allyTarget && hasbuff == false)
                {
                    AddBuff("Radiance_ally", 10.0f, 1, spell, (IObjAiBase)allyTarget, owner);
                }
            }
            if (owner == target && hasbuff == false)
            {
                var p3 = AddParticleTarget(owner, "taricgemstorm.troy", owner);
                AddBuff("Radiance", 10.0f, 1, spell, owner, owner);
                CreateTimer(10.0f, () =>
                {
                    RemoveParticle(p3);
                });
            }

            CreateTimer(10.0f, () =>
            {
                RemoveParticle(p1);
                RemoveParticle(p2);
            }
                        );
        }
コード例 #4
0
        public Buff(Game game, string buffName, float duration, int stacks, ISpell originspell, IObjAiBase onto, IObjAiBase from, bool infiniteDuration = false)
        {
            if (duration < 0)
            {
                throw new ArgumentException("Error: Duration was set to under 0.");
            }

            _infiniteDuration = infiniteDuration;
            _game             = game;
            _remove           = false;
            _scriptEngine     = game.ScriptEngine;

            _buffGameScript = _scriptEngine.CreateObject <IBuffGameScript>(buffName, buffName);

            BuffAddType = _buffGameScript.BuffAddType;
            if (BuffAddType == (BuffAddType.STACKS_AND_OVERLAPS | BuffAddType.STACKS_AND_RENEWS) && _buffGameScript.MaxStacks < 2)
            {
                throw new ArgumentException("Error: Tried to create Stackable Buff, but MaxStacks was less than 2.");
            }

            BuffType = _buffGameScript.BuffType;
            Duration = duration;
            IsHidden = _buffGameScript.IsHidden;
            if (_buffGameScript.MaxStacks > 254 && !(BuffType == BuffType.COUNTER))
            {
                MaxStacks = 254;
            }
            else
            {
                MaxStacks = _buffGameScript.MaxStacks;
            }
            Name        = buffName;
            OriginSpell = originspell;
            if (onto.HasBuff(Name) && BuffAddType == BuffAddType.STACKS_AND_OVERLAPS)
            {
                // Put parent buff data into children buffs
                StackCount = onto.GetBuffWithName(Name).StackCount;
                Slot       = onto.GetBuffWithName(Name).Slot;
            }
            else
            {
                StackCount = stacks;
                Slot       = onto.GetNewBuffSlot(this);
            }
            SourceUnit  = from;
            TimeElapsed = 0;
            TargetUnit  = onto;
        }
コード例 #5
0
        public void OnFinishCasting(IObjAiBase owner, ISpell spell, IAttackableUnit target)
        {
            var hasbuff = owner.HasBuff("GangplankE");

            if (hasbuff == false)
            {
                AddBuff("GangplankE", 7.0f, 1, spell, owner, owner);
            }

            foreach (var allyTarget in GetUnitsInRange(owner, 1000, true)
                     .Where(x => x.Team != CustomConvert.GetEnemyTeam(owner.Team)))
            {
                if (allyTarget is IAttackableUnit && owner != allyTarget && hasbuff == false)
                {
                    AddBuff("GangplankE", 7.0f, 1, spell, (IObjAiBase)allyTarget, owner);
                }
            }
        }
コード例 #6
0
 public static bool HasBuff(IObjAiBase unit, string b)
 {
     return(unit.HasBuff(b));
 }