MH Timers+

Description Pending

当前为 2019-08-08 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name MH Timers+
  3. // @author Warden Slayer - Warden Slayer#2302
  4. // @namespace https://greasyfork.org/en/users/227259-wardenslayer
  5. // @version 1.1.2
  6. // @description Description Pending
  7. // @include https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
  8. // @include http://www.mousehuntgame.com/*
  9. // @include https://www.mousehuntgame.com/*
  10. // @grant GM_setClipboard
  11. // ==/UserScript==
  12. $(document).ready(function() {
  13. console.log("MH Timers+");
  14. buildTimerBox();
  15. startTimers();
  16. });
  17.  
  18. function buildTimerBox() {
  19. if ($(".timerBox").length > 0) return;
  20. var container = $("#mousehuntContainer");
  21. var timerBox = document.createElement("div");
  22. timerBox.classList.add("timerBox");
  23. $(timerBox).css({
  24. 'background-image': 'url("https://image.freepik.com/free-vector/cool-blue-parchment_53876-86280.jpg")',
  25. 'background-size': 'cover'
  26. });
  27. $(timerBox).css({
  28. 'height': 115 + "px",
  29. 'padding': 2 + "px"
  30. });
  31. let forbiddenGrove = buildForbiddenGrove();
  32. let balacksCove = buildBalacksCove();
  33. let seasonalGarden = buildSeasonalGarden();
  34. let toxicSpill = buildToxicSpill();
  35. timerBox.appendChild(forbiddenGrove)
  36. timerBox.appendChild(balacksCove)
  37. timerBox.appendChild(seasonalGarden)
  38. timerBox.appendChild(toxicSpill)
  39. $(forbiddenGrove).css({
  40. 'float': 'left'
  41. })
  42. $(balacksCove).css({
  43. 'float': 'left',
  44. 'marginLeft': 1 + "px"
  45. })
  46. $(seasonalGarden).css({
  47. 'float': 'left',
  48. 'marginLeft': 1 + "px"
  49. })
  50. $(toxicSpill).css({
  51. 'float': 'left',
  52. 'marginLeft': 1 + "px"
  53. })
  54. //LAST
  55. container.prepend(timerBox)
  56. }
  57.  
  58. function startTimers() {
  59. localStorage.setItem("mainTimer", 0);
  60. runTimers();
  61. }
  62.  
  63. function runTimers() {
  64. updateText();
  65. var myTimer = setInterval(updateText, 5000);
  66. }
  67.  
  68. function updateText() {
  69. if ($(".forbiddenGrove").length > 0) updateForbiddenGroveTimer();
  70. if ($(".balacksCove").length > 0) updateBalacksCoveTimer();
  71. if ($(".seasonalGarden").length > 0) updateSeasonalGardenTimer();
  72. if ($(".toxicSpill").length > 0) updateToxicSpillTimer();
  73. }
  74. //===================================== Forbidden Grove ======================================
  75. function buildForbiddenGrove() {
  76. if ($(".forbiddenGrove").length > 0) return;
  77. var timerBox = $(".timerBox");
  78. var forbiddenGrove = document.createElement("div");
  79. forbiddenGrove.classList.add("forbiddenGrove");
  80. $(forbiddenGrove).css({
  81. 'border': '1px solid black',
  82. 'width': '21%',
  83. 'height': '90%',
  84. 'padding': 2 + "px"
  85. });
  86. //Header
  87. var forbiddenGroveHeader = document.createElement("div");
  88. forbiddenGroveHeader.classList.add("forbiddenGroveHeader");
  89. var forbiddenGroveHeaderLabel = document.createElement("div");
  90. forbiddenGroveHeaderLabel.classList.add("forbiddenGroveHeaderLabel");
  91. var forbiddenGroveHeaderLabelText = document.createTextNode("Forbidden Grove is:");
  92. forbiddenGroveHeaderLabel.appendChild(forbiddenGroveHeaderLabelText);
  93. var forbiddenGroveHeaderValue = document.createElement("div");
  94. forbiddenGroveHeaderValue.classList.add("forbiddenGroveHeaderValue");
  95. var forbiddenGroveHeaderValueText = document.createTextNode("Open");
  96. forbiddenGroveHeaderValue.appendChild(forbiddenGroveHeaderValueText);
  97. $(forbiddenGroveHeaderLabel).css({
  98. 'float': 'left',
  99. 'font-weight': 700,
  100. "marginRight": "5px"
  101. })
  102. $(forbiddenGroveHeaderValue).css({
  103. "marginLeft": "100px"
  104. });
  105. forbiddenGroveHeader.appendChild(forbiddenGroveHeaderLabel);
  106. forbiddenGroveHeader.appendChild(forbiddenGroveHeaderValue);
  107. //Close
  108. var forbiddenGroveCloses = document.createElement("div");
  109. forbiddenGroveCloses.classList.add("forbiddenGroveCloses");
  110. var forbiddenGroveClosesLabel = document.createElement("div");
  111. forbiddenGroveClosesLabel.classList.add("forbiddenGroveClosesLabel");
  112. var forbiddenGroveClosesLabelText = document.createTextNode("Closes in:");
  113. forbiddenGroveClosesLabel.appendChild(forbiddenGroveClosesLabelText);
  114. var forbiddenGroveClosesValue = document.createElement("div");
  115. forbiddenGroveClosesValue.classList.add("forbiddenGroveClosesValue");
  116. var forbiddenGroveClosesValueText = document.createTextNode("?");
  117. forbiddenGroveClosesValue.appendChild(forbiddenGroveClosesValueText);
  118. $(forbiddenGroveClosesLabel).css({
  119. 'float': 'left',
  120. 'font-weight': 700,
  121. "marginRight": "5px"
  122. })
  123. $(forbiddenGroveClosesValue).css("marginLeft", "50px");
  124. forbiddenGroveCloses.appendChild(forbiddenGroveClosesLabel);
  125. forbiddenGroveCloses.appendChild(forbiddenGroveClosesValue);
  126. //Open
  127. var forbiddenGroveOpens = document.createElement("div");
  128. forbiddenGroveOpens.classList.add("forbiddenGroveOpens");
  129. var forbiddenGroveOpensLabel = document.createElement("div");
  130. forbiddenGroveOpensLabel.classList.add("forbiddenGroveOpensLabel");
  131. var forbiddenGroveOpensLabelText = document.createTextNode("Opens in:");
  132. forbiddenGroveOpensLabel.appendChild(forbiddenGroveOpensLabelText);
  133. var forbiddenGroveOpensValue = document.createElement("div");
  134. forbiddenGroveOpensValue.classList.add("forbiddenGroveOpensValue");
  135. var forbiddenGroveOpensValueText = document.createTextNode("??");
  136. forbiddenGroveOpensValue.appendChild(forbiddenGroveOpensValueText);
  137. $(forbiddenGroveOpensLabel).css({
  138. 'float': 'left',
  139. 'font-weight': 700,
  140. "marginRight": "5px"
  141. })
  142. $(forbiddenGroveOpensValue).css("marginLeft", "50px");
  143. forbiddenGroveOpens.appendChild(forbiddenGroveOpensLabel);
  144. forbiddenGroveOpens.appendChild(forbiddenGroveOpensValue);
  145.  
  146. //FG Travel Button
  147. var forbiddenGroveControlPanel = document.createElement("div");
  148. forbiddenGroveControlPanel.classList.add("forbiddenGroveControlPanel");
  149. var forbiddenGroveButton = document.createElement("button");
  150. forbiddenGroveButton.id = "forbiddenGroveButton";
  151. forbiddenGroveButton.innerText = "Travel";
  152. forbiddenGroveButton.addEventListener("click", travelTo);
  153. forbiddenGroveControlPanel.appendChild(forbiddenGroveButton);
  154.  
  155. //Append
  156. forbiddenGrove.appendChild(forbiddenGroveHeader);
  157. forbiddenGrove.appendChild(forbiddenGroveCloses);
  158. forbiddenGrove.appendChild(forbiddenGroveOpens);
  159. forbiddenGrove.appendChild(forbiddenGroveControlPanel);
  160. return forbiddenGrove;
  161. }
  162.  
  163. function updateForbiddenGroveTimer() {
  164. if ($(".forbiddenGrove").length < 1) return;
  165. var forbiddenGrove = $(".forbiddenGrove");
  166. var firstGroveOpen = 1285704000;
  167. var now = todayNow();
  168. let timePassedHours = (now - firstGroveOpen) / 3600;
  169. var rotaionLenght = 20;
  170. var rotationsExact = timePassedHours / rotaionLenght;
  171. var rotationsInteger = Math.trunc(rotationsExact);
  172. var partialrotation = (rotationsExact - rotationsInteger) * rotaionLenght;
  173. if (partialrotation < 16) {
  174. //Open
  175. $(".forbiddenGroveHeaderValue").text(" OPEN");
  176. var timeCloses = (16 - partialrotation).toPrecision(4);
  177. var closesHours = Math.trunc(timeCloses);
  178. var closesMinutes = Math.ceil((timeCloses - closesHours) * 60);
  179. $(".forbiddenGroveClosesValue").text(closesHours + "h " + closesMinutes + "m");
  180. $(".forbiddenGroveOpensLabel").text("Opens Again in:");
  181. $(".forbiddenGroveOpensValue").text((closesHours + 4) + "h " + closesMinutes + "m");
  182. forbiddenGrove.append($(".forbiddenGroveOpens"))
  183. forbiddenGrove.append($(".forbiddenGroveControlPanel"));
  184. } else {
  185. //Closed
  186. $(".forbiddenGroveHeaderValue").text("CLOSED")
  187. var timeOpens = (rotaionLenght - partialrotation).toPrecision(4);
  188. var opensHours = Math.trunc(timeOpens);
  189. var opensMinutes = Math.ceil((timeOpens - opensHours) * 60);
  190. $(".forbiddenGroveOpensValue").text(opensHours + "h " + opensMinutes + "m");
  191. $(".forbiddenGroveClosesLabel").text("Next Close in:");
  192. $(".forbiddenGroveClosesValue").text((opensHours + 16) + "h " + opensMinutes + "m");
  193. forbiddenGrove.append($(".forbiddenGroveCloses"))
  194. forbiddenGrove.append($(".forbiddenGroveControlPanel"));
  195. }
  196. }
  197. //====================================== Balacks's Cove ======================================
  198. function buildBalacksCove() {
  199. if ($(".balacksCove").length > 0) return;
  200. var timerBox = $(".timerBox");
  201. var balacksCove = document.createElement("div");
  202. balacksCove.classList.add("balacksCove");
  203. $(balacksCove).css({
  204. 'border': '1px solid black',
  205. 'width': '25%',
  206. 'height': '90%',
  207. 'padding': 2 + "px"
  208. });
  209. //Header
  210. var balacksCoveHeader = document.createElement("div");
  211. balacksCoveHeader.classList.add("balacksCoveHeader");
  212. var balacksCoveHeaderLabel = document.createElement("div");
  213. balacksCoveHeaderLabel.classList.add("balacksCoveHeaderLabel");
  214. var balacksCoveHeaderLabelText = document.createTextNode("Balack's Cove Tide is:");
  215. balacksCoveHeaderLabel.appendChild(balacksCoveHeaderLabelText);
  216. var balacksCoveHeaderValue = document.createElement("div");
  217. balacksCoveHeaderValue.classList.add("balacksCoveHeaderValue");
  218. var balacksCoveHeaderValueText = document.createTextNode("Low");
  219. balacksCoveHeaderValue.appendChild(balacksCoveHeaderValueText);
  220. $(balacksCoveHeaderLabel).css({
  221. 'float': 'left',
  222. 'font-weight': 700,
  223. "marginRight": "5px"
  224. })
  225. $(balacksCoveHeaderValue).css({
  226. "marginLeft": "100px"
  227. });
  228. balacksCoveHeader.appendChild(balacksCoveHeaderLabel);
  229. balacksCoveHeader.appendChild(balacksCoveHeaderValue);
  230. //Low
  231. var balacksCoveLow = document.createElement("div");
  232. balacksCoveLow.classList.add("balacksCoveLow");
  233. var balacksCoveLowLabel = document.createElement("div");
  234. balacksCoveLowLabel.classList.add("balacksCoveLowLabel");
  235. var balacksCoveLowLabelText = document.createTextNode("Low Tide in:");
  236. balacksCoveLowLabel.appendChild(balacksCoveLowLabelText);
  237. var balacksCoveLowValue = document.createElement("div");
  238. balacksCoveLowValue.classList.add("balacksCoveLowValue");
  239. var balacksCoveLowValueText = document.createTextNode("?");
  240. balacksCoveLowValue.appendChild(balacksCoveLowValueText);
  241. $(balacksCoveLowLabel).css({
  242. 'float': 'left',
  243. 'font-weight': 700,
  244. "marginRight": "5px"
  245. })
  246. $(balacksCoveLowValue).css("marginLeft", "50px");
  247. balacksCoveLow.appendChild(balacksCoveLowLabel);
  248. balacksCoveLow.appendChild(balacksCoveLowValue);
  249. //Medium
  250. var balacksCoveMid = document.createElement("div");
  251. balacksCoveMid.classList.add("balacksCoveMid");
  252. var balacksCoveMidLabel = document.createElement("div");
  253. balacksCoveMidLabel.classList.add("balacksCoveMidLabel");
  254. var balacksCoveMidLabelText = document.createTextNode("Mid Tide in:");
  255. balacksCoveMidLabel.appendChild(balacksCoveMidLabelText);
  256. var balacksCoveMidValue = document.createElement("div");
  257. balacksCoveMidValue.classList.add("balacksCoveMidValue");
  258. var balacksCoveMidValueText = document.createTextNode("??");
  259. balacksCoveMidValue.appendChild(balacksCoveMidValueText);
  260. $(balacksCoveMidLabel).css({
  261. 'float': 'left',
  262. 'font-weight': 700,
  263. "marginRight": "5px"
  264. })
  265. $(balacksCoveMidValue).css("marginLeft", "50px");
  266. balacksCoveMid.appendChild(balacksCoveMidLabel);
  267. balacksCoveMid.appendChild(balacksCoveMidValue);
  268. //High
  269. var balacksCoveHigh = document.createElement("div");
  270. balacksCoveHigh.classList.add("balacksCoveHigh");
  271. var balacksCoveHighLabel = document.createElement("div");
  272. balacksCoveHighLabel.classList.add("balacksCoveHighLabel");
  273. var balacksCoveHighLabelText = document.createTextNode("High Tide in:");
  274. balacksCoveHighLabel.appendChild(balacksCoveHighLabelText);
  275. var balacksCoveHighValue = document.createElement("div");
  276. balacksCoveHighValue.classList.add("balacksCoveHighValue");
  277. var balacksCoveHighValueText = document.createTextNode("??");
  278. balacksCoveHighValue.appendChild(balacksCoveHighValueText);
  279. $(balacksCoveHighLabel).css({
  280. 'float': 'left',
  281. 'font-weight': 700,
  282. "marginRight": "5px"
  283. })
  284. $(balacksCoveHighValue).css("marginLeft", "50px");
  285. balacksCoveHigh.appendChild(balacksCoveHighLabel);
  286. balacksCoveHigh.appendChild(balacksCoveHighValue);
  287. //Append
  288. balacksCove.appendChild(balacksCoveHeader);
  289. balacksCove.appendChild(balacksCoveLow);
  290. balacksCove.appendChild(balacksCoveMid);
  291. balacksCove.appendChild(balacksCoveHigh);
  292. return balacksCove;
  293. }
  294.  
  295. function updateBalacksCoveTimer() {
  296. if ($(".balacksCove").length < 1) return;
  297. var balacksCove = $(".balacksCove");
  298. var firstCoveLow = 1294680060;
  299. var now = todayNow();
  300. let timePassedHours = (now - firstCoveLow) / 3600;
  301. var rotaionLenght = 18.6666666666666666666666666666666666666667;
  302. var rotationsExact = timePassedHours / rotaionLenght;
  303. var rotationsInteger = Math.trunc(rotationsExact);
  304. var partialrotation = (rotationsExact - rotationsInteger) * rotaionLenght;
  305. //partialrotation = 17.8;
  306. if (partialrotation < 16) {
  307. //Low
  308. $(".balacksCoveHeaderValue").text("LOW");
  309. var timeMid = (16 - partialrotation).toPrecision(4);
  310. var midHours = Math.trunc(timeMid);
  311. var midMinutes = Math.ceil((timeMid - midHours) * 60);
  312. $(".balacksCoveMidValue").text(midHours + "h " + midMinutes + "m");
  313. $(".balacksCoveMidLabel").text("Mid-Filling in:")
  314. $(".balacksCoveHighValue").text((midHours + 1) + "h " + midMinutes + "m");
  315. $(".balacksCoveLowLabel").text("Low Again in:");
  316. var lowHours = midHours + 2;
  317. var lowMinutes = midMinutes + 40;
  318. if (lowMinutes >= 60) {
  319. lowMinutes = lowMinutes - 60;
  320. lowHours++;
  321. }
  322. $(".balacksCoveLowValue").text((lowHours) + "h " + (lowMinutes) + "m");
  323. balacksCove.append($(".balacksCoveLow"))
  324. } else if ((partialrotation >= 16) && (partialrotation < 17)) {
  325. //Mid (flooding)
  326. $(".balacksCoveHeaderValue").text("MID-Flooding");
  327. var timeHigh = (17 - partialrotation).toPrecision(4);
  328. var highHours = Math.trunc(timeHigh);
  329. var highMinutes = Math.ceil((timeHigh - highHours) * 60);
  330. $(".balacksCoveHighValue").text((highHours) + "h " + highMinutes + "m");
  331. $(".balacksCoveMidLabel").text("Mid-Ebbing in:")
  332. var midHours = highHours;
  333. var midMinutes = highMinutes + 40;
  334. if (midMinutes >= 60) {
  335. midMinutes = midMinutes - 60;
  336. midHours++;
  337. }
  338. $(".balacksCoveMidValue").text(midHours + "h " + midMinutes + "m");
  339. $(".balacksCoveLowLabel").text("Low Tide in:");
  340. $(".balacksCoveLowValue").text((midHours + 1) + "h " + (midMinutes) + "m");
  341. balacksCove.append($(".balacksCoveMid"))
  342. balacksCove.append($(".balacksCoveLow"))
  343.  
  344. } else if ((partialrotation >= 17) && (partialrotation < 17.6666666667)) {
  345. //High
  346. $(".balacksCoveHeaderValue").text("HIGH");
  347. var timeMid = (17.6666666667 - partialrotation).toPrecision(4);
  348. var midHours = Math.trunc(timeMid);
  349. var midMinutes = Math.ceil((timeMid - midHours) * 60);
  350. $(".balacksCoveMidValue").text((midHours) + "h " + midMinutes + "m");
  351. $(".balacksCoveMidLabel").text("Mid-Ebbing in:")
  352. $(".balacksCoveLowLabel").text("Low Tide in:")
  353. $(".balacksCoveLowValue").text((midHours + 1) + "h " + midMinutes + "m");
  354. $(".balacksCoveHigh").hide();
  355. balacksCove.append($(".balacksCoveLow"))
  356. } else if (partialrotation >= 17.6666666667) {
  357. //Mid (ebbing)
  358. $(".balacksCoveHeaderValue").text("MID-Ebbing");
  359. var timeLow = (rotaionLenght - partialrotation).toPrecision(4);
  360. var lowHours = Math.trunc(timeLow);
  361. var lowMinutes = Math.ceil((timeLow - lowHours) * 60);
  362. $(".balacksCoveLowLabel").text("Low Tide in:")
  363. $(".balacksCoveLowValue").text((lowHours) + "h " + lowMinutes + "m");
  364. $(".balacksCoveMidLabel").text("Mid-Filling in:")
  365. $(".balacksCoveMidValue").text(lowHours + 16 + "h " + lowMinutes + "m");
  366. $(".balacksCoveHighLabel").text("High Tide in:");
  367. $(".balacksCoveHighValue").text(lowHours + 17 + "h " + (lowMinutes) + "m");
  368. balacksCove.append($(".balacksCoveHigh").show())
  369. }
  370. }
  371. //====================================== Seasonal Garden ======================================
  372. function buildSeasonalGarden() {
  373. if ($(".seasonalGarden").length > 0) return;
  374. var timerBox = $(".timerBox");
  375. var seasonalGarden = document.createElement("div");
  376. seasonalGarden.classList.add("seasonalGarden");
  377. $(seasonalGarden).css({
  378. 'border': '1px solid black',
  379. 'width': '24%',
  380. 'height': '90%',
  381. 'padding': 2 + "px"
  382. });
  383. //Header
  384. var seasonalGardenHeader = document.createElement("div");
  385. seasonalGardenHeader.classList.add("seasonalGardenHeader");
  386. var seasonalGardenHeaderLabel = document.createElement("div");
  387. seasonalGardenHeaderLabel.classList.add("seasonalGardenHeaderLabel");
  388. var seasonalGardenHeaderLabelText = document.createTextNode("Current Garden Season:");
  389. seasonalGardenHeaderLabel.appendChild(seasonalGardenHeaderLabelText);
  390. var seasonalGardenHeaderValue = document.createElement("div");
  391. seasonalGardenHeaderValue.classList.add("seasonalGardenHeaderValue");
  392. var seasonalGardenHeaderValueText = document.createTextNode("FALL");
  393. seasonalGardenHeaderValue.appendChild(seasonalGardenHeaderValueText);
  394. $(seasonalGardenHeaderLabel).css({
  395. 'float': 'left',
  396. 'font-weight': 700,
  397. "marginRight": "5px"
  398. })
  399. $(seasonalGardenHeaderValue).css({
  400. "marginLeft": "100px"
  401. });
  402. seasonalGardenHeader.appendChild(seasonalGardenHeaderLabel);
  403. seasonalGardenHeader.appendChild(seasonalGardenHeaderValue);
  404. //Fall
  405. var seasonalGardenFall = document.createElement("div");
  406. seasonalGardenFall.classList.add("seasonalGardenFall");
  407. var seasonalGardenFallLabel = document.createElement("div");
  408. seasonalGardenFallLabel.classList.add("seasonalGardenFallLabel");
  409. var seasonalGardenFallLabelText = document.createTextNode("Fall in:");
  410. seasonalGardenFallLabel.appendChild(seasonalGardenFallLabelText);
  411. var seasonalGardenFallValue = document.createElement("div");
  412. seasonalGardenFallValue.classList.add("seasonalGardenFallValue");
  413. var seasonalGardenFallValueText = document.createTextNode("?");
  414. seasonalGardenFallValue.appendChild(seasonalGardenFallValueText);
  415. $(seasonalGardenFallLabel).css({
  416. 'float': 'left',
  417. 'font-weight': 700,
  418. "marginRight": "5px"
  419. })
  420. $(seasonalGardenFallValue).css("marginLeft", "50px");
  421. seasonalGardenFall.appendChild(seasonalGardenFallLabel);
  422. seasonalGardenFall.appendChild(seasonalGardenFallValue);
  423. //Winter
  424. var seasonalGardenWinter = document.createElement("div");
  425. seasonalGardenWinter.classList.add("seasonalGardenWinter");
  426. var seasonalGardenWinterLabel = document.createElement("div");
  427. seasonalGardenWinterLabel.classList.add("seasonalGardenWinterLabel");
  428. var seasonalGardenWinterLabelText = document.createTextNode("Winter in:");
  429. seasonalGardenWinterLabel.appendChild(seasonalGardenWinterLabelText);
  430. var seasonalGardenWinterValue = document.createElement("div");
  431. seasonalGardenWinterValue.classList.add("seasonalGardenWinterValue");
  432. var seasonalGardenWinterValueText = document.createTextNode("?");
  433. seasonalGardenWinterValue.appendChild(seasonalGardenWinterValueText);
  434. $(seasonalGardenWinterLabel).css({
  435. 'float': 'left',
  436. 'font-weight': 700,
  437. "marginRight": "5px"
  438. })
  439. $(seasonalGardenWinterValue).css("marginLeft", "50px");
  440. seasonalGardenWinter.appendChild(seasonalGardenWinterLabel);
  441. seasonalGardenWinter.appendChild(seasonalGardenWinterValue);
  442. //Spring
  443. var seasonalGardenSpring = document.createElement("div");
  444. seasonalGardenSpring.classList.add("seasonalGardenSpring");
  445. var seasonalGardenSpringLabel = document.createElement("div");
  446. seasonalGardenSpringLabel.classList.add("seasonalGardenSpringLabel");
  447. var seasonalGardenSpringLabelText = document.createTextNode("Spring in:");
  448. seasonalGardenSpringLabel.appendChild(seasonalGardenSpringLabelText);
  449. var seasonalGardenSpringValue = document.createElement("div");
  450. seasonalGardenSpringValue.classList.add("seasonalGardenSpringValue");
  451. var seasonalGardenSpringValueText = document.createTextNode("?");
  452. seasonalGardenSpringValue.appendChild(seasonalGardenSpringValueText);
  453. $(seasonalGardenSpringLabel).css({
  454. 'float': 'left',
  455. 'font-weight': 700,
  456. "marginRight": "5px"
  457. })
  458. $(seasonalGardenSpringValue).css("marginLeft", "50px");
  459. seasonalGardenSpring.appendChild(seasonalGardenSpringLabel);
  460. seasonalGardenSpring.appendChild(seasonalGardenSpringValue);
  461. //Summer
  462. var seasonalGardenSummer = document.createElement("div");
  463. seasonalGardenSummer.classList.add("seasonalGardenSummer");
  464. var seasonalGardenSummerLabel = document.createElement("div");
  465. seasonalGardenSummerLabel.classList.add("seasonalGardenSummerLabel");
  466. var seasonalGardenSummerLabelText = document.createTextNode("Summer in:");
  467. seasonalGardenSummerLabel.appendChild(seasonalGardenSummerLabelText);
  468. var seasonalGardenSummerValue = document.createElement("div");
  469. seasonalGardenSummerValue.classList.add("seasonalGardenSummerValue");
  470. var seasonalGardenSummerValueText = document.createTextNode("?");
  471. seasonalGardenSummerValue.appendChild(seasonalGardenSummerValueText);
  472. $(seasonalGardenSummerLabel).css({
  473. 'float': 'left',
  474. 'font-weight': 700,
  475. "marginRight": "5px"
  476. })
  477. $(seasonalGardenSummerValue).css("marginLeft", "50px");
  478. seasonalGardenSummer.appendChild(seasonalGardenSummerLabel);
  479. seasonalGardenSummer.appendChild(seasonalGardenSummerValue);
  480. //Append
  481. seasonalGarden.appendChild(seasonalGardenHeader);
  482. seasonalGarden.appendChild(seasonalGardenFall);
  483. seasonalGarden.appendChild(seasonalGardenWinter);
  484. seasonalGarden.appendChild(seasonalGardenSpring);
  485. seasonalGarden.appendChild(seasonalGardenSummer);
  486. return seasonalGarden;
  487. }
  488.  
  489. function updateSeasonalGardenTimer() {
  490. if ($(".seasonalGarden").length < 1) return;
  491. var seasonalGarden = $(".seasonalGarden");
  492. var firstFall = 288000;
  493. var now = todayNow();
  494. let timePassedHours = (now - firstFall) / 3600;
  495. var rotaionLenght = 320;
  496. var rotationsExact = timePassedHours / rotaionLenght;
  497. var rotationsInteger = Math.trunc(rotationsExact);
  498. var partialrotation = (rotationsExact - rotationsInteger) * rotaionLenght;
  499. var fallObj = new season(0, 0, 0);
  500. var winterObj = new season(0, 0, 0);
  501. var springObj = new season(0, 0, 0);
  502. var summerObj = new season(0, 0, 0);
  503. if (partialrotation < 80) {
  504. //Summer
  505. $(".seasonalGardenHeaderValue").text("SUMMER");
  506. var timeFall = (80 - partialrotation).toPrecision(4);
  507. fallObj.hours = Math.floor(timeFall);
  508. fallObj.minutes = Math.ceil((timeFall - fallObj.hours) * 60);
  509. fallObj = convertToDyHrMn(0, fallObj.hours, fallObj.minutes);
  510. winterObj = convertToDyHrMn(fallObj.days + 3, fallObj.hours + 8, fallObj.minutes);
  511. springObj = convertToDyHrMn(winterObj.days + 3, winterObj.hours + 8, winterObj.minutes)
  512. summerObj = convertToDyHrMn(springObj.days + 3, springObj.hours + 8, springObj.minutes);
  513. $(".seasonalGardenFallLabel").text("Next Summer in:")
  514. $(".seasonalGardenWinterLabel").text("Winter in:")
  515. $(".seasonalGardenSpringLabel").text("Spring in:")
  516. $(".seasonalGardenSummerLabel").text("Summer in:")
  517. seasonalGarden.append($(".seasonalGardenFall"));
  518. seasonalGarden.append($(".seasonalGardenWinter"));
  519. seasonalGarden.append($(".seasonalGardenSpring"));
  520. seasonalGarden.append($(".seasonalGardenSummer"));
  521. } else if ((partialrotation >= 80) && (partialrotation < 160)) {
  522. //Fall
  523. $(".seasonalGardenHeaderValue").text("FALL");
  524. var timeWinter = (160 - partialrotation).toPrecision(4);
  525. winterObj.hours = Math.floor(timeWinter);
  526. winterObj.minutes = Math.ceil((timeWinter - winterObj.hours) * 60);
  527. winterObj = convertToDyHrMn(0, winterObj.hours, winterObj.minutes);
  528. springObj = convertToDyHrMn(winterObj.days + 3, winterObj.hours + 8, winterObj.minutes)
  529. summerObj = convertToDyHrMn(springObj.days + 3, springObj.hours + 8, springObj.minutes)
  530. fallObj = convertToDyHrMn(summerObj.days + 3, summerObj.hours + 8, summerObj.minutes);
  531. $(".seasonalGardenFallLabel").text("Next Fall in:")
  532. $(".seasonalGardenWinterLabel").text("Winter in:")
  533. $(".seasonalGardenSpringLabel").text("Spring in:")
  534. $(".seasonalGardenSummerLabel").text("Summer in:")
  535. seasonalGarden.append($(".seasonalGardenWinter"));
  536. seasonalGarden.append($(".seasonalGardenSpring"));
  537. seasonalGarden.append($(".seasonalGardenSummer"));
  538. seasonalGarden.append($(".seasonalGardenFall"));
  539. } else if ((partialrotation >= 160) && (partialrotation < 240)) {
  540. //Winter
  541. $(".seasonalGardenHeaderValue").text("WINTER");
  542. var timeSpring = (240 - partialrotation).toPrecision(4);
  543. springObj.hours = Math.floor(timeSpring);
  544. springObj.minutes = Math.ceil((timeSpring - springObj.hours) * 60);
  545. springObj = convertToDyHrMn(0, springObj.hours, springObj.minutes)
  546. summerObj = convertToDyHrMn(springObj.days + 3, springObj.hours + 8, springObj.minutes);
  547. fallObj = convertToDyHrMn(summerObj.days + 3, summerObj.hours + 8, summerObj.minutes);
  548. winterObj = convertToDyHrMn(fallObj.days + 3, fallObj.hours + 8, fallObj.minutes);
  549. $(".seasonalGardenFallLabel").text("Fall in:")
  550. $(".seasonalGardenWinterLabel").text("Next Winter in:")
  551. $(".seasonalGardenSpringLabel").text("Spring in:")
  552. $(".seasonalGardenSummerLabel").text("Summer in:")
  553. seasonalGarden.append($(".seasonalGardenSpring"));
  554. seasonalGarden.append($(".seasonalGardenSummer"));
  555. seasonalGarden.append($(".seasonalGardenFall"));
  556. seasonalGarden.append($(".seasonalGardenWinter"));
  557. } else {
  558. //Spring
  559. $(".seasonalGardenHeaderValue").text("SPRING");
  560. var timeSummer = (320 - partialrotation).toPrecision(4);
  561. summerObj.hours = Math.floor(timeSummer);
  562. summerObj.minutes = Math.ceil((timeSummer - summerObj.hours) * 60);
  563. summerObj = convertToDyHrMn(0, summerObj.hours, summerObj.minutes)
  564. fallObj = convertToDyHrMn(summerObj.days + 3, summerObj.hours + 8, summerObj.minutes);
  565. winterObj = convertToDyHrMn(fallObj.days + 3, fallObj.hours + 8, fallObj.minutes);
  566. springObj = convertToDyHrMn(winterObj.days + 3, winterObj.hours + 8, winterObj.minutes);
  567. $(".seasonalGardenFallLabel").text("Fall in:")
  568. $(".seasonalGardenWinterLabel").text("Winter in:")
  569. $(".seasonalGardenSpringLabel").text("Next Spring in:")
  570. $(".seasonalGardenSummerLabel").text("Summer in:")
  571. seasonalGarden.append($(".seasonalGardenSummer"));
  572. seasonalGarden.append($(".seasonalGardenFall"));
  573. seasonalGarden.append($(".seasonalGardenWinter"));
  574. seasonalGarden.append($(".seasonalGardenSpring"));
  575. }
  576. $(".seasonalGardenFallValue").text(fallObj.days + "d " + fallObj.hours + "h " + fallObj.minutes + "m");
  577. $(".seasonalGardenWinterValue").text(winterObj.days + "d " + winterObj.hours + "h " + winterObj.minutes + "m");
  578. $(".seasonalGardenSpringValue").text(springObj.days + "d " + springObj.hours + "h " + springObj.minutes + "m");
  579. $(".seasonalGardenSummerValue").text(summerObj.days + "d " + summerObj.hours + "h " + summerObj.minutes + "m");
  580. }
  581.  
  582. function season(days, hours, minutes) {
  583. this.days = days;
  584. this.hours = hours;
  585. this.minutes = minutes;
  586. }
  587. //====================================== Toxic Spill ======================================
  588. function buildToxicSpill() {
  589. if ($(".toxicSpill").length > 0) return;
  590. var timerBox = $(".timerBox");
  591. var toxicSpill = document.createElement("div");
  592. toxicSpill.classList.add("toxicSpill");
  593. $(toxicSpill).css({
  594. 'border': '1px solid black',
  595. 'width': '26%',
  596. 'height': '90%',
  597. 'padding': 2 + "px"
  598. });
  599. //Header
  600. var toxicSpillHeader = document.createElement("div");
  601. toxicSpillHeader.classList.add("toxicSpillHeader");
  602. var toxicSpillHeaderLabel = document.createElement("div");
  603. toxicSpillHeaderLabel.classList.add("toxicSpillHeaderLabel");
  604. var toxicSpillHeaderLabelText = document.createTextNode("Current Spill Level:");
  605. toxicSpillHeaderLabel.appendChild(toxicSpillHeaderLabelText);
  606. var toxicSpillHeaderValue = document.createElement("div");
  607. toxicSpillHeaderValue.classList.add("toxicSpillHeaderValue");
  608. var toxicSpillHeaderValueText = document.createTextNode("Archduke");
  609. toxicSpillHeaderValue.appendChild(toxicSpillHeaderValueText);
  610. $(toxicSpillHeaderLabel).css({
  611. 'float': 'left',
  612. 'font-weight': 700,
  613. "marginRight": "5px"
  614. })
  615. $(toxicSpillHeaderValue).css({
  616. "marginLeft": "100px"
  617. });
  618. toxicSpillHeader.appendChild(toxicSpillHeaderLabel);
  619. toxicSpillHeader.appendChild(toxicSpillHeaderValue);
  620. //Hero
  621. var toxicSpillHero = document.createElement("div");
  622. toxicSpillHero.classList.add("toxicSpillHero");
  623. var toxicSpillHeroLabel = document.createElement("div");
  624. toxicSpillHeroLabel.classList.add("toxicSpillHeroLabel");
  625. var toxicSpillHeroLabelText = document.createTextNode("Hero in:");
  626. toxicSpillHeroLabel.appendChild(toxicSpillHeroLabelText);
  627. var toxicSpillHeroValue = document.createElement("div");
  628. toxicSpillHeroValue.classList.add("toxicSpillHeroValue");
  629. var toxicSpillHeroValueText = document.createTextNode("?");
  630. toxicSpillHeroValue.appendChild(toxicSpillHeroValueText);
  631. $(toxicSpillHeroLabel).css({
  632. 'float': 'left',
  633. 'font-weight': 700,
  634. "marginRight": "5px"
  635. })
  636. $(toxicSpillHeroValue).css("marginLeft", "50px");
  637. toxicSpillHero.appendChild(toxicSpillHeroLabel);
  638. toxicSpillHero.appendChild(toxicSpillHeroValue);
  639. //Knight
  640. var toxicSpillKnight = document.createElement("div");
  641. toxicSpillKnight.classList.add("toxicSpillKnight");
  642. var toxicSpillKnightLabel = document.createElement("div");
  643. toxicSpillKnightLabel.classList.add("toxicSpillKnightLabel");
  644. var toxicSpillKnightLabelText = document.createTextNode("Knight in:");
  645. toxicSpillKnightLabel.appendChild(toxicSpillKnightLabelText);
  646. var toxicSpillKnightValue = document.createElement("div");
  647. toxicSpillKnightValue.classList.add("toxicSpillKnightValue");
  648. var toxicSpillKnightValueText = document.createTextNode("?");
  649. toxicSpillKnightValue.appendChild(toxicSpillKnightValueText);
  650. $(toxicSpillKnightLabel).css({
  651. 'float': 'left',
  652. 'font-weight': 700,
  653. "marginRight": "5px"
  654. })
  655. $(toxicSpillKnightValue).css("marginLeft", "50px");
  656. toxicSpillKnight.appendChild(toxicSpillKnightLabel);
  657. toxicSpillKnight.appendChild(toxicSpillKnightValue);
  658. //Lord
  659. var toxicSpillLord = document.createElement("div");
  660. toxicSpillLord.classList.add("toxicSpillLord");
  661. var toxicSpillLordLabel = document.createElement("div");
  662. toxicSpillLordLabel.classList.add("toxicSpillLordLabel");
  663. var toxicSpillLordLabelText = document.createTextNode("Lord in:");
  664. toxicSpillLordLabel.appendChild(toxicSpillLordLabelText);
  665. var toxicSpillLordValue = document.createElement("div");
  666. toxicSpillLordValue.classList.add("toxicSpillLordValue");
  667. var toxicSpillLordValueText = document.createTextNode("?");
  668. toxicSpillLordValue.appendChild(toxicSpillLordValueText);
  669. $(toxicSpillLordLabel).css({
  670. 'float': 'left',
  671. 'font-weight': 700,
  672. "marginRight": "5px"
  673. })
  674. $(toxicSpillLordValue).css("marginLeft", "50px");
  675. toxicSpillLord.appendChild(toxicSpillLordLabel);
  676. toxicSpillLord.appendChild(toxicSpillLordValue);
  677. //Baron
  678. var toxicSpillBaron = document.createElement("div");
  679. toxicSpillBaron.classList.add("toxicSpillBaron");
  680. var toxicSpillBaronLabel = document.createElement("div");
  681. toxicSpillBaronLabel.classList.add("toxicSpillBaronLabel");
  682. var toxicSpillBaronLabelText = document.createTextNode("Baron in:");
  683. toxicSpillBaronLabel.appendChild(toxicSpillBaronLabelText);
  684. var toxicSpillBaronValue = document.createElement("div");
  685. toxicSpillBaronValue.classList.add("toxicSpillBaronValue");
  686. var toxicSpillBaronValueText = document.createTextNode("?");
  687. toxicSpillBaronValue.appendChild(toxicSpillBaronValueText);
  688. $(toxicSpillBaronLabel).css({
  689. 'float': 'left',
  690. 'font-weight': 700,
  691. "marginRight": "5px"
  692. })
  693. $(toxicSpillBaronValue).css("marginLeft", "50px");
  694. toxicSpillBaron.appendChild(toxicSpillBaronLabel);
  695. toxicSpillBaron.appendChild(toxicSpillBaronValue);
  696. //Count
  697. var toxicSpillCount = document.createElement("div");
  698. toxicSpillCount.classList.add("toxicSpillCount");
  699. var toxicSpillCountLabel = document.createElement("div");
  700. toxicSpillCountLabel.classList.add("toxicSpillCountLabel");
  701. var toxicSpillCountLabelText = document.createTextNode("Count in:");
  702. toxicSpillCountLabel.appendChild(toxicSpillCountLabelText);
  703. var toxicSpillCountValue = document.createElement("div");
  704. toxicSpillCountValue.classList.add("toxicSpillCountValue");
  705. var toxicSpillCountValueText = document.createTextNode("?");
  706. toxicSpillCountValue.appendChild(toxicSpillCountValueText);
  707. $(toxicSpillCountLabel).css({
  708. 'float': 'left',
  709. 'font-weight': 700,
  710. "marginRight": "5px"
  711. })
  712. $(toxicSpillCountValue).css("marginLeft", "50px");
  713. toxicSpillCount.appendChild(toxicSpillCountLabel);
  714. toxicSpillCount.appendChild(toxicSpillCountValue);
  715. //Duke
  716. var toxicSpillDuke = document.createElement("div");
  717. toxicSpillDuke.classList.add("toxicSpillDuke");
  718. var toxicSpillDukeLabel = document.createElement("div");
  719. toxicSpillDukeLabel.classList.add("toxicSpillDukeLabel");
  720. var toxicSpillDukeLabelText = document.createTextNode("Duke in:");
  721. toxicSpillDukeLabel.appendChild(toxicSpillDukeLabelText);
  722. var toxicSpillDukeValue = document.createElement("div");
  723. toxicSpillDukeValue.classList.add("toxicSpillDukeValue");
  724. var toxicSpillDukeValueText = document.createTextNode("?");
  725. toxicSpillDukeValue.appendChild(toxicSpillDukeValueText);
  726. $(toxicSpillDukeLabel).css({
  727. 'float': 'left',
  728. 'font-weight': 700,
  729. "marginRight": "5px"
  730. })
  731. $(toxicSpillDukeValue).css("marginLeft", "50px");
  732. toxicSpillDuke.appendChild(toxicSpillDukeLabel);
  733. toxicSpillDuke.appendChild(toxicSpillDukeValue);
  734. //Grand Duke
  735. var toxicSpillGrandDuke = document.createElement("div");
  736. toxicSpillGrandDuke.classList.add("toxicSpillGrandDuke");
  737. var toxicSpillGrandDukeLabel = document.createElement("div");
  738. toxicSpillGrandDukeLabel.classList.add("toxicSpillGrandDukeLabel");
  739. var toxicSpillGrandDukeLabelText = document.createTextNode("Grand Duke in:");
  740. toxicSpillGrandDukeLabel.appendChild(toxicSpillGrandDukeLabelText);
  741. var toxicSpillGrandDukeValue = document.createElement("div");
  742. toxicSpillGrandDukeValue.classList.add("toxicSpillGrandDukeValue");
  743. var toxicSpillGrandDukeValueText = document.createTextNode("?");
  744. toxicSpillGrandDukeValue.appendChild(toxicSpillGrandDukeValueText);
  745. $(toxicSpillGrandDukeLabel).css({
  746. 'float': 'left',
  747. 'font-weight': 700,
  748. "marginRight": "5px"
  749. })
  750. $(toxicSpillGrandDukeValue).css("marginLeft", "50px");
  751. toxicSpillGrandDuke.appendChild(toxicSpillGrandDukeLabel);
  752. toxicSpillGrandDuke.appendChild(toxicSpillGrandDukeValue);
  753. //Archduke
  754. var toxicSpillArchduke = document.createElement("div");
  755. toxicSpillArchduke.classList.add("toxicSpillArchduke");
  756. var toxicSpillArchdukeLabel = document.createElement("div");
  757. toxicSpillArchdukeLabel.classList.add("toxicSpillArchdukeLabel");
  758. var toxicSpillArchdukeLabelText = document.createTextNode("Archduke in:");
  759. toxicSpillArchdukeLabel.appendChild(toxicSpillArchdukeLabelText);
  760. var toxicSpillArchdukeValue = document.createElement("div");
  761. toxicSpillArchdukeValue.classList.add("toxicSpillArchdukeValue");
  762. var toxicSpillArchdukeValueText = document.createTextNode("?");
  763. toxicSpillArchdukeValue.appendChild(toxicSpillArchdukeValueText);
  764. $(toxicSpillArchdukeLabel).css({
  765. 'float': 'left',
  766. 'font-weight': 700,
  767. "marginRight": "5px"
  768. })
  769. $(toxicSpillArchdukeValue).css("marginLeft", "50px");
  770. toxicSpillArchduke.appendChild(toxicSpillArchdukeLabel);
  771. toxicSpillArchduke.appendChild(toxicSpillArchdukeValue);
  772. //Append
  773. toxicSpill.appendChild(toxicSpillHeader);
  774. toxicSpill.appendChild(toxicSpillHero);
  775. toxicSpill.appendChild(toxicSpillKnight);
  776. toxicSpill.appendChild(toxicSpillLord);
  777. toxicSpill.appendChild(toxicSpillBaron);
  778. toxicSpill.appendChild(toxicSpillCount);
  779. toxicSpill.appendChild(toxicSpillDuke);
  780. toxicSpill.appendChild(toxicSpillGrandDuke);
  781. toxicSpill.appendChild(toxicSpillArchduke);
  782. return toxicSpill;
  783. }
  784.  
  785. function updateToxicSpillTimer() {
  786. if ($(".toxicSpill").length < 1) return;
  787. var toxicSpill = $(".toxicSpill");
  788. $(".toxicSpill").children().show();
  789. var firstHero = 1503597600;
  790. var now = todayNow();
  791. let timePassedHours = (now - firstHero) / 3600;
  792. var rotaionLenght = 302;
  793. var rotationsExact = timePassedHours / rotaionLenght;
  794. var rotationsInteger = Math.floor(rotationsExact);
  795. var partialrotation = (rotationsExact - rotationsInteger) * rotaionLenght;
  796. var heroObj = new season(0, 0, 0);
  797. var knightObj = new season(0, 0, 0);
  798. var lordObj = new season(0, 0, 0);
  799. var baronObj = new season(0, 0, 0);
  800. var countObj = new season(0, 0, 0);
  801. var dukeObj = new season(0, 0, 0);
  802. var granddukeObj = new season(0, 0, 0);
  803. var archdukeObj = new season(0, 0, 0);
  804. if (partialrotation < 15) {
  805. //Hero Rising
  806. $(".toxicSpillHeaderValue").text("HERO-RISING");
  807. var timeKnight = (15 - partialrotation).toPrecision(4);
  808. knightObj.hours = Math.floor(timeKnight);
  809. knightObj.minutes = Math.ceil((timeKnight - knightObj.hours) * 60);
  810. knightObj = convertToDyHrMn(0, knightObj.hours, knightObj.minutes);
  811. lordObj = convertToDyHrMn(knightObj.days, knightObj.hours + 16, knightObj.minutes);
  812. baronObj = convertToDyHrMn(lordObj.days, lordObj.hours + 18, lordObj.minutes);
  813. countObj = convertToDyHrMn(baronObj.days, baronObj.hours + 18, baronObj.minutes);
  814. dukeObj = convertToDyHrMn(countObj.days + 1, countObj.hours, countObj.minutes);
  815. $(".toxicSpillKnightLabel").text("Knight in:");
  816. $(".toxicSpillLordLabel").text("Lord in:");
  817. $(".toxicSpillBaronLabel").text("Baron in:");
  818. $(".toxicSpillCountLabel").text("Count in:");
  819. $(".toxicSpillDukeLabel").text("Duke in:");
  820. toxicSpill.append($(".toxicSpillKnight"));
  821. toxicSpill.append($(".toxicSpillLord"));
  822. toxicSpill.append($(".toxicSpillBaron"));
  823. toxicSpill.append($(".toxicSpillCount"));
  824. toxicSpill.append($(".toxicSpillDuke"));
  825. $(".toxicSpillHero").hide();
  826. $(".toxicSpillGrandDuke").hide();
  827. $(".toxicSpillArchduke").hide();
  828. } else if (partialrotation >= 15 && partialrotation < 31) {
  829. //Knight Rising
  830. $(".toxicSpillHeaderValue").text("KNIGHT-RISING");
  831. var timeLord = (31 - partialrotation).toPrecision(4);
  832. lordObj.hours = Math.floor(timeLord);
  833. lordObj.minutes = Math.ceil((timeLord - lordObj.hours) * 60);
  834. lordObj = convertToDyHrMn(0, lordObj.hours, lordObj.minutes);
  835. baronObj = convertToDyHrMn(lordObj.days, lordObj.hours + 18, lordObj.minutes);
  836. countObj = convertToDyHrMn(baronObj.days, baronObj.hours + 18, baronObj.minutes);
  837. dukeObj = convertToDyHrMn(countObj.days + 1, countObj.hours, countObj.minutes);
  838. granddukeObj = convertToDyHrMn(dukeObj.days + 1, dukeObj.hours, dukeObj.minutes);
  839. $(".toxicSpillLordLabel").text("Lord in:");
  840. $(".toxicSpillBaronLabel").text("Baron in:");
  841. $(".toxicSpillCountLabel").text("Count in:");
  842. $(".toxicSpillDukeLabel").text("Duke in:");
  843. $(".toxicSpillGrandDukeLabel").text("Grand Duke in:");
  844. toxicSpill.append($(".toxicSpillLord"));
  845. toxicSpill.append($(".toxicSpillBaron"));
  846. toxicSpill.append($(".toxicSpillCount"));
  847. toxicSpill.append($(".toxicSpillDuke"));
  848. toxicSpill.append($(".toxicSpillGrandDuke"));
  849. $(".toxicSpillHero").hide();
  850. $(".toxicSpillKnight").hide();
  851. $(".toxicSpillArchduke").hide();
  852. } else if (partialrotation >= 31 && partialrotation < 49) {
  853. //Lord Rising
  854. $(".toxicSpillHeaderValue").text("LORD-RISING");
  855. var timeBaron = (49 - partialrotation).toPrecision(4);
  856. baronObj.hours = Math.floor(timeBaron);
  857. baronObj.minutes = Math.ceil((timeBaron - baronObj.hours) * 60);
  858. baronObj = convertToDyHrMn(0, baronObj.hours, baronObj.minutes);
  859. countObj = convertToDyHrMn(baronObj.days, baronObj.hours + 18, baronObj.minutes);
  860. dukeObj = convertToDyHrMn(countObj.days + 1, countObj.hours, countObj.minutes);
  861. granddukeObj = convertToDyHrMn(dukeObj.days + 1, dukeObj.hours, dukeObj.minutes);
  862. archdukeObj = convertToDyHrMn(granddukeObj.days + 1, granddukeObj.hours, granddukeObj.minutes);
  863. $(".toxicSpillBaronLabel").text("Baron in:");
  864. $(".toxicSpillCountLabel").text("Count in:");
  865. $(".toxicSpillDukeLabel").text("Duke in:");
  866. $(".toxicSpillGrandDukeLabel").text("Grand Duke in:");
  867. $(".toxicSpillLordLabel").text("Archduke in:");
  868. toxicSpill.append($(".toxicSpillBaron"));
  869. toxicSpill.append($(".toxicSpillCount"));
  870. toxicSpill.append($(".toxicSpillDuke"));
  871. toxicSpill.append($(".toxicSpillGrandDuke"));
  872. toxicSpill.append($(".toxicSpillArchduke"));
  873. $(".toxicSpillHero").hide();
  874. $(".toxicSpillKnight").hide();
  875. $(".toxicSpillLord").hide();
  876. } else if (partialrotation >= 49 && partialrotation < 67) {
  877. //Baron Rising
  878. $(".toxicSpillHeaderValue").text("BARON-RISING");
  879. var timeCount = (67 - partialrotation).toPrecision(4);
  880. countObj.hours = Math.floor(timeCount);
  881. countObj.minutes = Math.ceil((timeCount - countObj.hours) * 60);
  882. countObj = convertToDyHrMn(0, countObj.hours, countObj.minutes);
  883. dukeObj = convertToDyHrMn(countObj.days + 1, countObj.hours, countObj.minutes);
  884. granddukeObj = convertToDyHrMn(dukeObj.days + 1, dukeObj.hours, dukeObj.minutes);
  885. archdukeObj = convertToDyHrMn(granddukeObj.days + 1, granddukeObj.hours, granddukeObj.minutes);
  886. countObj = convertToDyHrMn(archdukeObj.days + 3, archdukeObj.hours, archdukeObj.minutes);
  887. baronObj = convertToDyHrMn(countObj.days + 1, countObj.hours, countObj.minutes);
  888. $(".toxicSpillGrandDukeLabel").text("Grand Duke in:");
  889. $(".toxicSpillLordLabel").text("Archduke in:");
  890. $(".toxicSpillDukeLabel").text("Duke in:");
  891. $(".toxicSpillCountLabel").text("Count in:");
  892. $(".toxicSpillBaronLabel").text("Baron Falling in:");
  893. toxicSpill.append($(".toxicSpillCount"));
  894. toxicSpill.append($(".toxicSpillDuke"));
  895. toxicSpill.append($(".toxicSpillGrandDuke"));
  896. toxicSpill.append($(".toxicSpillArchduke"));
  897. toxicSpill.append($(".toxicSpillBaron"));
  898. $(".toxicSpillHero").hide();
  899. $(".toxicSpillKnight").hide();
  900. $(".toxicSpillLord").hide();
  901. } else if (partialrotation >= 67 && partialrotation < 91) {
  902. //Count Rising
  903. $(".toxicSpillHeaderValue").text("COUNT-RISING");
  904. var timeDuke = (91 - partialrotation).toPrecision(4);
  905. dukeObj.hours = Math.floor(timeDuke);
  906. dukeObj.minutes = Math.ceil((timeDuke - dukeObj.hours) * 60);
  907. dukeObj = convertToDyHrMn(0, dukeObj.hours, dukeObj.minutes);
  908. granddukeObj = convertToDyHrMn(dukeObj.days + 1, dukeObj.hours, dukeObj.minutes);
  909. archdukeObj = convertToDyHrMn(granddukeObj.days + 1, granddukeObj.hours, granddukeObj.minutes);
  910. countObj = convertToDyHrMn(archdukeObj.days + 3, archdukeObj.hours, archdukeObj.minutes);
  911. baronObj = convertToDyHrMn(countObj.days + 1, countObj.hours, countObj.minutes);
  912. $(".toxicSpillGrandDukeLabel").text("Grand Duke in:");
  913. $(".toxicSpillLordLabel").text("Archduke in:");
  914. $(".toxicSpillDukeLabel").text("Duke in:");
  915. $(".toxicSpillCountLabel").text("Count Falling in:");
  916. $(".toxicSpillBaronLabel").text("Baron in:");
  917. toxicSpill.append($(".toxicSpillDuke"));
  918. toxicSpill.append($(".toxicSpillGrandDuke"));
  919. toxicSpill.append($(".toxicSpillArchduke"));
  920. toxicSpill.append($(".toxicSpillCount"));
  921. toxicSpill.append($(".toxicSpillBaron"));
  922. $(".toxicSpillHero").hide();
  923. $(".toxicSpillKnight").hide();
  924. $(".toxicSpillLord").hide();
  925. } else if (partialrotation >= 91 && partialrotation < 115) {
  926. //Duke Rising
  927. $(".toxicSpillHeaderValue").text("DUKE-RISING");
  928. var timeGrandDuke = (115 - partialrotation).toPrecision(4);
  929. granddukeObj.hours = Math.floor(timeGrandDuke);
  930. granddukeObj.minutes = Math.ceil((timeGrandDuke - granddukeObj.hours) * 60);
  931. granddukeObj = convertToDyHrMn(0, granddukeObj.hours, granddukeObj.minutes);
  932. archdukeObj = convertToDyHrMn(granddukeObj.days + 1, granddukeObj.hours, granddukeObj.minutes);
  933. dukeObj = convertToDyHrMn(archdukeObj.days + 2, archdukeObj.hours, archdukeObj.minutes);
  934. countObj = convertToDyHrMn(dukeObj.days + 1, dukeObj.hours + 10, dukeObj.minutes);
  935. baronObj = convertToDyHrMn(countObj.days + 1, countObj.hours, countObj.minutes);
  936. $(".toxicSpillGrandDukeLabel").text("Grand Duke in:");
  937. $(".toxicSpillLordLabel").text("Archduke in:");
  938. $(".toxicSpillDukeLabel").text("Duke Falling in:");
  939. $(".toxicSpillCountLabel").text("Count in:");
  940. $(".toxicSpillBaronLabel").text("Baron in:");
  941. toxicSpill.append($(".toxicSpillGrandDuke"));
  942. toxicSpill.append($(".toxicSpillArchduke"));
  943. toxicSpill.append($(".toxicSpillDuke"));
  944. toxicSpill.append($(".toxicSpillCount"));
  945. toxicSpill.append($(".toxicSpillBaron"));
  946. $(".toxicSpillHero").hide();
  947. $(".toxicSpillKnight").hide();
  948. $(".toxicSpillLord").hide();
  949. } else if (partialrotation >= 115 && partialrotation < 139) {
  950. //Grand Duke Rising
  951. $(".toxicSpillHeaderValue").text("GD-RISING");
  952. var timeArchduke = (139 - partialrotation).toPrecision(4);
  953. archdukeObj.hours = Math.floor(timeArchduke);
  954. archdukeObj.minutes = Math.ceil((timeArchduke - archdukeObj.hours) * 60);
  955. archdukeObj = convertToDyHrMn(0, archdukeObj.hours, archdukeObj.minutes);
  956. granddukeObj = convertToDyHrMn(archdukeObj.days, archdukeObj.hours + 24, archdukeObj.minutes);
  957. dukeObj = convertToDyHrMn(0, granddukeObj.hours + 24, granddukeObj.minutes);
  958. countObj = convertToDyHrMn(dukeObj.days + 1, dukeObj.hours + 10, dukeObj.minutes);
  959. baronObj = convertToDyHrMn(countObj.days + 1, countObj.hours, countObj.minutes);
  960. $(".toxicSpillLordLabel").text("Archduke in:");
  961. $(".toxicSpillGrandDukeLabel").text("GD Falling in:");
  962. $(".toxicSpillDukeLabel").text("Duke in:");
  963. $(".toxicSpillCountLabel").text("Count in:");
  964. $(".toxicSpillBaronLabel").text("Baron in:");
  965. toxicSpill.append($(".toxicSpillArchduke"));
  966. toxicSpill.append($(".toxicSpillGrandDuke"));
  967. toxicSpill.append($(".toxicSpillDuke"));
  968. toxicSpill.append($(".toxicSpillCount"));
  969. toxicSpill.append($(".toxicSpillBaron"));
  970. $(".toxicSpillHero").hide();
  971. $(".toxicSpillKnight").hide();
  972. $(".toxicSpillLord").hide();
  973. } else if (partialrotation >= 139 && partialrotation < 151) {
  974. //Archduke Falling
  975. $(".toxicSpillHeaderValue").text("AD-FALLING");
  976. var timeArchduke = (151 - partialrotation).toPrecision(4);
  977. archdukeObj.hours = Math.floor(timeArchduke);
  978. archdukeObj.minutes = Math.ceil((timeArchduke - archdukeObj.hours) * 60);
  979. archdukeObj = convertToDyHrMn(0, archdukeObj.hours, archdukeObj.minutes);
  980. granddukeObj = convertToDyHrMn(archdukeObj.days, archdukeObj.hours + 12, archdukeObj.minutes);
  981. dukeObj = convertToDyHrMn(0, granddukeObj.hours + 24, granddukeObj.minutes);
  982. countObj = convertToDyHrMn(dukeObj.days + 1, dukeObj.hours + 10, dukeObj.minutes);
  983. baronObj = convertToDyHrMn(countObj.days + 1, countObj.hours, countObj.minutes);
  984. $(".toxicSpillLordLabel").text("AD Falling in:");
  985. $(".toxicSpillGrandDukeLabel").text("Grand Duke in:");
  986. $(".toxicSpillDukeLabel").text("Duke in:");
  987. $(".toxicSpillCountLabel").text("Count in:");
  988. $(".toxicSpillBaronLabel").text("Baron in:");
  989. toxicSpill.append($(".toxicSpillArchduke"));
  990. toxicSpill.append($(".toxicSpillGrandDuke"));
  991. toxicSpill.append($(".toxicSpillDuke"));
  992. toxicSpill.append($(".toxicSpillCount"));
  993. toxicSpill.append($(".toxicSpillBaron"));
  994. $(".toxicSpillHero").hide();
  995. $(".toxicSpillKnight").hide();
  996. $(".toxicSpillLord").hide();
  997. } else if (partialrotation >= 151 && partialrotation < 163) {
  998. //Archduke Falling
  999. $(".toxicSpillHeaderValue").text("AD-FALLING");
  1000. var timeGDuke = (163 - partialrotation).toPrecision(4);
  1001. granddukeObj.hours = Math.floor(timeGDuke);
  1002. granddukeObj.minutes = Math.ceil((timeGDuke - granddukeObj.hours) * 60);
  1003. granddukeObj = convertToDyHrMn(0, granddukeObj.hours, granddukeObj.minutes);
  1004. dukeObj = convertToDyHrMn(0, granddukeObj.hours + 24, granddukeObj.minutes);
  1005. countObj = convertToDyHrMn(dukeObj.days + 1, dukeObj.hours + 10, dukeObj.minutes);
  1006. baronObj = convertToDyHrMn(countObj.days + 1, countObj.hours, countObj.minutes);
  1007. lordObj = convertToDyHrMn(baronObj.days, baronObj.hours + 18, baronObj.minutes);
  1008. $(".toxicSpillGrandDukeLabel").text("Grand Duke in:");
  1009. $(".toxicSpillDukeLabel").text("Duke in:");
  1010. $(".toxicSpillCountLabel").text("Count in:");
  1011. $(".toxicSpillBaronLabel").text("Baron in:");
  1012. $(".toxicSpillLordLabel").text("Lord in:");
  1013. toxicSpill.append($(".toxicSpillGrandDuke"));
  1014. toxicSpill.append($(".toxicSpillDuke"));
  1015. toxicSpill.append($(".toxicSpillCount"));
  1016. toxicSpill.append($(".toxicSpillBaron"));
  1017. toxicSpill.append($(".toxicSpillLord"));
  1018. $(".toxicSpillHero").hide();
  1019. $(".toxicSpillKnight").hide();
  1020. $(".toxicSpillArchduke").hide();
  1021. } else if (partialrotation >= 163 && partialrotation < 187) {
  1022. //Grand Duke Falling
  1023. $(".toxicSpillHeaderValue").text("GD-FALLING");
  1024. var timeDuke = (187 - partialrotation).toPrecision(4);
  1025. dukeObj.hours = Math.floor(timeDuke);
  1026. dukeObj.minutes = Math.ceil((timeDuke - dukeObj.hours) * 60);
  1027. dukeObj = convertToDyHrMn(0, dukeObj.hours, dukeObj.minutes);
  1028. countObj = convertToDyHrMn(dukeObj.days + 1, dukeObj.hours + 10, dukeObj.minutes);
  1029. baronObj = convertToDyHrMn(countObj.days + 1, countObj.hours, countObj.minutes);
  1030. lordObj = convertToDyHrMn(baronObj.days, baronObj.hours + 18, baronObj.minutes);
  1031. knightObj = convertToDyHrMn(lordObj.days, lordObj.hours + 18, lordObj.minutes);
  1032. $(".toxicSpillDukeLabel").text("Duke in:");
  1033. $(".toxicSpillCountLabel").text("Count in:");
  1034. $(".toxicSpillBaronLabel").text("Baron in:");
  1035. $(".toxicSpillLordLabel").text("Lord in:");
  1036. $(".toxicSpillKnightLabel").text("Knight in:");
  1037. toxicSpill.append($(".toxicSpillDuke"));
  1038. toxicSpill.append($(".toxicSpillCount"));
  1039. toxicSpill.append($(".toxicSpillBaron"));
  1040. toxicSpill.append($(".toxicSpillLord"));
  1041. toxicSpill.append($(".toxicSpillKnight"));
  1042. $(".toxicSpillHero").hide();
  1043. $(".toxicSpillGrandDuke").hide();
  1044. $(".toxicSpillArchduke").hide();
  1045. } else if (partialrotation >= 187 && partialrotation < 211) {
  1046. //Duke Falling
  1047. $(".toxicSpillHeaderValue").text("DUKE-FALLING");
  1048. var timeCount = (211 - partialrotation).toPrecision(4);
  1049. countObj.hours = Math.floor(timeCount);
  1050. countObj.minutes = Math.ceil((timeCount - countObj.hours) * 60);
  1051. countObj = convertToDyHrMn(0, countObj.hours, countObj.minutes);
  1052. baronObj = convertToDyHrMn(countObj.days + 1, countObj.hours, countObj.minutes);
  1053. lordObj = convertToDyHrMn(baronObj.days, baronObj.hours + 18, baronObj.minutes);
  1054. knightObj = convertToDyHrMn(lordObj.days, lordObj.hours + 18, lordObj.minutes);
  1055. heroObj = convertToDyHrMn(knightObj.days, knightObj.hours + 16, knightObj.minutes);
  1056. $(".toxicSpillCountLabel").text("Count in:");
  1057. $(".toxicSpillBaronLabel").text("Baron in:");
  1058. $(".toxicSpillLordLabel").text("Lord in:");
  1059. $(".toxicSpillKnightLabel").text("Knight in:");
  1060. $(".toxicSpillHeroLabel").text("Hero in:");
  1061. toxicSpill.append($(".toxicSpillCount"));
  1062. toxicSpill.append($(".toxicSpillBaron"));
  1063. toxicSpill.append($(".toxicSpillLord"));
  1064. toxicSpill.append($(".toxicSpillKnight"));
  1065. toxicSpill.append($(".toxicSpillHero"));
  1066. $(".toxicSpillDuke").hide();
  1067. $(".toxicSpillGrandDuke").hide();
  1068. $(".toxicSpillArchduke").hide();
  1069. } else if (partialrotation >= 211 && partialrotation < 235) {
  1070. //Count Falling
  1071. $(".toxicSpillHeaderValue").text("COUNT-FALLING");
  1072. var timeBaron = (235 - partialrotation).toPrecision(4);
  1073. baronObj.hours = Math.floor(timeBaron);
  1074. baronObj.minutes = Math.ceil((timeBaron - baronObj.hours) * 60);
  1075. baronObj = convertToDyHrMn(0, baronObj.hours, baronObj.minutes);
  1076. lordObj = convertToDyHrMn(baronObj.days, baronObj.hours + 18, baronObj.minutes);
  1077. knightObj = convertToDyHrMn(lordObj.days, lordObj.hours + 18, lordObj.minutes);
  1078. heroObj = convertToDyHrMn(knightObj.days, knightObj.hours + 16, knightObj.minutes);
  1079. countObj = convertToDyHrMn(heroObj.days + 3, heroObj.hours + 10, heroObj.minutes);
  1080. $(".toxicSpillBaronLabel").text("Baron in:");
  1081. $(".toxicSpillLordLabel").text("Lord in:");
  1082. $(".toxicSpillKnightLabel").text("Knight in:");
  1083. $(".toxicSpillHeroLabel").text("Hero in:");
  1084. $(".toxicSpillCountLabel").text("Count Rising in:");
  1085. toxicSpill.append($(".toxicSpillBaron"));
  1086. toxicSpill.append($(".toxicSpillLord"));
  1087. toxicSpill.append($(".toxicSpillKnight"));
  1088. toxicSpill.append($(".toxicSpillHero"));
  1089. toxicSpill.append($(".toxicSpillCount"));
  1090. $(".toxicSpillDuke").hide();
  1091. $(".toxicSpillGrandDuke").hide();
  1092. $(".toxicSpillArchduke").hide();
  1093. } else if (partialrotation >= 235 && partialrotation < 253) {
  1094. //Baron Falling
  1095. $(".toxicSpillHeaderValue").text("BARON-FALLING");
  1096. var timeLord = (253 - partialrotation).toPrecision(4);
  1097. lordObj.hours = Math.floor(timeLord);
  1098. lordObj.minutes = Math.ceil((timeLord - lordObj.hours) * 60);
  1099. lordObj = convertToDyHrMn(0, lordObj.hours, lordObj.minutes);
  1100. knightObj = convertToDyHrMn(lordObj.days, lordObj.hours + 18, lordObj.minutes);
  1101. heroObj = convertToDyHrMn(knightObj.days, knightObj.hours + 16, knightObj.minutes);
  1102. baronObj = convertToDyHrMn(heroObj.days + 2, heroObj.hours + 16, heroObj.minutes);
  1103. countObj = convertToDyHrMn(baronObj.days, baronObj.hours + 18, baronObj.minutes);
  1104. $(".toxicSpillCountLabel").text("Count in:");
  1105. $(".toxicSpillBaronLabel").text("Baron Rising in:");
  1106. $(".toxicSpillLordLabel").text("Lord in:");
  1107. $(".toxicSpillKnightLabel").text("Knight in:");
  1108. $(".toxicSpillHeroLabel").text("Hero in:");
  1109. toxicSpill.append($(".toxicSpillLord"));
  1110. toxicSpill.append($(".toxicSpillKnight"));
  1111. toxicSpill.append($(".toxicSpillHero"));
  1112. toxicSpill.append($(".toxicSpillBaron"));
  1113. toxicSpill.append($(".toxicSpillCount"));
  1114. $(".toxicSpillDuke").hide();
  1115. $(".toxicSpillGrandDuke").hide();
  1116. $(".toxicSpillArchduke").hide();
  1117. } else if (partialrotation >= 256 && partialrotation < 271) {
  1118. //Lord Falling
  1119. $(".toxicSpillHeaderValue").text("LORD-FALLING");
  1120. var timeKnight = (271 - partialrotation).toPrecision(4);
  1121. knightObj.hours = Math.floor(timeKnight);
  1122. knightObj.minutes = Math.ceil((timeKnight - knightObj.hours) * 60);
  1123. knightObj = convertToDyHrMn(0, knightObj.hours, knightObj.minutes);
  1124. heroObj = convertToDyHrMn(knightObj.days, knightObj.hours + 16, knightObj.minutes);
  1125. lordObj = convertToDyHrMn(heroObj.days + 1, heroObj.hours + 22, heroObj.minutes);
  1126. baronObj = convertToDyHrMn(lordObj.days, lordObj.hours + 18, lordObj.minutes);
  1127. countObj = convertToDyHrMn(baronObj.days, baronObj.hours + 18, baronObj.minutes);
  1128. $(".toxicSpillCountLabel").text("Count in:");
  1129. $(".toxicSpillBaronLabel").text("Baron in:");
  1130. $(".toxicSpillLordLabel").text("Lord Rising in:");
  1131. $(".toxicSpillKnightLabel").text("Knight in:");
  1132. $(".toxicSpillHeroLabel").text("Hero in:");
  1133. toxicSpill.append($(".toxicSpillKnight"));
  1134. toxicSpill.append($(".toxicSpillHero"));
  1135. toxicSpill.append($(".toxicSpillLord"));
  1136. toxicSpill.append($(".toxicSpillBaron"));
  1137. toxicSpill.append($(".toxicSpillCount"));
  1138. $(".toxicSpillDuke").hide();
  1139. $(".toxicSpillGrandDuke").hide();
  1140. $(".toxicSpillArchduke").hide();
  1141. } else if (partialrotation >= 271 && partialrotation < 287) {
  1142. //Knight Falling
  1143. $(".toxicSpillHeaderValue").text("KNIGHT-FALLING");
  1144. var timeHero = (287 - partialrotation).toPrecision(4);
  1145. heroObj.hours = Math.floor(timeHero);
  1146. heroObj.minutes = Math.ceil((timeHero - heroObj.hours) * 60);
  1147. heroObj = convertToDyHrMn(0, heroObj.hours, heroObj.minutes);
  1148. knightObj = convertToDyHrMn(heroObj.days + 1, heroObj.hours + 6, heroObj.minutes);
  1149. lordObj = convertToDyHrMn(knightObj.days, knightObj.hours + 16, knightObj.minutes);
  1150. baronObj = convertToDyHrMn(lordObj.days, lordObj.hours + 18, lordObj.minutes);
  1151. countObj = convertToDyHrMn(baronObj.days, baronObj.hours + 18, baronObj.minutes);
  1152. $(".toxicSpillCountLabel").text("Count in:");
  1153. $(".toxicSpillBaronLabel").text("Baron in:");
  1154. $(".toxicSpillLordLabel").text("Lord in:");
  1155. $(".toxicSpillKnightLabel").text("Knight Rising in:");
  1156. $(".toxicSpillHeroLabel").text("Hero in:");
  1157. toxicSpill.append($(".toxicSpillHero"));
  1158. toxicSpill.append($(".toxicSpillKnight"));
  1159. toxicSpill.append($(".toxicSpillLord"));
  1160. toxicSpill.append($(".toxicSpillBaron"));
  1161. toxicSpill.append($(".toxicSpillCount"));
  1162. $(".toxicSpillDuke").hide();
  1163. $(".toxicSpillGrandDuke").hide();
  1164. $(".toxicSpillArchduke").hide();
  1165. } else if (partialrotation >= 287 && partialrotation < 302) {
  1166. //Hero Falling
  1167. $(".toxicSpillHeaderValue").text("HERO-FALLING");
  1168. var timeHero = (302 - partialrotation).toPrecision(4);
  1169. heroObj.hours = Math.floor(timeHero);
  1170. heroObj.minutes = Math.ceil((timeHero - heroObj.hours) * 60);
  1171. heroObj = convertToDyHrMn(0, heroObj.hours, heroObj.minutes);
  1172. knightObj = convertToDyHrMn(heroObj.days, heroObj.hours + 15, heroObj.minutes);
  1173. lordObj = convertToDyHrMn(knightObj.days, knightObj.hours + 16, knightObj.minutes);
  1174. baronObj = convertToDyHrMn(lordObj.days, lordObj.hours + 18, lordObj.minutes);
  1175. countObj = convertToDyHrMn(baronObj.days, baronObj.hours + 18, baronObj.minutes);
  1176. $(".toxicSpillCountLabel").text("Count in:");
  1177. $(".toxicSpillBaronLabel").text("Baron in:");
  1178. $(".toxicSpillLordLabel").text("Lord in:");
  1179. $(".toxicSpillKnightLabel").text("Knight in:");
  1180. $(".toxicSpillHeroLabel").text("Hero Rising in:");
  1181. toxicSpill.append($(".toxicSpillHero"));
  1182. toxicSpill.append($(".toxicSpillKnight"));
  1183. toxicSpill.append($(".toxicSpillLord"));
  1184. toxicSpill.append($(".toxicSpillBaron"));
  1185. toxicSpill.append($(".toxicSpillCount"));
  1186. $(".toxicSpillDuke").hide();
  1187. $(".toxicSpillGrandDuke").hide();
  1188. $(".toxicSpillArchduke").hide();
  1189. } else {
  1190. //WTF are we?
  1191. }
  1192. $(".toxicSpillArchdukeValue").text(archdukeObj.days + "d " + archdukeObj.hours + "h " + archdukeObj.minutes + "m");
  1193. $(".toxicSpillGrandDukeValue").text(granddukeObj.days + "d " + granddukeObj.hours + "h " + granddukeObj.minutes + "m");
  1194. $(".toxicSpillDukeValue").text(dukeObj.days + "d " + dukeObj.hours + "h " + dukeObj.minutes + "m");
  1195. $(".toxicSpillCountValue").text(countObj.days + "d " + countObj.hours + "h " + countObj.minutes + "m");
  1196. $(".toxicSpillBaronValue").text(baronObj.days + "d " + baronObj.hours + "h " + baronObj.minutes + "m");
  1197. $(".toxicSpillLordValue").text(lordObj.days + "d " + lordObj.hours + "h " + lordObj.minutes + "m");
  1198. $(".toxicSpillKnightValue").text(knightObj.days + "d " + knightObj.hours + "h " + knightObj.minutes + "m");
  1199. $(".toxicSpillHeroValue").text(heroObj.days + "d " + heroObj.hours + "h " + heroObj.minutes + "m");
  1200. //https://mhwiki.hitgrab.com/wiki/index.php/Toxic_Spill#Pollution_Levels
  1201. }
  1202.  
  1203. function spillLevel(days, hours, minutes) {
  1204. this.days = days;
  1205. this.hours = hours;
  1206. this.minutes = minutes;
  1207. }
  1208. //============================================================================================
  1209. function todayNow() {
  1210. var today = new Date();
  1211. var todayEpoch = today.getTime() / 1000.0;
  1212. return todayEpoch;
  1213. }
  1214.  
  1215. function convertToDyHrMn(days, hours, minutes) {
  1216. if (hours >= 24) {
  1217. var daysExact = hours / 24;
  1218. var daysTrunc = Math.floor(daysExact);
  1219. var partialDays = daysExact - daysTrunc;
  1220. hours = Math.floor(partialDays * 24);
  1221. days = daysTrunc + days;
  1222. }
  1223. return {
  1224. days,
  1225. hours,
  1226. minutes
  1227. }
  1228. }
  1229.  
  1230. function travelTo(destination){
  1231. }