Пример #1
0
        public static float FlankPointValue(Vector3 point, IAIAgent agent)
        {
            if (Object.op_Equality((Object)agent.AttackTarget, (Object)null))
            {
                return(0.0f);
            }
            float num = 0.0f;

            return(!NavPointSampler.PointDirectnessToTarget(point, agent.Entity.ServerPosition, agent.AttackTarget.ServerPosition, out num) || (double)num < -0.100000001490116 || (double)num > 0.100000001490116 ? 0.0f : 1f);
        }
Пример #2
0
        public static float ApproachPointValue(Vector3 point, IAIAgent agent)
        {
            if (Object.op_Equality((Object)agent.AttackTarget, (Object)null))
            {
                return(0.0f);
            }
            float num = 0.0f;

            if (!NavPointSampler.PointDirectnessToTarget(point, agent.Entity.ServerPosition, agent.AttackTarget.ServerPosition, out num) || (double)num < 0.5)
            {
                return(0.0f);
            }
            return(num);
        }
Пример #3
0
        public static float RetreatPointValueExplosive(Vector3 point, IAIAgent agent)
        {
            BaseContext context = agent.GetContext(Guid.Empty) as BaseContext;

            if (context == null || context.DeployedExplosives.Count == 0 || (Object.op_Equality((Object)context.DeployedExplosives[0], (Object)null) || context.DeployedExplosives[0].IsDestroyed))
            {
                return(0.0f);
            }
            float num = 0.0f;

            if (!NavPointSampler.PointDirectnessToTarget(point, agent.Entity.ServerPosition, context.DeployedExplosives[0].ServerPosition, out num) || (double)num > -0.5)
            {
                return(0.0f);
            }
            return(num * -1f);
        }
        public static float FlankPointValue(Vector3 point, IAIAgent agent)
        {
            if (agent.AttackTarget == null)
            {
                return(0f);
            }
            float single = 0f;

            if (!NavPointSampler.PointDirectnessToTarget(point, agent.Entity.ServerPosition, agent.AttackTarget.ServerPosition, out single))
            {
                return(0f);
            }
            if (single >= -0.1f && single <= 0.1f)
            {
                return(1f);
            }
            return(0f);
        }
        public static float RetreatPointValueExplosive(Vector3 point, IAIAgent agent)
        {
            BaseContext context = agent.GetContext(Guid.Empty) as BaseContext;

            if (context == null || context.DeployedExplosives.Count == 0 || context.DeployedExplosives[0] == null || context.DeployedExplosives[0].IsDestroyed)
            {
                return(0f);
            }
            float single = 0f;

            if (!NavPointSampler.PointDirectnessToTarget(point, agent.Entity.ServerPosition, context.DeployedExplosives[0].ServerPosition, out single))
            {
                return(0f);
            }
            if (single > -0.5f)
            {
                return(0f);
            }
            return(single * -1f);
        }