Advertisement
Guest User

Elemental Arts.js

a guest
Oct 8th, 2016
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 69.67 KB | None | 0 0
  1. (function () {
  2.  
  3. // Elemental Arts v1.0
  4.  
  5. // This mod is the result of a cross between multiple mods, three of which are EzEdit, Monsterparty, and Gumangi Awakens.
  6. // Many of the lines and functions you'll see here were either edited, created, or otherwise copy-pasted from the said sources.
  7. // Credits to original makers. I can never make something original. T-T
  8. // This mod is still in its infancy. There's more to come! :D
  9.  
  10. // ----------------------------------------------------------------------------------------------------- VARIABLES
  11.  
  12. var reqTal;
  13. var reqStr;
  14. var reqStrHol;
  15. var perfSpell = false;
  16. var talcnt;
  17. var setDex;
  18. var setStv;
  19. var setDeh;
  20. var setStr;
  21. var setTal;
  22. var reset = 0;
  23. var nadx;
  24. var nady;
  25. var heaHol;
  26. var deus = 0;
  27. var nope = 0;
  28.  
  29. // ----------------------------------------------------------------------------------------------------- TESTS
  30. // Ignore this section. It's for testing stuff.
  31. // Use the reset button for resetting stats to full.
  32.  
  33. $("#optionswindow").append('<button type="button" id="testing">TEST</button>');
  34.  
  35. $("#optionswindow").on("click", '#testing', function () {
  36. ui.message("tesmes", 'normal');
  37. ui.message("sucmes", 'normal');
  38. });
  39.  
  40. $("#optionswindow").append('<button type="button" id="setting">SET</button>');
  41. $("#optionswindow").on("click", '#setting', function () {
  42. if (reset === 0) {
  43. $("#optionswindow").append('<button type="button" id="resetting">RESET</button>');
  44. reset = 1;
  45. setDex = player.dexterity;
  46. setDeh = player.dehydration;
  47. setStv = player.starvation;
  48. setStr = player.strength;
  49. setTal = player.talent;
  50. } else {
  51. setDex = player.dexterity;
  52. setDeh = player.dehydration;
  53. setStv = player.starvation;
  54. setStr = player.strength;
  55. setTal = player.talent;
  56. }
  57. });
  58.  
  59. $("#optionswindow").on("click", '#resetting', function () {
  60. player.status.bleeding = false;
  61. player.status.burning = false;
  62. player.status.poisoned = false;
  63. player.dexterity = setDex;
  64. player.dehydration = setDeh;
  65. player.starvation = setStv;
  66. player.strength = setStr;
  67. player.talent = setTal;
  68. player.stamina = 999;
  69. player.hunger = 999;
  70. player.thirst = 999;
  71. player.health = 999;
  72. ui.message("resmes", 'normal');
  73. });
  74.  
  75. // ----------------------------------------------------------------------------------------------------- HINTS
  76.  
  77. hints.deusMode = {
  78. name: "Nox Deus Mode",
  79. description: "You have activated your Nox Deus mode! You've gained a tremendous amount of mana at the cost of your life force.<br /><br />The mana surge puts a tremendous strain on your body, forcing you to bleed out of your eyes. The large amount of mana itself will poison you, and the heat produced by it will make you feel like you're on fire. Using this mana for a spell shaves off a tenth of your life force.<br /><br />Warning: Nox Deus mode CAN and WILL kill you if left unchecked! The poison, bleeding, and burning sensation will not stop even after you turn it off. Each spell you cast while in this form will cut your current health by 10%, and permanently reduce your maximum health by 1%"
  80. }
  81. hints.elementalArts = {
  82. name: "Elemental Arts v1.0",
  83. description: "Due to your uncontrollable magic, you were sent to a distant school for young mages. Unfortunately, on the way there, one of your Chaos style spells went haywire, and now you're in this godforsaken place.<br /><br />You realize, however, that this just might be a new opportunity for you: this isolated group of islands is the perfect training grounds!"
  84. }
  85. hints.spellAct = {
  86. name: "Casting Spells",
  87. description: "At first, your spells consume stamina. If you do not have enough stamina, they consume both thirst and hunger. Finally, you have to use your own life force in order to successfully cast the spell. Costs double when casting spells that are beyond your current talent level.<br /><br />Be careful! The spells themselves won't kill you, but they just might weaken you enough for monsters to finish you off!"
  88. }
  89.  
  90. // ----------------------------------------------------------------------------------------------------- DONT TOUCH
  91.  
  92. var saveBlob, saveLink, fileInput;
  93.  
  94. function saveToFile() {
  95. if (!saveLink) {
  96. saveLink = document.createElement("a");
  97. document.body.appendChild(saveLink);
  98. }
  99. // Save game without nullfilter as it makes the game unstable if it keeps running
  100. saveGame(true);
  101. // Avoid saving whole localStorage as it's a privacy risk if playing locally
  102. var data = JSON.stringify({
  103. version: localStorage.getItem('version'),
  104. options: localStorage.getItem('options'),
  105. seeds: localStorage.getItem('seeds'),
  106. player: localStorage.getItem('player'),
  107. crafted: localStorage.getItem('crafted'),
  108. envitems: localStorage.getItem('envitems'),
  109. monsters: localStorage.getItem('monsters'),
  110. tileData: localStorage.getItem('tileData'),
  111. tileitems: localStorage.getItem('tileitems'),
  112. milestoneCount: localStorage.getItem('milestoneCount'),
  113. });
  114. if (window.URL) {
  115. if (saveBlob) window.URL.revokeObjectURL(saveBlob);
  116. saveLink.href = saveBlob = window.URL.createObjectURL(new Blob([data], {
  117. type: 'text/json'
  118. }));
  119. } else {
  120. // Give poor Opera 12 at least some way to save
  121. saveLink.target = "_blank";
  122. saveLink.href = 'data:application/octet-stream;charset=utf-8,' + escape(data);
  123. }
  124. var d = new Date();
  125. saveLink.download = ["Wayward_save_", d.getFullYear(), "_", (101 + d.getMonth() + "").slice(-2), (100 + d.getDate() + "").slice(-2), "_", (100 + d.getHours() + "").slice(-2), (100 + d.getMinutes() + "").slice(-2), (100 + d.getSeconds() + "").slice(-2), ".json"].join("");
  126. saveLink.click();
  127. }
  128.  
  129. function loadFromFile() {
  130. if (!fileInput) {
  131. fileInput = document.createElement("input");
  132. fileInput.type = "file";
  133. fileInput.accept = ".json";
  134. document.body.appendChild(fileInput);
  135. fileInput.addEventListener("change", function (e) {
  136. var reader = new FileReader();
  137. reader.onload = function (evt) {
  138. var result = JSON.parse(evt.target.result);
  139. for (var re in result) localStorage[re] = result[re];
  140. window.onbeforeunload = null;
  141. location.reload();
  142. };
  143. reader.readAsText(e.target.files[0], "ascii");
  144. }, false);
  145. }
  146. fileInput.click();
  147. }
  148.  
  149. // Check if already loaded
  150. if (document.getElementById("saveToFile")) return;
  151.  
  152. // Add buttons to main menu
  153. var saveButton = $('<button type="button" id="saveToFile">Save to file</button>');
  154. saveButton.click(saveToFile);
  155. var loadButton = $('<button type="button" id="loadFromFile">Load from file</button>');
  156. loadButton.click(loadFromFile);
  157. $("#saveAndExit").after(loadButton).after(saveButton).after("<br /><br />");
  158.  
  159. // Increase main menu height accordingly
  160. var gm = $('#gameMenu');
  161. gm.dialog("option", "height", gm.dialog("option", "height") + 80);
  162.  
  163. // ----------------------------------------------------------------------------------------------------- CHECKS
  164. // Checks if the player has enough talent and energy for casting spells.
  165. // This is in representation of spells in fantasy. It's easier to cast spells that you understand, and once you run out of mana, you use your own life force.
  166.  
  167. function spellCheck() {
  168. if (ui.options.hints && !player.hintseen.spellAct) {
  169. ui.hintDisplay("spellAct");
  170. }
  171. reqStrHol = reqStr;
  172. if (player.talent >= reqTal) {
  173. if (player.stamina >= reqStr) {
  174. player.stamina -= reqStr;
  175. perfSpell = true;
  176. } else {
  177. reqStrHol -= player.stamina;
  178. if (player.thirst > reqStrHol && player.hunger > reqStrHol) {
  179. reqStr -= player.stamina;
  180. player.stamina = 1;
  181. player.thirst = reqStr / 2;
  182. player.hunger = reqStr / 2;
  183. perfSpell = true;
  184. } else if (player.thirst <= reqStrHol && player.hunger > reqStrHol) {
  185. reqStrHol -= player.thirst;
  186. if (player.health > reqStrHol) {
  187. reqStr -= player.stamina;
  188. reqStr -= player.thirst;
  189. player.stamina = 1;
  190. player.thirst = 1;
  191. player.hunger -= reqStr / 2;
  192. player.health -= reqStr / 2;
  193. perfSpell = true;
  194. } else {
  195. ui.message("nomanames", 'normal');
  196. }
  197. } else if (player.thirst > reqStrHol && player.hunger <= reqStrHol) {
  198. reqStrHol -= player.hunger;
  199. if (player.health > reqStrHol) {
  200. reqStr -= player.stamina;
  201. reqStr -= player.hunger;
  202. player.stamina = 1;
  203. player.hunger = 1;
  204. player.thirst -= reqStr / 2;
  205. player.health -= reqStr / 2;
  206. perfSpell = true;
  207. } else {
  208. ui.message("nomanames", 'normal');
  209. }
  210. } else if (player.thirst <= reqStrHol && player.hunger <= reqStrHol) {
  211. reqStrHol -= player.thirst;
  212. reqStrHol -= player.hunger;
  213. if (player.health > reqStrHol) {
  214. reqStr -= player.stamina;
  215. reqStr -= player.hunger;
  216. reqStr -= player.thirst;
  217. player.stamina = 1;
  218. player.hunger = 1;
  219. player.thirst = 1;
  220. player.health -= reqStr;
  221. perfSpell = true;
  222. } else {
  223. ui.message("nomanames", 'normal');
  224. }
  225. }
  226. }
  227. } else {
  228. reqStr = reqStr * 2
  229. reqStrHol = reqStr;
  230. if (player.stamina >= reqStr) {
  231. player.stamina -= reqStr;
  232. perfSpell = true;
  233. } else {
  234. reqStrHol -= player.stamina;
  235. if (player.thirst > reqStrHol && player.hunger > reqStrHol) {
  236. reqStr -= player.stamina;
  237. player.stamina = 1;
  238. player.thirst = reqStr / 2;
  239. player.hunger = reqStr / 2;
  240. perfSpell = true;
  241. } else if (player.thirst <= reqStrHol && player.hunger > reqStrHol) {
  242. reqStrHol -= player.thirst;
  243. if (player.health > reqStrHol) {
  244. reqStr -= player.stamina;
  245. reqStr -= player.thirst;
  246. player.stamina = 1;
  247. player.thirst = 1;
  248. player.hunger -= reqStr / 2;
  249. player.health -= reqStr / 2;
  250. perfSpell = true;
  251. } else {
  252. ui.message("nomanames", 'normal');
  253. }
  254. } else if (player.thirst > reqStrHol && player.hunger <= reqStrHol) {
  255. reqStrHol -= player.hunger;
  256. if (player.health > reqStrHol) {
  257. reqStr -= player.stamina;
  258. reqStr -= player.hunger;
  259. player.stamina = 1;
  260. player.hunger = 1;
  261. player.thirst -= reqStr / 2;
  262. player.health -= reqStr / 2;
  263. perfSpell = true;
  264. } else {
  265. ui.message("nomanames", 'normal');
  266. }
  267. } else if (player.thirst <= reqStrHol && player.hunger <= reqStrHol) {
  268. reqStrHol -= player.thirst;
  269. reqStrHol -= player.hunger;
  270. if (player.health > reqStrHol) {
  271. reqStr -= player.stamina;
  272. reqStr -= player.hunger;
  273. reqStr -= player.thirst;
  274. player.stamina = 1;
  275. player.hunger = 1;
  276. player.thirst = 1;
  277. player.health -= reqStr;
  278. perfSpell = true;
  279. } else {
  280. ui.message("nomanames", 'normal');
  281. }
  282. }
  283. }
  284. }
  285. };
  286.  
  287. $("#optionswindow").append('<button type="button" id="deumod">Deus Mode</button>');
  288.  
  289. $("#optionswindow").on("click", '#deumod', function () {
  290. if (deus === 0) {
  291. deus = 1;
  292. ui.message("infmes", 'normal');
  293. player.status.bleeding = true;
  294. player.status.poisoned = true;
  295. player.status.burning = true;
  296. player.strength -= 10;
  297. if (ui.options.hints && !player.hintseen.deusMode) {
  298. ui.hintDisplay("deusMode");
  299. }
  300. } else {
  301. deus = 0;
  302. ui.message("noninfmes", 'normal');
  303. }
  304. });
  305.  
  306. // Activates Nox Deus mode. Basically infinite spellcasting, but at the cost of health.
  307.  
  308. function deusCheck() {
  309. if (deus === 0) {
  310. spellCheck();
  311. } else {
  312. perfSpell = true;
  313. player.status.bleeding = true;
  314. player.status.poisoned = true;
  315. player.status.burning = true;
  316. player.health = (((player.health / 10) - ((player.health % 10) / 10)) * 9);
  317. player.strength = (((player.strength / 100) - ((player.strength % 100) / 100)) * 99);
  318. }
  319. }
  320.  
  321. function postSpell() {
  322. perfSpell = false;
  323. reqTal = 0;
  324. reqStr = 0;
  325. nadx = 0;
  326. nady = 0;
  327. heaHol = 0;
  328. talcnt = 0;
  329. }
  330.  
  331. // Cleanup
  332.  
  333. // ----------------------------------------------------------------------------------------------------- PASSIVES
  334. // Passives do not need to be activated. They can be attributed to the player's (slightly) higher intelligence.
  335.  
  336. if (ui.options.hints && !player.hintseen.elementalArts) {
  337. ui.hintDisplay("elementalArts");
  338. }
  339.  
  340. groups.unrefinediron = {
  341. name: "Unrefined Iron"
  342. }
  343. groups.ironitem = {
  344. name: "Iron Equipment"
  345. }
  346. groups.ironlump = {
  347. name: "Iron Lump"
  348. }
  349.  
  350. items.scrapiron = new Object
  351. items.scrapiron.id = 254
  352. items.scrapiron.x = 58
  353. items.scrapiron.y = 1
  354. items.scrapiron.name = "Scrap Iron"
  355. items.scrapiron.weight = 2
  356. items.scrapiron.recipe = new Object
  357. items.scrapiron.recipe.requires = [["ironitem", 1, 1], ["wroughtironhammer", 1, 0]]
  358. items.scrapiron.recipe.skill = "blacksmithing"
  359. items.scrapiron.recipe.level = "intermediate"
  360. items.scrapiron.recipe.requiredenv = "forgeandanvil_lit"
  361. items.scrapiron.group = ["unrefinediron"]
  362.  
  363. items.ironblob = new Object
  364. items.ironblob.id = 255
  365. items.ironblob.x = 58
  366. items.ironblob.y = 1
  367. items.ironblob.name = "Iron Blob"
  368. items.ironblob.weight = 2
  369. items.ironblob.recipe = new Object
  370. items.ironblob.recipe.requires = [["ironlump", 10, 10], ["wroughtironhammer", 1, 0]]
  371. items.ironblob.recipe.skill = "blacksmithing"
  372. items.ironblob.recipe.level = "intermediate"
  373. items.ironblob.recipe.requiredenv = "forgeandanvil_lit"
  374. items.ironblob.group = ["unrefinediron"]
  375.  
  376. items.ironore.group = ["unrefinediron"]
  377. items.wroughtiron.recipe.requires = [["unrefinediron", 1, 1], ["hammerlike", 1, 0]]
  378. items.wroughtironpickaxe.group = ["ironitem"]
  379. items.wroughtironlockpick.recipe.requires = [["wroughtiron", 1, 0], ["hammerlike", 1, 0]]
  380. items.wroughtirondoubleaxe.group = ["sharpeneditem", "ironitem"]
  381. items.wroughtironshovel.group = ["ironitem"]
  382. items.wroughtironspear.group = ["utensil", "ironitem"]
  383. items.wroughtironhammer.group = ["hammerlike", "repair", "ironitem"]
  384. items.wroughtironshield.group = ["ironitem"]
  385. items.wroughtirongauntlets.group = ["ironitem"]
  386. items.wroughtirongreaves.group = ["ironitem"]
  387. items.wroughtirongorget.group = ["ironitem"]
  388. items.wroughtironhelmet.group = ["ironitem"]
  389. items.wroughtironboots.group = ["ironitem"]
  390. items.wroughtironbreastplate.group = ["ironitem"]
  391. items.wroughtironsword.group = ["sharpeneditem", "ironitem"]
  392. items.wroughtirontongs.group = ["tongs", "utensil", "ironitem"]
  393. items.wroughtironarrowhead.group = ["sharpeneditem", "ironlump"]
  394. items.wroughtironbullet.group = ["bullet", "ironlump"]
  395.  
  396. items.ironbullet.group = ["bullet", "ironlump"]
  397. items.ironarrowhead.group = ["sharpeneditem", "ironlump"]
  398. items.ironpickaxe.group = ["ironitem"]
  399. items.irondoubleaxe.group = ["sharpeneditem", "ironitem"]
  400. items.ironshovel.group = ["ironitem"]
  401. items.ironspear.group = ["utensil", "ironitem"]
  402. items.ironhammer.group = ["hammerlike", "repair", "ironitem"]
  403. items.ironshield.group = ["ironitem"]
  404. items.irongauntlets.group = ["ironitem"]
  405. items.irongreaves.group = ["ironitem"]
  406. items.irongorget.group = ["ironitem"]
  407. items.ironhelmet.group = ["ironitem"]
  408. items.ironboots.group = ["ironitem"]
  409. items.ironbreastplate.group = ["ironitem"]
  410. items.ironsword.group = ["sharpeneditem", "ironitem"]
  411. items.irontongs.group = ["tongs", "utensil", "ironitem"]
  412.  
  413. // Allows reverting unused iron tools into scrap iron. Recycling ftw!
  414.  
  415. items.stick = new Object
  416. items.stick.id = 256
  417. items.stick.x = 10
  418. items.stick.y = 1
  419. items.stick.name = "A Stick"
  420. items.stick.weight = .5
  421. items.stick.durability = 10
  422. items.stick.recipe = new Object
  423. items.stick.recipe.requires = [["log", 1, 1], ["sharpeneditem", 1, 0]]
  424. items.stick.recipe.skill = "woodworking"
  425. items.stick.recipe.level = "simple"
  426. items.stick.group = ["polelike", "utensil"]
  427. items.stick.equip = "held"
  428. items.stick.attack = "held"
  429. items.stick.damageType = ['blunt']
  430. items.stick.use = ["lightItem"]
  431. items.stick.lit = "poletorch_lit"
  432. items.stick.onBurn = "charcoal"
  433.  
  434. // Pet peeve of mine is that you can't chop logs into wooden poles, so I made sticks!
  435.  
  436. items.wroughtironknife = new Object
  437. items.wroughtironknife.id = 257
  438. items.wroughtironknife.x = 45
  439. items.wroughtironknife.y = 3
  440. items.wroughtironknife.name = "A Wroughtiron Knife"
  441. items.wroughtironknife.weight = 1
  442. items.wroughtironknife.durability = 75
  443. items.wroughtironknife.equip = "held"
  444. items.wroughtironknife.attack = 2
  445. items.wroughtironknife.damageType = ['slashing']
  446. items.wroughtironknife.group = ["sharpeneditem", "ironitem"]
  447. items.wroughtironknife.use = ["carve"]
  448. items.wroughtironknife.recipe = new Object
  449. items.wroughtironknife.recipe.requires = [["wroughtiron", 2, 2]]
  450. items.wroughtironknife.recipe.skill = "blacksmithing"
  451. items.wroughtironknife.recipe.level = "simple"
  452. items.wroughtironknife.recipe.requiredenv = "forgeandanvil_lit"
  453.  
  454. items.ironknife = new Object
  455. items.ironknife.id = 258
  456. items.ironknife.x = 45
  457. items.ironknife.y = 3
  458. items.ironknife.name = "An Iron Knife"
  459. items.ironknife.weight = 1.3
  460. items.ironknife.durability = 100
  461. items.ironknife.equip = "held"
  462. items.ironknife.attack = 5
  463. items.ironknife.damageType = ['slashing']
  464. items.ironknife.group = ["sharpeneditem", "ironitem"]
  465. items.ironknife.use = ["carve"]
  466. items.ironknife.recipe = new Object
  467. items.ironknife.recipe.requires = [["ironingot", 2, 2]]
  468. items.ironknife.recipe.skill = "blacksmithing"
  469. items.ironknife.recipe.level = "intermediate"
  470. items.ironknife.recipe.requiredenv = "forgeandanvil_lit"
  471.  
  472. // Sturdier, heavier, more expensive knives. Murica!
  473.  
  474. environmentals.campfire_lit.blockmove = true
  475. environmentals.torchstand_lit.blockmove = true
  476. environmentals.stonewaterstill_lit.blockmove = true
  477.  
  478. // Blocks stepping into some fire environmentals, coz some players (me) are stupid enough to step into them accidentally
  479.  
  480. items.redberries.use.push("plant")
  481. items.redberries.onUse.plant = "bush"
  482. environmentals.bush.spread = 8
  483. environmentals.bush.allowedtiles = ["grass", "dirt", "gravel"]
  484. environmentals.bush.garden = true
  485.  
  486. // Allows berry bushes to be planted
  487.  
  488. environmentals.pineappleplant.garden = true
  489. environmentals.pineappleplant.spread = 8
  490. environmentals.pineappleplant.allowedtiles = ["dirt", "grass", "sand"]
  491. environmentals.pineappleplant.trample = true
  492. items.pineapple.use.push("plant")
  493. items.pineapple.onUse.plant = "pineappleplant"
  494. items.pineapple.skillUse = "botany"
  495.  
  496. // Allows pineapples to be planted
  497.  
  498. items.seaweed.use.push("plant")
  499. items.seaweed.onUse.plant = "seaweed_ground"
  500. environmentals.seaweed_ground.spread = 8
  501. environmentals.seaweed_ground.garden = true
  502.  
  503. // Allows seaweeds to be planted
  504.  
  505. items.nopal.use.push("plant")
  506. items.nopal.onUse.plant = "cactus"
  507. environmentals.cactus.spread = 8
  508. environmentals.cactus.garden = true
  509. environmentals.cactus.allowedtiles = ["dirt", "grass", "sand"]
  510.  
  511. // Allows nopals to be planted
  512.  
  513. items.potion = new Object
  514. items.potion.id = 251
  515. items.potion.name = "Omni Potion"
  516. items.potion.weight = 2
  517. items.potion.use = ["cure"]
  518. items.potion.onUse = new Object
  519. items.potion.onUse.cure = [5, 20, 16, 8]
  520. items.potion.recipe = new Object
  521. items.potion.recipe.requires = [["cookedmeat", 2, 2], ["potablebottle", 1, 1]]
  522. items.potion.recipe.skill = "alchemy"
  523. items.potion.recipe.level = "intermediate"
  524. items.potion.durability = 25
  525. items.potion.returnOnUse = "glassbottle"
  526.  
  527. items.potion2 = new Object
  528. items.potion2.id = 252
  529. items.potion2.name = "Omini Potion"
  530. items.potion2.weight = 2
  531. items.potion2.use = ["cure"]
  532. items.potion2.onUse = new Object
  533. items.potion2.onUse.cure = [5, 15, 8, 8]
  534. items.potion2.recipe = new Object
  535. items.potion2.recipe.requires = [["cookedmeat", 1, 1], ["potablebottle", 1, 1]]
  536. items.potion2.recipe.skill = "alchemy"
  537. items.potion2.recipe.level = "intermediate"
  538. items.potion2.durability = 25
  539. items.potion2.returnOnUse = "glassbottle"
  540.  
  541. // Allows the crafting of two kinds of potions. This is in preparation for a future addition I call "iron man mode"
  542. // The potions are slightly less effective than their respective ingredients, but they don't decay
  543.  
  544. items.saplingseed = new Object
  545. items.saplingseed.id = 253
  546. items.saplingseed.name = "Tree Seed"
  547. items.saplingseed.weight = 2
  548. items.saplingseed.use = ["plant"]
  549. items.saplingseed.onUse = new Object
  550. items.saplingseed.onUse.plant = "sapling_ground"
  551. items.saplingseed.recipe = new Object
  552. items.saplingseed.recipe.requires = [["redberries", 1, 1], ["pileofcompost", 1, 1]]
  553. items.saplingseed.recipe.skill = "botany"
  554. items.saplingseed.recipe.level = "intermediate"
  555. items.saplingseed.durability = 5
  556. environmentals.sapling_ground.spread = 8
  557.  
  558. // Allows crafting of sapling seeds, and the spread of saplings. Let the world be eaten by Mother Nature once again!
  559. // But seriously though, I haven't tested how dangerous the rate of spreading for saplings is, since I made it for barren maps.
  560.  
  561. items.stones.group = ["bullet"]
  562. items.stones.attack = 1
  563. items.stones.damageType = ['blunt']
  564.  
  565. // Allows stones to be loaded as bullets, coz they're just taking up space if you're not planning on making cobblestones
  566.  
  567. environmentals.woodenchest_unlocked.maxWeight = 75 + (75 * ((player.talent / 20000) - ((player.talent % 20000) / 20000)))
  568.  
  569. // Increases wooden chests' storage space by 75 units for each 20000 talent.
  570. // Reload the game every time you get to a multiple of 20000 talent to refresh this code.
  571.  
  572. // ----------------------------------------------------------------------------------------------------- ACTIVES
  573.  
  574. Messages.mokgenmes = "Nature Style Variation: Genesis!";
  575. Messages.mokmanmes = "Nature Style Variation: Manna!";
  576. Messages.moktanmes = "Nature Style Variation: Tangle!";
  577. Messages.chaclumes = "Well, here goes nothing. Chaos Style: Creature Clusterfuck!";
  578. Messages.chaclumesnope = "This caused the ship to sink in the first place. Who knows what kinds of hellspawn will appear in this God-forsaken lands if this spell is used. Well, it might be a different matter if you could harness the power of the night though.";
  579. Messages.chatommes = "Chaos Style Variation: Tombstone!";
  580. Messages.chatomntrmes = "You can't cast that right now.";
  581. Messages.dotfismes = "Earth Style: Fissure!";
  582. Messages.mokfismes = "Nature Style: Fissure!";
  583. Messages.dotsherocmes = "Earth Style: Rock Shield!";
  584. Messages.dotsheiromes = "Earth Style: Pull Iron!";
  585. Messages.dotshecoames = "Earth Style: Pull Coal!";
  586. Messages.dotshetalmes = "Earth Style: Pull Talc!";
  587. Messages.dotshelimmes = "Earth Style: Pull Limestone!";
  588. Messages.mokshemes = "Nature Style: Shield!";
  589. Messages.dotplames = "Earth Style Variation: Planar Cleansing!";
  590. Messages.dotformes = "Earth Style Variation: Fortification!";
  591. Messages.medmes = "Chaos Style: Eyes of the Nox Deus!";
  592. Messages.medalrmes = "The Eyes are already open.";
  593. Messages.enlmes = "The Eyes have closed.";
  594. Messages.enlalrmes = "The Eyes are already closed.";
  595. Messages.suifismes = "Water Style: Fissure!";
  596. Messages.suiravmes = "Water Style: Ravine!";
  597. Messages.suilakmes = "Water Style Variation: Lake!";
  598. Messages.suicovmes = "Water Style Variation: Sea!";
  599. Messages.chasummes = "Chaos Style: Summon Creature!";
  600. Messages.tesmes = "Test activated.";
  601. Messages.resmes = "Status reset.";
  602. Messages.recmes = "Chaos Style: Dynamic Reconstitution!";
  603. Messages.nomanames = "Too weak to cast this spell right now.";
  604. Messages.sucmes = "Activation success.";
  605. Messages.infmes = "Status: Nox Deus";
  606. Messages.noninfmes = "Status: Magus";
  607. Messages.casfaimes = "Spell casting failed.";
  608. Messages.chaheames = "Heal!";
  609. Messages.chacurmes = "Cure!";
  610. Messages.chaheaparmes = "You are exhausted, so you have gained only some of your health back.";
  611. Messages.chaheanopmes = "You are already at maximum health.";
  612. Messages.chaheafulmes = "You have fully healed yourself.";
  613. Messages.recfaimes = "You do not understand this spell yet.";
  614. Messages.deunopmes = "Curing yourself does not work while in Nox Deus form!";
  615.  
  616.  
  617. // Ignore the cheesy lines. It's got something to do with the mod's backstory.
  618.  
  619. $("#optionswindow").append('<button type="button" id="dotfisr">Fissure R</button>'); // "Fissure right", 6 rock tiles in a straight line to the right
  620. $("#optionswindow").append('<button type="button" id="dotfisl">Fissure L</button>'); // "Fissure left"
  621. $("#optionswindow").append('<button type="button" id="dotfisu">Fissure U</button>'); // "Fissure up"
  622. $("#optionswindow").append('<button type="button" id="dotfisd">Fissure D</button>'); // "Fissure down"
  623. $("#optionswindow").append('<button type="button" id="dotsherocs">Shield S</button>'); // "Shield small", hollow 3x3 rock tiles around the player
  624. $("#optionswindow").append('<button type="button" id="dotsherocl">Shield L</button>'); // "Shield large", hollow 5x5
  625. $("#optionswindow").append('<button type="button" id="dotshecoa">Coal</button>'); // Creates 2 walls of coalrock tiles to the sides of the player
  626. $("#optionswindow").append('<button type="button" id="dotsheiro">Iron</button>'); // ironrock tiles
  627. $("#optionswindow").append('<button type="button" id="dotshetal">Talc</button>'); // talcrock tiles
  628. $("#optionswindow").append('<button type="button" id="dotshelim">Limestone</button>'); // limestone tiles
  629. $("#optionswindow").append('<button type="button" id="dotpla">Plane</button>'); // Changes the tiles around the player into grass tiles, 7x7. Works even in the middle of the ocean.
  630. $("#optionswindow").append('<button type="button" id="dotfor">Fort</button>'); // Creates a 9x9 house around the player. Works well with planar cleansing if you want a walled garden.
  631. $("#optionswindow").append('<button type="button" id="mokshes">TShield S</button>'); // "Tree shield small"
  632. $("#optionswindow").append('<button type="button" id="mokshel">TShield L</button>'); // "Tree shield large"
  633. $("#optionswindow").append('<button type="button" id="mokfisr">TFissure R</button>'); // "Tree fissure right"
  634. $("#optionswindow").append('<button type="button" id="mokfisl">TFissure L</button>');
  635. $("#optionswindow").append('<button type="button" id="mokfisu">TFissure U</button>');
  636. $("#optionswindow").append('<button type="button" id="mokfisd">TFissure D</button>');
  637. $("#optionswindow").append('<button type="button" id="mokman">Manna</button>');
  638. $("#optionswindow").append('<button type="button" id="moktan">Tangle</button>');
  639. $("#optionswindow").append('<button type="button" id="mokgen">Genesis</button>'); // Creates an 11x11 forest around the player. Each layer is different.
  640. $("#optionswindow").append('<button type="button" id="suifisr">FWFissure R</button>'); // "Fresh water fissure right"
  641. $("#optionswindow").append('<button type="button" id="suifisl">FWFissure L</button>');
  642. $("#optionswindow").append('<button type="button" id="suifisu">FWFissure U</button>');
  643. $("#optionswindow").append('<button type="button" id="suifisd">FWFissure D</button>');
  644. $("#optionswindow").append('<button type="button" id="suiravr">SWRavine R</button>'); // "Salt water ravine right", same with fissure but with salt water
  645. $("#optionswindow").append('<button type="button" id="suiravl">SWRavine L</button>');
  646. $("#optionswindow").append('<button type="button" id="suiravu">SWRavine U</button>');
  647. $("#optionswindow").append('<button type="button" id="suiravd">SWRavine D</button>');
  648. $("#optionswindow").append('<button type="button" id="suilak">FWLake</button>'); // "Fresh water lake", 'nuff said.
  649. $("#optionswindow").append('<button type="button" id="suicov">SWCove</button>'); // "Salt water cove", same as the lake but with salt water
  650. $("#optionswindow").append('<button type="button" id="chaclu">Clusterfuck</button>'); // Monsterparty aka iron man mode #11. Can only be turned on when in Nox Deus mode.
  651. $("#optionswindow").append('<button type="button" id="chatom">Tombstone</button>'); // Turns the monster you are facing into Living Rock
  652. $("#optionswindow").append('<button type="button" id="chicken">Chicken</button>'); // Normal summon in face-up attack position
  653. $("#optionswindow").append('<button type="button" id="bear">Bear</button>'); // Green vanilla creature, with power 2, toughness 2, usually dropped for 1G
  654. $("#optionswindow").append('<button type="button" id="kraken">Kraken</button>'); // "Have you finished those errands?"
  655. $("#optionswindow").append('<button type="button" id="recsta">Stamina</button>'); // Increase stats depending on the amount of talent, but costs more depending on the amount of stats increased. Fails if talent is too low. Costs are not affected by Deus Mode.
  656. $("#optionswindow").append('<button type="button" id="recstr">HP</button>');
  657. $("#optionswindow").append('<button type="button" id="rechun">Fill</button>');
  658. $("#optionswindow").append('<button type="button" id="rechyd">Hydration</button>');
  659. $("#optionswindow").append('<button type="button" id="showMap">Eyes Open</button>'); // Sends a satellite to space
  660. $("#optionswindow").append('<button type="button" id="closeMap">Eyes Closed</button>'); // temporarily disables satellite
  661. $("#optionswindow").append('<button type="button" id="chahea">Heal</button>'); // Exchanges stamina for HP. Costs are not affected by Deus Mode.
  662. $("#optionswindow").append('<button type="button" id="chacur">Cure</button>'); // Removes status debuffs (bleeding, poison, burning), one at a time, in that order
  663.  
  664. // The names have a reason. It helps me remember what one does.
  665.  
  666. $("#optionswindow").on("click", '#chahea', function () {
  667. heaHol = player.strength - player.health;
  668. ui.message("chaheames", 'normal');
  669. if (heaHol === 0) {
  670. postSpell();
  671. ui.message("chaheanopmes", 'good');
  672. } else if (heaHol <= player.stamina) {
  673. player.stamina -= heaHol;
  674. player.health += heaHol;
  675. postSpell();
  676. ui.message("chaheafulmes", 'good');
  677. } else {
  678. player.strength += player.stamina;
  679. player.stamina = 0;
  680. postSpell();
  681. ui.message("chaheaparmes", 'good');
  682. }
  683. postSpell();
  684. });
  685.  
  686. $("#optionswindow").on("click", '#recsta', function () {
  687. talcnt = (player.talent / 5000) - ((player.talent % 5000) / 5000);
  688. reqStr = talcnt * 15;
  689. reqTal = 10000;
  690. if (player.talent >= 5000) {
  691. spellCheck();
  692. if (perfSpell === true) {
  693. player.dexterity += talcnt;
  694. ui.message("recmes", 'normal');
  695. ui.message("dexterityGain", 'normal');
  696. } else {
  697. ui.message("casfaimes", 'normal');
  698. }
  699. } else {
  700. ui.message("recfaimes", 'normal');
  701. }
  702. postSpell();
  703. });
  704.  
  705. $("#optionswindow").on("click", '#recstr', function () {
  706. talcnt = (player.talent / 7500) - ((player.talent % 7500) / 7500);
  707. reqStr = talcnt * 20;
  708. reqTal = 10000;
  709. if (player.talent >= 7500) {
  710. spellCheck();
  711. if (perfSpell === true) {
  712. player.strength += talcnt;
  713. ui.message("recmes", 'normal');
  714. ui.message("strengthGain", 'normal');
  715. } else {
  716. ui.message("casfaimes", 'normal');
  717. }
  718. } else {
  719. ui.message("recfaimes", 'normal');
  720. }
  721. postSpell();
  722. });
  723.  
  724. $("#optionswindow").on("click", '#rechun', function () {
  725. talcnt = (player.talent / 10000) - ((player.talent % 10000) / 10000);
  726. reqStr = talcnt * 40;
  727. reqTal = 15000;
  728. if (player.talent >= 10000) {
  729. spellCheck();
  730. if (perfSpell === true) {
  731. player.starvation += talcnt;
  732. ui.message("recmes", 'normal');
  733. ui.message("metabolismGain", 'normal');
  734. } else {
  735. ui.message("casfaimes", 'normal');
  736. }
  737. } else {
  738. ui.message("recfaimes", 'normal');
  739. }
  740. postSpell();
  741. });
  742.  
  743. $("#optionswindow").on("click", '#rechyd', function () {
  744. talcnt = (player.talent / 10000) - ((player.talent % 10000) / 10000);
  745. reqStr = talcnt * 40;
  746. reqTal = 15000;
  747. if (player.talent >= 10000) {
  748. spellCheck();
  749. if (perfSpell === true) {
  750. player.dehydration += talcnt;
  751. ui.message("recmes", 'normal');
  752. ui.message("metabolismGain", 'normal');
  753. } else {
  754. ui.message("casfaimes", 'normal');
  755. }
  756. } else {
  757. ui.message("recfaimes", 'normal');
  758. }
  759. postSpell();
  760. });
  761.  
  762. $("#optionswindow").on("click", '#chacur', function () {
  763. if (player.status.bleeding) {
  764. player.status.bleeding = false;
  765. ui.message('curedBleeding', 'good');
  766. if (deus === 1) {
  767. ui.message("deunopmes", 'bad');
  768. player.status.bleeding = true;
  769. }
  770. } else if (player.status.poisoned) {
  771. player.status.poisoned = false;
  772. ui.message('curedPoison', 'good');
  773. if (deus === 1) {
  774. ui.message("deunopmes", 'bad');
  775. player.status.poisoned = true;
  776. }
  777. } else if (player.status.burning) {
  778. player.status.burning = false;
  779. ui.message('curedBurning', 'good');
  780. if (deus === 1) {
  781. ui.message("deunopmes", 'bad');
  782. player.status.burning = true;
  783. }
  784. } else {
  785. ui.message('casfaimes', 'normal');
  786. }
  787. });
  788.  
  789. $("#optionswindow").on("click", '#chicken', function () {
  790. reqTal = 0;
  791. reqStr = 30;
  792. deusCheck();
  793. if (perfSpell === true) {
  794. spawnMonster("chicken", player.x + 2, player.y);
  795. ui.message("chasummes", 'normal');
  796. } else {
  797. ui.message("casfaimes", 'normal');
  798. }
  799. postSpell();
  800. });
  801.  
  802. $("#optionswindow").on("click", '#bear', function () {
  803. reqTal = 1000;
  804. reqStr = 75;
  805. deusCheck();
  806. if (perfSpell === true) {
  807. spawnMonster("bear", player.x + 2, player.y);
  808. ui.message("chasummes", 'normal');
  809. } else {
  810. ui.message("casfaimes", 'normal');
  811. }
  812. postSpell();
  813. });
  814.  
  815. $("#optionswindow").on("click", '#kraken', function () {
  816. reqTal = 5000;
  817. reqStr = 100;
  818. deusCheck();
  819. if (perfSpell === true) {
  820. spawnMonster("kraken", player.x + 2, player.y);
  821. ui.message("chasummes", 'normal');
  822. } else {
  823. ui.message("casfaimes", 'normal');
  824. }
  825. postSpell();
  826. });
  827.  
  828. $("#optionswindow").on("click", '#chatom', function () {
  829. reqTal = 10000;
  830. reqStr = 80;
  831. deusCheck();
  832. if (perfSpell === true) {
  833. try {
  834. var monsterId = tile[player.x + player.direction.x][player.y + player.direction.y].monster;
  835. deleteMonsters(monsterId);
  836. spawnMonster("livingrock", player.x + player.direction.x, player.y + player.direction.y);
  837. ui.message("chatommes", 'normal');
  838. }
  839. catch (error) {
  840. ui.message("casfaimes", 'normal');
  841. }
  842. } else {
  843. ui.message("casfaimes", 'normal');
  844. }
  845. postSpell();
  846. });
  847.  
  848. $("#optionswindow").on("click", '#chaclu', function () {
  849. if (deus !== 1) {
  850. ui.message("chaclumesnope", 'bad');
  851. } else {
  852. reqTal = 25000;
  853. reqStr = 500;
  854. spellCheck();
  855. if (perfSpell === true) {
  856. var monsterSpawned = 0;
  857. for (var i = 0; i < 100; i++) {
  858. var monsterX = 0;
  859. var monsterY = 0;
  860. monsterX = Math.floor(Math.random() * 80 + player.x - 40);
  861. monsterY = Math.floor(Math.random() * 80 + player.y - 40);
  862. if (tile[monsterX] && tile[monsterX][monsterY] && tiletypes[tile[monsterX][monsterY].type].water) {
  863. if (spawnMonster("water", monsterX, monsterY)) {
  864. monsterSpawned++;
  865. }
  866. } else if (tile[monsterX] && tile[monsterX][monsterY]) {
  867. if (spawnMonster("", monsterX, monsterY)) {
  868. monsterSpawned++;
  869. }
  870. }
  871. }
  872. ui.message("chaclumes", 'normal');
  873. passturn();
  874. } else {
  875. ui.message("casfaimes", 'normal');
  876. }
  877. }
  878. });
  879.  
  880. $("#optionswindow").on("click", '#mokfisr', function () {
  881. reqTal = 0;
  882. reqStr = 35;
  883. deusCheck();
  884. if (perfSpell === true) {
  885. ui.message("mokfismes", 'normal');
  886. nadx = 1;
  887. while (nadx <= 7) {
  888. changeTile({
  889. type: "forest"
  890. }, player.x + 1 + nadx, player.y);
  891. nadx++;
  892. }
  893. } else {
  894. ui.message("casfaimes", 'normal');
  895. }
  896. });
  897.  
  898. $("#optionswindow").on("click", '#mokfisl', function () {
  899. reqTal = 0;
  900. reqStr = 35;
  901. deusCheck();
  902. if (perfSpell === true) {
  903. ui.message("mokfismes", 'normal');
  904. nadx = 1;
  905. while (nadx <= 7) {
  906. changeTile({
  907. type: "forest"
  908. }, player.x - (1 + nadx), player.y);
  909. nadx++;
  910. }
  911. } else {
  912. ui.message("casfaimes", 'normal');
  913. }
  914. });
  915.  
  916. $("#optionswindow").on("click", '#mokfisu', function () {
  917. reqTal = 0;
  918. reqStr = 35;
  919. deusCheck();
  920. if (perfSpell === true) {
  921. ui.message("mokfismes", 'normal');
  922. nadx = 1;
  923. while (nadx <= 7) {
  924. changeTile({
  925. type: "forest"
  926. }, player.x, player.y - (1 + nadx));
  927. nadx++;
  928. }
  929. } else {
  930. ui.message("casfaimes", 'normal');
  931. }
  932. });
  933.  
  934. $("#optionswindow").on("click", '#mokfisd', function () {
  935. reqTal = 0;
  936. reqStr = 35;
  937. deusCheck();
  938. if (perfSpell === true) {
  939. ui.message("mokfismes", 'normal');
  940. nadx = 1;
  941. while (nadx <= 7) {
  942. changeTile({
  943. type: "forest"
  944. }, player.x, player.y + 1 + nadx);
  945. nadx++;
  946. }
  947. } else {
  948. ui.message("casfaimes", 'normal');
  949. }
  950. });
  951.  
  952. $("#optionswindow").on("click", '#showMap', function () {
  953. reqTal = 0;
  954. reqStr = 1;
  955. if (nope === 0) {
  956. deusCheck();
  957. if (perfSpell === true) {
  958. $("#map").show();
  959. ui.message("medmes", 'normal');
  960. player.status.bleeding = true;
  961. nope = 1;
  962. } else {
  963. ui.message("casfaimes", 'normal');
  964. }
  965. } else {
  966. ui.message("medalrmes", 'normal');
  967. }
  968. });
  969.  
  970. $("#optionswindow").on("click", '#closeMap', function () {
  971. if (nope === 1) {
  972. $("#map").hide();
  973. ui.message("enlmes", 'normal');
  974. player.status.bleeding = false;
  975. nope = 0;
  976. } else {
  977. ui.message("enlalrmes", 'normal');
  978. }
  979. });
  980.  
  981. $("#optionswindow").on("click", '#dotfor', function () {
  982. reqTal = 0;
  983. reqStr = 150;
  984. deusCheck();
  985. if (perfSpell === true) {
  986. ui.message("dotformes", 'normal');
  987. var nadx = -3;
  988. var nady = -3;
  989. while (nady <= 3) {
  990. nadx = -3;
  991. while (nadx <= 3) {
  992. changeTile({
  993. type: "woodenfloor"
  994. }, player.x + nadx, player.y + nady);
  995. nadx++;
  996. }
  997. nady++;
  998. }
  999. changeTile({
  1000. type: "woodendoor"
  1001. }, player.x - 2, player.y - 4);
  1002. changeTile({
  1003. type: "woodendoor"
  1004. }, player.x + 2, player.y - 4);
  1005. changeTile({
  1006. type: "woodendoor"
  1007. }, player.x - 4, player.y - 2);
  1008. changeTile({
  1009. type: "woodendoor"
  1010. }, player.x + 4, player.y - 2);
  1011. changeTile({
  1012. type: "woodendoor"
  1013. }, player.x - 4, player.y + 2);
  1014. changeTile({
  1015. type: "woodendoor"
  1016. }, player.x + 4, player.y + 2);
  1017. changeTile({
  1018. type: "woodendoor"
  1019. }, player.x - 2, player.y + 4);
  1020. changeTile({
  1021. type: "woodendoor"
  1022. }, player.x + 2, player.y + 4);
  1023. changeTile({
  1024. type: "stonewall"
  1025. }, player.x - 4, player.y - 4);
  1026. changeTile({
  1027. type: "stonewall"
  1028. }, player.x - 3, player.y - 4);
  1029. changeTile({
  1030. type: "stonewall"
  1031. }, player.x - 1, player.y - 4);
  1032. changeTile({
  1033. type: "stonewall"
  1034. }, player.x, player.y - 4);
  1035. changeTile({
  1036. type: "stonewall"
  1037. }, player.x + 1, player.y - 4);
  1038. changeTile({
  1039. type: "stonewall"
  1040. }, player.x + 3, player.y - 4);
  1041. changeTile({
  1042. type: "stonewall"
  1043. }, player.x + 4, player.y - 4);
  1044. changeTile({
  1045. type: "stonewall"
  1046. }, player.x - 4, player.y - 3);
  1047. changeTile({
  1048. type: "stonewall"
  1049. }, player.x + 4, player.y - 3);
  1050. changeTile({
  1051. type: "stonewall"
  1052. }, player.x - 4, player.y - 1);
  1053. changeTile({
  1054. type: "stonewall"
  1055. }, player.x + 4, player.y - 1);
  1056. changeTile({
  1057. type: "stonewall"
  1058. }, player.x - 4, player.y);
  1059. changeTile({
  1060. type: "stonewall"
  1061. }, player.x + 4, player.y);
  1062. changeTile({
  1063. type: "stonewall"
  1064. }, player.x - 4, player.y + 1);
  1065. changeTile({
  1066. type: "stonewall"
  1067. }, player.x + 4, player.y + 1);
  1068. changeTile({
  1069. type: "stonewall"
  1070. }, player.x - 4, player.y + 3);
  1071. changeTile({
  1072. type: "stonewall"
  1073. }, player.x + 4, player.y + 3);
  1074. changeTile({
  1075. type: "stonewall"
  1076. }, player.x - 4, player.y + 4);
  1077. changeTile({
  1078. type: "stonewall"
  1079. }, player.x - 3, player.y + 4);
  1080. changeTile({
  1081. type: "stonewall"
  1082. }, player.x - 1, player.y + 4);
  1083. changeTile({
  1084. type: "stonewall"
  1085. }, player.x, player.y + 4);
  1086. changeTile({
  1087. type: "stonewall"
  1088. }, player.x + 1, player.y + 4);
  1089. changeTile({
  1090. type: "stonewall"
  1091. }, player.x + 3, player.y + 4);
  1092. changeTile({
  1093. type: "stonewall"
  1094. }, player.x + 4, player.y + 4);
  1095. } else {
  1096. ui.message("casfaimes", 'normal');
  1097. }
  1098. postSpell();
  1099. });
  1100.  
  1101. $("#optionswindow").on("click", '#dotpla', function () {
  1102. reqTal = 0;
  1103. reqStr = 50;
  1104. deusCheck();
  1105. if (perfSpell === true) {
  1106. ui.message("dotplames", 'normal');
  1107. var nadx = -3;
  1108. var nady = -3;
  1109. while (nady <= 3) {
  1110. nadx = -3;
  1111. while (nadx <= 3) {
  1112. changeTile({
  1113. type: "grass"
  1114. }, player.x + nadx, player.y + nady);
  1115. nadx++;
  1116. }
  1117. nady++;
  1118. }
  1119. } else {
  1120. ui.message("casfaimes", 'normal');
  1121. }
  1122. postSpell();
  1123. });
  1124.  
  1125. $("#optionswindow").on("click", '#dotsherocs', function () {
  1126. reqTal = 0;
  1127. reqStr = 40;
  1128. ui.message("dotsherocmes", 'normal');
  1129. deusCheck();
  1130. if (perfSpell === true) {
  1131. var nadx = -1;
  1132. var nady = -1;
  1133. while (nady <= 1) {
  1134. nadx = -1;
  1135. while (nadx <= 1) {
  1136. if (nady === -1 || nady === 1) {
  1137. changeTile({
  1138. type: "rock"
  1139. }, player.x + nadx, player.y + nady);
  1140. nadx++;
  1141. } else {
  1142. if (nadx === -1 || nadx === 1) {
  1143. changeTile({
  1144. type: "rock"
  1145. }, player.x + nadx, player.y + nady);
  1146. nadx++;
  1147. } else {
  1148. nadx++;
  1149. }
  1150. }
  1151. }
  1152. nady++;
  1153. }
  1154. } else {
  1155. ui.message("casfaimes", 'normal');
  1156. }
  1157. postSpell();
  1158. });
  1159.  
  1160. $("#optionswindow").on("click", '#dotsherocl', function () {
  1161. reqTal = 500;
  1162. reqStr = 80;
  1163. deusCheck();
  1164. if (perfSpell === true) {
  1165. ui.message("dotsherocmes", 'normal');
  1166. var nadx = -2;
  1167. var nady = -2;
  1168. while (nady <= 2) {
  1169. nadx = -2;
  1170. while (nadx <= 2) {
  1171. if (nady === -2 || nady === 2) {
  1172. changeTile({
  1173. type: "rock"
  1174. }, player.x + nadx, player.y + nady);
  1175. nadx++;
  1176. } else {
  1177. if (nadx === -2 || nadx === 2) {
  1178. changeTile({
  1179. type: "rock"
  1180. }, player.x + nadx, player.y + nady);
  1181. nadx++;
  1182. } else {
  1183. nadx++;
  1184. }
  1185. }
  1186. }
  1187. nady++;
  1188. }
  1189. } else {
  1190. ui.message("casfaimes", 'normal');
  1191. }
  1192. postSpell();
  1193. });
  1194.  
  1195. $("#optionswindow").on("click", '#dotshecoa', function () {
  1196. reqTal = 5000;
  1197. reqStr = 150;
  1198. deusCheck();
  1199. if (perfSpell === true) {
  1200. ui.message("dotshecoames", 'normal');
  1201. var nadx = -2;
  1202. var nady = -2;
  1203. while (nady <= 2) {
  1204. nadx = -2;
  1205. while (nadx <= 2) {
  1206. if (nadx !== 0) {
  1207. changeTile({
  1208. type: "coalrock"
  1209. }, player.x + nadx, player.y + nady);
  1210. nadx++;
  1211. } else {
  1212. nadx++;
  1213. }
  1214. }
  1215. nady++;
  1216. }
  1217. } else {
  1218. ui.message("casfaimes", 'normal');
  1219. }
  1220. postSpell();
  1221. });
  1222.  
  1223. $("#optionswindow").on("click", '#dotsheiro', function () {
  1224. reqTal = 12500;
  1225. reqStr = 200;
  1226. deusCheck();
  1227. if (perfSpell === true) {
  1228. ui.message("dotsheiromes", 'normal');
  1229. var nadx = -2;
  1230. var nady = -2;
  1231. while (nady <= 2) {
  1232. nadx = -2;
  1233. while (nadx <= 2) {
  1234. if (nadx !== 0) {
  1235. changeTile({
  1236. type: "ironrock"
  1237. }, player.x + nadx, player.y + nady);
  1238. nadx++;
  1239. } else {
  1240. nadx++;
  1241. }
  1242. }
  1243. nady++;
  1244. }
  1245. } else {
  1246. ui.message("casfaimes", 'normal');
  1247. }
  1248. postSpell();
  1249. });
  1250.  
  1251. $("#optionswindow").on("click", '#dotfisr', function () {
  1252. reqTal = 0;
  1253. reqStr = 35;
  1254. deusCheck();
  1255. if (perfSpell === true) {
  1256. ui.message("dotfismes", 'normal');
  1257. nadx = 1;
  1258. while (nadx <= 7) {
  1259. changeTile({
  1260. type: "rock"
  1261. }, player.x + 1 + nadx, player.y);
  1262. nadx++;
  1263. }
  1264. } else {
  1265. ui.message("casfaimes", 'normal');
  1266. }
  1267. postSpell();
  1268. });
  1269.  
  1270. $("#optionswindow").on("click", '#dotfisl', function () {
  1271. reqTal = 0;
  1272. reqStr = 35;
  1273. deusCheck();
  1274. if (perfSpell === true) {
  1275. ui.message("dotfismes", 'normal');
  1276. nadx = 1;
  1277. while (nadx <= 7) {
  1278. changeTile({
  1279. type: "rock"
  1280. }, player.x - (1 + nadx), player.y);
  1281. nadx++;
  1282. }
  1283. } else {
  1284. ui.message("casfaimes", 'normal');
  1285. }
  1286. postSpell();
  1287. });
  1288.  
  1289. $("#optionswindow").on("click", '#dotfisu', function () {
  1290. reqTal = 0;
  1291. reqStr = 35;
  1292. deusCheck();
  1293. if (perfSpell === true) {
  1294. ui.message("dotfismes", 'normal');
  1295. nadx = 1;
  1296. while (nadx <= 7) {
  1297. changeTile({
  1298. type: "rock"
  1299. }, player.x, player.y - (1 + nadx));
  1300. nadx++;
  1301. }
  1302. } else {
  1303. ui.message("casfaimes", 'normal');
  1304. }
  1305. postSpell();
  1306. });
  1307.  
  1308. $("#optionswindow").on("click", '#dotfisd', function () {
  1309. reqTal = 0;
  1310. reqStr = 35;
  1311. deusCheck();
  1312. if (perfSpell === true) {
  1313. ui.message("dotfismes", 'normal');
  1314. nadx = 1;
  1315. while (nadx <= 7) {
  1316. changeTile({
  1317. type: "rock"
  1318. }, player.x, player.y + 1 + nadx);
  1319. nadx++;
  1320. }
  1321. } else {
  1322. ui.message("casfaimes", 'normal');
  1323. }
  1324. postSpell();
  1325. });
  1326.  
  1327. $("#optionswindow").on("click", '#mokshes', function () {
  1328. reqTal = 0;
  1329. reqStr = 40;
  1330. deusCheck();
  1331. if (perfSpell === true) {
  1332. ui.message("mokshemes", 'normal');
  1333. var nadx = -1;
  1334. var nady = -1;
  1335. while (nady <= 1) {
  1336. nadx = -1;
  1337. while (nadx <= 1) {
  1338. if (nady === -1 || nady === 1) {
  1339. changeTile({
  1340. type: "forest"
  1341. }, player.x + nadx, player.y + nady);
  1342. nadx++;
  1343. } else {
  1344. if (nadx === -1 || nadx === 1) {
  1345. changeTile({
  1346. type: "forest"
  1347. }, player.x + nadx, player.y + nady);
  1348. nadx++;
  1349. } else {
  1350. nadx++;
  1351. }
  1352. }
  1353. }
  1354. nady++;
  1355. }
  1356. } else {
  1357. ui.message("casfaimes", 'normal');
  1358. }
  1359. postSpell();
  1360. });
  1361.  
  1362. $("#optionswindow").on("click", '#mokshel', function () {
  1363. reqTal = 500;
  1364. reqStr = 80;
  1365. deusCheck();
  1366. if (perfSpell === true) {
  1367. ui.message("mokshemes", 'normal');
  1368. var nadx = -2;
  1369. var nady = -2;
  1370. while (nady <= 2) {
  1371. nadx = -2;
  1372. while (nadx <= 2) {
  1373. if (nady === -2 || nady === 2) {
  1374. changeTile({
  1375. type: "forest"
  1376. }, player.x + nadx, player.y + nady);
  1377. nadx++;
  1378. } else {
  1379. if (nadx === -2 || nadx === 2) {
  1380. changeTile({
  1381. type: "forest"
  1382. }, player.x + nadx, player.y + nady);
  1383. nadx++;
  1384. } else {
  1385. nadx++;
  1386. }
  1387. }
  1388. }
  1389. nady++;
  1390. }
  1391. } else {
  1392. ui.message("casfaimes", 'normal');
  1393. }
  1394. postSpell();
  1395. });
  1396.  
  1397. $("#optionswindow").on("click", '#mokgen', function () {
  1398. reqTal = 15000;
  1399. reqStr = 400;
  1400. deusCheck();
  1401. if (perfSpell === true) {
  1402. ui.message("mokgenmes", 'normal');
  1403. var nadx = -1;
  1404. var nady = -1;
  1405. while (nady <= 1) {
  1406. nadx = -1;
  1407. while (nadx <= 1) {
  1408. if (nady === -1 || nady === 1) {
  1409. changeTile({
  1410. type: "coconutpalm"
  1411. }, player.x + nadx, player.y + nady);
  1412. nadx++;
  1413. } else {
  1414. if (nadx === -1 || nadx === 1) {
  1415. changeTile({
  1416. type: "coconutpalm"
  1417. }, player.x + nadx, player.y + nady);
  1418. nadx++;
  1419. } else {
  1420. nadx++;
  1421. }
  1422. }
  1423. }
  1424. nady++;
  1425. }
  1426. var nadx = -2;
  1427. var nady = -2;
  1428. while (nady <= 2) {
  1429. nadx = -2;
  1430. while (nadx <= 2) {
  1431. if (nady === -2 || nady === 2) {
  1432. changeTile({
  1433. type: "palm"
  1434. }, player.x + nadx, player.y + nady);
  1435. nadx++;
  1436. } else {
  1437. if (nadx === -2 || nadx === 2) {
  1438. changeTile({
  1439. type: "palm"
  1440. }, player.x + nadx, player.y + nady);
  1441. nadx++;
  1442. } else {
  1443. nadx++;
  1444. }
  1445. }
  1446. }
  1447. nady++;
  1448. }
  1449. var nadx = -3;
  1450. var nady = -3;
  1451. while (nady <= 3) {
  1452. nadx = -3;
  1453. while (nadx <= 3) {
  1454. if (nady === -3 || nady === 3) {
  1455. changeTile({
  1456. type: "berryforest"
  1457. }, player.x + nadx, player.y + nady);
  1458. nadx++;
  1459. } else {
  1460. if (nadx === -3 || nadx === 3) {
  1461. changeTile({
  1462. type: "berryforest"
  1463. }, player.x + nadx, player.y + nady);
  1464. nadx++;
  1465. } else {
  1466. nadx++;
  1467. }
  1468. }
  1469. }
  1470. nady++;
  1471. }
  1472. var nadx = -4;
  1473. var nady = -4;
  1474. while (nady <= 4) {
  1475. nadx = -4;
  1476. while (nadx <= 4) {
  1477. if (nady === -4 || nady === 4) {
  1478. changeTile({
  1479. type: "vineforest"
  1480. }, player.x + nadx, player.y + nady);
  1481. nadx++;
  1482. } else {
  1483. if (nadx === -4 || nadx === 4) {
  1484. changeTile({
  1485. type: "vineforest"
  1486. }, player.x + nadx, player.y + nady);
  1487. nadx++;
  1488. } else {
  1489. nadx++;
  1490. }
  1491. }
  1492. }
  1493. nady++;
  1494. }
  1495. var nadx = -5;
  1496. var nady = -5;
  1497. while (nady <= 5) {
  1498. nadx = -5;
  1499. while (nadx <= 5) {
  1500. if (nady === -5 || nady === 5) {
  1501. changeTile({
  1502. type: "forest"
  1503. }, player.x + nadx, player.y + nady);
  1504. nadx++;
  1505. } else {
  1506. if (nadx === -5 || nadx === 5) {
  1507. changeTile({
  1508. type: "forest"
  1509. }, player.x + nadx, player.y + nady);
  1510. nadx++;
  1511. } else {
  1512. nadx++;
  1513. }
  1514. }
  1515. }
  1516. nady++;
  1517. }
  1518. nadx = 1;
  1519. while (nadx <= 5) {
  1520. changeTile({
  1521. type: "grass"
  1522. }, player.x, player.y + nadx);
  1523. nadx++;
  1524. }
  1525. } else {
  1526. ui.message("casfaimes", 'normal');
  1527. }
  1528. postSpell();
  1529. });
  1530.  
  1531. $("#optionswindow").on("click", '#mokman', function () {
  1532. reqTal = 500;
  1533. reqStr = 120;
  1534. deusCheck();
  1535. if (perfSpell === true) {
  1536. ui.message("mokmanmes", 'normal');
  1537. var nadx = -2;
  1538. var nady = -2;
  1539. while (nady <= 2) {
  1540. nadx = -2;
  1541. while (nadx <= 2) {
  1542. if (nadx !== 0) {
  1543. changeTile({
  1544. type: "berryforest"
  1545. }, player.x + nadx, player.y + nady);
  1546. nadx++;
  1547. } else {
  1548. nadx++;
  1549. }
  1550. }
  1551. nady++;
  1552. }
  1553. } else {
  1554. ui.message("casfaimes", 'normal');
  1555. }
  1556. postSpell();
  1557. });
  1558.  
  1559. $("#optionswindow").on("click", '#moktan', function () {
  1560. reqTal = 500;
  1561. reqStr = 75;
  1562. deusCheck();
  1563. if (perfSpell === true) {
  1564. ui.message("moktanmes", 'normal');
  1565. var nadx = -2;
  1566. var nady = -2;
  1567. while (nady <= 2) {
  1568. nadx = -2;
  1569. while (nadx <= 2) {
  1570. if (nadx !== 0) {
  1571. changeTile({
  1572. type: "vineforest"
  1573. }, player.x + nadx, player.y + nady);
  1574. nadx++;
  1575. } else {
  1576. nadx++;
  1577. }
  1578. }
  1579. nady++;
  1580. }
  1581. } else {
  1582. ui.message("casfaimes", 'normal');
  1583. }
  1584. postSpell();
  1585. });
  1586.  
  1587. $("#optionswindow").on("click", '#suifisr', function () {
  1588. reqTal = 0;
  1589. reqStr = 50;
  1590. deusCheck();
  1591. if (perfSpell === true) {
  1592. ui.message("suifismes", 'normal');
  1593. nadx = 1;
  1594. while (nadx <= 7) {
  1595. changeTile({
  1596. type: "freshwater"
  1597. }, player.x + 1 + nadx, player.y);
  1598. nadx++;
  1599. }
  1600. } else {
  1601. ui.message("casfaimes", 'normal');
  1602. }
  1603. postSpell();
  1604. });
  1605.  
  1606. $("#optionswindow").on("click", '#suifisl', function () {
  1607. reqTal = 0;
  1608. reqStr = 50;
  1609. deusCheck();
  1610. if (perfSpell === true) {
  1611. ui.message("suifismes", 'normal');
  1612. nadx = 1;
  1613. while (nadx <= 7) {
  1614. changeTile({
  1615. type: "freshwater"
  1616. }, player.x - (1 + nadx), player.y);
  1617. nadx++;
  1618. }
  1619. } else {
  1620. ui.message("casfaimes", 'normal');
  1621. }
  1622. postSpell();
  1623. });
  1624.  
  1625. $("#optionswindow").on("click", '#suifisu', function () {
  1626. reqTal = 0;
  1627. reqStr = 50;
  1628. deusCheck();
  1629. if (perfSpell === true) {
  1630. ui.message("suifismes", 'normal');
  1631. nadx = 1;
  1632. while (nadx <= 7) {
  1633. changeTile({
  1634. type: "freshwater"
  1635. }, player.x, player.y - (1 + nadx));
  1636. nadx++;
  1637. }
  1638. } else {
  1639. ui.message("casfaimes", 'normal');
  1640. }
  1641. postSpell();
  1642. });
  1643.  
  1644. $("#optionswindow").on("click", '#suifisd', function () {
  1645. reqTal = 0;
  1646. reqStr = 50;
  1647. deusCheck();
  1648. if (perfSpell === true) {
  1649. ui.message("suifismes", 'normal');
  1650. nadx = 1;
  1651. while (nadx <= 7) {
  1652. changeTile({
  1653. type: "freshwater"
  1654. }, player.x, player.y + 1 + nadx);
  1655. nadx++;
  1656. }
  1657. } else {
  1658. ui.message("casfaimes", 'normal');
  1659. }
  1660. postSpell();
  1661. });
  1662.  
  1663.  
  1664. $("#optionswindow").on("click", '#suiravr', function () {
  1665. reqTal = 0;
  1666. reqStr = 30;
  1667. deusCheck();
  1668. if (perfSpell === true) {
  1669. ui.message("suiravmes", 'normal');
  1670. nadx = 1;
  1671. while (nadx <= 7) {
  1672. changeTile({
  1673. type: "deepwater"
  1674. }, player.x + 1 + nadx, player.y);
  1675. nadx++;
  1676. }
  1677. } else {
  1678. ui.message("casfaimes", 'normal');
  1679. }
  1680. postSpell();
  1681. });
  1682.  
  1683. $("#optionswindow").on("click", '#suiravl', function () {
  1684. reqTal = 0;
  1685. reqStr = 30;
  1686. deusCheck();
  1687. if (perfSpell === true) {
  1688. ui.message("suiravmes", 'normal');
  1689. nadx = 1;
  1690. while (nadx <= 7) {
  1691. changeTile({
  1692. type: "deepwater"
  1693. }, player.x - (1 + nadx), player.y);
  1694. nadx++;
  1695. }
  1696. } else {
  1697. ui.message("casfaimes", 'normal');
  1698. }
  1699. postSpell();
  1700. });
  1701.  
  1702. $("#optionswindow").on("click", '#suiravu', function () {
  1703. reqTal = 0;
  1704. reqStr = 30;
  1705. deusCheck();
  1706. if (perfSpell === true) {
  1707. ui.message("suiravmes", 'normal');
  1708. nadx = 1;
  1709. while (nadx <= 7) {
  1710. changeTile({
  1711. type: "deepwater"
  1712. }, player.x, player.y - (1 + nadx));
  1713. nadx++;
  1714. }
  1715. } else {
  1716. ui.message("casfaimes", 'normal');
  1717. }
  1718. postSpell();
  1719. });
  1720.  
  1721. $("#optionswindow").on("click", '#suiravd', function () {
  1722. reqTal = 0;
  1723. reqStr = 30;
  1724. deusCheck();
  1725. if (perfSpell === true) {
  1726. ui.message("suiravmes", 'normal');
  1727. nadx = 1;
  1728. while (nadx <= 7) {
  1729. changeTile({
  1730. type: "deepwater"
  1731. }, player.x, player.y + 1 + nadx);
  1732. nadx++;
  1733. }
  1734. } else {
  1735. ui.message("casfaimes", 'normal');
  1736. }
  1737. postSpell();
  1738. });
  1739.  
  1740. $("#optionswindow").on("click", '#suilak', function () {
  1741. reqTal = 2500;
  1742. reqStr = 200;
  1743. deusCheck();
  1744. if (perfSpell === true) {
  1745. ui.message("suilakmes", 'normal');
  1746. var nadx = -6;
  1747. var nady = -6;
  1748. while (nady <= 6) {
  1749. nadx = -6;
  1750. while (nadx <= 6) {
  1751. changeTile({
  1752. type: "freshwater"
  1753. }, player.x + nadx, player.y + nady);
  1754. nadx++;
  1755. }
  1756. nady++;
  1757. }
  1758. } else {
  1759. ui.message("casfaimes", 'normal');
  1760. }
  1761. postSpell();
  1762. });
  1763.  
  1764. $("#optionswindow").on("click", '#suicov', function () {
  1765. reqTal = 2500;
  1766. reqStr = 150;
  1767. deusCheck();
  1768. if (perfSpell === true) {
  1769. ui.message("suicovmes", 'normal');
  1770. var nadx = -6;
  1771. var nady = -6;
  1772. while (nady <= 6) {
  1773. nadx = -6;
  1774. while (nadx <= 6) {
  1775. changeTile({
  1776. type: "deepwater"
  1777. }, player.x + nadx, player.y + nady);
  1778. nadx++;
  1779. }
  1780. nady++;
  1781. }
  1782. } else {
  1783. ui.message("casfaimes", 'normal');
  1784. }
  1785. postSpell();
  1786. });
  1787.  
  1788. $("#optionswindow").on("click", '#dotshetal', function () {
  1789. reqTal = 15000;
  1790. reqStr = 200;
  1791. deusCheck();
  1792. if (perfSpell === true) {
  1793. ui.message("dotshetalmes", 'normal');
  1794. var nadx = -2;
  1795. var nady = -2;
  1796. while (nady <= 2) {
  1797. nadx = -2;
  1798. while (nadx <= 2) {
  1799. if (nadx !== 0) {
  1800. changeTile({
  1801. type: "talcrock"
  1802. }, player.x + nadx, player.y + nady);
  1803. nadx++;
  1804. } else {
  1805. nadx++;
  1806. }
  1807. }
  1808. nady++;
  1809. }
  1810. } else {
  1811. ui.message("casfaimes", 'normal');
  1812. }
  1813. postSpell();
  1814. });
  1815.  
  1816. $("#optionswindow").on("click", '#dotshelim', function () {
  1817. reqTal = 15000;
  1818. reqStr = 200;
  1819. deusCheck();
  1820. if (perfSpell === true) {
  1821. ui.message("dotshelimmes", 'normal');
  1822. var nadx = -2;
  1823. var nady = -2;
  1824. while (nady <= 2) {
  1825. nadx = -2;
  1826. while (nadx <= 2) {
  1827. if (nadx !== 0) {
  1828. changeTile({
  1829. type: "limestonerock"
  1830. }, player.x + nadx, player.y + nady);
  1831. nadx++;
  1832. } else {
  1833. nadx++;
  1834. }
  1835. }
  1836. nady++;
  1837. }
  1838. } else {
  1839. ui.message("casfaimes", 'normal');
  1840. }
  1841. postSpell();
  1842. });
  1843.  
  1844. // Yeah, I'm aware that I could probably have these shortened into better loops or something, but my brain doesn't function well without coffee, which is something my stomach hates.
  1845. // So no coffee for me unless ABSOLUTELY necessary.
  1846.  
  1847. }) ();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement