Beispiel #1
0
        public static PositionInfo SetAllUndodgeable()
        {
            ConsoleDebug.WriteLineColor("Setting all Undodgeable", ConsoleColor.Red);
            List <int> dodgeableSpells   = new List <int>();
            List <int> undodgeableSpells = new List <int>();

            var posDangerLevel = 0;
            var posDangerCount = 0;

            foreach (KeyValuePair <int, Spell> entry in SpellDetector.Spells)
            {
                Spell spell = entry.Value;
                undodgeableSpells.Add(entry.Key);

                var spellDangerLevel = spell.Dangerlevel;

                posDangerLevel  = Math.Max(posDangerLevel, (int)spellDangerLevel);
                posDangerCount += (int)spellDangerLevel;
            }

            return(new PositionInfo(
                       MyHero.Position.To2D(),
                       posDangerLevel,
                       posDangerCount,
                       true,
                       0,
                       dodgeableSpells,
                       undodgeableSpells));
        }
Beispiel #2
0
        public static PositionInfo SetAllDodgeable(Vector2 position)
        {
            List <int> dodgeableSpells   = new List <int>();
            List <int> undodgeableSpells = new List <int>();

            foreach (KeyValuePair <int, Spell> entry in SpellDetector.Spells)
            {
                Spell spell = entry.Value;
                dodgeableSpells.Add(entry.Key);
            }

            return(new PositionInfo(
                       position,
                       0,
                       0,
                       true,
                       0,
                       dodgeableSpells,
                       undodgeableSpells));
        }
Beispiel #3
0
        private void CheckHeroInDanger()
        {
            bool playerInDanger = false;

            foreach (KeyValuePair <int, Spell> entry in SpellDetector.Spells)
            {
                Spell spell = entry.Value;

                if (LastPosInfo != null) //&& lastPosInfo.dodgeableSpells.Contains(spell.spellID))
                {
                    if (GameData.MyHero.ServerPosition.To2D().InSkillShot(spell, GameData.HeroInfo.BoundingRadius))
                    {
                        playerInDanger = true;
                        break;
                    }

                    if (ConfigValue.EnableEvadeDistance.GetBool() && EvadeUtils.TickCount < LastPosInfo.EndTime)
                    {
                        playerInDanger = true;
                        break;
                    }
                }
            }

            if (IsDodging && !playerInDanger)
            {
                LastDodgingEndTime = EvadeUtils.TickCount;
            }

            if (IsDodging == false && !Situation.ShouldDodge())
            {
                return;
            }

            IsDodging = playerInDanger;
        }