Ejemplo n.º 1
0
        private void Drawing_OnEndScene(EventArgs args)
        {
            foreach (var enemy in ObjectManager.Heroes.Enemies.Where(x => !x.IsDead || x.IsInRange(EnemySpawn, 250)))
            {
                if (!FogOfWarChamps.ContainsKey(enemy.NetworkId))
                {
                    continue;
                }

                var pos = FogOfWarChamps[enemy.NetworkId].LastSeenPosition.WorldToMinimap();


                //var invisibleTime = (Game.GameTimeTickCount - FogOfWarChamps[enemy.NetworkId].LastSeenTime) / 1000f;

                if (Menu.GetCheckbox("Draw movement circle"))
                {
                    var radius = FogOfWarChamps[enemy.NetworkId].LastSeenRange;

                    if (radius < DisableRange)
                    {
                        Drawing.DrawCircle(pos - new Vector2(radius / 2), (int)radius);
                    }
                }

                // Draw the minimap icon
                //ChampionSprites[enemy.Hero].Draw(pos + MinimapIconOffset);

                /*
                 *  // Draw the time being invisible
                 *  if (DrawInvisibleTime.CurrentValue && invisibleTime >= DelayInvisibleTime.CurrentValue)
                 *  {
                 *      var text = Math.Floor(invisibleTime).ToString(CultureInfo.InvariantCulture);
                 *      var bounding = TimerText.MeasureBounding(text);
                 *      TimerText.Draw(text, TimerText.Color, pos - (new Vector2(bounding.Width, bounding.Height) / 2) + 1);
                 *  }
                 */
                /*
                 * // Draw recall circle
                 * if (DrawRecallCircle.CurrentValue && RecallingHeroes.ContainsKey(enemy.NetworkId))
                 * {
                 *  var startTime = RecallingHeroes[enemy.NetworkId].Item1;
                 *  var duration = RecallingHeroes[enemy.NetworkId].Item2;
                 *
                 *  Utilities.DrawArc(pos, (MinimapIconSize + 4) / 2f, Color.Aqua, 3.1415f, Utilities.PI2 * ((Core.GameTickCount - startTime) / (float)duration), 2f, 100);
                 * }
                 */
            }
        }
Ejemplo n.º 2
0
        private void Game_OnTick()
        {
            var elapsedTime = Game.GameTimeTickCount - LastUpdate;

            LastUpdate = Game.GameTimeTickCount;

            foreach (var enemy in ObjectManager.Heroes.Enemies)
            {
                // Died
                if (enemy.IsDead)
                {
                    if (!DeadChamps.Contains(enemy.NetworkId))
                    {
                        Utils.DebugLog(enemy.ChampionName + " died " + enemy.NetworkId);
                        DeadChamps.Add(enemy.NetworkId);
                        FogOfWarChamps.Remove(enemy.NetworkId);
                    }
                    continue;
                }

                // Visible
                if (enemy.IsVisible)
                {
                    if (FogOfWarChamps.ContainsKey(enemy.NetworkId))
                    {
                        Utils.DebugLog(enemy.ChampionName + " reappeared " + enemy.NetworkId);
                        FogOfWarChamps.Remove(enemy.NetworkId);
                    }
                    continue;
                }

                // Respawned
                if (DeadChamps.Contains(enemy.NetworkId))
                {
                    Utils.DebugLog(enemy.ChampionName + " respawned " + enemy.NetworkId);
                    DeadChamps.Remove(enemy.NetworkId);

                    FogOfWarChamps[enemy.NetworkId] = new LastSeenInfo
                    {
                        LastSeenTime     = Game.GameTimeTickCount,
                        LastSeenPosition = EnemySpawn,
                        LastSeenRange    = 0
                    };
                }

                // Disappeared
                if (!FogOfWarChamps.ContainsKey(enemy.NetworkId))
                {
                    Utils.DebugLog(enemy.ChampionName + " disappeared " + enemy.NetworkId);
                    FogOfWarChamps[enemy.NetworkId] = new LastSeenInfo
                    {
                        LastSeenPosition = enemy.ServerPosition,
                        LastSeenTime     = Game.GameTimeTickCount,
                        LastSeenRange    = 0
                    };
                }


                if (elapsedTime > 0 && FogOfWarChamps.ContainsKey(enemy.NetworkId) /* && !RecallingHeroes.ContainsKey(enemy.NetworkId)*/)
                {
                    FogOfWarChamps[enemy.NetworkId].LastSeenRange += (enemy.MovementSpeed >= 1 ? enemy.MovementSpeed : 540) * elapsedTime / 1000f;
                }

                Utils.DebugLog($"RangeUpdate for {enemy.ChampionName}: {FogOfWarChamps[enemy.NetworkId].LastSeenRange}\t @{enemy.MovementSpeed}");
            }
        }