Advertisement
Guest User

Untitled

a guest
Apr 11th, 2018
901
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.94 KB | None | 0 0
  1. public class MyClass {
  2. public static void main(String args[]) {
  3.  
  4. boolean horse = true;
  5. boolean hellHorse = false;
  6. boolean unicorn = false;
  7. // Unicorns are exempt from SoulStrength checks on traits, not modeled here.
  8.  
  9. boolean isRidden = true;
  10. boolean isSecondRider = false;
  11. boolean isSaddled = false;
  12. boolean isShoed = false;
  13.  
  14. float saddleQL = 70.0F;
  15. byte saddleRarity = 0; //0 normal, 1 rare, 2 supreme, 3 fantastic
  16. float saddleWoA = 0.0F;
  17.  
  18. float horseShoe1QL = 70.0F;
  19. byte horseShoe1Rarity = 0;
  20. float horseShoe1WoA = 0.0F;
  21.  
  22. float horseShoe2QL = 70.0F;
  23. byte horseShoe2Rarity = 0;
  24. float horseShoe2WoA = 0.0F;
  25.  
  26. float horseShoe3QL = 70.0F;
  27. byte horseShoe3Rarity = 0;
  28. float horseShoe3WoA = 0.0F;
  29.  
  30. float horseShoe4QL = 70.0F;
  31. byte horseShoe4Rarity = 0;
  32. float horseShoe4WoA = 0.0F;
  33.  
  34.  
  35. boolean trait1 = false; //It has fleeter movement than normal
  36. boolean trait3 = false; //It has a strong body
  37. boolean trait4 = false; //It has lightning movement
  38. boolean trait5 = false; //It can carry more than average
  39. boolean trait6 = false; //It has very strong leg muscles
  40. boolean trait8 = false; //It has malformed hindlegs
  41. boolean trait9 = false; //The legs are of different length
  42. boolean trait11 = false; //It looks very unmotivated
  43. boolean trait23 = false; //Color is ebony black
  44.  
  45.  
  46. float mountCarriedWeight = 6500; // Assumes four 500 gram shoes and one 4500 saddle
  47. float riderOneFatLevel = 125; // 0 - 125, Only matters if under 30
  48. float riderOneCarriedWeight = 50000; // Weight in grams
  49. float riderTwoFatLevel = 0;
  50. float riderTwoCarriedWeight = 0;
  51.  
  52. int hungerPercent = 0;
  53. int damagePercent = 0;
  54.  
  55.  
  56.  
  57.  
  58.  
  59. //The below are calculated values, do not change
  60. float mountStrength = 0;
  61. float mountMaxSpeed = 0;
  62. boolean isHorse = false;
  63. boolean isUnicorn = false;
  64. float shoeBonus = 0;
  65. float saddleBonus = 0;
  66.  
  67. if (horse)
  68. {
  69. mountStrength = 25;
  70. mountMaxSpeed = 30;
  71. isHorse = true;
  72. isUnicorn = false;
  73. }
  74. if (hellHorse)
  75. {
  76. mountStrength = 35;
  77. mountMaxSpeed = 32;
  78. isHorse = true;
  79. isUnicorn = false;
  80. }
  81. if (unicorn)
  82. {
  83. mountStrength = 30;
  84. mountMaxSpeed = 33;
  85. isHorse = false;
  86. isUnicorn = true;
  87. }
  88.  
  89. int hunger = hungerPercent * 65535 / 100;
  90. int damage = damagePercent * 65535 / 100;
  91.  
  92. float factor = 0.5F;
  93. if (hunger < 45000) {
  94. factor += 0.2F;
  95. }
  96. if (hunger < 10000) {
  97. factor += 0.1F;
  98. }
  99. if (damage < 10000) {
  100. factor += 0.1F;
  101. } else if (damage > 20000) {
  102. factor -= 0.5F;
  103. } else if (damage > 45000) {
  104. factor -= 0.7F;
  105. }
  106. if ((isHorse) || (isUnicorn))
  107. {
  108. if (isShoed)
  109. {
  110. shoeBonus += Math.max(10.0F, horseShoe1QL) / 2000.0F;
  111. shoeBonus += horseShoe1WoA / 2000.0F;
  112. shoeBonus += horseShoe1Rarity * 0.03F;
  113.  
  114. shoeBonus += Math.max(10.0F, horseShoe2QL) / 2000.0F;
  115. shoeBonus += horseShoe2WoA / 2000.0F;
  116. shoeBonus += horseShoe2Rarity * 0.03F;
  117.  
  118. shoeBonus += Math.max(10.0F, horseShoe3QL) / 2000.0F;
  119. shoeBonus += horseShoe3WoA / 2000.0F;
  120. shoeBonus += horseShoe3Rarity * 0.03F;
  121.  
  122. shoeBonus += Math.max(10.0F, horseShoe4QL) / 2000.0F;
  123. shoeBonus += horseShoe4WoA / 2000.0F;
  124. shoeBonus += horseShoe4Rarity * 0.03F;
  125. factor += shoeBonus;
  126. }
  127. }
  128.  
  129. float postperc = 0;
  130. float negtperc = 0;
  131. float tperc = 0;
  132. float poswmod = 0;
  133. float negwmod = 0;
  134. float wmod = 0;
  135. float weightPenalty = 0;
  136.  
  137.  
  138. if (trait1) { postperc += 0.1; }
  139. if (trait3) { poswmod += 10000; }
  140. if (trait4) { postperc += 0.2; }
  141. if (trait5) { poswmod += 20000; }
  142. if (trait6) { postperc += 0.1; }
  143. if (trait6) { poswmod += 10000; }
  144. if (trait8) { negtperc -= 0.1; }
  145. if (trait9) { negtperc -= 0.3; }
  146. if (trait11) {negwmod -= 30000; }
  147. if (trait23) {postperc += 0.025; }
  148.  
  149.  
  150. if (isRidden)
  151. {
  152. if (isSaddled)
  153. {
  154. saddleBonus += Math.max(10.0F, saddleQL) / 1000.0F;
  155. saddleBonus += saddleRarity * 0.03F;
  156. saddleBonus += saddleWoA / 2000.0F;
  157. }
  158. factor += saddleBonus;
  159.  
  160. mountCarriedWeight += Math.max(30000, riderOneFatLevel * 1000);
  161. mountCarriedWeight += riderOneCarriedWeight;
  162.  
  163.  
  164. if (isUnicorn)
  165. {
  166. if (isSecondRider)
  167. {
  168. mountCarriedWeight += Math.max(30000, riderTwoFatLevel * 1000);
  169. mountCarriedWeight += riderTwoCarriedWeight;
  170. }
  171. }
  172. }
  173.  
  174. float allFactor = 0;
  175. float minFactor = 0;
  176. float maxFactor = 0;
  177.  
  178. float allWeightPenalty = 0;
  179. float minWeightPenalty = 0;
  180. float maxWeightPenalty = 0;
  181.  
  182.  
  183. //factor += tperc;
  184. allFactor = factor + negtperc + postperc;
  185. minFactor = factor + negtperc;
  186. maxFactor = factor + postperc;
  187.  
  188.  
  189.  
  190. if (mountCarriedWeight > (mountStrength * 5000 + poswmod + negwmod))
  191. {
  192. allWeightPenalty = (float)(0.15D * (mountCarriedWeight - mountStrength * 5000.0D - poswmod - negwmod) / 50000.0D);
  193. }
  194. allFactor -= allWeightPenalty;
  195.  
  196. if (mountCarriedWeight > (mountStrength * 5000 + negwmod))
  197. {
  198. minWeightPenalty = (float)(0.15D * (mountCarriedWeight - mountStrength * 5000.0D - negwmod) / 50000.0D);
  199. }
  200. minFactor -= minWeightPenalty;
  201.  
  202. if (mountCarriedWeight > (mountStrength * 5000 + poswmod))
  203. {
  204. maxWeightPenalty = (float)(0.15D * (mountCarriedWeight - mountStrength * 5000.0D - poswmod) / 50000.0D);
  205. }
  206. maxFactor -= maxWeightPenalty;
  207.  
  208. int allSpeed = (int)Math.max(0.0D, Math.min(127.0D, allFactor * mountMaxSpeed));
  209. int minSpeed = (int)Math.max(0.0D, Math.min(127.0D, minFactor * mountMaxSpeed));
  210. int maxSpeed = (int)Math.max(0.0D, Math.min(127.0D, maxFactor * mountMaxSpeed));
  211.  
  212. System.out.println("If the mount is classified as a horse, all traits (even negative ones) must pass");
  213. System.out.println("intermittent Soul Strength checks to stay active.");
  214. System.out.println("");
  215. System.out.println("");
  216. System.out.println("shoeBonus = " + shoeBonus);
  217. System.out.println("saddleBonus = " + saddleBonus);
  218. System.out.println("");
  219. System.out.println("All traits active weight penalty = " + allWeightPenalty);
  220. System.out.println("Worst traits active weight penalty = " + minWeightPenalty);
  221. System.out.println("Best traits active weight penalty = " + maxWeightPenalty);
  222. System.out.println("");
  223. System.out.println("All traits active speed = " + allSpeed);
  224. System.out.println("Worst traits active speed = " + minSpeed);
  225. System.out.println("Best traits active speed = " + maxSpeed);
  226. }
  227. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement