public bool Inside(UInt16 aPosX, UInt16 aPosY) { if (MyMath.GetDistance(aPosX, aPosY, mAttackerX, mAttackerY) <= mDistance) { int degree = MyMath.GetDirection(mAttackerX, aPosX, mAttackerY, aPosY); if (mAddExtra) { degree += 360; } if (degree >= mLeftSide && degree <= mRightSide) { return(true); } } return(false); }
//Circle skill... public static AdvancedEntity[] GetTargetsForType05(AdvancedEntity Attacker, UInt16 X, UInt16 Y, UInt32 Range) { List <AdvancedEntity> targets = new List <AdvancedEntity>(); var entities = from entity in Attacker.Map.Entities.Values where entity is AdvancedEntity select(AdvancedEntity) entity; foreach (AdvancedEntity entity in entities) { if (targets.Count == MAX_TARGET_COUNT) { break; } if (entity.IsAlive() && MyMath.GetDistance(Attacker.X, Attacker.Y, entity.X, entity.Y) <= Range) { targets.Add(entity); } } return(targets.ToArray()); }