示例#1
0
        private void OnBoolPropertyChange(Entity sender, BoolPropertyChangeEventArgs args)
        {
            try
            {
                if (args.OldValue == args.NewValue || (!args.OldValue && args.NewValue) || args.PropertyName != "m_bIsWaitingToSpawn")
                {
                    return;
                }

                if (this.spawnSleeper)
                {
                    return;
                }

                var unit = EntityManager9.GetUnit(sender.Handle);
                if (unit == null || !unit.IsLaneCreep || unit.Team != this.ownerTeam)
                {
                    return;
                }

                foreach (var creepWave in this.creepWaves.Where(x => !x.IsSpawned))
                {
                    creepWave.Spawn();
                }

                this.spawnSleeper.Sleep(25);
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }
示例#2
0
        private void Entity_OnBoolPropertyChange(Entity sender, BoolPropertyChangeEventArgs args)
        {
            if (args.PropertyName != "m_bInAbilityPhase")
            {
                return;
            }

            var ability = sender as Ability;

            if (ability == null)
            {
                return;
            }

            if (args.NewValue)
            {
                var detected = this.abilities.FirstOrDefault(e => e.Ability == ability);
                if (detected == null)
                {
                    return;
                }

                this.AbilityCastStarted?.Invoke(this, new AbilityEventArgs(detected));
                this.abilities.Remove(detected);
            }
            else
            {
                this.abilities.Add(new DetectedAbility(ability));
            }
        }
示例#3
0
        private void OnBoolPropertyChanged(Entity sender, BoolPropertyChangeEventArgs args)
        {
            if (args.OldValue.Equals(args.NewValue))
            {
                return;
            }

            var menu = mainMenu.OnChangeMenu.Bools;

            if (!menu.Enabled || menu.HeroesOnly && !(sender is Hero) ||
                menu.IgnoreUseless && Data.IgnoredBools.Contains(args.PropertyName))
            {
                return;
            }

            const Color       Color = Color.Cyan;
            const Logger.Type Type  = Logger.Type.Bool;

            logger.Write("Bool property changed", Type, Color, true);
            logger.Write("Sender name: " + sender.Name, Type, Color);
            logger.Write("Sender classID: " + sender.ClassId, Type, Color);
            if (sender.Owner != null)
            {
                logger.Write("Owner Name: " + sender.Owner.Name, Type, Color);
                logger.Write("Owner classID: " + sender.Owner.ClassId, Type, Color);
            }
            logger.Write("Property name: " + args.PropertyName, Type, Color);
            logger.Write("Property values: " + args.OldValue + " => " + args.NewValue, Type, Color);
            logger.EmptyLine();
        }
示例#4
0
文件: FailSafe.cs 项目: vana41203/O9K
        private void OnBoolPropertyChange(Entity sender, BoolPropertyChangeEventArgs args)
        {
            try
            {
                if (args.NewValue == args.OldValue || args.PropertyName != "m_bInAbilityPhase")
                {
                    return;
                }

                var ability = EntityManager9.GetAbility(sender.Handle) as ActiveAbility;
                if (ability?.IsControllable != true)
                {
                    return;
                }

                if (this.IsIgnored(ability))
                {
                    return;
                }

                if (!(ability is AreaOfEffectAbility) && !(ability is PredictionAbility))
                {
                    return;
                }

                if (args.NewValue)
                {
                    if (ability is AreaOfEffectAbility)
                    {
                        if (ability.CastRange > 0)
                        {
                            UpdateManager.BeginInvoke(
                                () => this.abilityPositions[ability.Handle] = ability.Owner.InFront(ability.CastRange),
                                10);
                        }
                        else
                        {
                            UpdateManager.BeginInvoke(() => this.abilityPositions[ability.Handle] = ability.Owner.Position, 10);
                        }
                    }

                    this.abilityTimings[ability]   = Game.RawGameTime + ability.CastPoint;
                    this.failSafeHandler.IsEnabled = true;
                }
                else
                {
                    this.abilityTimings.Remove(ability);
                    this.abilityPositions.Remove(ability.Handle);
                    if (this.abilityTimings.Count <= 0)
                    {
                        this.failSafeHandler.IsEnabled = false;
                    }
                }
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }
 // Token: 0x060009F7 RID: 2551 RVA: 0x0002B518 File Offset: 0x00029718
 private void OnBoolPropertyChange(Entity sender, BoolPropertyChangeEventArgs args)
 {
     try
     {
         if (args.NewValue != args.OldValue && !(args.PropertyName != "m_bInAbilityPhase"))
         {
             ActiveAbility ability  = EntityManager9.GetAbility(sender.Handle) as ActiveAbility;
             ActiveAbility ability2 = ability;
             if (ability2 != null && ability2.IsControllable)
             {
                 if (!this.IsIgnored(ability))
                 {
                     if (ability is AreaOfEffectAbility || ability is PredictionAbility)
                     {
                         if (args.NewValue)
                         {
                             if (ability is AreaOfEffectAbility)
                             {
                                 if (ability.CastRange > 0f)
                                 {
                                     UpdateManager.BeginInvoke(delegate
                                     {
                                         this.abilityPositions[ability.Handle] = ability.Owner.InFront(ability.CastRange, 0f, true);
                                     }, 10);
                                 }
                                 else
                                 {
                                     UpdateManager.BeginInvoke(delegate
                                     {
                                         this.abilityPositions[ability.Handle] = ability.Owner.Position;
                                     }, 10);
                                 }
                             }
                             this.abilityTimings[ability]   = Game.RawGameTime + ability.CastPoint;
                             this.failSafeHandler.IsEnabled = true;
                         }
                         else
                         {
                             this.abilityTimings.Remove(ability);
                             this.abilityPositions.Remove(ability.Handle);
                             if (this.abilityTimings.Count <= 0)
                             {
                                 this.failSafeHandler.IsEnabled = false;
                             }
                         }
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Logger.Error(ex, null);
     }
 }
示例#6
0
        private void OnBoolPropertyChange(Entity sender, BoolPropertyChangeEventArgs args)
        {
            var newValue = args.NewValue;

            if (newValue == args.OldValue)
            {
                return;
            }

            try
            {
                switch (args.PropertyName)
                {
                case "m_bToggleState":
                {
                    if (!newValue)
                    {
                        break;
                    }

                    var ability = EntityManager9.GetAbilityFast(sender.Handle);
                    if (ability == null)
                    {
                        return;
                    }

                    this.AbilityCasted?.Invoke(ability);
                    break;
                }
                    //case "m_bInAbilityPhase":
                    //{
                    //    var ability = EntityManager9.GetAbilityFast(sender.Handle);
                    //    if (ability == null)
                    //    {
                    //        return;
                    //    }

                    //    ability.IsCasting = newValue;
                    //    ability.Owner.IsCasting = newValue;

                    //    this.AbilityCastChange?.Invoke(ability);
                    //    break;
                    //}
                }
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }
示例#7
0
        private void OnBoolPropertyChange(Entity sender, BoolPropertyChangeEventArgs args)
        {
            if (args.OldValue == args.NewValue || !args.OldValue && args.NewValue || args.PropertyName != "m_bIsWaitingToSpawn")
            {
                return;
            }

            var creep = sender as Creep;

            if (creep == null || !creep.IsValid || creep.Team != myTeam || creep.UnitType != 1152)
            {
                return;
            }

            SpawnCreepWaves();
        }
示例#8
0
 private void OnLongRazeCast(Entity sender, BoolPropertyChangeEventArgs args)
 {
     if (args.NewValue == args.OldValue || sender != this.Nevermore.RazeLong ||
         args.PropertyName != "m_bInAbilityPhase")
     {
         return;
     }
     if (args.NewValue)
     {
         this.razeStartCastTime           = Game.RawGameTime;
         this.razeUpdateHandler.IsEnabled = true;
     }
     else
     {
         this.razeUpdateHandler.IsEnabled = false;
     }
 }
示例#9
0
        private void OnHookCast(Entity sender, BoolPropertyChangeEventArgs args)
        {
            if (args.NewValue == args.OldValue || sender != this.Pudge.Hook || args.PropertyName != "m_bInAbilityPhase")
            {
                return;
            }

            if (args.NewValue)
            {
                this.hookStartCastTime           = Game.RawGameTime;
                this.hookUpdateHandler.IsEnabled = true;
            }
            else
            {
                this.hookUpdateHandler.IsEnabled = false;
            }
        }
示例#10
0
        private static void OnBoolPropertyChange(Entity sender, BoolPropertyChangeEventArgs args)
        {
            if (args.NewValue == args.OldValue)
            {
                return;
            }

            try
            {
                switch (args.PropertyName)
                {
                case "m_bReincarnating":
                {
                    var unit = (Hero9)EntityManager9.GetUnitFast(sender.Handle);
                    if (unit == null)
                    {
                        return;
                    }

                    unit.IsReincarnating = args.NewValue;
                    break;
                }
                    //case "m_bIsWaitingToSpawn":
                    //{
                    //    if (args.NewValue)
                    //    {
                    //        return;
                    //    }

                    //    var unit = EntityManager9.GetUnitFast(sender.Handle);
                    //    if (unit == null)
                    //    {
                    //        return;
                    //    }

                    //    unit.IsSpawned = true;
                    //    break;
                    //}
                }
            }
            catch (Exception e)
            {
                Logger.Error(e);
            }
        }
示例#11
0
        private void OnSofCast(Entity sender, BoolPropertyChangeEventArgs args)
        {
            if (args.NewValue == args.OldValue || sender != this.Grimstroke.StrokeOfFate ||
                args.PropertyName != "m_bInAbilityPhase")
            {
                return;
            }

            if (args.NewValue)
            {
                this.sofStartCastTime           = Game.RawGameTime;
                this.sofUpdateHandler.IsEnabled = true;
            }
            else
            {
                this.sofUpdateHandler.IsEnabled = false;
            }
        }
示例#12
0
        private void OnBoolPropertyChange(Entity sender, BoolPropertyChangeEventArgs args)
        {
            if (args.OldValue == args.NewValue || !args.OldValue && args.NewValue ||
                args.PropertyName != "m_bIsWaitingToSpawn")
            {
                return;
            }

            var creep = sender as Creep;

            if (creep == null || !creep.IsValid || creep.Team != myTeam ||
                creep.ClassId != ClassId.CDOTA_BaseNPC_Creep_Lane)
            {
                return;
            }

            SpawnCreepWaves();
        }
示例#13
0
文件: Bools.cs 项目: XXXHake/Ensage-1
        private bool IsValid(Entity sender, BoolPropertyChangeEventArgs args)
        {
            if (args.OldValue.Equals(args.NewValue))
            {
                return(false);
            }

            if (this.ignoreUseless && this.ignored.Contains(args.PropertyName))
            {
                return(false);
            }

            if (this.heroesOnly && !(sender is Hero) && !(sender.Owner is Hero))
            {
                return(false);
            }

            return(true);
        }
示例#14
0
 private void Entity_OnBoolPropertyChange(Entity sender, BoolPropertyChangeEventArgs args)
 {
     if (!sender.Equals(myHero))
     {
         return;
     }
     if (args.PropertyName == "m_bIsMoving")
     {
         if (!args.NewValue)
         {
             //isPositionKnown = false;
             Debugging.WriteLine("Stopping and not known");
         }
         // get some position where we can evade to
         else if (!isPositionKnown)
         {
             movePosition = GetValidMovePosition();
         }
     }
 }
示例#15
0
        private void EntityOnBoolPropertyChange(Entity sender, BoolPropertyChangeEventArgs args)
        {
            if (!this.CanExecute)
            {
                return;
            }

            if (sender != this.poison || args.NewValue == args.OldValue || args.PropertyName != "m_bInAbilityPhase")
            {
                return;
            }

            if (args.NewValue)
            {
                this.poisonStartCastTime           = Game.RawGameTime;
                this.poisonUpdateHandler.IsEnabled = true;
            }
            else
            {
                this.poisonUpdateHandler.IsEnabled = false;
            }
        }
        /// <summary>
        ///     The entity_ on bool property change.
        /// </summary>
        /// <param name="sender">
        ///     The sender.
        /// </param>
        /// <param name="args">
        ///     The args.
        /// </param>
        public void Entity_OnBoolPropertyChange(Entity sender, BoolPropertyChangeEventArgs args)
        {
            // if (sender.Handle == this.Unit.UnitHandle && args.PropertyName == GlobalVariables.PropertyVisible)
            // {
            // if (args.NewValue == false)
            // {
            // return;
            // }

            // this.Unit.Position.Update();
            // }
            // else if (args.PropertyName == GlobalVariables.PropertyAbilityPhase)
            // {
            // var ability = sender as Ability;
            // var owner = ability?.Owner;
            // if (ability == null || owner?.Handle != this.Unit.UnitHandle)
            // {
            // return;
            // }

            // foreach (var keyValuePair in this.Unit.SkillBook.CastPointSpells)
            // {
            // if (!ability.Handle.Equals(keyValuePair.Value.SkillHandle))
            // {
            // continue;
            // }

            // if (args.NewValue && !args.OldValue)
            // {
            // keyValuePair.Value.AbilityPhase.Start();
            // }
            // else
            // {
            // keyValuePair.Value.AbilityPhase.Stop();
            // }
            // }
            // }
        }
示例#17
0
文件: Bools.cs 项目: XXXHake/Ensage-1
        private void OnBoolPropertyChange(Entity sender, BoolPropertyChangeEventArgs args)
        {
            if (!this.IsValid(sender, args))
            {
                return;
            }

            var item = new LogItem(LogType.Bool, Color.Cyan, "Bool changed");

            item.AddLine("Property name: " + args.PropertyName, args.PropertyName);
            item.AddLine("Property values: " + args.OldValue + " => " + args.NewValue, args.NewValue);
            item.AddLine("Sender name: " + sender.Name, sender.Name);
            item.AddLine("Sender network name: " + sender.NetworkName, sender.NetworkName);
            item.AddLine("Sender classID: " + sender.ClassId, sender.ClassId);
            if (sender.Owner is Unit)
            {
                item.AddLine("Owner name: " + sender.Owner.Name, sender.Owner.Name);
                item.AddLine("Owner network name: " + sender.Owner.NetworkName, sender.Owner.NetworkName);
                item.AddLine("Owner classID: " + sender.Owner.ClassId, sender.Owner.ClassId);
            }

            this.log.Display(item);
        }
示例#18
0
 // Token: 0x0600020B RID: 523 RVA: 0x0000FEAC File Offset: 0x0000E0AC
 private void OnBoolPropertyChange(Entity sender, BoolPropertyChangeEventArgs args)
 {
     try
     {
         if (args.OldValue != args.NewValue && (args.OldValue || !args.NewValue) && !(args.PropertyName != "m_bIsWaitingToSpawn"))
         {
             Unit9 unit = EntityManager9.GetUnit(sender.Handle);
             if (!(unit == null) && unit.IsLaneCreep && unit.Team == this.ownerTeam)
             {
                 foreach (CreepWave creepWave in from x in this.creepWaves
                          where !x.IsSpawned
                          select x)
                 {
                     creepWave.Spawn();
                 }
             }
         }
     }
     catch (Exception exception)
     {
         Logger.Error(exception, null);
     }
 }
        private void EntityOnBoolPropertyChange(Entity sender, BoolPropertyChangeEventArgs args)
        {
            if (!this.CanExecute)
            {
                return;
            }

            if (sender != this.hook || args.NewValue == args.OldValue || args.PropertyName != "m_bInAbilityPhase")
            {
                return;
            }

            if (args.NewValue)
            {
                // start HookHitCheck updater when we casted it
                this.hookStartCastTime           = Game.RawGameTime;
                this.hookUpdateHandler.IsEnabled = true;
            }
            else
            {
                this.hookUpdateHandler.IsEnabled = false;
            }
        }
 /// <summary>
 ///     The entity_ on bool property change.
 /// </summary>
 /// <param name="sender">
 ///     The sender.
 /// </param>
 /// <param name="args">
 ///     The args.
 /// </param>
 public void Entity_OnBoolPropertyChange(Entity sender, BoolPropertyChangeEventArgs args)
 {
 }
示例#21
0
        /// <summary>
        ///     The entity_ on boolean property change.
        /// </summary>
        /// <param name="sender">
        ///     The sender.
        /// </param>
        /// <param name="args">
        ///     The args.
        /// </param>
        private void Entity_OnBoolPropertyChange(Entity sender, BoolPropertyChangeEventArgs args)
        {
            if (args.NewValue == args.OldValue)
            {
                return;
            }

            if (sender is Creep)
            {
                return;
            }

            var propertyName = args.PropertyName;

            switch (propertyName)
            {
            default:

                // foreach (var keyValuePair in this.AbilityUnitManager.Value.Units)
                // {
                // keyValuePair.Value.DataReceiver.Entity_OnBoolPropertyChange(sender, args);
                // }
                return;

            case GlobalVariables.PropertyAbilityPhase:
                var ability = sender as Ability;
                var owner   = ability?.Owner;
                if (ability == null || owner == null)
                {
                    return;
                }

                GlobalVariables.Time = Game.RawGameTime;

                if (args.NewValue)
                {
                    this.AbilityUnitManager.Value.Units.FirstOrDefault(x => x.Key == owner.Handle)
                    .Value?.SkillBook.CastPointSpells.FirstOrDefault(x => x.Key == ability.Handle)
                    .Value?.AbilityPhase.Start();
                }
                else
                {
                    this.AbilityUnitManager.Value.Units.FirstOrDefault(x => x.Key == owner.Handle)
                    .Value?.SkillBook.CastPointSpells.FirstOrDefault(x => x.Key == ability.Handle)
                    .Value?.AbilityPhase.Stop();
                }

                return;

                // case GlobalVariables.PropertyVisible:
                // if (!args.NewValue)
                // {
                // return;
                // }

                // Console.WriteLine("visble: " + sender.Name);
                // var unit = this.AbilityUnitManager.Value.Units.FirstOrDefault(x => x.Key == sender.Handle);
                // unit.Value?.Position.Update();
                // if (unit.Value != null)
                // {
                // unit.Value.Visibility.Visible = args.NewValue;
                // }

                // return;
                // case "m_flStartSequenceCycle":
                // return;
            }
        }
示例#22
0
 private void OnBoolPropertyChange(Entity sender, BoolPropertyChangeEventArgs args)
 {
     Messenger <BoolPropertyChangeEventArgs> .Publish(args);
 }