Beispiel #1
0
        public bool IsInExplosionZone(SummonedBomb bomb)
        {
            if (IsCarried() || bomb.IsCarried())
            {
                return(false);
            }

            var dist = Position.Point.ManhattanDistanceTo(bomb.Position.Point);

            return(dist <= ExplosionZone);
        }
Beispiel #2
0
        public bool IsBoundWith(SummonedBomb bomb)
        {
            var dist = Position.Point.ManhattanDistanceTo(bomb.Position.Point);

            return(dist > WallMinSize && dist <= (WallMaxSize + 1) &&  // check the distance
                   MonsterBombTemplate == bomb.MonsterBombTemplate &&  // bombs are from the same type
                   !IsCarried() && !bomb.IsCarried() &&                // bombs are not carried
                   Position.Point.IsOnSameLine(bomb.Position.Point) && // bombs are in alignment
                   Summoner.Bombs.All(x => x == this || x == bomb ||
                                      !x.Position.Point.IsBetween(Position.Point, bomb.Position.Point) ||
                                      (x.Position.Point.IsBetween(Position.Point, bomb.Position.Point) && MonsterBombTemplate != x.MonsterBombTemplate))); // there are no others bombs from the same type between them
        }