Back to project page L5RHelper.
The source code is released under:
Copyright (c) 2010 Robert Uhl Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Sof...
If you think the Android project L5RHelper listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.uhl.calc; //from w w w .j a v a 2 s . c o m import android.content.Context; public class Raises { public static int calculateRaises(Context ctx, int target, Roll roll) { return calculateRaises(ctx, target, roll, 95); } public static int calculateRaises(Context ctx, int target, Roll roll, int confidence) { Histogram h = new Histogram(roll, ctx); int highest = h.getHighestTN(confidence)+roll.getStatMod(); if(highest < target) return -1; return (highest - target) / 5; } public static double[] CalculateRange(Context ctx, Roll roll, int range, int tn) { Histogram h = new Histogram(roll, ctx); return h.getRangeRaises(range, tn-roll.getStatMod()); } }