Esempio n. 1
0
        /// <summary>
        ///     Checks if healthrelic or traps are created and add them to the list.
        /// </summary>
        public static void GameObject_OnCreate(GameObject sender, EventArgs args)
        {
            var @base = sender as Obj_AI_Base;

            if (@base != null && @base.BaseSkinName.Equals("OlafAxe") || sender.Name.Contains("Olaf_Base_Q_Axe_Ally"))
            {
                OlafAxeObject = new Objects.OlafAxe(sender);
            }

            if (sender.Name.Contains("Draven_Base_Q_reticle_self"))
            {
                if (!DravenAxes.Any(a => a.Axe.IdEquals(sender)))
                {
                    DravenAxes.Add(new Objects.DravenAxe(sender));
                }
            }

            if (sender.GetType() == typeof(Obj_GeneralParticleEmitter))
            {
                var gameObject = (Obj_GeneralParticleEmitter)sender;
                if (ZacPassiveNames.Contains(gameObject.Name) && !ZacPassives.Contains(gameObject) && Player.Instance.Hero == Champion.Zac)
                {
                    ZacPassives.Add(gameObject);
                    Logger.Send("Create " + gameObject.Name);
                }
            }

            var caster = sender as Obj_AI_Base;

            if (caster != null)
            {
                if (TrapsNames.Contains(sender.Name) && sender.IsEnemy)
                {
                    var trap = new traps {
                        Trap = caster, IsSpecial = false
                    };
                    EnemyTraps.Add(trap);
                    Logger.Send("Create " + sender.Name);
                } /*
                   * if (SpecialTrapsNames.Contains(caster.Name) && caster.IsEnemy)
                   * {
                   * var trap = new traps { Trap = caster, IsSpecial = true };
                   * EnemyTraps.Add(trap);
                   * Logger.Send("Create " + sender.Name);
                   * }*/
            }
            if (sender.Name.ToLower().Contains("healthrelic"))
            {
                HealthRelics.Add(sender);
                Logger.Send("Create " + sender.Name);
            }
        }
Esempio n. 2
0
        /// <summary>
        ///     Checks if healthrelic or traps are deleted and remove them from the list.
        /// </summary>
        public static void GameObject_OnDelete(GameObject sender, EventArgs args)
        {
            var @base = sender as Obj_AI_Base;

            if (@base != null && @base.BaseSkinName.Equals("OlafAxe") || sender.Name.Contains("Olaf_Base_Q_Axe_Ally"))
            {
                OlafAxeObject = null;
            }

            if (sender.Name.Contains("Draven_Base_Q_reticle_self"))
            {
                if (DravenAxes.Any(a => a.Axe.IdEquals(sender)))
                {
                    DravenAxes.RemoveAll(a => a.Axe.IdEquals(sender));
                }
            }

            if (sender.GetType() == typeof(Obj_GeneralParticleEmitter))
            {
                var gameObject = (Obj_GeneralParticleEmitter)sender;
                if (ZacPassiveNames.Contains(gameObject.Name) && ZacPassives.Contains(gameObject))
                {
                    ZacPassives.Remove(gameObject);
                    Logger.Send("Delete " + gameObject.Name);
                }
            }

            var caster = sender as Obj_AI_Base;

            if (caster != null)
            {
                var trap = new traps {
                    Trap = caster, IsSpecial = false
                };
                //var Specialtrap = new traps { Trap = caster, IsSpecial = true };
                if (EnemyTraps.Contains(trap) && trap.Trap.IsEnemy)
                {
                    EnemyTraps.Remove(trap);
                    Logger.Send("Delete " + sender.Name);
                } /*
                   * if (EnemyTraps.Contains(Specialtrap) && caster.IsEnemy)
                   * {
                   * EnemyTraps.Remove(Specialtrap);
                   * Logger.Send("Delete " + sender.Name);
                   * }*/
            }
            if (sender.Name.ToLower().Contains("healthrelic"))
            {
                HealthRelics.Remove(sender);
                Logger.Send("Delete " + sender.Name);
            }
        }