Пример #1
0
 /// <summary>
 /// Call this before <see cref="FindWithinArea"/> <para/>
 /// </summary>
 /// <param name="maxDistance">
 /// <see cref="TargetFindAOEType.Circle"/> - radius of circle <para/>
 /// <see cref="TargetFindAOEType.Cone"/> - height of cone <para/>
 /// <see cref="TargetFindAOEType.Box"/> - width of box / 2 (todo: set box length not just between user and target)
 /// </param>
 /// <param name="param"> param in degrees of cone (todo: probably use radians and forget converting at runtime) </param>
 public void SetAOEType(ValidTarget validTarget, TargetFindAOEType aoeType, TargetFindAOETarget aoeTarget, float maxDistance, float minDistance, float height, float aoeRotate, float coneAngle, float param = 0.0f)
 {
     this.validTarget    = validTarget;
     this.aoeType        = aoeType;
     this.maxDistance    = maxDistance;
     this.minDistance    = minDistance;
     this.param          = param;
     this.height         = height;
     this.aoeRotateAngle = aoeRotate;
     this.coneAngle      = coneAngle;
 }
Пример #2
0
        /// <summary>
        /// Call this to prepare Box AOE
        /// </summary>
        /// <param name="validTarget"></param>
        /// <param name="aoeTarget"></param>
        /// <param name="length"></param>
        /// <param name="width"></param>
        public void SetAOEBox(ValidTarget validTarget, TargetFindAOETarget aoeTarget, float length, float width, float aoeRotateAngle)
        {
            this.validTarget    = validTarget;
            this.aoeType        = TargetFindAOEType.Box;
            this.aoeTarget      = aoeTarget;
            this.aoeRotateAngle = aoeRotateAngle;
            float x = owner.positionX - (float)Math.Cos(owner.rotation + (float)(Math.PI / 2)) * (length);
            float z = owner.positionZ + (float)Math.Sin(owner.rotation + (float)(Math.PI / 2)) * (length);

            this.maxDistance = length;
            this.width       = width;
        }
Пример #3
0
 public void Reset()
 {
     this.findType          = TargetFindCharacterType.None;
     this.validTarget       = ValidTarget.Enemy;
     this.aoeType           = TargetFindAOEType.None;
     this.aoeTarget         = TargetFindAOETarget.Target;
     this.aoeTargetPosition = null;
     this.aoeTargetRotation = 0;
     this.maxDistance       = 0.0f;
     this.minDistance       = 0.0f;
     this.width             = 0.0f;
     this.height            = 0.0f;
     this.aoeRotateAngle    = 0.0f;
     this.coneAngle         = 0.0f;
     this.param             = 0.0f;
     this.targets           = new List <Character>();
 }