Harem Heroes++ modified by 1121

Adding things here and there in Harem Heroes game.

  1. // ==UserScript==
  2. // @name Harem Heroes++ modified by 1121
  3. // @namespace haremheroes.com
  4. // @description Adding things here and there in Harem Heroes game.
  5. // @version 0.06.6
  6. // @match https://nutaku.haremheroes.com/*
  7. // @match https://www.hentaiheroes.com/*
  8. // @match https://www.gayharem.com/*
  9. // @match http://test.hentaiheroes.com/*
  10. // @run-at document-end
  11. // @grant none
  12. // @author Raphael Updated by 1121
  13. // ==/UserScript==
  14.  
  15. /* ==================
  16. localStorage
  17. ==================
  18. - lsMarket (updated each time you enter the Market / click buttons in Market)
  19. .buyable
  20. .potion.Nb = number of buyable books
  21. .potion.Xp = total xp of buyable books
  22. .potion.Value = cost of buyable books
  23. .gift.Nb = number of owned gifts
  24. .gift.Xp = total affection of buyable gifts
  25. .gift.Value = cost of buyable gifts
  26. .stocks
  27. .armor.Nb = number of owned equipments
  28. .booster.Nb = number of owned boosters
  29. .potion.Nb = number of owned books
  30. .potion.Xp = total xp you can give to your girls
  31. .gift.Nb = number of owned gifts
  32. .gift.Xp = total affection you can give to your girls
  33. .restock
  34. .herolvl = hero level before restock
  35. .time = next market restock time
  36. ================== */
  37. var lang = "en";
  38. if($('html')[0].lang == "en")
  39. lang = "en";
  40. else if($('html')[0].lang == "es_ES"){
  41. lang = "es";
  42. }
  43. else if($('html')[0].lang == "de_DE"){
  44. // lang = "de";
  45. }
  46. else if($('html')[0].lang == "fr"){
  47. lang = "fr";
  48. }
  49. else if($('html')[0].lang == "it_IT"){
  50. // lang = "it";
  51. }
  52.  
  53. //alert($('html')[0].lang);
  54. //lang = "et";
  55. var GIRLS_EXP_LEVELS = [10, 21, 32, 43, 54, 65, 76, 87, 98, 109, 120, 131, 142, 154, 166, 178, 190, 202, 214, 226, 238, 250, 262, 274, 286, 299, 312, 325, 338, 351, 364, 377, 390, 403, 416, 429, 443, 457, 471, 485, 499, 513, 527, 541, 555, 569, 584, 599, 614, 629, 644, 659, 674, 689, 704, 720, 736, 752, 768, 784, 800, 816, 832, 849, 866, 883, 900, 917, 934, 951, 968, 985, 1003, 1021, 1039, 1057, 1075, 1093, 1111, 1130, 1149, 1168, 1187, 1206, 1225, 1244, 1264, 1284, 1304, 1324, 1344, 1364, 1384, 1405, 1426, 1447, 1468, 1489, 1510, 1531, 1553, 1575, 1597, 1619, 1641, 1663, 1686, 1709, 1732, 1755, 1778, 1801, 1825, 1849, 1873, 1897, 1921, 1945, 1970, 1995, 2020, 2045, 2070, 2096, 2122, 2148, 2174, 2200, 2227, 2254, 2281, 2308, 2335, 2363, 2391, 2419, 2447, 2475, 2504, 2533, 2562, 2591, 2620, 2650, 2680, 2710, 2740, 2770, 2801, 2832, 2863, 2894, 2926, 2958, 2990, 3022, 3055, 3088, 3121, 3154, 3188, 3222, 3256, 3290, 3325, 3360, 3395, 3430, 3466, 3502, 3538, 3574, 3611, 3648, 3685, 3722, 3760, 3798, 3836, 3875, 3914, 3953, 3992, 4032, 4072, 4112, 4153, 4194, 4235, 4277, 4319, 4361, 4403, 4446, 4489, 4532, 4576, 4620, 4664, 4709, 4754, 4799, 4845, 4891, 4937, 4984, 5031, 5078, 5126, 5174, 5223, 5272, 5321, 5371, 5421, 5471, 5522, 5573, 5624, 5676, 5728, 5781, 5834, 5887, 5941, 5995, 6050, 6105, 6160, 6216, 6272, 6329, 6386, 6444, 6502, 6560, 6619, 6678, 6738, 6798, 6859, 6920, 6981, 7043, 7105, 7168, 7231, 7295, 7359, 7424, 7489, 7555, 7621, 7688, 7755, 7823, 7891, 7960, 8029, 8099, 8169, 8240, 8311, 8383, 8455, 8528, 8601, 8675, 8750, 8825, 8901, 8977, 9054, 9131, 9209, 9288, 9367, 9447, 9527, 9608, 9690, 9772, 9855, 9938, 10022, 10107, 10192, 10278, 10365, 10452, 10540, 10628, 10717, 10807, 10897, 10988, 11080, 11172, 11265, 11359, 11454, 11549, 11645, 11742, 11839, 11937, 12036, 12136, 12236, 12337, 12439, 12542, 12645, 12749, 12854, 12960, 13067, 13174, 13282, 13391, 13501, 13612, 13723, 13835, 13948, 14062, 14177, 14293, 14409, 14526, 14644, 14763, 14883, 15004, 15126, 15249, 15373, 15498, 15623, 15749, 15876, 16004, 16133, 16263, 16394, 16526, 16659, 16793, 16928, 17064, 17201, 17339, 17478, 17618, 17759, 17901, 18044, 18189, 18335, 18482, 18630, 18779, 18929, 19080, 19232, 19385, 19540, 19696, 19853, 20011, 20170, 20330, 20492, 20655, 20819, 20984, 21151, 21319, 21488, 21658, 21830, 22003, 22177, 22352, 22529, 22707, 22886, 23067, 23249, 23432, 23617, 23803, 23991, 24180, 24370, 24562, 24755, 24950, 25146, 25344];
  56. var texts = [];
  57. texts.fr = {
  58. navigate:"Déplaces-toi",
  59. current:"actuelle",
  60. locked:"bloquée",
  61. unlock_it:"débloques-la!",
  62. scene:"scène",
  63. harem:"Harem",
  64. bottom:"bas",
  65. or:"ou",
  66. total:"total",
  67. affection:"affection",
  68. harem_stats:"Stats du harem",
  69. haremettes:"haremettes",
  70. hardcore:"Hardcore",
  71. charm:"Charme",
  72. know_how:"Savoir-faire",
  73. unlocked_scenes:"scènes débloquées",
  74. money_incomes:"Revenu",
  75. per_hour:"par heure",
  76. when_all_collectable:"quand tout est disponible",
  77. required_to_unlock:"Requis pour débloquer la scène",
  78. my_stocks:"Mes Stocks",
  79. top:"haut",
  80. equipments:"équipments",
  81. boosters:"boosters",
  82. books:"livres",
  83. gifts:"cadeaux",
  84. currently_buyable:"Stocks achetable",
  85. visit_the:'Visite le <a href="../shop.html">Marché</a> first.',
  86. not_combatible:"Votre navigateur n'est pas compatible.",
  87. or_level:"ou niveau",
  88. restock:"Restock",
  89. wiki:"wiki",
  90. she_is_your:"Elle est ta", //He_is_your:"Il est ton',
  91. evolution_costs:"ème haremette. Ses coûts d'évolutions sont",
  92. world:"Monde ",
  93. villain:" villain",
  94. fight_villain:"Combats un villain",
  95. you_own:"Tu possèdes",
  96. you_can_give:"Tu peux donner un total de",
  97. you_can_sell:"Tu peux tout vendre pour",
  98. Xp:"Xp",
  99. stat_points_need:"Nombre de points requis pour max",
  100. money_need:"Argent demandée pour max",
  101. money_spent:"Argent dépensé dans le Marché",
  102. bought_points:"Points achetés au Marché",
  103. equipment_points:"Points donnés par ton équipement",
  104. points_from_level:"Points donnés par ton niveau",
  105. quick_list:"Liste rapide",
  106. required_to_get_max_level:"Requis pour obtenir toutes les filles au niveau maximum"
  107. };
  108. texts.es = {
  109. navigate:"Navegar",
  110. current:"actual",
  111. locked:"bloqueado",
  112. unlock_it:"desbloquealo!",
  113. scene:"escena",
  114. harem:"Harén",
  115. bottom:"Fondo",
  116. or:"o",
  117. total:"Total",
  118. affection:"afecto",
  119. harem_stats:"Estatus del Harén",
  120. haremettes:"haremettes",
  121. hardcore:"Folladas",
  122. charm:"Encanto",
  123. know_how:"Saber-hacer",
  124. unlocked_scenes:"escenas desbloqueadas",
  125. money_incomes:"Ingreso de dinero",
  126. per_hour:"por hora",
  127. when_all_collectable:"cuando todo es coleccionable",
  128. required_to_unlock:"Requerido para desbloquear todas las escenas bloqueadas",
  129. my_stocks:"Mi Stock",
  130. top:"Tope",
  131. equipments:"equipamiento",
  132. boosters:"potenciadores",
  133. books:"libros",
  134. gifts:"regalos",
  135. currently_buyable:"Stocks Comprables Actualmente",
  136. visit_the:'Visita el <a href="../shop.html">Mercado</a> primero.',
  137. not_combatible:"Tu navegador no es compatible.",
  138. or_level:"o nivel",
  139. restock:"Restock",
  140. wiki:"wiki",
  141. she_is_your:"Ella es tu",
  142. evolution_costs:"ta haremette. Sus costo de evolucion son",
  143. world:"Mundo ",
  144. villain:" villano",
  145. fight_villain:"Pelear un villano",
  146. you_own:"Tienes",
  147. you_can_give:"Puedes dar un total de",
  148. you_can_sell:"Puedes vender todo por",
  149. Xp:"Xp",
  150. stat_points_need:"Puntos de estatus necesarios para maximo",
  151. money_need:"Dinero necesario para maximo",
  152. money_spent:"Dinero usado en el mercado",
  153. bought_points:"Puntos comprados del mercado",
  154. equipment_points:"Puntos de estatus de equipamiento",
  155. points_from_level:"Puntos de estatus de nivel",
  156. quick_list:"Lista Rapida",
  157. required_to_get_max_level:"Requerido para obtener el máximo nivel de todas las chicas"
  158. };
  159.  
  160. texts.en = {
  161. navigate:"Navigate",
  162. current:"current",
  163. locked:"locked",
  164. unlock_it:"unlock it!",
  165. scene:"scene",
  166. harem:"Harem",
  167. bottom:"Bottom",
  168. or:"or",
  169. total:"Total",
  170. affection:"affection",
  171. harem_stats:"Harem Stats",
  172. haremettes:"haremettes",
  173. hardcore:"Hardcore",
  174. charm:"Charm",
  175. know_how:"Know-how",
  176. unlocked_scenes:"unlocked scenes",
  177. money_incomes:"Money incomes",
  178. per_hour:"per hour",
  179. when_all_collectable:"when all collectable",
  180. required_to_unlock:"Required to unlock all locked scenes",
  181. my_stocks:"My Stocks",
  182. top:"Top",
  183. equipments:"equipments",
  184. boosters:"boosters",
  185. books:"books",
  186. gifts:"gifts",
  187. currently_buyable:"Currently Buyable Stocks",
  188. visit_the:'Visit the <a href="../shop.html">Market</a> first.',
  189. not_combatible:"Your webbrowser is not compatible.",
  190. or_level:"or level",
  191. restock:"Restock",
  192. wiki:"'s wiki page",
  193. she_is_your:"She is your",
  194. evolution_costs:"th haremette. Evolution costs are",
  195. world:"World ",
  196. villain:" villain",
  197. fight_villain:"Fight a villain",
  198. you_own:"You own",
  199. you_can_give:"You can give a total of",
  200. you_can_sell:"You can sell everything for",
  201. Xp:"Xp",
  202. stat_points_need:"Stat points need to max",
  203. money_need:"Money need to max",
  204. money_spent:"Money spent in market",
  205. bought_points:"Bought points from market",
  206. equipment_points:"Equipments stat points",
  207. points_from_level:"Stat points from level",
  208. quick_list:"Quick list",
  209. required_to_get_max_level:"Required to get all haremettes max level"
  210. };
  211. texts.et = {
  212. navigate:"Navigeeri",
  213. current:"praegune",
  214. locked:"lukus",
  215. unlock_it:"ava!",
  216. scene:"stseen",
  217. harem:"Naase haaremisse",
  218. bottom:"Alla",
  219. or:"või",
  220. total:"Kokku",
  221. affection:"kiinduvust",
  222. harem_stats:"Haaremi näitajad",
  223. haremettes:"haaremi naist",
  224. hardcore:"Hardcore",
  225. charm:"Sarm",
  226. know_how:"Teadmisi",
  227. unlocked_scenes:"avatud stseene",
  228. money_incomes:"Sissetulek",
  229. per_hour:"tunnis",
  230. when_all_collectable:"kui kõik valmis",
  231. required_to_unlock:"Maksumus, et avada stseenid",
  232. my_stocks:"Minu laoseis",
  233. top:"Üles",
  234. equipments:"eset",
  235. boosters:"boonust",
  236. books:"raamatut",
  237. gifts:"kingitust",
  238. currently_buyable:"Praegu ostetavad",
  239. visit_the:'Külasta <a href="../shop.html">turgu</a> kõigepealt.',
  240. not_combatible:"Sinu brauser ei ühildu.",
  241. or_level:"või level",
  242. restock:"Lao uuendus",
  243. wiki:" wiki",
  244. she_is_your:"Ta on sinu",
  245. evolution_costs:" haaremi liige. Tema evolutsiooni maksumused",
  246. world:"Maailma",
  247. villain:"boss",
  248. fight_villain:"Võitle bossiga",
  249. you_own:"Sul on",
  250. you_can_give:"Sa saad lisada kokku",
  251. you_can_sell:"Sa saad müügiga teenida",
  252. Xp:"Xp",
  253. stat_points_need:"Oskuse punkte maksimumini",
  254. money_need:"Raha maksimumini",
  255. money_spent:"Raha kulunud oskuspunktidele",
  256. bought_points:"Ostetud oskuse punkte",
  257. equipment_points:"Esemete oskuse punktid",
  258. points_from_level:"Oskuse punkte levelist",
  259. quick_list:"Sorteeritud nimekiri",
  260. required_to_get_max_level:"Vajalik, et saada kõik tüdrukud maksimum levelini"
  261. };
  262. var CurrentPage = window.location.pathname;
  263.  
  264. // css define
  265. var sheet = (function() {
  266. var style = document.createElement('style');
  267. document.head.appendChild(style);
  268. return style.sheet;
  269. })();
  270.  
  271. // verify localstorage
  272. var lsAvailable = (lsTest() === true) ? 'yes' : 'no';
  273.  
  274. FightATroll(); // added everywhere
  275. if (CurrentPage.indexOf('shop') != -1) ModifyMarket(); // Current page: Market
  276. else if (CurrentPage.indexOf('harem') != -1) ModifyHarem(); // Current page: Harem
  277. else if (CurrentPage.indexOf('quest') != -1) ModifyScenes(); // Current page: Haremettes' Scenes
  278.  
  279.  
  280. /* ======================
  281. Fight A Troll Menu
  282. ====================== */
  283.  
  284. function FightATroll() {
  285. // Some pages don't carry the Hero data - skip the menu in this case by Hollo
  286. if (typeof Hero == 'undefined') {
  287. return;
  288. }
  289. // Trolls' database
  290. var Trolls = ['Dark Lord', 'Ninja Spy', 'Gruntt', 'Edwarda', 'Donatien', 'Silvanus', 'Bremen', 'Finalmecia', 'Fredy Sih Roko Senseï'];
  291.  
  292. // get current world of player
  293. var CurrentWorld = Hero.infos.questing.id_world - 1,
  294. TrollName = '',
  295. TrollsMenu = '';
  296.  
  297. // generate troll list
  298. for (var i = 0; i < CurrentWorld; i++) {
  299. if (typeof Trolls[i] !== typeof undefined && Trolls[i] !== false) {
  300. TrollName = Trolls[i];
  301. } else TrollName = texts[lang].world + ' ' + (i+1) + ' ' + texts[lang].villain;
  302. TrollsMenu += '<a href="/battle.html?id_troll=' + (i+1) + '">' + TrollName + '</a><br />';
  303. }
  304.  
  305. // display: 'Fight a troll' menu
  306. $('#contains_all > header').children('[type=energy_fight]').append('<div id="FightTroll">' + texts[lang].fight_villain + '<span class="Arrow"></span><div class="TrollsMenu">' + TrollsMenu + '</div></div>');
  307. fightTrollCss();
  308. }
  309.  
  310.  
  311. /* ==========
  312. Market
  313. ========== */
  314.  
  315. function ModifyMarket() {
  316. var loc2 = $('.hero_stats').children();
  317. loc2.each(function() {
  318. var stat = $(this).attr("hero");
  319. if(stat == "carac1" || stat == "carac2" || stat == "carac3"){
  320. $(this).append('<span class="CustomStats"></span><div id="CustomStats' + stat +'" class="StatsTooltip"></div>');
  321. }
  322. });
  323.  
  324. updateStats();
  325.  
  326. function updateStats(){
  327. var loc2 = $('.hero_stats').children();
  328. var last_cost = 0,
  329. levelPoints = 0,
  330. levelMoney = 0,
  331. level = Hero.infos.level;
  332. if(level <=25)
  333. levelPoints = level *40;
  334. else
  335. levelPoints = 1000 + (level-25)*19;
  336. levelMoney = calculateTotalPrice(levelPoints);
  337. loc2.each(function() {
  338. var stat = $(this).attr("hero");
  339. $(".CustomStats").html('');
  340. if(stat == "carac1" || stat == "carac2" || stat == "carac3"){
  341. var currentStatPoints = Hero.infos[stat],
  342. remainingPoints = levelPoints - currentStatPoints,
  343. currentMoney = calculateTotalPrice(currentStatPoints),
  344. remainingMoney = levelMoney - currentMoney,
  345. skillPoints = Hero.infos.caracs[stat],
  346. itemPoints = Hero.infos.items[stat],
  347. boughtPoints = Hero.infos[stat];
  348. skillPoints = skillPoints - itemPoints - boughtPoints;
  349.  
  350.  
  351. $("#CustomStats" + stat).html(
  352. "<b>" + texts[lang].stat_points_need + ":</b> " + NbCommas(remainingPoints) + "<br />" +
  353. "<b>" + texts[lang].money_need + ": </b>" + NbCommas(remainingMoney) + "<br />" +
  354. "<b>" + texts[lang].money_spent + ": </b>" + NbCommas(currentMoney) + "<br /><br />" +
  355. "<b>" + texts[lang].bought_points + ": </b>" + NbCommas(boughtPoints) + "<br />" +
  356. "<b>" + texts[lang].equipment_points + ": </b>" + NbCommas(itemPoints) + "<br />" +
  357. "<b>" + texts[lang].points_from_level + ": </b>" + NbCommas(skillPoints) + "<br />"
  358. );
  359. }
  360. });
  361. }
  362.  
  363. function calculateTotalPrice(points){
  364. var last_price = calculateStatPrice(points);
  365. if(points < 2001)
  366. price = (5+last_price)/2*(points);
  367. else if(points < 4001){
  368. price = 4012005+(4009+last_price)/2*(points-2001);
  369. }else if(points < 6001)
  370. price = 20026005+(12011+last_price)/2*(points-4001);
  371. else if(points < 8001)
  372. price = 56042005+(24013+last_price)/2*(points-6001);
  373. else if(points < 10001)
  374. price = 120060005+(40015+last_price)/2*(points-8001);
  375. return price;
  376. }
  377.  
  378. function calculateStatPrice(points){
  379. var cost = 0;
  380. if(points < 2001)
  381. cost = 3 + points * 2;
  382. else if(points < 4001)
  383. cost = 4005+(points-2001)*4;
  384. else if(points < 6001)
  385. cost = 12005+(points-4001)*6;
  386. else if(points < 8001)
  387. cost = 24005+(points-6001)*8;
  388. else if(points < 10001)
  389. cost = 40005+(points-8001)*10;
  390. return cost;
  391. }
  392.  
  393.  
  394. var lsMarket = {};
  395. lsMarket.buyable = {};
  396. lsMarket.stocks = {};
  397. lsMarket.restock = {};
  398.  
  399. setTimeout( function() {
  400. // save time of restock
  401. var RestockTimer = $('#shop > .shop_count > span').text().split(':'),
  402. s = 0, m = 1;
  403. // convert HH:MM:SS or MM:SS or SS to seconds
  404. while (RestockTimer.length > 0) {
  405. s += m * parseInt(RestockTimer.pop(), 10);
  406. m *= 60;
  407. }
  408. lsMarket.restock.herolvl = Hero.infos.level;
  409. lsMarket.restock.time = (new Date()).getTime() + s*1000;
  410.  
  411. // first load
  412. get_buyableStocks('potion');
  413. get_buyableStocks('gift');
  414. equipments_shop(0);
  415. boosters_shop(0);
  416. books_shop(0);
  417. gifts_shop(0);
  418. }, 500 );
  419.  
  420.  
  421. // catch click on Buy, Restock, Equip/Offer or Sell > update tooltip after 500ms
  422. var timer;
  423. $('#shop > button, #inventory > button').click(function() {
  424. var clickedButton = $(this).attr('rel'),
  425. opened_shop = $('#shop').children('.selected');
  426. clearTimeout(timer); // kill previous update
  427. timer = setTimeout( function() {
  428. if (opened_shop.hasClass('armor')) {
  429. equipments_shop(1);
  430. } else if (opened_shop.hasClass('booster')) {
  431. boosters_shop(1);
  432. } else if (opened_shop.hasClass('potion')) {
  433. if (clickedButton == 'buy' || clickedButton == 'shop_reload') get_buyableStocks('potion');
  434. books_shop(1);
  435. } else if (opened_shop.hasClass('gift')) {
  436. if (clickedButton == 'buy' || clickedButton == 'shop_reload') get_buyableStocks('gift');
  437. gifts_shop(1);
  438. }
  439. }, 500 );
  440. });
  441.  
  442. function get_buyableStocks(loc_class) {
  443. // initialize
  444. var itemsNb = 0,
  445. itemsXp = 0,
  446. itemsPrice = 0,
  447. loc = $('#shop').children('.' + loc_class);
  448. // get stats
  449. loc.find('.slot').each(function() {
  450. if ($(this).hasClass('empty')) return false;
  451. var item = $(this).data('d');
  452. itemsNb++;
  453. itemsXp += parseInt(item.value, 10);
  454. itemsPrice += parseInt(item.price, 10);
  455. });
  456. // save
  457. lsMarket.buyable[loc_class] = {'Nb':itemsNb, 'Xp':itemsXp, 'Value':itemsPrice};
  458. }
  459.  
  460. function equipments_shop(update) {
  461. tt_create(update, 'armor', 'EquipmentsTooltip', 'equipments', '');
  462. }
  463. function boosters_shop(update) {
  464. tt_create(update, 'booster', 'BoostersTooltip', 'boosters', '');
  465. }
  466. function books_shop(update) {
  467. tt_create(update, 'potion', 'BooksTooltip', 'books', 'Xp');
  468. }
  469. function gifts_shop(update) {
  470. tt_create(update, 'gift', 'GiftsTooltip', 'gifts', 'affection');
  471. }
  472.  
  473. // create/update tooltip & save to localstorage
  474. function tt_create(update, loc_class, tt_class, itemName, itemUnit) {
  475. // initialize
  476. var itemsNb = 0,
  477. itemsXp = (itemUnit === '') ? -1 : 0,
  478. itemsSell = 0,
  479. loc = $('#inventory').children('.' + loc_class);
  480.  
  481. // get stats
  482. loc.find('.slot').each(function() {
  483. if ($(this).hasClass('empty')) return false;
  484. var item = $(this).data('d'),
  485. Nb = parseInt(item.count, 10);
  486. itemsNb += Nb;
  487. itemsSell += Nb * parseInt(item.price_sell, 10);
  488. if (itemsXp != -1) itemsXp += Nb * parseInt(item.value, 10);
  489. });
  490.  
  491. var tooltip = texts[lang].you_own + ' <b>' + NbCommas(itemsNb) + '</b> ' + texts[lang][itemName] + '.<br />' +
  492. (itemsXp == -1 ? '' : texts[lang].you_can_give + ' <b>' + NbCommas(itemsXp) + '</b> ' + texts[lang][itemUnit] + '.<br />') +
  493. texts[lang].you_can_sell + ' <b>' + NbCommas(itemsSell) + '</b> <span class="imgMoney"></span>.';
  494.  
  495. // save to localstorage
  496. lsMarket.stocks[loc_class] = (loc_class == 'potion' || loc_class == 'gift') ? {'Nb':itemsNb, 'Xp':itemsXp} : {'Nb':itemsNb};
  497. localStorage.setItem('lsMarket', JSON.stringify(lsMarket));
  498.  
  499. // create or update tooltip
  500. if (update === 0) {
  501. loc.prepend('<span class="CustomTT"></span><div class="' + tt_class + '">' + tooltip + '</div>');
  502. } else {
  503. loc.children('.' + tt_class).html(tooltip);
  504. }
  505. }
  506. $('plus').on('click', function (event) {
  507. var stat = "carac" + $(this).attr("for_carac");
  508. Hero.infos[stat]++;
  509. timer = setTimeout( function() {
  510. updateStats();
  511. }, 400 );
  512.  
  513.  
  514. });
  515. marketCss();
  516. }
  517.  
  518.  
  519. /* =========
  520. Harem
  521. ========= */
  522.  
  523. function ModifyHarem() {
  524. // initialize
  525. var i = 0,
  526. GirlId = '',
  527. GirlName = '',
  528. Anchor = '',
  529. Specialty = [0, 0, 0], // [Hardcore, Charm, Know-how]
  530. UnlockedSc = 0,
  531. AvailableSc = 0,
  532. IncHourly = 0,
  533. IncCollect = 0,
  534. HList = [],
  535. Saffection = 0, // S= Stats tab
  536. Smoney = 0,
  537. Skobans = 0,
  538. ScenesLink = '',
  539. total_exp = GIRLS_EXP_LEVELS[Hero.infos.level-2],
  540. totalXpNeeded = 0;
  541.  
  542. var EvoReq = [];
  543. EvoReq.push({ affection: 15, money: 3150, kobans: 3 });
  544. EvoReq.push({ affection: 50, money: 6750, kobans: 6 });
  545. EvoReq.push({ affection: 150, money: 18000, kobans: 18 });
  546. EvoReq.push({ affection: 700, money: 135000, kobans: 90 });
  547. EvoReq.push({ affection: 1750, money: 968000, kobans: 300 });
  548.  
  549. $('#harem_left').find('div[girl]').each( function(){
  550. i++;
  551.  
  552. GirlId = $(this).attr('girl');
  553. GirlName = $(this).find('h4').text();
  554. IncCollect += parseInt($(this).find('.sal').text(), 10);
  555. HList.push({Id: GirlId, Order: i, Name: GirlName});
  556.  
  557. $(this).attr('id', GirlName);
  558. if ($(this).hasClass('opened')) Anchor = GirlName;
  559.  
  560. $(this).find('h4').append('<div class="HaremetteNb">' + i + '</div>');
  561. });
  562. var haremBottomGirl = GirlName;
  563.  
  564. // auto-scroll to anchor
  565. location.hash = '#' + Anchor;
  566.  
  567. // get haremettes stats & display wiki link
  568. i = 0;
  569. $('#harem_right').children('[girl]').each( function() {
  570. // display: wiki link
  571. if(HH_UNIVERSE == "gay")
  572. $(this).append('<div class="WikiLink"><a href="https://harem-battle.club/wiki/Gay-Harem/GH:' + HList[i].Name + '" target="_blank"> ' + HList[i].Name + texts[lang].wiki + ' </a></div>');
  573. else
  574. $(this).append('<div class="WikiLink"><a href="https://harem-battle.club/wiki/Harem-Heroes/HH:' + HList[i].Name + '" target="_blank"> ' + HList[i].Name + texts[lang].wiki + ' </a></div>');
  575.  
  576. i++;
  577.  
  578. var j = 0,
  579. Taffection = 0, // T= Total requirements (right tooltip)
  580. Tmoney = 0,
  581. Tkobans = 0,
  582. FirstLockedScene = 1,
  583. AffectionTT = texts[lang].she_is_your + ' <b>' + i + '</b>' + texts[lang].evolution_costs + ':<br />',
  584. girl_quests = $(this).find('.girl_quests');
  585.  
  586. // get stats: specialty
  587. Spe = parseInt($(this).find('h3 > span').attr('carac'), 10) - 1;
  588. Specialty[Spe]++;
  589.  
  590. // get stats: hourly income update by Hollo
  591. //IncHourly += parseInt($(this).find('.salary').text(), 10);
  592. var salaryStr = $(this).find('.salary').text().replace(/\s|,/g,"");
  593. IncHourly += parseInt(salaryStr, 10);
  594.  
  595. girl_quests.find('g').each( function() {
  596. // prepare affection tooltip
  597. var Raffection = EvoReq[j].affection * i, // R= Required for this star (right tooltip)
  598. Rmoney = EvoReq[j].money * i,
  599. Rkobans = EvoReq[j].kobans * i;
  600. if(i>20){
  601. if(j==3){
  602. Raffection = 14000;
  603. Rmoney = 2700000;
  604. Rkobans = 1800;
  605. } else if(j==4){
  606. Raffection = 35000;
  607. Rmoney = 19360000;
  608. Rkobans = 6000;
  609. }
  610. }
  611. if(i>100){
  612. if(j==0){
  613. Raffection = 1500;
  614. Rmoney = 315000;
  615. Rkobans = 300;
  616. } else if(j==1){
  617. Raffection = 5000;
  618. Rmoney = 675000;
  619. Rkobans = 600;
  620. } else if(j==2){
  621. Raffection = 15000;
  622. Rmoney = 1800000;
  623. Rkobans = 1800;
  624. }
  625. }
  626. if(hh_nutaku)
  627. Rkobans = Math.ceil(Rkobans/6);
  628. Taffection += Raffection;
  629. Tmoney += Rmoney;
  630. Tkobans += Rkobans;
  631. j++;
  632. AffectionTT += addPriceRow(j + '</b><span class="imgStar"></span>', Raffection, Rmoney, Rkobans);
  633.  
  634. AvailableSc++;
  635. ScenesLink += (ScenesLink === '') ? 'hh_scenes=' : ',';
  636. var SceneHref = $(this).parent().attr('href');
  637. if ($(this).hasClass('grey') || $(this).hasClass('green')) {
  638. if (FirstLockedScene === 0) {
  639. Saffection += Raffection;
  640. ScenesLink += '0';
  641. } else {
  642. FirstLockedScene = 0;
  643. var XpLeft = girl_quests.parent().children('.girl_exp_left');
  644. var isUpgradable = girl_quests.parent().children('.green_text_button');
  645. // console.log(XpLeft.text());
  646. // console.log(parseInt(XpLeft.text().replace(/[^0-9]/g, ''), 10));
  647. Saffection += (XpLeft.length) ? parseInt(XpLeft.text().replace(/[^0-9]/g, ''), 10) : 0;
  648. ScenesLink += (isUpgradable.length) ? '0.' + isUpgradable.attr('href').substr(7) : '0';
  649. }
  650. Smoney += Rmoney;
  651. Skobans += Rkobans;
  652. } else {
  653. UnlockedSc++;
  654. var attrHref = $(this).parent().attr('href');
  655. if (typeof attrHref != 'undefined') {
  656. ScenesLink += attrHref.substr(7);
  657. }
  658.  
  659. }
  660. });
  661. var counter = 0;
  662. $(this).find('.girl_line').each( function() {
  663. var h4 = $(this).find('h4');
  664. if( counter == 0 ){
  665. var XpLeft = $(this).find('.girl_exp_left');
  666. var xp = (XpLeft.length) ? parseInt(XpLeft.text().replace(/[^0-9]/g, ''), 10) : 0;
  667. var girl_level = $(this).find("span[rel='level']").html();
  668. var girl_current_exp = GIRLS_EXP_LEVELS[girl_level-1] - xp;
  669. totalXpNeeded +=(total_exp - girl_current_exp);
  670. }
  671. counter++;
  672. });
  673. // parseInt(XpLeft.text().replace(/[^0-9]/g, ''), 10)
  674.  
  675. // change scene links
  676. girl_quests.children('a').each(function() {
  677. var attr = $(this).attr('href');
  678. if (typeof attr !== typeof undefined && attr !== false) {
  679. $(this).attr('href', attr + '?' + ScenesLink);
  680. }
  681. });
  682. ScenesLink = '';
  683.  
  684. AffectionTT += addPriceRow(texts[lang].total, Taffection, Tmoney, Tkobans);
  685.  
  686. // display: Affection costs tooltip
  687. girl_quests.parent().children('h4').prepend('<span class="CustomTT"></span><div class="AffectionTooltip">' + AffectionTT + '</div>');
  688. });
  689.  
  690. // ### TAB: Quick List ###
  691.  
  692. // order haremettes alphabetically
  693. HList.sort(function(a, b) {
  694. var textA = a.Name.toUpperCase(),
  695. textB = b.Name.toUpperCase();
  696. return (textA < textB) ? -1 : (textA > textB) ? 1 : 0;
  697. });
  698. // html quick list
  699. var len = HList.length,
  700. QListString = '<div class="QListContent"><span class="Title">' + texts[lang].quick_list + ':</span>';
  701. for (i = 0; i < len; i++) {
  702. QListString += '<br /><a f="ql_girl" girl="' + HList[i].Id + '" href="#' + HList[i].Name + '">' + HList[i].Name + '</a> (#' + HList[i].Order + ')';
  703. }
  704. QListString += '</div>';
  705.  
  706. // ### TAB: Stats ###
  707.  
  708. // Market stocks
  709. try {
  710. var lsMarket = JSON.parse(localStorage.getItem('lsMarket')),
  711. d = new Date(lsMarket.restock.time);
  712. // console.log(lsMarket);
  713.  
  714. // buyable stocks
  715. if (new Date() > lsMarket.restock.time || Hero.infos.level > lsMarket.restock.herolvl) {
  716. var RestockInfo = '> The <a href="../shop.html">Market</a> restocked since your last visit.';
  717. } else {
  718. var marketBookTxt = lsMarket.buyable.potion.Nb + ' ' + texts[lang].books + ' (' + NbCommas(lsMarket.buyable.potion.Xp) + ' Xp)',
  719. marketGiftTxt = lsMarket.buyable.gift.Nb + ' ' + texts[lang].gifts + ' (' + NbCommas(lsMarket.buyable.gift.Xp) + ' Aff)',
  720. RestockInfo = '- ' + marketBookTxt + ' = ' + NbCommas(lsMarket.buyable.potion.Value) + ' <img src="https://i.harem-battle.club/images/2017/01/07/0Gsvn.png">'
  721. + '<br />- ' + marketGiftTxt + ' = ' + NbCommas(lsMarket.buyable.gift.Value) + ' <img src="https://i.harem-battle.club/images/2017/01/07/0Gsvn.png">'
  722. + '<br /><font style="color:gray;">' + texts[lang].restock + ': ' + d.toLocaleString() + ' (' + texts[lang].or_level + ' ' + (Hero.infos.level+1) + ')</font>';
  723. }
  724.  
  725. // my stocks
  726. var myArmorTxt = NbCommas(lsMarket.stocks.armor.Nb) + (lsMarket.stocks.armor.Nb > 99 ? '+ ' : ' ') + ' ' + texts[lang].equipments,
  727. myBoosterTxt = NbCommas(lsMarket.stocks.booster.Nb) + ' ' + texts[lang].boosters,
  728. myBookTxt = NbCommas(lsMarket.stocks.potion.Nb) + ' ' + texts[lang].books + ' (' + NbCommas(lsMarket.stocks.potion.Xp) + ' Xp)',
  729. myGiftTxt = NbCommas(lsMarket.stocks.gift.Nb) + ' ' + texts[lang].gifts + ' (' + NbCommas(lsMarket.stocks.gift.Xp) + ')',
  730. MarketStocks = '- ' + myArmorTxt + ', ' + myBoosterTxt
  731. + '<br />- ' + myBookTxt
  732. + '<br />- ' + myGiftTxt
  733. + '<span class="subTitle">' + texts[lang].currently_buyable + ':</span>'
  734. + RestockInfo;
  735. } catch(e) {
  736. var MarketStocks = (lsAvailable == 'yes') ? '> ' + texts[lang].visit_the : '> ' + texts[lang].not_combatible;
  737. }
  738.  
  739. var StatsString = '<div class="StatsContent"><span class="Title">' + texts[lang].harem_stats + ':</span>' +
  740. '<span class="subTitle" style="margin-top:-10px;">' + i + ' ' + texts[lang].haremettes +':</span>' +
  741. '- ' + Specialty[0] + ' ' + texts[lang].hardcore + ', ' + Specialty[1] + ' ' + texts[lang].charm + ', ' + Specialty[2] + ' ' + texts[lang].know_how + ''
  742. + '<br />- ' + UnlockedSc + '/' + AvailableSc + ' ' + texts[lang].unlocked_scenes + ''
  743. + '<span class="subTitle">' + texts[lang].money_incomes + ':</span>'
  744. + '~' + NbCommas(IncHourly) + ' <img src="https://i.harem-battle.club/images/2017/01/07/0Gsvn.png"> ' + texts[lang].per_hour
  745. + '<br />' + NbCommas(IncCollect) + ' <img src="https://i.harem-battle.club/images/2017/01/07/0Gsvn.png"> ' + texts[lang].when_all_collectable
  746. + '<span class="subTitle">' + texts[lang].required_to_unlock + ':</span>'
  747. + addPriceRow('', Saffection, Smoney, Skobans)
  748. + '<span class="subTitle">' + texts[lang].required_to_get_max_level + ':</span>' //fdfdf
  749. + NbCommas(totalXpNeeded) + ' xp(' + NbCommas(totalXpNeeded*200) + ' <span class="imgMoney"></span>), '+ ' <br />'
  750. + '<span class="subTitle">' + texts[lang].my_stocks + ':</span>'
  751. + MarketStocks
  752. + '</div>';
  753.  
  754. // add custom bar buttons/links & quick list div & stats div
  755. $('#harem_left').append('<div id="CustomBar">'
  756. + '<img f="list" src="https://i.harem-battle.club/images/2017/09/10/FRW.png">'
  757. + '<img f="stats" src="https://i.harem-battle.club/images/2017/09/11/FRh.png">'
  758. + '<div class="TopBottomLinks"><a href="#Bunny">' + texts[lang].top + '</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#' + haremBottomGirl + '">' + texts[lang].bottom + '</a></div>'
  759. + '</div>'
  760. + '<div id="TabsContainer">' + QListString + StatsString + '</div>');
  761.  
  762. // cache
  763. TabsContainer = $('#TabsContainer');
  764. QList = TabsContainer.children('.QListContent');
  765. Stats = TabsContainer.children('.StatsContent');
  766.  
  767. // catch clicks
  768. $('body').click(function(e) {
  769. var clickOn = e.target.getAttribute('f');
  770. switch (clickOn) {
  771. // on quick list button
  772. case 'list':
  773. toggleTabs(QList, Stats);
  774. break;
  775. // on stats button
  776. case 'stats':
  777. toggleTabs(Stats, QList);
  778. break;
  779. // on a girl in quick list
  780. case 'ql_girl':
  781. var clickedGirl = e.target.getAttribute('girl');
  782. $('#harem_left').find('[girl=' + clickedGirl + ']').triggerHandler('click');
  783. break;
  784. // somewhere else except custom containers
  785. default:
  786. var clickedContainer = $(e.target).closest('[id]').attr('id');
  787. if (clickedContainer == 'TabsContainer') return;
  788. TabsContainer.fadeOut(400);
  789. }
  790. });
  791.  
  792. // tabs switching animations
  793. function toggleTabs(tabIn, tabOut) {
  794. if (TabsContainer.css('display') == 'block') {
  795. if (tabOut.css('display') == 'block') {
  796. tabOut.fadeOut(200);
  797. setTimeout( function(){ tabIn.fadeIn(300); }, 205 );
  798. } else {
  799. TabsContainer.fadeOut(400);
  800. }
  801. } else {
  802. tabOut.toggle(false);
  803. tabIn.toggle(true);
  804. TabsContainer.fadeIn(400);
  805. }
  806. }
  807.  
  808. haremCss();
  809.  
  810. function addPriceRow(rowName, affection, money, kobans){
  811. return '<b>' + rowName + ':</b> ' +
  812. NbCommas(affection) + ' ' + texts[lang].affection + '(' + NbCommas(affection*417) + ' <span class="imgMoney"></span>), '+
  813. NbCommas(money) + ' <span class="imgMoney"></span> ' + texts[lang].or + ' '+
  814. NbCommas(kobans) + ' <span class="imgKobans"></span><br />';
  815. }
  816.  
  817. }
  818.  
  819. /* ==========
  820. Scenes
  821. ========== */
  822.  
  823. function ModifyScenes() {
  824. // parse GET hh_scenes variable
  825. var currentScene = CurrentPage.substr(7),
  826. hh_scenesParams = new URL(window.location.href).searchParams.get('hh_scenes'),
  827. hh_scenes = hh_scenesParams.split(','),
  828. len = hh_scenes.length;
  829.  
  830. // no scenes, less than 3 or more than 5 (human manipulation)
  831. if (!len || len < 3 || len > 5) {
  832. return false;
  833. } else {
  834. var ScenesNavigate = '<div class="Scenes" style="display:block;">' + texts[lang].navigate + ':<br/>',
  835. SceneLink = '';
  836.  
  837. for (var i = 0; i < len; i++ ) {
  838. // string format certification
  839. if (/^(0\.)?[0-9]{1,5}$/.test(hh_scenes[i]) === true) {
  840. if (hh_scenes[i] == currentScene) {
  841. SceneLink = '<span class="current">' + texts[lang].current + '</span>';
  842. } else if (hh_scenes[i] == '0') {
  843. SceneLink = '<span class="locked">' + texts[lang].locked + '</span>';
  844. } else if (parseInt(hh_scenes[i], 10) < 1) {
  845. SceneLink = '<a href="/quest/' + hh_scenes[i].substr(2) + '">' + texts[lang].unlock_it + '!</a>';
  846. } else {
  847. SceneLink = '<a href="/quest/' + hh_scenes[i] + '?hh_scenes=' + hh_scenesParams + '">' + texts[lang].scene + '</a>';
  848. }
  849. ScenesNavigate += (i+1) + '<span class="imgStar"></span> ' + SceneLink + '<br />';
  850. }
  851. // string error: doesn't match (human manipulation)
  852. else return false;
  853. }
  854. ScenesNavigate += '<span class="backToHarem">< <a href="' + $('#breadcrumbs').children('a').eq(2).attr('href') + '">' + texts[lang].harem + '</a></span></div>';
  855.  
  856. // insert navigate interface
  857. $('#controls').append(ScenesNavigate);
  858. }
  859.  
  860. scenesCss();
  861. }
  862.  
  863. // is localstorage available?
  864. function lsTest() {
  865. try {
  866. localStorage.setItem('test', 'test');
  867. localStorage.removeItem('test');
  868. return true;
  869. } catch(e) {
  870. return false;
  871. }
  872. }
  873.  
  874. // adds thousands commas
  875. function NbCommas(x) {
  876. if(lang == "fr" || lang == "es" || lang == "et")
  877. return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
  878. return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
  879. }
  880.  
  881. function fightTrollCss(){
  882. sheet.insertRule('#FightTroll {'
  883. + 'position: absolute;'
  884. + 'z-index: 99;'
  885. + 'width: 90%;'
  886. + 'margin:21px 0 0 13px;'
  887. + 'border-radius: 8px 10px 10px 8px;'
  888. + 'background: rgba(102,136,153,0.67);'
  889. + 'box-shadow: 0 0 0 1px rgba(255,255,255,0.73);'
  890. + 'text-align: center; }');
  891.  
  892. sheet.insertRule('#FightTroll > .Arrow {'
  893. + 'float:right;'
  894. + 'background-image: url("https://i.harem-battle.club/images/2017/09/19/Fmo.png");'
  895. + 'background-size: 18px 18px;'
  896. + 'background-repeat: no-repeat;'
  897. + 'width: 18px;'
  898. + 'height: 18px; }');
  899.  
  900. sheet.insertRule('#FightTroll > .TrollsMenu {'
  901. + 'position: absolute;'
  902. + 'width: 88%;'
  903. + 'margin-left:6px;'
  904. + 'border-radius: 0px 0 8px 8px;'
  905. + 'background: rgba(102,136,153,0.67);'
  906. + 'line-height: 15px;'
  907. + 'opacity: 0;'
  908. + 'visibility: hidden;'
  909. + 'transition: opacity 400ms, visibility 400ms; }');
  910.  
  911. sheet.insertRule('#FightTroll:hover > .TrollsMenu {'
  912. + 'opacity: 1;'
  913. + 'visibility: visible; }');
  914.  
  915. sheet.insertRule('#FightTroll a {'
  916. + 'color: rgb(255, 255, 255);'
  917. + 'text-decoration: none; }');
  918.  
  919. sheet.insertRule('#FightTroll a:hover {'
  920. + 'color: rgb(255, 247, 204);'
  921. + 'text-decoration: underline; }');
  922. }
  923.  
  924. function marketCss(){
  925. // -----------------
  926. // CSS RULES
  927. // -----------------
  928.  
  929. sheet.insertRule('#inventory .CustomTT {'
  930. + 'float: right;'
  931. + 'margin: 11px 1px 0 0;'
  932. + 'background-image: url("https://i.harem-battle.club/images/2017/09/13/FPE.png");'
  933. + 'background-size: 20px 20px;'
  934. + 'width: 20px;'
  935. + 'height: 20px; }');
  936.  
  937. sheet.insertRule('#inventory .CustomTT:hover {'
  938. + 'cursor: help; }');
  939.  
  940. sheet.insertRule('#inventory .CustomTT:hover + div {'
  941. + 'opacity: 1;'
  942. + 'visibility: visible; }');
  943.  
  944. sheet.insertRule('#inventory .EquipmentsTooltip, #inventory .BoostersTooltip, #inventory .BooksTooltip, #inventory .GiftsTooltip {'
  945. + 'position: absolute;'
  946. + 'z-index: 99;'
  947. + 'width: 240px;'
  948. + 'border: 1px solid rgb(162, 195, 215);'
  949. + 'border-radius: 8px;'
  950. + 'box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.1);'
  951. + 'padding: 3px 7px 4px 7px;'
  952. + 'background-color: #F2F2F2;'
  953. + 'font: normal 10px/17px Tahoma, Helvetica, Arial, sans-serif;'
  954. + 'color: #057;'
  955. + 'opacity: 0;'
  956. + 'visibility: hidden;'
  957. + 'transition: opacity 400ms, visibility 400ms; }');
  958.  
  959. sheet.insertRule('#inventory .EquipmentsTooltip, #inventory .BoostersTooltip {'
  960. + 'margin: -33px 0 0 210px;'
  961. + 'height: 43px; }');
  962.  
  963. sheet.insertRule('#inventory .BooksTooltip, #inventory .GiftsTooltip {'
  964. + 'margin: -50px 0 0 210px;'
  965. + 'height: 60px; }');
  966.  
  967. sheet.insertRule('#inventory .EquipmentsTooltip b, #inventory .BoostersTooltip b, #inventory .BooksTooltip b, #inventory .GiftsTooltip b {'
  968. + 'font-weight:bold; }');
  969.  
  970. sheet.insertRule('#inventory .imgMoney {'
  971. + 'background-size: 12px 12px;'
  972. + 'background-repeat: no-repeat;'
  973. + 'width: 12px;'
  974. + 'height: 14px;'
  975. + 'vertical-align: text-bottom;'
  976. + 'background-image: url("https://i.harem-battle.club/images/2017/01/07/0Gsvn.png");'
  977. + 'display: inline-block; }');
  978. sheet.insertRule('.hero_stats .CustomStats:hover {'
  979. + 'cursor: help; }');
  980. sheet.insertRule('.hero_stats .CustomStats {'
  981. + 'float: right;'
  982. + 'margin-left: -25px;'
  983. + 'background-image: url("https://i.harem-battle.club/images/2017/09/13/FPE.png");'
  984. + 'background-size: 18px 18px;'
  985. + 'background-position: center;'
  986. + 'background-repeat: no-repeat;'
  987. + 'width: 18px;'
  988. + 'height: 100%;'
  989. + 'visibility: none; }');
  990. sheet.insertRule('.hero_stats .CustomStats:hover + div {' +
  991. 'opacity: 1;' +
  992. 'visibility: visible; }');
  993.  
  994. sheet.insertRule('.hero_stats .StatsTooltip {'
  995. + 'position: absolute;'
  996. + 'z-index: 99;'
  997. + 'margin: -130px 0 0 -28px;'
  998. + 'width: 280px;'
  999. + 'height: 127px;'
  1000. + 'border: 1px solid rgb(162, 195, 215);'
  1001. + 'border-radius: 8px;'
  1002. + 'box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.1);'
  1003. + 'padding: 3px 7px 4px 7px;'
  1004. + 'background-color: #F2F2F2;'
  1005. + 'font: normal 10px/17px Tahoma, Helvetica, Arial, sans-serif;;'
  1006. + 'text-align: left;'
  1007. + 'opacity: 0;'
  1008. + 'visibility: hidden;'
  1009. + 'transition: opacity 400ms, visibility 400ms; }');
  1010.  
  1011. sheet.insertRule('.hero_stats .StatsTooltip b {'
  1012. + 'font-weight: bold; }');
  1013. }
  1014.  
  1015. function haremCss(){
  1016. // -----------------
  1017. // CSS RULES
  1018. // -----------------
  1019.  
  1020. sheet.insertRule('#harem_left .HaremetteNb {'
  1021. + 'float: right;'
  1022. + 'line-height: 14px;'
  1023. + 'font-size: 12px; }');
  1024.  
  1025. sheet.insertRule('#CustomBar {'
  1026. + 'position: absolute;'
  1027. + 'z-index: 99;'
  1028. + 'width: 100%;'
  1029. + 'padding: 3px 10px 0 3px;'
  1030. + 'font: bold 10px Tahoma, Helvetica, Arial, sans-serif; }');
  1031.  
  1032. sheet.insertRule('#CustomBar img {'
  1033. + 'width: 20px;'
  1034. + 'height: 20px;'
  1035. + 'margin-right: 3px;'
  1036. + 'opacity: 0.5; }');
  1037.  
  1038. sheet.insertRule('#CustomBar img:hover {'
  1039. + 'opacity: 1;'
  1040. + 'cursor: pointer; }');
  1041.  
  1042. sheet.insertRule('#CustomBar .TopBottomLinks {'
  1043. + 'float: right;'
  1044. + 'margin-top: 2px; }');
  1045.  
  1046. sheet.insertRule('#CustomBar a, #TabsContainer a, #harem_right .WikiLink a {'
  1047. + 'color: #057;'
  1048. + 'text-decoration: none; }');
  1049.  
  1050. sheet.insertRule('#CustomBar a:hover, #TabsContainer a:hover, #harem_right .WikiLink a:hover {'
  1051. + 'color: #B14;'
  1052. + 'text-decoration: underline; }');
  1053.  
  1054. sheet.insertRule('#TabsContainer {'
  1055. + 'position: absolute;'
  1056. + 'z-index: 99;'
  1057. + 'margin: -270px 0 0 -1px;'
  1058. + 'width: 240px;'
  1059. + 'height: 270px;'
  1060. + 'overflow-y: scroll;'
  1061. + 'border: 1px solid rgb(156, 182, 213);'
  1062. + 'box-shadow: 1px -1px 1px 0px rgba(0,0,0,0.3);'
  1063. + 'font: normal 10px/16px Tahoma, Helvetica, Arial, sans-serif;'
  1064. + 'color: #000000;'
  1065. + 'background-color: #ffffff;'
  1066. + 'display: none; }');
  1067.  
  1068. sheet.insertRule('#TabsContainer > div {'
  1069. + 'padding: 1px 0 8px 10px; }');
  1070.  
  1071. sheet.insertRule('#TabsContainer .Title {'
  1072. + 'margin-left: -5px;'
  1073. + 'font: bold 12px/22px Tahoma, Helvetica, Arial, sans-serif;'
  1074. + 'color: #B14; }');
  1075.  
  1076. sheet.insertRule('#TabsContainer .subTitle {'
  1077. + 'padding-top: 10px;;'
  1078. + 'font-weight: bold;'
  1079. + 'display: block; }');
  1080.  
  1081. sheet.insertRule('#TabsContainer img {'
  1082. + 'width: 14px;'
  1083. + 'height: 14px;'
  1084. + 'vertical-align: text-bottom; }');
  1085.  
  1086. sheet.insertRule('#harem_right .CustomTT {'
  1087. + 'float: right;'
  1088. + 'margin-left: -25px;'
  1089. + 'background-image: url("https://i.harem-battle.club/images/2017/09/13/FPE.png");'
  1090. + 'background-size: 18px 18px;'
  1091. + 'width: 18px;'
  1092. + 'height: 18px;'
  1093. + 'visibility: none; }');
  1094.  
  1095. sheet.insertRule('#harem_right .CustomTT:hover {'
  1096. + 'cursor: help; }');
  1097.  
  1098. sheet.insertRule('#harem_right .CustomTT:hover + div {'
  1099. + 'opacity: 1;'
  1100. + 'visibility: visible; }');
  1101.  
  1102. sheet.insertRule('#harem_right .AffectionTooltip {'
  1103. + 'position: absolute;'
  1104. + 'z-index: 99;'
  1105. + 'margin: -130px 0 0 -28px;'
  1106. + 'width: 320px;'
  1107. + 'height: 127px;'
  1108. + 'border: 1px solid rgb(162, 195, 215);'
  1109. + 'border-radius: 8px;'
  1110. + 'box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.1);'
  1111. + 'padding: 3px 7px 4px 7px;'
  1112. + 'background-color: #F2F2F2;'
  1113. + 'font: normal 10px/17px Tahoma, Helvetica, Arial, sans-serif;;'
  1114. + 'text-align: left;'
  1115. + 'opacity: 0;'
  1116. + 'visibility: hidden;'
  1117. + 'transition: opacity 400ms, visibility 400ms; }');
  1118.  
  1119. sheet.insertRule('#harem_right .AffectionTooltip b {'
  1120. + 'font-weight: bold; }');
  1121.  
  1122. sheet.insertRule('#harem_right .WikiLink {'
  1123. + 'float: right;'
  1124. + 'margin: -13px 7px 0 0;'
  1125. + 'font-size: 12px; }');
  1126.  
  1127. sheet.insertRule('#harem_right .imgStar, #harem_right .imgMoney, #harem_right .imgKobans, #harem_left .imgStar, #harem_left .imgMoney, #harem_left .imgKobans {'
  1128. + 'background-size: 10px 10px;'
  1129. + 'background-repeat: no-repeat;'
  1130. + 'width: 10px;'
  1131. + 'height: 14px;'
  1132. + 'display: inline-block; }');
  1133.  
  1134. sheet.insertRule('#harem_right .imgStar, #harem_left .imgStar {'
  1135. + 'background-image: url("https://i.harem-battle.club/images/2016/12/29/R9HWCKEtD.png"); }');
  1136.  
  1137. sheet.insertRule('#harem_right .imgMoney, #harem_left .imgMoney {'
  1138. + 'background-image: url("https://i.harem-battle.club/images/2017/01/07/0Gsvn.png"); }');
  1139.  
  1140. sheet.insertRule('#harem_right .imgKobans, #harem_left .imgKobans {'
  1141. + 'background-image: url("https://i.harem-battle.club/images/2016/08/30/gNUo3XdY.png"); }');
  1142. }
  1143.  
  1144. function scenesCss(){
  1145. // -----------------
  1146. // CSS RULES
  1147. // -----------------
  1148.  
  1149. sheet.insertRule('#controls .Scenes {'
  1150. + 'height:200px;'
  1151. + 'box-shadow: 3px 3px 0px 0px rgba(0,0,0,0.3);'
  1152. + 'background-color:#000000;'
  1153. + 'background: linear-gradient(to bottom, rgba(196,3,35,1) 0%,rgba(132,2,30,1) 51%,rgba(79,0,14,1) 100%);'
  1154. + 'text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.4);'
  1155. + 'display: block !important; }');
  1156.  
  1157. sheet.insertRule('#controls .current {'
  1158. + 'color: rgb(251, 255, 108); }');
  1159.  
  1160. sheet.insertRule('#controls .locked {'
  1161. + 'color: rgb(150, 99, 99); }');
  1162.  
  1163. sheet.insertRule('#controls .Scenes a {'
  1164. + 'color: rgb(233, 142, 228);'
  1165. + 'text-decoration: none; }');
  1166.  
  1167. sheet.insertRule('#controls .Scenes a:hover {' +
  1168. 'color: rgb(254, 202, 255);' +
  1169. 'text-decoration: underline; }');
  1170.  
  1171. sheet.insertRule('#controls .backToHarem {'
  1172. + 'position: absolute;'
  1173. + 'bottom: 0;'
  1174. + 'left: 0;'
  1175. + 'width: 100%; }');
  1176.  
  1177. sheet.insertRule('#controls .imgStar {'
  1178. + 'background-image: url("https://i.harem-battle.club/images/2016/12/29/R9HWCKEtD.png");'
  1179. + 'background-size: 10px 10px;'
  1180. + 'background-repeat: no-repeat;'
  1181. + 'width: 10px;'
  1182. + 'height: 18px;'
  1183. + 'display: inline-block; }');
  1184. }