Here you can find the source of AngleEvaluation(double angle, int effectIndex, int angleNeeded, int orbValue)
public static double AngleEvaluation(double angle, int effectIndex, int angleNeeded, int orbValue)
//package com.java2s; //License from project: Open Source License public class Main { private static double return_result = 0; public static double AngleEvaluation(double angle, int effectIndex, int angleNeeded, int orbValue) { // compared relation angle with angled needed double angleDiference = angle - angleNeeded; //System.out.println(angleDiference); // to make future relations positive numbers are needed if (angleDiference < 0) { angleDiference = angleDiference * -1; }/*w w w . j a va 2 s. co m*/ // angle separation most be +- orb permision to qualify for relation effect if (angleDiference <= orbValue) { // factor based on how precice the relation is (how close to the perfect value) double factor = ((orbValue - angleDiference) / orbValue); // effectIndex is the value for a perfect angle match (maximum value), by multiplying it to the factor we mark down this effect value proportionally to how perfect it was. return_result = effectIndex * factor; } else { // if angle diference is off the orb persmision, the effect is neglected and asign a value of 0 return_result = 0; } return return_result; } }