CatWar Script

Новый мод-скрипт для браузерной игры CatWar. Обычно разработчиков скрипта держат в подвале, чтобы они хоть что-то делали.

  1. // ==UserScript==
  2. // @name CatWar Script
  3. // @version 0.1.99C
  4. // @description Новый мод-скрипт для браузерной игры CatWar. Обычно разработчиков скрипта держат в подвале, чтобы они хоть что-то делали.
  5. // @author Krivodushie & Psiii
  6. // @copyright 2024 Дурное Сновидение (https://catwar.su/cat1293224) & Заря (https://catwar.su/cat590698)
  7. // @license MIT; https://opensource.org/licenses/MIT
  8. // @match *://catwar.su/*
  9. // @grant GM_xmlhttpRequest
  10. // @grant GM.xmlHttpRequest
  11. // @grant GM_addStyle
  12. // @require https://code.jquery.com/jquery-3.4.1.min.js
  13. // @namespace https://greasyfork.org/users/1354132
  14. // ==/UserScript==
  15.  
  16. const csDefaults = {
  17. // Шаблоны
  18. 'textTemplates': true // Шаблоны в ЛС
  19. ,'toggleTextTemplates': false // Сворачивать ли шаблоны ЛС по умолчанию
  20. ,'replaceTemplateTheme': true // Заменять ли тему сообщения названием шаблона?
  21. // ,'chatTextTemplates': true // Шаблоны в ЧАТЕ
  22. // ,'toggleChatTextTemplates': true // Сворачивать ли шаблоны ЧАТА по умолчанию
  23. // ,'bloglentTextTemplates': true // Шаблоны в БЛОГОЛЕНТЕ
  24. // ,'toggleBloglentTextTemplates': true // Сворачивать ли шаблоны БЛОГОЛЕНТЫ по умолчанию
  25. // Часики
  26. ,'inGameClock': false // Часы в игровой
  27. ,'isClockMoscow': true // Московсике ли часы?
  28. ,'isDateShow': true // Показывать ли дату?
  29. ,'movableClocks': false // Перетаскиваемые часы
  30.  
  31. // Приколы с ЛС
  32. ,'dontReadenLS': false // Непрочитанные ЛС для себя
  33. ,'timerForLS': false // Таймер до удаления ЛС
  34.  
  35. // Дефекты
  36. ,'brightGameField': false // Яркое поле игровой
  37. ,'customDefectDelay': false // Подробная настройка отображения дефектов в Игровой
  38. ,'cstmDfctShowColors': false // Показывать ли цветные клетки при дефектах?
  39. ,'cstmDfctShowRamki': false // Выделять клетки рамкой при дефектах?
  40. ,'cstmDfctShowNum': true // Показывать ли цифры и иконки при дефектах?
  41. ,'cstmDfctWounds': '#4646ff' // Цвет ран по дефолту
  42. ,'cstmDfctBruise': '#46ffef' // Цвет ушибов от падения
  43. ,'cstmDfctFractures': '#68ff46' // Цвет переломов от утопленя
  44. ,'cstmDfctPoison': '#ff4646' // Цвет отравления
  45. ,'cstmDfctCough': '#eeff46' // Цвет кашля
  46. ,'cstmDfctDirt': '#9446ff' // Цвет грязи
  47. ,'cstmDfctPodstilki': '#79553D' // Цвет подстилок
  48. ,'cstmDfctOpacity': '0.25' // Прозрачность отображения дефектов
  49. ,'cstmDfctShowHighDirt': false // Показывать ли 3-4 стадии грязи?
  50. ,'cstmDfctShowLowDirt': false // Показывать ли 1-2 стадии грязи?
  51. ,'cstmDfctShowDivers': false // Показывать ныряющих
  52. ,'cstmDfctShowPodstilki': false // Показывать podstilki
  53. ,'cstmDfctShow34WoundBetter': true // Показывать ли 3-4 стадии ран сильнее?
  54. ,'cstmDfctShowAllBetter': false // Показывать ли 3-4 стадии ВСЕГО сильнее?
  55.  
  56. // Предметы
  57. ,'customItemsDelay': false // Подробная настройка отображения предметов в Игровой
  58. ,'cstmItmHerbDelay': false // Травы
  59. ,'cstmItmHerbClr': '#2bff75' // Травы
  60. ,'cstmItmMossDelay': false // Мох
  61. ,'cstmItmMossClr': '#2bff75' // Мох
  62. ,'cstmItmWebDelay': false // Паутина
  63. ,'cstmItmWebClr': '#2bff75' // Паутина
  64. ,'cstmItmStickDelay': false // STICKS
  65. ,'cstmItmStickClr': '#2bff75' // STICKS
  66. ,'cstmItmDustDelay': false // Звёздная пыль
  67. ,'cstmItmDustClr': '#c096e2' // Звёздная пыль
  68. ,'cstmItmMusorDelay': false // MUSOR
  69. ,'cstmItmMusorClr': '#ff2b2b' // MUSOR
  70. ,'cstmItmOpacity': '0.25' // Прозрачность отображения ресурсов
  71.  
  72. // Иная суть
  73. ,'nightLagsWarning': true // Предупреждение о ночных лагах чтобы не лезли в воды и вообще аккуратнее были
  74. ,'darkCatTooltip': false // Тёмное окошко инфы о котах
  75. ,'boneCorrectTimer': false // Таймер ношения костоправов
  76. ,'toggleBoneTimer': false // Свёрнутый таймер
  77. ,'hideWoundWarning': true // Скрыть варн о ранах везде кроме Игровой
  78. ,'cwscriptDarkTheme': false
  79.  
  80. // Боережимовые прикольчики для самых маленьких
  81. ,'phoneFightPanel': false // Переместить кнопочки боережима для телефонщиков
  82. ,'friendlyCatWar': false // Удалить кнопки захода в опасные БР
  83. ,'deleteFPTitles': false // Убрать тайтлы у кнопок боережима
  84. ,'showButterflyBots': false // Показывать бота-бабочку для прокачки бу
  85.  
  86. // Библиотека костюмов
  87. ,'costumeLibrary': true // Библиотека костюмов
  88. ,'watermarkCostumes': true // Ватермарка на костюмах из библиотеки
  89.  
  90. // Недоделанное
  91. // ,'hideInGameBlocks': false // Скрывать в игровой при загрузке блоки: НЕТУ
  92. // ,'isHideHistory': false // Скрывать ли историю? НЕТУ
  93. // ,'isHideRelatives': false // Скрывать ли РС? НЕТУ
  94. // ,'isHideParameters': false // Скрывать ли параметры/навыки? НЕТУ
  95. // ,'fieldHideButton': true // Кнопочка "Скрыть поле" в ПК-версии игры НЕТУ
  96. // ,'scrollDownTime': false // Время при прокрутке страницы вниз для ПК-версии игры НЕТУ
  97. // ,'rllyImportantButton': true // РЕАЛЬНО важная кнопка НЕТУ
  98.  
  99. // Палитра наших функций в игровой. Когда доделаем кастомизацию игровой нормально будет вообще имба
  100. // ,'sscrlClr1': '#776c5f' // scrlClr1
  101. // ,'sscrlClr2': '#463E33' // scrlClr2
  102. // ,'shrClr': '#463E3330' // hrClr
  103. // ,'stxtClr1': '#C8C0BE' // txtClr1
  104. // ,'stxtClr2': '#181510' // txtClr2
  105. // ,'stxtClr3': '#fff' // txtClr3
  106. // ,'sbrdrClr1': '#BD7E5C' // brdrClr1
  107. // ,'sbrdrClr2': '#ff0' // brdrClr2
  108. // ,'sbrdrClr3': '#000' // brdrClr3
  109. // ,'sbckgClr1': '#463E33' // bckgClr1
  110. // ,'sbckgClr2': '#918474' // bckgClr2
  111. // ,'sbckgClr3': '#333' // bckgClr3
  112. // ,'sbckgClr4': '#463E3350' // bckgClr4
  113. // ,'selectedTheme1': 'CWScript светлая'
  114.  
  115. // Палитра наших функций ВНЕ игровой
  116. // ,'s1scrlClr1': '#776c5f' // scrlClr1
  117. // ,'s1scrlClr2': '#463E33' // scrlClr2
  118. // ,'s1hrClr': '#463E3330' // hrClr
  119. // ,'s1txtClr1': '#C8C0BE' // txtClr1
  120. // ,'s1txtClr2': '#181510' // txtClr2
  121. // ,'s1txtClr3': '#fff' // txtClr3
  122. // ,'s1brdrClr1': '#BD7E5C' // brdrClr1
  123. // ,'s1brdrClr2': '#ff0' // brdrClr2
  124. // ,'s1brdrClr3': '#000' // brdrClr3
  125. // ,'s1bckgClr1': '#463E33' // bckgClr1
  126. // ,'s1bckgClr2': '#918474' // bckgClr2
  127. // ,'s1bckgClr3': '#333' // bckgClr3
  128. // ,'s1bckgClr4': '#463E3350' // bckgClr4
  129. // ,'selectedTheme2': 'CWScript светлая'
  130. };
  131.  
  132. const globals = {}; //Настройки
  133. for (var key in csDefaults) {
  134. let settings = getSettings(key);
  135. if (settings === null) {
  136. globals[key] = csDefaults[key];
  137. }
  138. else {
  139. if (Array.isArray(csDefaults[key])) {
  140. globals[key] = JSON.parse(settings);
  141. }
  142. else if (typeof csDefaults[key] === 'number') {
  143. globals[key] = parseFloat(settings);
  144. }
  145. else {
  146. globals[key] = settings;
  147. }
  148. }
  149. }
  150.  
  151. function getSettings(key) { //Получить настройку
  152. let setting = 'cs_n_' + key;
  153. let val = window.localStorage.getItem(setting);
  154. switch (val) {
  155. case null:
  156. return null;
  157. case 'true':
  158. return true;
  159. case 'false':
  160. return false;
  161. default:
  162. return val;
  163. }
  164. }
  165.  
  166. function setSettings(key, val) { // Задать настройку
  167. let setting = 'cs_n_' + key;
  168. window.localStorage.setItem(setting, String(val));
  169. globals[key] = val; // Записываем новое значение в globals
  170. }
  171.  
  172. function removeSettings(key) { // Удалить настройку
  173. let setting = 'cs_n_' + key;
  174. window.localStorage.removeItem(setting);
  175. }
  176.  
  177. function nightLagsWarning() {
  178. function showWarning() {
  179. let now = new Date();
  180. now.setHours(now.getUTCHours() + 3);
  181. let hours = now.getHours();
  182. let minutes = now.getMinutes();
  183. if ((hours === 2 && minutes >= 50) || (hours === 3) || (hours === 4 && minutes <= 10)) {
  184. if ($('#warning').length === 0) {
  185. let warningHtml = `<div id="warning" style="background: white; font-weight: bold; text-align: justify; padding: 2px 10px; position: fixed; z-index: 1;">
  186. Настоятельно рекомендуем Вам покинуть локации для лазания и ныряния в промежутке с 03:00 до 04:00 по МСК. В случае продолжения нахождения на них не используйте горячие клавиши при перемещении между локациями, а также не нажимайте на переходы по несколько раз. Некоторый контент может находиться под данным уведомлением. <a id="hideWarning" href="#">Скрыть</a>
  187. </div>`;
  188. $('body').prepend(warningHtml);
  189. $('#hideWarning').click(function() {
  190. $('#warning').remove();
  191. });
  192. }
  193. }
  194. else {
  195. $('#warning').remove();
  196. }
  197. }
  198. showWarning();
  199. }
  200.  
  201. function appendToElementOrPrependFallback(primaryElement, secondaryElement, elementToAdd) {
  202. if ($(primaryElement).length) {
  203. $(primaryElement).append(elementToAdd);
  204. }
  205. else {
  206. $(secondaryElement).before(elementToAdd);
  207. }
  208. }
  209.  
  210. function appendToElementOrFallback(primaryElement, secondaryElement, elementToAdd) {
  211. if ($(primaryElement).length) {
  212. $(primaryElement).append(elementToAdd);
  213. }
  214. else {
  215. $(secondaryElement).after(elementToAdd);
  216. }
  217. }
  218.  
  219. const pageurl = window.location.href;
  220. const isCW3 = (/^https:\/\/\w?\.?catwar.su\/cw3(?!(\/kns|\/jagd))/.test(pageurl));
  221. const isSite = !(/^https:\/\/\w?\.?catwar.su\/cw3(\/kns|\/jagd)?.*/.test(pageurl));
  222. const isDM = (/^https:\/\/\w?\.?catwar.su\/ls/.test(pageurl));
  223. const isSett = (/^https:\/\/\w?\.?catwar.su\/settings/.test(pageurl));
  224. const isMyCat = (/^https:\/\/\w?\.?catwar.su\/$/.test(pageurl));
  225. const isAll = (/^https:\/\/\w?\.?catwar.su\/.*/.test(pageurl));
  226.  
  227. try {
  228. if (isCW3) cw3();
  229. if (isDM) dm();
  230. if (isSite) site();
  231. if (isSett) sett();
  232. if (isMyCat) myCat();
  233. if (isAll) all();
  234. }
  235. catch (error) {
  236. console.error("An error occurred: ", error);
  237. }
  238.  
  239. // ...
  240. // ...
  241. // ...
  242.  
  243. function sett() {
  244. const html = `
  245. <br><br><div id="cwsSet"><i>(c) CWScript</i><b>Настройки</b><div id="cwsSetList"><div><input class="cs-set" id="textTemplates" type="checkbox"${globals.textTemplates?' checked':''}><label for="textTemplates">Блок с шаблонами в личных сообщениях</label></div>
  246. <div><input class="cs-set" id="toggleTextTemplates" type="checkbox"${globals.toggleTextTemplates?' checked':''}><label for="toggleTextTemplates">Изначально сворачивать блок с шаблонами</label></div>
  247. <div><input class="cs-set" id="replaceTemplateTheme" type="checkbox"${globals.replaceTemplateTheme?' checked':''}><label for="replaceTemplateTheme">Вставлять название шаблона в тему сообщения</label></div>
  248. <!-- <div><input class="cs-set" id="chatTextTemplates" type="checkbox"${globals.chatTextTemplates?' checked':''}><label for="chatTextTemplates">Отображать шаблоны для ЧАТОВ</label></div>
  249. <div><input class="cs-set" id="toggleChatTextTemplates" type="checkbox"${globals.toggleChatTextTemplates?' checked':''}><label for="toggleChatTextTemplates">Сворачивать шаблоны ЧАТОВ изначально</label></div>
  250. <div><input class="cs-set" id="bloglentTextTemplates" type="checkbox"${globals.bloglentTextTemplates?' checked':''}><label for="bloglentTextTemplates">Отображать шаблоны для БЛОГОЛЕНТЫ</label></div>
  251. <div><input class="cs-set" id="toggleBloglentTextTemplates" type="checkbox"${globals.toggleBloglentTextTemplates?' checked':''}><label for="toggleBloglentTextTemplates">Сворачивать шаблоны БЛОГОЛЕНТЫ изначально</label></div>--><hr>
  252. <div><input class="cs-set" id="inGameClock" type="checkbox"${globals.inGameClock?' checked':''}><label for="inGameClock">Часы в игровой</label></div>
  253. <div><input class="cs-set" id="showDate" type="checkbox"${globals.isDateShow?' checked':''}><label for="showDate">Показывать дату</label></div>
  254. <div><input class="cs-set" id="movableClocks" type="checkbox"${globals.movableClocks?' checked':''}><label for="movableClocks">Перетаскиваемый блок часов (на телефонах перетаскивание пока не работает)</label></div>
  255. <table><tr><td><div><input class="cs-set" id="deviceTime" type="radio" name="timeSource"${!globals.isClockMoscow?' checked':''}><label for="deviceTime">Время с устройства</label></div></td>
  256. <td><div><input class="cs-set" id="moscowTime" type="radio" name="timeSource"${globals.isClockMoscow?' checked':''}><label for="moscowTime">Московское время</label></div></td></tr></table><hr>
  257. <div><input class="cs-set" id="phoneFightPanel" type="checkbox"${globals.phoneFightPanel?' checked':''}><label for="phoneFightPanel">Переместить кнопочки окошка БР для телефонщиков</label></div><hr>
  258. <div><input class="cs-set" id="friendlyCatWar" type="checkbox"${globals.friendlyCatWar?' checked':''}><label for="friendlyCatWar">Убрать кнопки входа в опасные боережимы</label></div><hr>
  259. <div><input class="cs-set" id="nightLagsWarning" type="checkbox"${globals.nightLagsWarning?' checked':''}><label for="nightLagsWarning">Предупреждение об осторожности на водах/лазательных локациях в период с 03:00 по 04:00 по МСК</label></div><hr>
  260. <div id="dontRdnLS"><input class="cs-set" id="dontReadenLS" type="checkbox"${globals.dontReadenLS?' checked':''}><label for="dontReadenLS">“Непрочитанное ЛС” только для себя</label></div>
  261. <button type="button" id="clearDontReadButton">Нажми меня!</button><label for="clearDontReadButton">Кнопка, чтобы починить (обнулить) счётчик непрочитанных ЛС</label><br><hr>
  262. <div><input class="cs-set" id="timerForLS" type="checkbox"${globals.timerForLS?' checked':''}><label for="timerForLS">Выделение сообщений в ЛС, которые скоро удалятся (выделяет непрочитанные ЛС, которые были получены/отправлены от 6 до 14 дней назад)</label></div><hr>
  263. <div><input class="cs-set" id="hideWoundWarning" type="checkbox"${globals.hideWoundWarning?' checked':''}><label for="hideWoundWarning">Убрать предупреждение "Вы ранены" со всех страниц сайта</label></div><hr>
  264. <div><input class="cs-set" id="brightGameField" type="checkbox"${globals.brightGameField?' checked':''}><label for="brightGameField">Не затемнять окошко игровой</label></div><hr>
  265. <div><input class="cs-set" id="customDefectDelay" type="checkbox"${globals.customDefectDelay?' checked':''}><label for="customDefectDelay">Выделение клеток с больными котиками в игровой</label></div>
  266. <div><input class="cs-set" id="cstmDfctShowColors" type="checkbox"${globals.cstmDfctShowColors?' checked':''}><label for="cstmDfctShowColors">Подсветка клетки игрока с дефектом полностью</label></div>
  267. <div><input class="cs-set" id="cstmDfctShowRamki" type="checkbox"${globals.cstmDfctShowRamki?' checked':''}><label for="cstmDfctShowRamki">Подсветка клетки игрока с дефектом рамкой</label></div>
  268. <div><input class="cs-set" id="cstmDfctShowNum" type="checkbox"${globals.cstmDfctShowNum?' checked':''}><label for="cstmDfctShowNum">Показывать иконки болезней с цифрами</label></div>
  269. <div><input class="cs-set" id="cstmDfctShowLowDirt" type="checkbox"${globals.cstmDfctShowLowDirt?' checked':''}><label for="cstmDfctShowLowDirt">Показывать 1-2 стадии грязи у игроков</label></div>
  270. <div><input class="cs-set" id="cstmDfctShowHighDirt" type="checkbox"${globals.cstmDfctShowHighDirt?' checked':''}><label for="cstmDfctShowHighDirt">Показывать 3-4 стадии грязи у игроков</label></div>
  271. <div><input class="cs-set" id="cstmDfctShow34WoundBetter" type="checkbox"${globals.cstmDfctShow34WoundBetter?' checked':''}><label for="cstmDfctShow34WoundBetter">Более выразительное выделение 3-4 стадий ран</label></div>
  272. <div><input class="cs-set" id="cstmDfctShowAllBetter" type="checkbox"${globals.cstmDfctShowAllBetter?' checked':''}><label for="cstmDfctShowAllBetter">Более выразительное выделение 3-4 стадий всех дефектов</label></div><hr>
  273. <div><input class="cs-set" id="cstmDfctShowDivers" type="checkbox"${globals.cstmDfctShowDivers?' checked':''}><label for="cstmDfctShowDivers">Выделять ныряющих в Игровой</label></div><hr>
  274. <div><input class="cs-set" id="cstmDfctShowPodstilki" type="checkbox"${globals.cstmDfctShowPodstilki?' checked':''}><label for="cstmDfctShowPodstilki">Выделять заподстиленных в Игровой</label></div><hr>
  275. <div><input class="cs-set" id="showButterflyBots" type="checkbox"${globals.showButterflyBots?' checked':''}><label for="showButterflyBots">Выделять бота-бабочку для прокачки БУ в Игровой</label></div><hr>
  276. <div><input class="cs-set" id="darkCatTooltip" type="checkbox"${globals.darkCatTooltip?' checked':''}><label for="darkCatTooltip">Тёмное окошко информации о персонажах в Игровой</label></div><hr>
  277. <div><input class="cs-set" id="customItemsDelay" type="checkbox"${globals.customItemsDelay?' checked':''}><label for="customItemsDelay">Подсвечивание клеток с полезными ресурсами в Игровой</label></div>
  278. <div><input class="cs-set" id="cstmItmHerbDelay" type="checkbox"${globals.cstmItmHerbDelay?' checked':''}><label for="cstmItmHerbDelay">Подсвечивать травы, мёд и целебные водоросли</label></div>
  279. <div><input class="cs-set" id="cstmItmMossDelay" type="checkbox"${globals.cstmItmMossDelay?' checked':''}><label for="cstmItmMossDelay">Подсвечивать мох (обычный, водяной, с желчью)</label></div>
  280. <div><input class="cs-set" id="cstmItmWebDelay" type="checkbox"${globals.cstmItmWebDelay?' checked':''}><label for="cstmItmWebDelay">Подсвечивать паутину</label></div>
  281. <div><input class="cs-set" id="cstmItmStickDelay" type="checkbox"${globals.cstmItmStickDelay?' checked':''}><label for="cstmItmStickDelay">Подсвечивать крепкие ветки, вьюнки, костоправы и плотные водоросли</label></div>
  282. <div><input class="cs-set" id="cstmItmDustDelay" type="checkbox"${globals.cstmItmDustDelay?' checked':''}><label for="cstmItmDustDelay">Подсвечивать звёздную пыль</label></div>
  283. <div><input class="cs-set" id="cstmItmMusorDelay" type="checkbox"${globals.cstmItmMusorDelay?' checked':''}><label for="cstmItmMusorDelay">Подсвечивать травящие предметы</label></div><hr>
  284. <div><input class="cs-set" id="boneCorrectTimer" type="checkbox"${globals.boneCorrectTimer?' checked':''}><label for="boneCorrectTimer">Таймер снятия костоправов</label></div>
  285. <div><input class="cs-set" id="toggleBoneTimer" type="checkbox"${globals.toggleBoneTimer?' checked':''}><label for="toggleBoneTimer">Изначально сворачивать блок таймера костоправов</label></div><hr>
  286. <div><input class="cs-set" id="deleteFPTitles" type="checkbox"${globals.deleteFPTitles?' checked':''}><label for="deleteFPTitles">Убрать подписи к кнопкам боережима</label></div><hr>
  287. <div><input class="cs-set" id="cwscriptDarkTheme" type="checkbox"${globals.cwscriptDarkTheme?' checked':''}><label for="cwscriptDarkTheme">Тёмная тема для функций из CWScript <small>(В слудующем обновлении добавим больше тем!)</small></label></div><hr>
  288. <div><input class="cs-set" id="costumeLibrary" type="checkbox"${globals.costumeLibrary?' checked':''}><label for="costumeLibrary">Библиотека костюмов</label></div>
  289. <div><input class="cs-set" id="watermarkCostumes" type="checkbox"${globals.watermarkCostumes?' checked':''}><label for="watermarkCostumes">Наш значок у костюмов, добавленных библиотекой</label></div>
  290. <!--<div><select id="selectInGame"><option>CWScript светлая</option><option>CWScript тёмная</option><option>CatWar светлая</option><option>Стандартная тёмная</option><option>Стандартная светлая</option></select></div><br>
  291. <div><select id="selectOutGame"><option>CWScript светлая</option><option>CWScript тёмная</option><option>CatWar светлая</option><option>Стандартная тёмная</option><option>Стандартная светлая</option><option>Стандартная тёмная</option></select></div>-->
  292. </div><br></div><br></div><br>`
  293. appendToElementOrFallback('#branch', 'a[href="del"]', html);
  294.  
  295. $('#nightLagsWarning').on('change', function() {
  296. if (!this.checked) {
  297. let userConfirmation = confirm("Вы уверены, что хотите отключить предупреждение о ночных лагах?");
  298. if (!userConfirmation) {
  299. this.checked = true;
  300. }
  301. else {}
  302. }
  303. else {}
  304. });
  305.  
  306. let cssForSett = `
  307. <style>
  308. div#cwsSet>b {
  309. display: block;
  310. text-align: center;
  311. font-size: 23px;
  312. padding: 10px;
  313. margin-top: -23px;
  314. letter-spacing: 15px;
  315. text-transform: uppercase;
  316. border: 3px solid var(--brdrClr1);
  317. margin-bottom: 10px;
  318. background-color: var(--bckgClr1);
  319. color: var(--txtClr1); }
  320.  
  321. div#cwsSet>i {
  322. display: block;
  323. text-align: right;
  324. padding-top: 5px;
  325. padding-right: 10px;
  326. font-size: 11px;
  327. color: var(--txtClr1); }
  328.  
  329. div#cwsSet {
  330. background-color: var(--bckgClr2);
  331. border: 3px solid var(--brdrClr1);
  332. color: var(--txtClr2);
  333. font-family: Montserrat; }
  334.  
  335. div#cwsSetList {
  336. max-height: 500px;
  337. overflow: auto;
  338. background-color: var(--bckgClr2);
  339. color: var(--txtClr2); }
  340.  
  341. div#cwsSetList::-webkit-scrollbar {
  342. width: 13px; }
  343.  
  344. div#cwsSetList::-webkit-scrollbar-track {
  345. background: var(--scrlClr1) !important; }
  346.  
  347. div#cwsSetList::-webkit-scrollbar-thumb {
  348. background: var(--scrlClr2) !important; }
  349.  
  350. div#cwsSetList>hr {
  351. border: 0.5px solid var(--hrClr1);
  352. margin: 10px auto; }
  353.  
  354. div#cwsSetList>table>tbody>tr>td>div {
  355. margin-top: 3px;
  356. margin-right: 30px; }
  357.  
  358. table#dfctSet {
  359. margin-left: 4px; }
  360.  
  361. table#dfctSet, table#dfctSet>tbody>tr, table#dfctSet>tbody>tr>td {
  362. border: 3px solid var(--hrClr1);
  363. font-weight: bold;
  364. font-size: 13px;
  365. text-align: center; }
  366.  
  367. table#dfctSet>tbody>tr>td {
  368. padding: 10px; }
  369.  
  370. table#dfctSet>tbody>tr.dfctName {
  371. background: var(--hrClr1) }
  372.  
  373. div#dfctOpacity, div#itmOpacity {
  374. margin-left: 4px; }
  375.  
  376. div#dfctOpacity>input, div#itmOpacity>input {
  377. margin-top: 8px;
  378. margin-bottom: 8px; }
  379.  
  380. input#cstmDfctOpacity {
  381. border: 3px solid var(--hrClr1);
  382. width: 208px;
  383. margin-left: 0.3px; }
  384.  
  385. input#cstmItmOpacity {
  386. border: 3px solid var(--hrClr1);
  387. width: 220px;
  388. margin-left: 0.3px; }
  389.  
  390. button#resetDefectSettings, button#resetItemSettings {
  391. margin-left: 4px; }
  392.  
  393. button#resetDefectSettings:hover, button#resetItemSettings:hover {
  394. border: 1px solid var(--brdrClr2); }
  395.  
  396. button#clearDontReadButton {
  397. background-color: var(--bckgClr3);
  398. color: var(--txtClr3);
  399. border: 1px solid var(--brdrClr3);
  400. font-family: Verdana;
  401. font-size: .9em;
  402. margin: 0 1em;
  403. display: inline-block;
  404. margin-top: 6px;}
  405.  
  406. button#clearDontReadButton:hover {
  407. border: 1px solid var(--brdrClr2);}
  408. </style>
  409. `
  410. $('head').append(cssForSett);
  411.  
  412. $('.cs-set').on('change', function() {
  413. let key = this.id;
  414. let val = this.type === 'checkbox' ? this.checked : this.value;
  415. setSettings(key, val);
  416. });
  417.  
  418. let settingsToResetDfct = [
  419. 'customDefectDelay', 'cstmDfctWounds', 'cstmDfctBruise', 'cstmDfctFractures',
  420. 'cstmDfctPoison', 'cstmDfctCough', 'cstmDfctDirt', 'cstmDfctOpacity',
  421. 'cstmDfctShowColors', 'cstmDfctShowNum', 'cstmDfctShowHighDirt',
  422. 'cstmDfctShowLowDirt', 'cstmDfctShow34WoundBetter', 'cstmDfctShowAllBetter'
  423. ];
  424.  
  425. let settingsToResetItm = [
  426. 'customItemsDelay', 'cstmItmHerbDelay', 'cstmItmHerbClr', 'cstmItmMossDelay',
  427. 'cstmItmMossClr', 'cstmItmWebDelay', 'cstmItmWebClr', 'cstmItmStickDelay',
  428. 'cstmItmStickClr', 'cstmItmDustDelay', 'cstmItmDustClr', 'cstmItmOpacity', 'cstmItmMusorDelay', 'cstmItmMusorClr'
  429. ];
  430.  
  431. function resetSettings(settingsToReset) {
  432. for (var i = 0; i < settingsToReset.length; i++) {
  433. let key = settingsToReset[i];
  434. removeSettings(key);
  435. }
  436. for (i = 0; i < settingsToReset.length; i++) {
  437. let key = settingsToReset[i];
  438. globals[key] = csDefaults[key];
  439. }
  440. $('.cs-set').each(function() {
  441. let key = this.id;
  442. if (settingsToReset.includes(key)) {
  443. let val = csDefaults[key];
  444. if (this.type === 'checkbox') {
  445. this.checked = val;
  446. }
  447. else {
  448. this.value = val;
  449. }
  450. }
  451. });
  452. }
  453.  
  454. $('#resetDefectSettings').on('click', function() {
  455. resetSettings(settingsToResetDfct);
  456. });
  457. $('#resetItemSettings').on('click', function() {
  458. resetSettings(settingsToResetItm);
  459. });
  460.  
  461. $(document).ready(function() {
  462. function toggleCustomDefectDelay() {
  463. $('#cstmDfctWounds, #cstmDfctBruise, #cstmDfctShowRamki, #cstmDfctFractures, #cstmDfctPoison, #cstmDfctCough, #cstmDfctDirt, #cstmDfctOpacity, #cstmDfctShowColors, #cstmDfctShowNum, #cstmDfctShowHighDirt, #cstmDfctShowLowDirt, #cstmDfctShow34WoundBetter, #cstmDfctShowAllBetter').prop('disabled', !$('#customDefectDelay').is(':checked'));
  464. }
  465. $('#customDefectDelay').change(toggleCustomDefectDelay);
  466. toggleCustomDefectDelay();
  467.  
  468. function toggleCustomItemsDelay() {
  469. $('#cstmItmHerbDelay, #cstmItmHerbClr, #cstmItmMossDelay, #cstmItmMossClr, #cstmItmWebDelay, #cstmItmWebClr, #cstmItmStickDelay, #cstmItmStickClr, #cstmItmDustDelay, #cstmItmDustClr, #cstmItmOpacity, #cstmItmMusorDelay, #cstmItmMusorClr').prop('disabled', !$('#customItemsDelay').is(':checked'));
  470. }
  471. $('#customItemsDelay').change(toggleCustomItemsDelay);
  472. toggleCustomItemsDelay();
  473.  
  474. function toggleTimeBlock() {
  475. $('#deviceTime, #moscowTime, #showDate, #movableClocks').prop('disabled', !$('#inGameClock').is(':checked'));
  476. }
  477. $('#inGameClock').change(toggleTimeBlock);
  478. toggleTimeBlock();
  479. });
  480.  
  481. }
  482.  
  483. // ...
  484. // ...
  485. // ...
  486.  
  487. function dm() {
  488. if (globals['dontReadenLS']) {
  489. function updateDontReadCounter() {
  490. let count = 0;
  491. for (let i = 0; i < localStorage.length; i++) {
  492. let key = localStorage.key(i);
  493. if (key.startsWith('message')) {
  494. count++;
  495. }
  496. }
  497. localStorage.setItem('dontReadenCount', count);
  498. $('#dontReadCounter').text(count > 0 ? '(' + count + ')' : '');
  499. }
  500.  
  501. function updateDontReadenMessages() {
  502. $('#messList tr').each(function() {
  503. if (!$(this).hasClass('msg_notRead') && !$(this).find('.dontReadButton').length) {
  504. $(this).append('<td><button class="dontReadButton">Н</button></td>');
  505. let messageId = $(this).find('a.msg_open').data('id');
  506. if (localStorage.getItem('message' + messageId)) {
  507. $(this).addClass('dontReaden');
  508. }
  509. }
  510. });
  511. }
  512. $(document).on('click', '.dontReadButton', function() {
  513. let row = $(this).closest('tr');
  514. let messageId = row.find('a.msg_open').data('id');
  515. if (row.hasClass('dontReaden')) {
  516. row.removeClass('dontReaden');
  517. localStorage.removeItem('message' + messageId);
  518. }
  519. else {
  520. row.addClass('dontReaden');
  521. localStorage.setItem('message' + messageId, true);
  522. }
  523. updateDontReadCounter();
  524. });
  525. $(document).on('click', '.msg_open', function() {
  526. let row = $(this).closest('tr');
  527. if (row.hasClass('dontReaden')) {
  528. let messageId = row.find('a.msg_open').data('id');
  529. row.removeClass('dontReaden');
  530. localStorage.removeItem('message' + messageId);
  531. updateDontReadCounter();
  532. }
  533. });
  534. setInterval(function() {
  535. updateDontReadenMessages();
  536. updateDontReadCounter();
  537. }, 1000);
  538. let dontreadencss = `<style>.dontReaden {
  539. background-color: var(--bckgClr6); }</style>`
  540. $('head').append(dontreadencss);
  541. }
  542.  
  543. // Чипсеки
  544.  
  545. if (globals['textTemplates']) {
  546. function checkForForm() {
  547. let form = document.querySelector('#write_form');
  548. if (form && !form.classList.contains('templates-added')) {
  549. add_templates();
  550. form.classList.add('templates-added');
  551. }
  552. }
  553. checkForForm();
  554. let observer = new MutationObserver((mutationsList, observer) => {
  555. for (let mutation of mutationsList) {
  556. if (mutation.type === 'childList') {
  557. checkForForm();
  558. }
  559. }
  560. });
  561. observer.observe(document.body, {
  562. childList: true,
  563. subtree: true
  564. });
  565.  
  566. function add_templates() {
  567. if (window.location.href.includes("https://catwar.su/ls?new")) {
  568. $(document).ready(function() {
  569. setTimeout(function() {
  570. initScript();
  571. }, 70);
  572. });
  573.  
  574. function initScript() {
  575. 'use strict';
  576. let templates = localStorage.getItem('templates') ? JSON.parse(localStorage.getItem('templates')) : [];
  577.  
  578. function renderTemplates() {
  579. let list = $('.patternlist');
  580. list.empty();
  581. templates.forEach(function(template, index) {
  582. let templateText = '<div class="patternline"><a href="#" class="name" data-index="' + index + '">' + template.name + '</a> <a href="#" class="delete" data-index="' + index + '">[X]</a> <a href="#" class="edit" data-index="' + index + '">[✍]</a><hr><div>';
  583. list.append(templateText);
  584. });
  585. }
  586. let writeForm = $('form#write_form');
  587. if (writeForm.length === 0) {
  588. return;
  589. }
  590. writeForm.find('.patternblock').remove();
  591. writeForm.prepend('<div class="patternblock"><i>(c) CWScript</i><b>Шаблоны</b><div class="patternlist"></div></div>');
  592. let patternBlock = writeForm.find('.patternblock');
  593. let createButton = $('<a href="#" id="createButton">Создать новый шаблон</a>').click(function(e) {
  594. e.preventDefault();
  595. $(this).hide();
  596. let inputField = $('<input type="text" id="templateName" placeholder="Введите название шаблона"></input>');
  597. let okButton = $('<button type="button" id="templateBtnOK" class="templateBtns">OK</button>').click(function() {
  598. let templateName = inputField.val();
  599. if (templateName) {
  600. let currentContent = $('#text').val();
  601. let newTemplate = {
  602. name: templateName,
  603. content: currentContent
  604. };
  605. templates.push(newTemplate);
  606. localStorage.setItem('templates', JSON.stringify(templates));
  607. renderTemplates();
  608. inputField.remove();
  609. okButton.remove();
  610. cancelButton.remove();
  611. createButton.show();
  612. }
  613. });
  614. let cancelButton = $('<button id="templateBtnUndo" class="templateBtns">Отмена</button>').click(function() {
  615. inputField.remove();
  616. okButton.remove();
  617. cancelButton.remove();
  618. createButton.show();
  619. });
  620. $(this).after(inputField, okButton, ' ', cancelButton);
  621. });
  622. patternBlock.append(createButton);
  623. writeForm.off('click', '.delete').on('click', '.delete', function(e) {
  624. e.preventDefault();
  625. let templateIndex = $(this).data('index');
  626. let templateName = templates[templateIndex].name;
  627. if (confirm('Точно ли вы хотите удалить шаблон "' + templateName + '"?')) {
  628. templates.splice(templateIndex, 1);
  629. localStorage.setItem('templates', JSON.stringify(templates));
  630. renderTemplates();
  631. }
  632. });
  633. writeForm.off('click', '.edit').on('click', '.edit', function(e) {
  634. e.preventDefault();
  635. let templateIndex = $(this).data('index');
  636. let template = templates[templateIndex];
  637. if (template) {
  638. let templateContent = template.content;
  639. $('#text').val(templateContent);
  640. let saveButton = $('#templateBtnSaveChanges');
  641. if (saveButton.length === 0) {
  642. saveButton = $('<button id="templateBtnSaveChanges">Сохранить шаблон</button><br><br>');
  643. writeForm.append(saveButton);
  644. }
  645. saveButton.off('click').click(function(e) {
  646. e.preventDefault();
  647. let editedContent = $('#text').val();
  648. templates[templateIndex].content = editedContent;
  649. localStorage.setItem('templates', JSON.stringify(templates));
  650. renderTemplates();
  651. $('#text').val('');
  652. });
  653. }
  654. });
  655. writeForm.on('click', '.name', function(e) {
  656. e.preventDefault();
  657. let templateIndex = $(this).data('index');
  658. let template = templates[templateIndex];
  659. if (template) {
  660. $('#text').val(template.content);
  661. if (globals['replaceTemplateTheme']) {
  662. $('#subject').val(template.name);
  663. }
  664. }
  665. });
  666. renderTemplates();
  667.  
  668. function togglePatternBlock() {
  669. $('.patternblock').slideToggle();
  670. }
  671. let toggleButton = $('<button id="togglePatternBlockButton" type="button">Ш</button>').click(togglePatternBlock);
  672. $('button[data-code="b"]').before(toggleButton);
  673. if (globals['toggleTextTemplates']) {
  674. $('.patternblock').hide();
  675. }
  676. }
  677. }
  678. }
  679. let css = `
  680. <style>
  681. button#templateBtnOK, button#templateBtnUndo, button#templateBtnSaveChanges {
  682. background-color: var(--bckgClr3);
  683. color: var(--txtClr3);
  684. border: 1px solid var(--brdrClr3);
  685. font-family: Verdana;
  686. font-size: .9em; }
  687.  
  688. button#templateBtnOK:hover, button#templateBtnUndo:hover, button#templateBtnSaveChanges:hover {
  689. border: 1px solid var(--brdrClr2); }
  690.  
  691. div.patternblock {
  692. border: 3px solid var(--brdrClr1);
  693. margin-bottom: 10px;
  694. background-color: var(--bckgClr1);
  695. color: var(--txtClr1);
  696. font-family: Montserrat; }
  697.  
  698. div.patternlist {
  699. max-height: 140px;
  700. overflow: auto;
  701. background-color: var(--bckgClr2);
  702. color: var(--txtClr2); }
  703.  
  704. div.patternlist::-webkit-scrollbar {
  705. width: 13px; }
  706.  
  707. div.patternlist::-webkit-scrollbar-track {
  708. background: var(--scrlClr1) !important; }
  709.  
  710. div.patternlist::-webkit-scrollbar-thumb {
  711. background: var(--scrlClr2) !important; }
  712.  
  713. div.patternline>hr {
  714. border: 0.5px solid var(--hrClr1);
  715. margin: 0;
  716. margin-top: 6px; }
  717.  
  718. div.patternline:hover {
  719. background: var(--bckgClr4) !important;
  720. transition: 0.8s; }
  721.  
  722. div.patternline {
  723. transition: 0.8s;
  724. padding-top: 6px;
  725. color: var(--txtClr2); }
  726.  
  727. div.patternline>a {
  728. color: var(--txtClr2); }
  729.  
  730. div.patternblock>b {
  731. border: 3px solid var(--brdrClr1);
  732. display: block;
  733. text-align: center;
  734. font-size: 23px;
  735. padding: 10px;
  736. margin-top: -23px;
  737. letter-spacing: 15px;
  738. text-transform: uppercase; }
  739.  
  740. div.patternblock>i {
  741. display: block;
  742. text-align: right;
  743. padding-top: 5px;
  744. padding-right: 10px;
  745. font-size: 11px; }
  746.  
  747. .patternline>a.name {
  748. display: block;
  749. margin-left: 5px; }
  750.  
  751. .patternline>a.delete {
  752. display: block;
  753. max-width: 80px;
  754. margin-top: -17px;
  755. margin-left: auto;
  756. margin-right: 0; }
  757.  
  758. .patternline>a.edit {
  759. display: block;
  760. max-width: 50px;
  761. margin-top: -19px;
  762. margin-left: auto;
  763. margin-right: 0; }
  764.  
  765. a#createButton {
  766. display: block;
  767. padding: 5px;
  768. color: var(--txtClr1); }
  769.  
  770. button#templateBtnSaveChanges {
  771. margin-top: 1px; }
  772.  
  773. input#templateName {
  774. width: 20% !important;
  775. margin: 4px auto; }
  776.  
  777. button.templateBtns {
  778. overflow: auto; }
  779.  
  780. button.templateBtns {
  781. margin-top: 4px; }
  782.  
  783. button#templateBtnOK {
  784. margin-left: 10px;
  785. margin-right: 3px; }
  786.  
  787. button#togglePatternBlockButton {
  788. background-color: #333;
  789. color: #fff;
  790. border: none;
  791. margin-right: 5px;
  792. }
  793.  
  794. button#togglePatternBlockButton:hover {
  795. outline: 1px solid #ff0;
  796. }
  797. </style>`
  798. $('head').append(css);
  799. }
  800. }
  801.  
  802. // ...
  803. // ...
  804. // ...
  805.  
  806. function cw3() {
  807. if (globals['inGameClock']) {
  808. if (globals['movableClocks']) {
  809. (function() {
  810. function injectDateTime() {
  811. let htmlClock = `
  812. <div id="clockContainer">
  813. <div id="clock"></div>
  814. <div id="date"></div>
  815. </div>
  816. <style>
  817. div#clockContainer {
  818. position: absolute;
  819. z-index: 9999;
  820. cursor: move;
  821. font-family: Montserrat;
  822. background-color: var(--bckgClr1);
  823. border: 3px solid var(--brdrClr1);
  824. color: var(--txtClr1);
  825. padding: 5px 5px 5px 10px;
  826. font-weight: bold;
  827. font-size: 15px;
  828. }
  829. </style>`
  830. $("body").append(htmlClock);
  831.  
  832. var dateTimeContainer = document.getElementById('clockContainer');
  833. var savedPosition = JSON.parse(localStorage.getItem('dateTimePosition'));
  834. if (savedPosition) {
  835. dateTimeContainer.style.left = savedPosition.left;
  836. dateTimeContainer.style.top = savedPosition.top;
  837. }
  838. else {
  839. dateTimeContainer.style.left = '0px';
  840. dateTimeContainer.style.top = '0px';
  841. }
  842. let isDragging = false;
  843. let initialX = 0;
  844. let initialY = 0;
  845. dateTimeContainer.addEventListener('mousedown', function(e) {
  846. isDragging = true;
  847. initialX = e.pageX - parseInt(dateTimeContainer.style.left);
  848. initialY = e.pageY - parseInt(dateTimeContainer.style.top);
  849. });
  850. document.addEventListener('mousemove', function(e) {
  851. if (isDragging) {
  852. e.preventDefault();
  853. dateTimeContainer.style.right = 'unset';
  854. dateTimeContainer.style.left = (e.pageX - initialX) + 'px';
  855. dateTimeContainer.style.top = (e.pageY - initialY) + 'px';
  856. }
  857. });
  858. document.addEventListener('mouseup', function() {
  859. isDragging = false;
  860. if (dateTimeContainer) {
  861. var currentPosition = {
  862. left: dateTimeContainer.style.left,
  863. top: dateTimeContainer.style.top
  864. };
  865. localStorage.setItem('dateTimePosition', JSON.stringify(currentPosition));
  866. }
  867. });
  868. }
  869. window.addEventListener('load', injectDateTime);
  870. })();
  871. }
  872. if (!globals['movableClocks']) {
  873. let clockHtml = `
  874. <div id="clockContainer">
  875. <div id="clock"></div>
  876. <div id="date"></div>
  877. </div>
  878. <style>
  879. div#clockContainer {
  880. font-family: Montserrat;
  881. background-color: var(--bckgClr1);
  882. border: 3px solid var(--brdrClr1);
  883. color: var(--txtClr1);
  884. padding: 5px 5px 5px 10px;
  885. font-weight: bold;
  886. font-size: 15px; }
  887. </style>`
  888. $('#tr_actions').after(clockHtml);
  889. }
  890. }
  891.  
  892. // Сухареки
  893.  
  894. if (globals['customDefectDelay']) { // Включить отображение дефектов в игровой
  895. let cstmDfctStyle = `<style id='cstmDfctStyle'></style>`
  896. $('head').append(cstmDfctStyle);
  897. if (globals['cstmDfctShowColors']) { // Включить подсветку клетки с больными
  898. if (globals['cstmDfctShowRamki']) {
  899. let cstmDfctRamki = `
  900. /* ОБЩЕЕ */
  901. ol.mouth>li>div.e>div[style*='disease'], ol.mouth>li>div.e>div[style*='trauma'], ol.mouth>li>div.e>div[style*='drown'], ol.mouth>li>div.e>div[style*='wound'], ol.mouth>li>div.e>div[style*='poisoning'], ol.mouth>li>div.e>div[style*='dirt'] {
  902. padding-top: 0px !important; }
  903.  
  904. /* КАШЕЛЬ */
  905. #tr_field [style*='disease'] {
  906. outline: 5px solid rgba(232, 255, 0, .5);
  907. outline-offset: -5px;
  908. padding-top: 16px; }
  909.  
  910. /* СКАЛЫ */
  911. #tr_field [style*='trauma'] {
  912. outline: 5px solid rgba(0, 255, 232, .3);
  913. outline-offset: -5px;
  914. padding-top: 16px; }
  915.  
  916. /* ВОДЫ */
  917. #tr_field [style*='drown'] {
  918. outline: 5px solid rgba(72, 255, 0, .3);
  919. outline-offset: -5px;
  920. padding-top: 16px; }
  921.  
  922. /* РАНЫ */
  923. #tr_field [style*='wound'] {
  924. outline: 5px solid rgba(0, 0, 255, .3);
  925. outline-offset: -5px;
  926. padding-top: 16px; }
  927.  
  928. /* ОТРАВЛЕНИЕ */
  929. #tr_field [style*='poisoning'] {
  930. outline: 5px solid rgba(255, 0, 0, .3);
  931. outline-offset: -5px;
  932. padding-top: 16px; }`
  933. $('#cstmDfctStyle').append(cstmDfctRamki);
  934. }
  935. if (!globals['cstmDfctShowRamki']) {
  936. let cstmDfctColors = `
  937. /* КАШЕЛЬ */
  938. #tr_field [style*='disease'] {
  939. background-color: rgba(238, 255, 70, .25) !important;
  940. padding-top: 16px; }
  941.  
  942. ol.mouth>li>div.e>div[style*='disease'] {
  943. padding-top: 0px !important; }
  944.  
  945. /* СКАЛЫ */
  946. #tr_field [style*='trauma'] {
  947. background-color: rgba(70, 255, 239, .25) !important;
  948. padding-top: 16px; }
  949.  
  950. ol.mouth>li>div.e>div[style*='trauma'] {
  951. padding-top: 0px !important; }
  952.  
  953. /* ВОДЫ */
  954. #tr_field [style*='drown'] {
  955. background-color: rgba(104, 255, 70, .25) !important;
  956. padding-top: 16px; }
  957.  
  958. ol.mouth>li>div.e>div[style*='drown'] {
  959. padding-top: 0px !important; }
  960.  
  961. /* РАНЫ */
  962. #tr_field [style*='wound'] {
  963. background-color: rgba(70, 70, 255, .25) !important;
  964. padding-top: 16px; }
  965.  
  966. ol.mouth>li>div.e>div[style*='wound'] {
  967. padding-top: 0px !important; }
  968.  
  969. /* ОТРАВЛЕНИЕ */
  970. #tr_field [style*='poisoning'] {
  971. background-color: rgba(255, 70, 70, .25) !important;
  972. padding-top: 16px; }
  973.  
  974. ol.mouth>li>div.e>div[style*='poisoning'] {
  975. padding-top: 0px !important; }`
  976. $('#cstmDfctStyle').append(cstmDfctColors);
  977. }
  978. }
  979. if (globals['cstmDfctShowNum']) { // Включить добавление иконок и цифр на клетках с больными
  980. if (globals['cstmDfctShowRamki']) {
  981. let cstmDfctNum1 = `
  982. /* КАШЕЛЬ */
  983. #tr_field [style*='disease/1']{
  984. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Кашель%201Р.png) !important; }
  985.  
  986. /* СКАЛЫ */
  987. #tr_field [style*='trauma/1'] {
  988. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Ушибы%201Р.png) !important; }
  989.  
  990. #tr_field [style*='trauma/2'] {
  991. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Ушибы%202Р.png) !important; }
  992.  
  993. #tr_field [style*='trauma/3'] {
  994. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Ушибы%203Р.png) !important; }
  995.  
  996. #tr_field [style*='trauma/4'] {
  997. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Ушибы%204Р.png) !important; }
  998.  
  999. /* ВОДЫ */
  1000. #tr_field [style*='drown/1'] {
  1001. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Переломы%201Р.png) !important; }
  1002.  
  1003. #tr_field [style*='drown/2'] {
  1004. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Переломы%202Р.png) !important; }
  1005.  
  1006. #tr_field [style*='drown/3'] {
  1007. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Переломы%203Р.png) !important; }
  1008.  
  1009. #tr_field [style*='drown/4'] {
  1010. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Переломы%204Р.png) !important; }
  1011.  
  1012. /* РАНЫ */
  1013. #tr_field [style*='wound/1'] {
  1014. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Раны%201Р.png) !important; }
  1015.  
  1016. #tr_field [style*='wound/2'] {
  1017. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Раны%202Р.png) !important; }
  1018.  
  1019. #tr_field [style*='wound/3'] {
  1020. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Раны%203Р.png) !important; }
  1021.  
  1022. #tr_field [style*='wound/4'] {
  1023. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Раны%204Р.png) !important; }
  1024.  
  1025. /* ОТРАВЛЕНИЕ */
  1026. #tr_field [style*='poisoning/1'] {
  1027. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Отравление%201Р.png) !important; }
  1028.  
  1029. #tr_field [style*='poisoning/2'] {
  1030. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Отравление%202Р.png) !important; }
  1031.  
  1032. #tr_field [style*='poisoning/3'] {
  1033. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Отравление%203Р.png) !important; }
  1034.  
  1035. #tr_field [style*='poisoning/4'] {
  1036. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Отравление%204Р.png) !important; }`
  1037. $('#cstmDfctStyle').append(cstmDfctNum1);
  1038. }
  1039. if (!globals['cstmDfctShowRamki']) {
  1040. let cstmDfctNum = `
  1041. /* КАШЕЛЬ */
  1042. #tr_field [style*='disease/1']{
  1043. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Кашель%201.png) !important; }
  1044.  
  1045. /* СКАЛЫ */
  1046. #tr_field [style*='trauma/1'] {
  1047. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Ушибы%201.png) !important; }
  1048.  
  1049. #tr_field [style*='trauma/2'] {
  1050. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Ушибы%202.png) !important; }
  1051.  
  1052. #tr_field [style*='trauma/3'] {
  1053. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Ушибы%203.png) !important; }
  1054.  
  1055. #tr_field [style*='trauma/4'] {
  1056. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Ушибы%204.png) !important; }
  1057.  
  1058. /* ВОДЫ */
  1059. #tr_field [style*='drown/1'] {
  1060. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Переломы%201.png) !important; }
  1061.  
  1062. #tr_field [style*='drown/2'] {
  1063. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Переломы%202.png) !important; }
  1064.  
  1065. #tr_field [style*='drown/3'] {
  1066. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Переломы%203.png) !important; }
  1067.  
  1068. #tr_field [style*='drown/4'] {
  1069. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Переломы%204.png) !important; }
  1070.  
  1071. /* РАНЫ */
  1072. #tr_field [style*='wound/1'] {
  1073. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Раны%201.png) !important; }
  1074.  
  1075. #tr_field [style*='wound/2'] {
  1076. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Раны%202.png) !important; }
  1077.  
  1078. #tr_field [style*='wound/3'] {
  1079. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Раны%203.png) !important; }
  1080.  
  1081. #tr_field [style*='wound/4'] {
  1082. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Раны%204.png) !important; }
  1083.  
  1084. /* ОТРАВЛЕНИЕ */
  1085. #tr_field [style*='poisoning/1'] {
  1086. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Отравление%201.png) !important; }
  1087.  
  1088. #tr_field [style*='poisoning/2'] {
  1089. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Отравление%202.png) !important; }
  1090.  
  1091. #tr_field [style*='poisoning/3'] {
  1092. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Отравление%203.png) !important; }
  1093.  
  1094. #tr_field [style*='poisoning/4'] {
  1095. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Отравление%204.png) !important; }`
  1096. $('#cstmDfctStyle').append(cstmDfctNum);
  1097. }
  1098. }
  1099. if (globals['cstmDfctShowHighDirt']) {
  1100. if (globals['cstmDfctShowColors']) { // Показывать 3-4 стадии грязи подсветкой клеток
  1101. if (globals['cstmDfctShowRamki']) {
  1102. let highDirtRamki = `
  1103. div[style*='dirt/base/1/3'], div[style*='dirt/base/2/3'], div[style*='/dirt/base/1/4.png'], div[style*='dirt/base/2/4'] {
  1104. outline: 5px solid rgba(108, 0, 255, .3);
  1105. outline-offset: -5px;
  1106. padding-top: 16px !important; }`
  1107. }
  1108. if (!globals['cstmDfctShowRamki']) {
  1109. let highDirtColors = `
  1110. div[style*='dirt/base/1/3'], div[style*='dirt/base/2/3'], div[style*='/dirt/base/1/4.png'], div[style*='dirt/base/2/4'] {
  1111. background-color: rgba(146, 70, 255, 0.25) !important;
  1112. padding-top: 16px !important;}
  1113.  
  1114. ol.mouth>li>div.e>div[style*='dirt/base/1/3'], ol.mouth>li>div.e>div[style*='dirt/base/2/3'], ol.mouth>li>div.e>div[style*='dirt/base/1/4'], ol.mouth>li>div.e>div[style*='dirt/base/2/4'] {
  1115. background-color: rgba(146, 70, 255, 0.25) !important;
  1116. padding-top: 0px !important;}`
  1117. $('#cstmDfctStyle').append(highDirtColors);
  1118. }
  1119. }
  1120. if (globals['cstmDfctShowNum']) { // Подсветка 3-4 стадий грязи иконкой и цифрой
  1121. if (globals['cstmDfctShowRamki']) {
  1122. let highDirtRamki = `
  1123. #tr_field [style*='/dirt/base/1/3.png'], #tr_field [style*='dirt/base/2/3'] {
  1124. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Грязь%203Р.png) !important; }
  1125.  
  1126. #tr_field [style*='/dirt/base/1/4.png'], #tr_field [style*='dirt/base/2/4'] {
  1127. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Грязь%204Р.png) !important; }`
  1128. }
  1129. if (!globals['cstmDfctShowRamki']) {
  1130. let highDirtNum = `
  1131. #tr_field [style*='/dirt/base/1/3.png'], #tr_field [style*='dirt/base/2/3'] {
  1132. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Грязь%203.png) !important; }
  1133.  
  1134. #tr_field [style*='/dirt/base/1/4.png'], #tr_field [style*='dirt/base/2/4'] {
  1135. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Грязь%204.png) !important; }`
  1136. $('#cstmDfctStyle').append(highDirtNum);
  1137. }
  1138. }
  1139. }
  1140. if (globals['cstmDfctShowLowDirt']) {
  1141. if (globals['cstmDfctShowRamki']) {
  1142. let lowDirtRamki = `
  1143. /* ГРЯЗЬ */
  1144. div[style*='dirt/base/1/1'], div[style*='dirt/base/2/1'], div[style*='/dirt/base/1/2.png'], div[style*='dirt/base/2/2'] {
  1145. outline: 5px solid rgba(108, 0, 255, .3);
  1146. outline-offset: -5px;
  1147. padding-top: 16px !important; }`
  1148. $('#cstmDfctStyle').append(lowDirtRamki);
  1149. }
  1150. if (!globals['cstmDfctShowRamki']) {
  1151. if (globals['cstmDfctShowColors']) { // Подсветка 1-2 стадий грязи подсветкой клеток
  1152. let lowDirtColors = `
  1153. div[style*='dirt/base/1/1'], div[style*='dirt/base/2/1'], div[style*='/dirt/base/1/2.png'], div[style*='dirt/base/2/2'] {
  1154. background-color: rgba(146, 70, 255, 0.25) !important;
  1155. padding-top: 16px !important;}
  1156.  
  1157. ol.mouth>li>div.e>div[style*='dirt/base/1/1'], ol.mouth>li>div.e>div[style*='dirt/base/2/1'], ol.mouth>li>div.e>div[style*='dirt/base/1/2'], ol.mouth>li>div.e>div[style*='dirt/base/2/2'] {
  1158. background-color: rgba(146, 70, 255, 0.25) !important;
  1159. padding-top: 0px !important;}`
  1160. $('#cstmDfctStyle').append(lowDirtColors);
  1161. }
  1162. }
  1163. if (globals['cstmDfctShowNum']) { // Подсветка 1-2 стадий грязи иконкой и цифрой
  1164. if (globals['cstmDfctShowRamki']) {
  1165. let lowDirtNum1 = `
  1166. #tr_field [style*='dirt/base/1/1'], #tr_field [style*='dirt/base/2/1'] {
  1167. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Грязь%201Р.png) !important; }
  1168.  
  1169. #tr_field [style*='/dirt/base/1/2.png'], #tr_field [style*='dirt/base/2/2'] {
  1170. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Грязь%202Р.png) !important; }`
  1171. $('#cstmDfctStyle').append(lowDirtNum1);
  1172. }
  1173. if (!globals['cstmDfctShowRamki']) {
  1174. let lowDirtNum = `
  1175. #tr_field [style*='dirt/base/1/1'], #tr_field [style*='dirt/base/2/1'] {
  1176. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Грязь%201.png) !important; }
  1177.  
  1178. #tr_field [style*='/dirt/base/1/2.png'], #tr_field [style*='dirt/base/2/2'] {
  1179. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Грязь%202.png) !important; }`
  1180. $('#cstmDfctStyle').append(lowDirtNum);
  1181. }
  1182. }
  1183. }
  1184. if (globals['cstmDfctShow34WoundBetter']) { // Лучшее отображение для раненых 3-4 стадии
  1185. if (globals['cstmDfctShowRamki']) {
  1186. let wounds341 = `
  1187. #tr_field [style*='wound/3'] {
  1188. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Раны%203!Р.png) !important; }
  1189.  
  1190. #tr_field [style*='wound/4'] {
  1191. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Раны%204!!!Р.png) !important; }`
  1192. $('#cstmDfctStyle').append(wounds341);
  1193. }
  1194. if (!globals['cstmDfctShowRamki']) {
  1195. let wounds34 = `
  1196. #tr_field [style*='wound/3'] {
  1197. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Rany_3_33.png) !important; }
  1198.  
  1199. #tr_field [style*='wound/4'] {
  1200. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Rany_4_33__33__33.png) !important; }`
  1201. $('#cstmDfctStyle').append(wounds34);
  1202. }
  1203. }
  1204. if (globals['cstmDfctShowAllBetter']) { // Лучшее отображение для всех болезней
  1205. if (globals['cstmDfctShowRamki']) {
  1206. let cstmDfctAllBetter1 = `
  1207. /* КАШЕЛЬ */
  1208. #tr_field [style*='disease/1']{
  1209. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Кашель%201Р.png) !important; }
  1210.  
  1211. #tr_field [style*='trauma/3'] {
  1212. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Ушибы%203!Р.png) !important; }
  1213.  
  1214. #tr_field [style*='trauma/4'] {
  1215. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Ушибы%204!!!Р.png) !important; }
  1216.  
  1217. /* ВОДЫ */
  1218. #tr_field [style*='drown/3'] {
  1219. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Переломы%203!Р.png) !important; }
  1220.  
  1221. #tr_field [style*='drown/4'] {
  1222. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Переломы%204!!!Р.png) !important; }
  1223.  
  1224. #tr_field [style*='poisoning/3'] {
  1225. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Отравление%203!Р.png) !important; }
  1226.  
  1227. #tr_field [style*='poisoning/4'] {
  1228. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/БолезниР/Отравление%204!!!Р.png) !important; }`
  1229. $('#cstmDfctStyle').append(cstmDfctAllBetter1);
  1230. }
  1231. if (!globals['cstmDfctShowRamki']) {
  1232. let cstmDfctAllBetter = `
  1233. /* КАШЕЛЬ */
  1234. #tr_field [style*='disease/1']{
  1235. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Кашель%201.png) !important; }
  1236.  
  1237. #tr_field [style*='trauma/3'] {
  1238. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Ushiby_3_33.png) !important; }
  1239.  
  1240. #tr_field [style*='trauma/4'] {
  1241. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Ushiby_4_33__33__33.png) !important; }
  1242.  
  1243. /* ВОДЫ */
  1244. #tr_field [style*='drown/3'] {
  1245. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Perelomy_3_33.png) !important; }
  1246.  
  1247. #tr_field [style*='drown/4'] {
  1248. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Perelomy_4_33__33__33.png) !important; }
  1249.  
  1250. #tr_field [style*='poisoning/3'] {
  1251. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Otravlenie_3_33.png) !important; }
  1252.  
  1253. #tr_field [style*='poisoning/4'] {
  1254. content: url(https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/Болезни/Otravlenie_4_33__33) !important; }`
  1255. $('#cstmDfctStyle').append(cstmDfctAllBetter);
  1256. }
  1257. }
  1258. }
  1259.  
  1260. if (globals['cstmDfctShowDivers']) {
  1261. let cstmDfctDivers = `
  1262. <style id="dfctDivers">
  1263. #tr_field [style*='/cw3/cats/0/costume/7.png'], [style*='/cw3/cats/-1/costume/7.png'] {
  1264. content: url(https://i.ibb.co/dG6mhTj/image.png) !important;
  1265. padding-top: 16px !important;
  1266. padding-left: 1.5px !important;}
  1267. </style>`
  1268. $('head').append(cstmDfctDivers);
  1269. }
  1270. if (globals['cstmDfctShowPodstilki']) {
  1271. let cstmDfctPodstilkiDelay = `
  1272. <style id="dfctPodstilki">
  1273. #tr_field [style*='/cw3/cats/0/costume/295.png'], [style*='/cw3/cats/-1/costume/295.png'], [style*='/cw3/cats/1/costume/295.png'] {
  1274. background-color: rgba(121, 85, 61, .25) !important;
  1275. padding-top: 16px !important;}
  1276.  
  1277. ol.mouth>li>div.e>div[style*='/cw3/cats/0/costume/295.png'], ol.mouth>li>div.e>div[style*='/cw3/cats/-1/costume/295.png'], ol.mouth>li>div.e>div[style*='/cw3/cats/1/costume/295.png'] {
  1278. padding-top: 0px !important; }
  1279. </style>`
  1280. $('head').append(cstmDfctPodstilkiDelay);
  1281. }
  1282.  
  1283. // Кыр сосичка
  1284.  
  1285. if (globals['customItemsDelay']) { // Подсветка трав и других полезных ресурсов в Игровой
  1286. let cstmItmStyle = `<style id='cstmItmStyle'></style>`
  1287. $('head').append(cstmItmStyle);
  1288. if (globals['cstmItmHerbDelay']) { // Отображение трав
  1289. let cstmItmHerbs = `
  1290. .cage_items[style*='things/13.png'],
  1291. .cage_items[style*='things/15.png'],
  1292. .cage_items[style*='things/17.png'],
  1293. .cage_items[style*='things/19.png'],
  1294. .cage_items[style*='things/21.png'],
  1295. .cage_items[style*='things/23.png'],
  1296. .cage_items[style*='things/25.png'],
  1297. .cage_items[style*='things/26.png'],
  1298. .cage_items[style*='things/106.png'],
  1299. .cage_items[style*='things/108.png'],
  1300. .cage_items[style*='things/109.png'],
  1301. .cage_items[style*='things/110.png'],
  1302. .cage_items[style*='things/111.png'],
  1303. .cage_items[style*='things/112.png'],
  1304. .cage_items[style*='things/115.png'],
  1305. .cage_items[style*='things/116.png'],
  1306. .cage_items[style*='things/119.png'],
  1307. .cage_items[style*='things/655.png'] {
  1308. background-color: rgba(43, 255, 117, 0.25) !important;}`
  1309. $('#cstmItmStyle').append(cstmItmHerbs);
  1310. }
  1311. if (globals['cstmItmMossDelay']) { // Отображение мха
  1312. let cstmItmMoss = `
  1313. /* МОХ (обычный, водяной и желчный) */
  1314. .cage_items[style*='things/75.png'], .cage_items[style*='things/78.png'], .cage_items[style*='things/95.png'] {
  1315. background-color: rgba(43, 255, 117, 0.25) !important;}`
  1316. $('#cstmItmStyle').append(cstmItmMoss);
  1317. }
  1318. if (globals['cstmItmWebDelay']) { // Отображение паутины
  1319. let cstmItmWeb = `
  1320. /* ПАУТИНА */
  1321. .cage_items[style*='things/20.png'] {
  1322. background-color: rgba(43, 255, 117, 0.25) !important;}`
  1323. $('#cstmItmStyle').append(cstmItmWeb);
  1324. }
  1325. if (globals['cstmItmStickDelay']) { // Отображение STICKS.
  1326. let cstmItmSticks = `
  1327. /* ВЕТКИ, ВЬЮНКИ, КОСТОПРАВЫ, ПЛОТНЫЕ ВОДОРОСЛИ */
  1328. .cage_items[style*='things/565.png'], .cage_items[style*='things/566.png'], .cage_items[style*='things/562.png'], .cage_items[style*='things/563.png'], .cage_items[style*='things/3993.png'] {
  1329. background-color: rgba(43, 255, 117, 0.25) !important;}`
  1330. $('#cstmItmStyle').append(cstmItmSticks);
  1331. }
  1332. if (globals['cstmItmDustDelay']) { // Отображение Звёздной Пыли
  1333. let cstmItmDust = `
  1334. /* ПЫЛЬ */
  1335. .cage_items[style*='things/94.png'], .cage_items[style*='things/385.png'], .cage_items[style*='things/386.png'], .cage_items[style*='things/387.png'], .cage_items[style*='things/388.png'], .cage_items[style*='things/389.png'], .cage_items[style*='things/390.png'], .cage_items[style*='things/391.png'], .cage_items[style*='things/392.png'] {
  1336. background-color: rgba(192, 150, 226, 0.25) !important;}`
  1337. $('#cstmItmStyle').append(cstmItmDust);
  1338. }
  1339. if (globals['cstmItmMusorDelay']) { // Отображение muror
  1340. let cstmItmMusor = `
  1341. /* КОСТИ */
  1342. .cage_items[style*='things/985.png'], .cage_items[style*='things/986.png'], .cage_items[style*='things/987.png'], .cage_items[style*='things/988.png'], .cage_items[style*='things/989.png'] {
  1343. background-color: rgba(255, 43, 43, 0.25) !important;}
  1344. /* ПАДАЛЬ, ГНИЛЬ */
  1345. .cage_items[style*='things/44.png'], .cage_items[style*='things/180.png'] {
  1346. background-color: rgba(255, 43, 43, 0.25) !important;}
  1347. /* МОХ (испорченный) */
  1348. .cage_items[style*='things/77.png'] {
  1349. background-color: rgba(255, 43, 43, 0.25) !important;}
  1350. /* МУСОР */
  1351. .cage_items[style*='things/7801.png'], .cage_items[style*='things/7802.png'], .cage_items[style*='things/7803.png'], .cage_items[style*='things/7804.png'], .cage_items[style*='things/7805.png'], .cage_items[style*='things/7806.png'] {
  1352. background-color: rgba(255, 43, 43, 0.25) !important;}`
  1353. $('#cstmItmStyle').append(cstmItmMusor);
  1354. }
  1355. }
  1356.  
  1357. // Луковые колечьки
  1358.  
  1359. if (globals['phoneFightPanel']) { // Панелька боережима для телефонщиков
  1360. let dangerModes = $('input[value="T+1"], input[value="T+2"], input[value="T+3"]').clone();
  1361. $('input[value="T+1"], input[value="T+2"], input[value="T+3"]').remove();
  1362. $('#fightLog').after(dangerModes);
  1363. if ($('#fteams-wrap').length === 0) { // Проверка на наличие модифицированного БР
  1364. // Если элемента нет, меняем стиль окна бр
  1365. $('#fightPanel').css('height', 'auto');
  1366. }
  1367. let fightPanelStyle = `
  1368. <style id="fightPanelStyle">
  1369. [value="T+1"] {
  1370. position: relative;
  1371. bottom: 0px;
  1372. left: 0px;
  1373. width: 65px !important;}
  1374. [value="T+2"] {
  1375. position: relative;
  1376. bottom: 0px;
  1377. left: 31px;
  1378. width: 65px !important;}
  1379. [value="T+3"] {
  1380. position: relative;
  1381. bottom: 0px;
  1382. left: 62px;
  1383. width: 65px !important;}
  1384. .hotkey {
  1385. margin-left: 15px;
  1386. width: 40px;
  1387. border-radius: 2px;}
  1388. img#block {
  1389. transform: scale(105%);
  1390. position: relative;
  1391. left: 5px;
  1392. top: 1.8px;}
  1393. </style>`
  1394. $('head').append(fightPanelStyle);
  1395. }
  1396.  
  1397. // Френдли кетвар лучшая функция
  1398.  
  1399. if (globals['friendlyCatWar']) {
  1400. $('#fightPanel input[value="T+1"]').remove();
  1401. $('#fightPanel input[value="T+2"]').remove();
  1402. $('#fightPanel input[value="T+3"]').remove();
  1403. }
  1404.  
  1405. // Чупачупсеки
  1406.  
  1407. if (globals['darkCatTooltip']) {
  1408. let darkCss = `
  1409. <style>
  1410. span.cat_tooltip, span.cat_tooltip>a, span.cat_tooltip>u>a {
  1411. color: #a2abb5c7 !important; }
  1412.  
  1413. span.cat_tooltip {
  1414. background: #1a1d22ed !important;
  1415. border: #4f4f59 0.5px solid !important;
  1416. filter: brightness(105%); }
  1417.  
  1418. span.cat_tooltip>[src*="odoroj"] {
  1419. filter: brightness(70%) contrast(90%); }
  1420.  
  1421. span.cat_tooltip>span.online {
  1422. filter: brightness(190%) contrast(50%) opacity(95%); }
  1423. </style>`
  1424. $('head').append(darkCss);
  1425. }
  1426.  
  1427. // Газеровочька
  1428.  
  1429. if (globals['showButterflyBots']) {
  1430. let butterflyCss = `<style>
  1431. /* ОБЫЧНАЯ */
  1432. img[src*='things/990.png'] {
  1433. border: 15px solid rgba(255, 170, 0, .6); }
  1434.  
  1435. ol.mouth>li>img[src*='things/990.png'] {
  1436. border: none; }
  1437.  
  1438. ol#itemList>li>img[src*='things/990.png'] {
  1439. border: none; }
  1440.  
  1441. /* КРАСИВАЯ */
  1442. img[src*='things/991.png'] {
  1443. border: 15px solid rgba(255, 170, 0, .6); }
  1444.  
  1445. ol.mouth>li>img[src*='things/991.png'] {
  1446. border: none; }
  1447.  
  1448. ol#itemList>li>img[src*='things/991.png'] {
  1449. border: none; }
  1450.  
  1451. /* РЕДКАЯ */
  1452. img[src*='things/992.png'] {
  1453. border: 15px solid rgba(255, 170, 0, .6); }
  1454.  
  1455. ol.mouth>li>img[src*='things/992.png'] {
  1456. border: none; }
  1457.  
  1458. ol#itemList>li>img[src*='things/992.png'] {
  1459. border: none; }
  1460. </style>`
  1461. $('head').append(butterflyCss);
  1462. }
  1463.  
  1464. // Лимонадек
  1465.  
  1466. if (globals['brightGameField']) {
  1467. let brightCss = `
  1468. <style>
  1469. div#cages_div {
  1470. opacity: 1 !important; }
  1471. </style>`
  1472. $('head').append(brightCss);
  1473. }
  1474.  
  1475. // Чокопайчеки
  1476.  
  1477. if (globals['deleteFPTitles']) {
  1478. let fptitlesCss = `
  1479. <style>
  1480. div#fightPanel input.hotkey:hover {
  1481. pointer-events: none;
  1482. }
  1483. </style>`
  1484. $('head').append(fptitlesCss);
  1485.  
  1486. }
  1487. if (globals["costumeLibrary"]) {
  1488. (function() {
  1489. 'use strict';
  1490. const githubUrl = 'https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/COSTUMES/catwarScript_Costumes.css?raw=true';
  1491. $.ajax({
  1492. url: githubUrl,
  1493. dataType: 'text',
  1494. success: function(data) {
  1495. $('head').append('<style>' + data + '</style>');
  1496. }
  1497. });
  1498. })();
  1499. if (globals["watermarkCostumes"]) {
  1500. (function() {
  1501. 'use strict';
  1502. const githubUrl = 'https://raw.githubusercontent.com/CatWarScript/CatWarScript/main/COSTUMES/catwarScript_CostumesW.css?raw=true';
  1503. $.ajax({
  1504. url: githubUrl,
  1505. dataType: 'text',
  1506. success: function(data) {
  1507. $('head').append('<style>' + data + '</style>');
  1508. }});})();}}
  1509. // Эта скобка literally закрывает весь мир
  1510. }
  1511.  
  1512. // ...
  1513. // ...
  1514. // ...
  1515.  
  1516. function myCat() {
  1517. if (globals['boneCorrectTimer']) {
  1518. let boneCorrectDiv = `
  1519. <div id="timer">
  1520. <i>(c) CWScript</i><b>Костоправы</b><div id="timerMain">
  1521. <input type="number" id="days" min="0" value='0' placeholder="Days" class="templateInputs">
  1522. <label for="days">Введите дни</label><br>
  1523. <input type="number" id="hours" min="0" value='0' max="23" placeholder="Hours" class="templateInputs">
  1524. <label for="hours">Введите часы</label><br>
  1525. <input type="number" id="minutes" min="0" value='0' max="59" placeholder="Minutes" class="templateInputs">
  1526. <label for="minutes">Введите минуты</label><br></div>
  1527. <div id="buttons"> <!-- новый div для кнопок -->
  1528. <button id="start" class="boneCorrectBtns">Запустить таймер</button> <button id="reset" class="boneCorrectBtns">Отменить таймер</button>
  1529. </div>
  1530. <span id="message"></span>
  1531. </div>`
  1532.  
  1533. function toggleBoneTimer() {
  1534. $('#timer').slideToggle();
  1535. }
  1536. let toggleButton = $('<button id="toggleBoneCorrectButton" type="button">Калькулятор костоправов</button>').click(toggleBoneTimer);
  1537. appendToElementOrPrependFallback('#pr', '#education-show', toggleButton);
  1538. appendToElementOrPrependFallback('#pr', '#education-show', boneCorrectDiv);
  1539. let cssBoneCorrect = `
  1540. <style>
  1541. div#timer>b {
  1542. border: 3px solid var(--brdrClr1);
  1543. display: block;
  1544. text-align: center;
  1545. font-size: 23px;
  1546. padding: 10px;
  1547. padding-top: 21px;
  1548. padding-bottom: 16px;
  1549. margin-top: -22px;
  1550. letter-spacing: 15px;
  1551. text-transform: uppercase; }
  1552.  
  1553. div#timer {
  1554. border: 3px solid var(--brdrClr1);
  1555. margin: 5px 0;
  1556. background-color: var(--bckgClr1);
  1557. color: var(--txtClr1);
  1558. font-family: Montserrat; }
  1559.  
  1560. div#timer>i {
  1561. display: block;
  1562. text-align: right;
  1563. padding-top: 5px;
  1564. padding-right: 10px;
  1565. font-size: 11px; }
  1566.  
  1567. input.templateInputs {
  1568. background-color: var(--bckgClr3);
  1569. color: var(--txtClr3);
  1570. border: 1px solid var(--brdrClr3);
  1571. font-family: Verdana;
  1572. font-size: .9em;
  1573. width: 50px;
  1574. margin-left: 10px;
  1575. margin-bottom: 5px; }
  1576.  
  1577. button.boneCorrectBtns, #toggleBoneCorrectButton {
  1578. background-color: var(--bckgClr3);
  1579. color: var(--txtClr3);
  1580. border: 1px solid var(--brdrClr3);
  1581. font-family: Verdana;
  1582. font-size: .9em;
  1583. margin: 0 1em;
  1584. display: inline-block; }
  1585.  
  1586. button.boneCorrectBtns:hover, #toggleBoneCorrectButton:hover {
  1587. border: 1px solid var(--brdrClr2); }
  1588.  
  1589. div#timerMain {
  1590. max-height: 140px;
  1591. overflow: auto;
  1592. background-color: var(--bckgClr2);
  1593. color: var(--txtClr2);
  1594. padding: 7px;
  1595. padding-bottom: 1px; }
  1596.  
  1597. div#buttons {
  1598. border-top: 3px solid var(--brdrClr1);
  1599. padding-top: 5px;
  1600. padding-bottom: 5px;
  1601. text-align: center; }
  1602.  
  1603. span#message {
  1604. display: block;
  1605. text-align: center !important; }
  1606. </style>`
  1607. $('head').append(cssBoneCorrect);
  1608. if (globals['toggleBoneTimer']) {
  1609. $('#timer').hide();
  1610. }
  1611. }
  1612. }
  1613.  
  1614. // ...
  1615. // ...
  1616. // ...
  1617.  
  1618. function all() {
  1619. function addFont() {
  1620. let link = document.createElement('link');
  1621. link.href = 'https://fonts.googleapis.com/css?family=Montserrat';
  1622. link.rel = 'stylesheet';
  1623. document.head.appendChild(link);
  1624. if (!globals['cwscriptDarkTheme']) {
  1625. let cssDlyaCWScripta = `
  1626. <style id="cssPalette">
  1627. html {
  1628. --scrlClr1: #776c5f;
  1629. --scrlClr2: #463E33;
  1630. --hrClr1: #463E3330;
  1631. --txtClr1: #C8C0BE;
  1632. --txtClr2: #181510;
  1633. --txtClr3: #fff;
  1634. --brdrClr1: #BD7E5C;
  1635. --brdrClr2: #ff0;
  1636. --brdrClr3: #000;
  1637. --bckgClr1: #463E33;
  1638. --bckgClr2: #918474;
  1639. --bckgClr3: #333;
  1640. --bckgClr4: #463E3350;
  1641. --bckgClr5: #DBAEFF;
  1642. --bckgClr6: #BB8DEB; }
  1643. </style>`
  1644. $('head').append(cssDlyaCWScripta);
  1645. }
  1646. if (globals['cwscriptDarkTheme']) {
  1647. let cssDlyaCWScripta = `
  1648. <style id="cssPalette">
  1649. html {
  1650. --scrlClr1: #1f1f1f;
  1651. --scrlClr2: #383838;
  1652. --hrClr1: #29292930;
  1653. --txtClr1: #b9b9b9;
  1654. --txtClr2: #070707;
  1655. --txtClr3: #fff;
  1656. --brdrClr1: #888;
  1657. --brdrClr2: #ff0;
  1658. --brdrClr3: #000;
  1659. --bckgClr1: #282828;
  1660. --bckgClr2: #5e5e5e;
  1661. --bckgClr3: #333;
  1662. --bckgClr4: #15151550;
  1663. --bckgClr5: #DBAEFF;
  1664. --bckgClr6: #BB8DEB;}
  1665. </style>`
  1666. $('head').append(cssDlyaCWScripta);
  1667. }
  1668. };
  1669. addFont();
  1670.  
  1671. // Wenomechainasama
  1672. // Tumajarbisaun
  1673.  
  1674. if (globals['dontReadenLS']) {
  1675. function updateDontReadCounter() {
  1676. let count = localStorage.getItem('dontReadenCount');
  1677. if (count > 0) {
  1678. if ($('#newls').length) {
  1679. if ($('#dontReadCounter').length) {
  1680. $('#dontReadCounter').text('(' + count + ')');
  1681. }
  1682. else {
  1683. let counter = $('<span id="dontReadCounter">(' + count + ')</span>');
  1684. $('#newls').after(counter);
  1685. }
  1686. }
  1687. else if ($('div.kn6').length) {
  1688. if ($('#dontReadCounter').length) {
  1689. $('#dontReadCounter').text('(' + count + ')');
  1690. }
  1691. else {
  1692. let counter = $('<span id="dontReadCounter">(' + count + ')</span>');
  1693. $('div.kn6').after(counter);
  1694. }
  1695. }
  1696. }
  1697. else {
  1698. $('#dontReadCounter').remove();
  1699. }
  1700. $(document).ready(function() {
  1701. $('#dontReadCounter').click(function(e) {
  1702. e.preventDefault();
  1703. });
  1704. $('#dontReadCounter').click();
  1705. });
  1706. }
  1707.  
  1708. setInterval(updateDontReadCounter, 1000);
  1709.  
  1710. let cssDontReadLS = `
  1711. <style>
  1712. .dontReadButton:hover {
  1713. border: 1px solid var(--brdrClr2);
  1714. }
  1715. .dontReadButton {
  1716. background-color: var(--bckgClr3);
  1717. color: var(--txtClr3);
  1718. border: 1px solid var(--brdrClr3);
  1719. font-family: Verdana;
  1720. font-size: .9em;
  1721. }
  1722. #dontReadCounter {
  1723. background-color: var(--bckgClr5);
  1724. font-weight: 700;
  1725. color: var(--brdrClr3);
  1726. text-decoration: none !important;
  1727. pointer-events: none !important;
  1728. }
  1729. </style>`
  1730. $('head').append(cssDontReadLS);
  1731. }
  1732.  
  1733. // Wifenlooof
  1734.  
  1735. function updateClock() {
  1736. setInterval(() => {
  1737. const now = new Date();
  1738.  
  1739. let time;
  1740. if (globals['isClockMoscow']) {
  1741. time = now.toLocaleTimeString('ru-RU', {
  1742. timeZone: 'Europe/Moscow',
  1743. hour12: false
  1744. });
  1745. }
  1746. else {
  1747. time = now.toLocaleTimeString('ru-RU', {
  1748. hour12: false
  1749. });
  1750. }
  1751.  
  1752. $('#clock').text(time);
  1753.  
  1754. if (globals['isDateShow']) {
  1755. updateDate(now);
  1756. }
  1757. else {
  1758. $('#date').text('');
  1759. }
  1760. }, 1000);
  1761. }
  1762.  
  1763. function updateDate(now) {
  1764. const daysOfWeek = ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота'];
  1765. const monthsOfYear = ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'];
  1766.  
  1767. const date = daysOfWeek[now.getDay()] + ', ' + now.getDate() + ' ' + monthsOfYear[now.getMonth()];
  1768.  
  1769. $('#date').text(date);
  1770. }
  1771.  
  1772. $(document).ready(function() {
  1773. $('#inGameClock').prop('checked', globals['inGameClock']);
  1774. $('#deviceTime').prop('checked', !globals['isClockMoscow']);
  1775. $('#moscowTime').prop('checked', globals['isClockMoscow']);
  1776. $('#showDate').prop('checked', globals['isDateShow']);
  1777.  
  1778. $('#inGameClock').on('change', function() {
  1779. setSettings('inGameClock', this.checked);
  1780. updateClock();
  1781. });
  1782.  
  1783. $('input[name="timeSource"]').on('change', function() {
  1784. setSettings('isClockMoscow', this.id === 'moscowTime');
  1785. });
  1786.  
  1787. $('#showDate').on('change', function() {
  1788. setSettings('isDateShow', this.checked);
  1789. });
  1790.  
  1791. $('.cs-chapter').on('click', function() {
  1792. updateClock();
  1793. });
  1794.  
  1795. updateClock();
  1796. });
  1797.  
  1798. // Eselifterbraun
  1799.  
  1800. if (globals['boneCorrectTimer']) {
  1801. let timerId;
  1802.  
  1803. function updateTimerMessage() {
  1804. let timerStart = localStorage.getItem('timerStart');
  1805. let timerDuration = localStorage.getItem('timerDuration');
  1806. if (timerStart && timerDuration) {
  1807. let timeLeft = timerDuration - (Date.now() - timerStart);
  1808. if (timeLeft > 0) {
  1809. let secondsLeft = Math.floor(timeLeft / 1000);
  1810. let minutesLeft = Math.floor(secondsLeft / 60);
  1811. let hoursLeft = Math.floor(minutesLeft / 60);
  1812. let daysLeft = Math.floor(hoursLeft / 24);
  1813. secondsLeft %= 60;
  1814. minutesLeft %= 60;
  1815. hoursLeft %= 24;
  1816. $('#message').text(`До окончания таймера осталось: ${daysLeft} дней, ${hoursLeft} часов, ${minutesLeft} минут, ${secondsLeft} секунд`);
  1817. }
  1818. else {
  1819. $('#message').text('Таймер истёк, Вы можете снять костоправ!');
  1820. localStorage.removeItem('timerStart');
  1821. localStorage.removeItem('timerDuration');
  1822. }
  1823. }
  1824. else {
  1825. $('#message').text('');
  1826. }
  1827. }
  1828. $('#start').click(function() {
  1829. if (timerId) {
  1830. clearTimeout(timerId);
  1831. }
  1832. let days = parseInt($('#days').val()) || 0;
  1833. let hours = parseInt($('#hours').val()) || 0;
  1834. let minutes = parseInt($('#minutes').val()) || 0;
  1835. let time = ((days * 24 + hours) * 60 + minutes) * 60 * 1000;
  1836. timerId = setTimeout(function() {
  1837. alert('Таймер истёк, Вы можете снять костоправ!');
  1838. localStorage.removeItem('timerStart');
  1839. localStorage.removeItem('timerDuration');
  1840. $('#message').text('Таймер истёк, Вы можете снять костоправ!');
  1841. }, time);
  1842. localStorage.setItem('timerStart', Date.now());
  1843. localStorage.setItem('timerDuration', time);
  1844. updateTimerMessage();
  1845. });
  1846. $('#reset').click(function() {
  1847. clearTimeout(timerId);
  1848. timerId = null;
  1849. $('#days').val('');
  1850. $('#hours').val('');
  1851. $('#minutes').val('');
  1852. localStorage.removeItem('timerStart');
  1853. localStorage.removeItem('timerDuration');
  1854. $('#message').text('');
  1855. });
  1856. setInterval(updateTimerMessage, 1000);
  1857. let timerStart = localStorage.getItem('timerStart');
  1858. let timerDuration = localStorage.getItem('timerDuration');
  1859. if (timerStart && timerDuration) {
  1860. let timeLeft = timerDuration - (Date.now() - timerStart);
  1861. if (timeLeft > 0) {
  1862. timerId = setTimeout(function() {
  1863. alert('Таймер истёк, Вы можете снять костоправ!');
  1864. localStorage.removeItem('timerStart');
  1865. localStorage.removeItem('timerDuration');
  1866. $('#message').text('Таймер истёк, Вы можете снять костоправ!');
  1867. }, timeLeft);
  1868. }
  1869. else {
  1870. alert('Таймер истёк, Вы можете снять костоправ!');
  1871. localStorage.removeItem('timerStart');
  1872. localStorage.removeItem('timerDuration');
  1873. }
  1874. }
  1875. updateTimerMessage();
  1876. }
  1877.  
  1878. // Anweculbetugtbaby
  1879.  
  1880. if (globals['hideWoundWarning']) {
  1881. setTimeout(function() {
  1882. $('#warningAboutWound').remove
  1883. }, 1000);
  1884. };
  1885.  
  1886. // Aslonskysrblu
  1887.  
  1888. if (globals['nightLagsWarning']) {
  1889. nightLagsWarning();
  1890. }
  1891.  
  1892. // Yuaksoinocenow
  1893.  
  1894. $('#clearDontReadButton').on('click', function() {
  1895. for (let i = 0; i < localStorage.length; i++) {
  1896. let key = localStorage.key(i);
  1897. if (key.startsWith('message')) {
  1898. localStorage.removeItem(key);
  1899. }
  1900. }
  1901. updateDontReadCounter();
  1902. $('#messList tr').removeClass('dontReaden');
  1903. });
  1904. }
  1905.  
  1906. // ...
  1907. // ...
  1908. // ...
  1909.  
  1910. function site() {
  1911. if (globals['hideWoundWarning']) {
  1912. $('#warningAboutWound').remove();
  1913. };
  1914. }