· 4 years ago · Dec 25, 2020, 12:56 AM
1// ==UserScript==
2// @name Hentai Heroes++ (OCD) Season version
3// @namespace hentaiheroes.com
4// @description Adding things here and there in the Hentai Heroes game.
5// @version 0.17.1
6// @match https://www.hentaiheroes.com/*
7// @match https://nutaku.haremheroes.com/*
8// @match https://eroges.hentaiheroes.com/*
9// @match https://thrix.hentaiheroes.com/*
10// @match https://www.gayharem.com/*
11// @match https://nutaku.gayharem.com/*
12// @match https://test.hentaiheroes.com/*
13// @run-at document-end
14// @updateURL https://pastebin.com/raw/ph7ZYuLH
15// @downloadURL https://pastebin.com/raw/ph7ZYuLH
16// @grant none
17// @author Raphael, 1121, Sluimerstand, shal, Tom208, test_anon
18// ==/UserScript==
19
20/* ===========
21 CHANGELOG
22 =========== */
23
24// 0.17.1: Fixed minor bugs.
25// 0.17.0: Fixed minor bugs.
26// 0.16.9: Minor improvements. Fixed a bug in the display of XP in the market.
27// 0.16.8: Fixed minor bugs. Fixed a bug in the display of XP in the market when XP girl was at Max.
28// 0.16.7: Fixed minor bugs.
29// 0.16.6: Fixed minor bugs.
30// 0.16.5: Fixed minor bugs.
31// 0.16.4: Fixed other Kinkoid's bugged timers.
32// 0.16.3: Fixed a bug in the display of the expected score in League Information
33// 0.16.2: Fixed a bug in the display of Affection in the market when gifts are given too quickly
34// 0.16.1: Fixed minor bugs.
35// 0.16.0: Fixed minor bugs. Fixed a bug in the display of XP in the market when books are given. Fixed other Kinkoid's bugged timers.
36// 0.15.9: Fixed Kinkoid's bugs about timers on Champions map and in troll fights bar.
37// 0.15.8: Fixed a bug in "league info" display on small screens. Fixed minor bugs.
38// 0.15.7: Fixed minor bugs. Fixed a bug in the display of the remaining XP and affection in the market.
39// 0.15.6: Fixed minor bugs.
40// 0.15.5: Fixed a bug in league results display.
41// 0.15.4: Added the display of Epic pachinko available girls names + the link to the wiki website (thanks to Shinya).
42// 0.15.3: Fixed a minor bug in champions timer.
43// 0.15.2: Added the display of Event and Mythic pachinko available girls' names + the link to the wiki website (thanks to Shinya).
44// 0.15.1: Added mythic rarity in list of Harem girls in Harem info. Fixed a bug and improved the display of XP and affection in the market (thanks to test_anon).
45// 0.15.0: Fixed minor bugs. Added mythic girl XP and affection in Harem info. Improved the display of XP and affection in the market.
46// 0.14.9: Fixed a bug on champions timer.
47// 0.14.8: Improved champions timer.
48// 0.14.7: Fixed minor bugs. Added a timer for Champions on home page as soon as it exists a timer less than 15 minutes on any champion. Added a row at the bottom of the season leaderboard to display the current rank of top 200 player.
49// 0.14.6: Fixed minor bugs. The link to the current quest in energy quest bar leads to the Champions reception desk when the adventure is over.
50// 0.14.5: Fixed a bug about number of victories/defeats for current league and the previous one. Added a new module to show in the market the remaining XP and affection of the girl to her next level/star instead of her total XP and affection.
51// 0.14.4: Fixed minor bugs. Added an option to display some tops in the league info.
52// 0.14.3: Added the average score per fight in league information and the expected score at the end of the league with this average in tooltip. Fixed minor bugs.
53// 0.14.2: Replaced "’" by "-" in Harem links to Wiki FR.
54// 0.14.1: Fixed minor bugs.
55// 0.14.0: Fixed minor bugs. Added display of "league info" tooltips on small screens. Added number of victories/defeats for current league and the previous one in a "league info" tooltip.
56// 0.13.9: Fixed minor bugs.
57// 0.13.8: Fixed a display bug in league info tooltip
58// 0.13.7: Added on energy bar a shortcut to current quest. Added display of league info on small screens.
59// 0.13.6: Minor changes for display.
60// 0.13.5: Changed color when timer bar is full.
61// 0.13.4: Added support for test server
62// 0.13.3: Fixed timers and villains shortcut after server-side code changes 2020/11/25
63// 0.13.2: Minor fixes.
64// 0.13.1: Added a timer for boosters. Merged the "Fight villains" bar with "Energy fight" bar. Changed position of the timers.
65// 0.13.0: Added a timer and a shortcut for Places of power. Added a popup with full time remaining on Season and League timer.
66// 0.12.9: Fixed some translations. Support for Pandara's witch tier 2 and 3 girls. Added a fill bar for every timer. Fixed market timer with module market disabled.
67// 0.12.8: Fixed the timer for the Season. Improved the display of the timers for Pachinko and market.
68// 0.12.7: Added shortcuts for league. Changed the display for the Season shortcut. Added a timer for market, pachinko, season fights and league fights.
69// 0.12.6: Added a separate option for the Season link.
70// 0.12.5: Minor changes for display.
71// 0.12.4: Added a link to Season opponents.
72// 0.12.3: Added module for the new feature "Season of the Rose". Added support of the module "League sim" on small screens (smartphones, tablets, ...). Improve display for small screens.
73// 0.12.2: Added support for German language. Cleaned up some old unused text strings in all languages.
74// 0.12.1: Fixed recognition of villain event girl presence (again) after server-side code changes 2020/08/19.
75// 0.12.0: Support for new world 14 villain Nike and her tier 1 girls.
76// 0.11.9: Changed exponentiation operator from ** to Math.pow() after reports of it breaking on (very) old browsers.
77// 0.11.8: Added support for Italian language (translation courtesy of Godius). Options menu now available in French (Tom208) and Spanish (Marcezeq), completing these localizations.
78// 0.11.7: Minor changes to rounding logic for money and battle excitement displays.
79// 0.11.6: Fixed an issue with non-promotion points targets in league information when league brackets have 115+ players.
80// 0.11.5: Support for Karole tier 2 / 3 and Jackson's Crew tier 3 girls.
81// 0.11.4: Cleaned up and improved calculations for demotion and non-promotion points targets in league information. (Additional es/fr info texts contributed by Marcezeq and Tom208.)
82// 0.11.3: Fixed some number display issues in harem and league information when the game is played in languages other than English. (With thanks to Tom208.)
83// 0.11.2: Support for Finalmecia and Roko Senseï tier 3 girls.
84// 0.11.1: Replaced image links on imgur with Postimage after files were removed. Minor changes to affection tooltip display in harem.
85// 0.11.0: Re-added support for automatic script updating.
86// 0.10.9: Fixed recognition of villain event girl presence after server-side code changes 2020/05/14.
87// 0.10.8: Extended villain menu to show which tiers still have world girls to get; can be toggled in options menu. (Note: Will require script update when new tier girls are released.)
88// 0.10.7: Fixed market stats cost formulas; cost is now 7 rather than 5 for first stat purchase, 1999 increases from first to second price level rather than 2000.
89// 0.10.6: Tweaked league sim to account for recently buffed charm proc, changed how procs are included in the sim, fixed omega girl effects, and generally cleaned up sim code.
90// 0.10.5: Moved the market stats tooltip buttons from right to left to account for Kinkoid's new multi-buy button. Tweaked tooltip texts and display.
91// 0.10.4: Added name of World 13 villain. Added localized villain names in fr/es language versions. Minor text tweaks in en version.
92// 0.10.3: Now supporting girl XP level calculations up to new level 500 cap (with thanks to piturda for the reminder).
93// 0.10.2: Incorporated piturda's Market fix (for server-side change 16/10/19) and Champion update. Added display of Club bonuses and Ginseng boosters to Market stats. Lots and lots of code clean-up.
94// 0.10.1: Fixed calculation of demotion and non-promotion points >1000 and remaining tokens in League info. Disabled display of highest obtainable League reward. Some League info code clean-up.
95// 0.10.0: Updated and expanded stats formula to reflect Patch of 14/08/19. (Contributed by Hare.)
96// 0.9.9: Fixed a bug in the Champions information caused by server-side changes to the code. (Last update by Sluimerstand.)
97// 0.9.8: Added Champions information (credit: Entwine). Fixed no longer working icons.
98// 0.9.7: Fixed League rewards calculating badly when it involves usernames with spaces. Fixed League rewards at 0 challenges left.
99// 0.9.6: Changed money abbreviations from K,M,G,T to K,M,B,T. Player values in Leagues are now exact. Sim result is orange if it's a close call.
100// 0.9.5: Fixed an issue for the Villain menu when the localStorage does not exist yet or anymore.
101// 0.9.4: Fixed a rare error in which the script would crash for trying to pull non-existent numbers to add thousand spacing to.
102// 0.9.3: Fixed League rewards not properly calculating for point values higher than 999.
103// 0.9.2: Added an options menu. Removed modifyScenes. Tweaked sim refresh. Tweaked League info. Tweaked better XP and money. Tweaked harem info.
104// 0.9.1: Fixed sims not refreshing anymore because I wanted to wrap up the previous version so I could watch the new Game of Thrones.
105// 0.9.0: Expanded on the extra League info. Added some missing translations for Spanish.
106// 0.8.9: Fixed player beta/omega stats not calculating properly for girls with spëcìál characters in their names. I'm a professional, I swear.
107// 0.8.8: Added Jackson's Crew villain name. Fixed Charm and Know-How defence in sim results. Added extra League info.
108// 0.8.7: Fixed Charm proc not occurring in sim results. Fixed Know-How proc not calculating correctly. Added opponent name in the console logs.
109// 0.8.6: Fixed wrong class defence stats for beta/omega girls. Fixed new line creation for wide sim results.
110// 0.8.5: Fixed wrong class Harmony procs for League sims.
111// 0.8.4: More tweaks to League sims.
112// 0.8.3: Fixed excitement for League sims (formerly known as match rating formerly known as power levels).
113// 0.8.2: Fixed an oopsie I made when calculating worst-case scenario. Console log (F12) is now also available.
114// 0.8.1: Fixed League numbers for French and Spanish localisations. Changed League ratings to show a worst-case scenario.
115// 0.8.0: Fixed the event villains issue.
116// 0.7.9: Properly fixed the button displacement. Match rating is now even more accurate.
117// 0.7.8: Fixed the collect all button displacement. Fixed Excitement stat in Leagues. Match rating is now more accurate.
118// 0.7.7: Replaced the League power levels with a match rating.
119// 0.7.6: Added better XP and better money.
120// 0.7.5: Added the @downloadURL, so the script can be updated directly from Tampermonkey.
121// 0.7.4: Removed the added mission and arena timers and the extra quest button. Added an auto refresh for the home screen.
122// 0.7.3: Cleaned up the code and prepared the file for "public launch." Added power levels to Leagues.
123// 0.7.2: Updated the harem info pane to be more pleasing to the eyes.
124
125/* =========
126 GENERAL
127 ========= */
128
129// Define jQuery
130var $ = window.jQuery;
131
132// Define CSS
133var sheet = (function() {
134 var style = document.createElement('style');
135 document.head.appendChild(style);
136 return style.sheet;
137})();
138
139// Numbers: thousand spacing
140function nThousand(x) {
141 if (typeof x != 'number') {
142 x = 0;
143 }
144 return x.toLocaleString();
145}
146
147// Numbers: rounding to K, M, G and T
148function nRounding(num, digits, updown) {
149 var power = [
150 { value: 1, symbol: '' },
151 { value: 1E3, symbol: 'K' },
152 { value: 1E6, symbol: 'M' },
153 { value: 1E9, symbol: 'B' },
154 { value: 1E12, symbol: 'T' },
155 ];
156 var i;
157 for (i = power.length - 1; i > 0; i--) {
158 if (num >= power[i].value) {
159 break;
160 }
161 }
162 if (updown == 1) {
163 return (Math.ceil(num / power[i].value * Math.pow(10, digits)) / Math.pow(10, digits)).toFixed(digits) + power[i].symbol;
164 }
165 else if (updown == 0) {
166 return (Math.round(num / power[i].value * Math.pow(10, digits)) / Math.pow(10, digits)).toFixed(digits) + power[i].symbol;
167 }
168 else if (updown == -1) {
169 return (Math.floor(num / power[i].value * Math.pow(10, digits)) / Math.pow(10, digits)).toFixed(digits) + power[i].symbol;
170 }
171}
172
173/* ==============
174 TRANSLATIONS
175 ============== */
176
177var lang = 'en';
178
179if ($('html')[0].lang === 'en') {
180 lang = 'en';
181}
182else if ($('html')[0].lang === 'fr') {
183 lang = 'fr';
184}
185else if ($('html')[0].lang === 'es_ES') {
186 lang = 'es';
187}
188else if ($('html')[0].lang === 'it_IT') {
189 lang = 'it';
190}
191else if ($('html')[0].lang === 'de_DE') {
192 lang = 'de';
193}
194
195var texts = [];
196
197texts.en = {
198 optionsRefresh: 'Home screen refresh',
199 optionsVillain: 'Fight a villain menu',
200 optionsTiers: 'Show tiers with girls',
201 optionsXP: 'Better XP',
202 optionsMoney: 'Better money',
203 optionsMarket: 'Market information',
204 optionsMarket_XP_Aff: 'XP and affection in market',
205 optionsHarem: 'Harem information',
206 optionsLeague: 'League information',
207 optionsLeagueBoard: 'Show the league tops',
208 optionsSim: 'League sim',
209 optionsChampions: 'Champions information',
210 optionsLinks: 'Shortcuts/Timers',
211 optionsSeasonSim: 'Season sim',
212 optionsPachinkoNames: 'Show names in Pachinko',
213 optionsEpicPachinkoNames: 'Show names in Epic Pachinko',
214 and: 'and',
215 or: 'or',
216 affection: 'affection',
217 harem_stats: 'Harem Stats',
218 haremettes: 'haremettes',
219 hardcore: 'Hardcore',
220 charm: 'Charm',
221 know_how: 'Know-how',
222 harem_level: 'harem level',
223 to_go: 'to go',
224 unlocked_scenes: 'scenes unlocked',
225 money_income: 'Money income',
226 per_hour: 'per hour',
227 when_all_collectable: 'when all collectable',
228 required_to_unlock: 'Required to upgrade all haremettes',
229 required_to_get_max_level: 'Required to level all haremettes',
230 my_stocks: 'My stock',
231 equipments: 'equipments',
232 boosters: 'boosters',
233 books: 'books',
234 gifts: 'gifts',
235 currently_buyable: 'Currently buyable stock',
236 visit_the: 'Visit the <a href="../shop.html">Market</a> first.',
237 not_compatible: 'Your webbrowser is not compatible.',
238 or_level: 'or level',
239 restock: 'Restock',
240 wiki: '\'s wiki page',
241 evolution_costs: 'Upgrade costs are',
242 world: 'World ',
243 villain: ' villain',
244 fight_villain: 'Fight a villain',
245 you_own: 'You own',
246 you_can_give: 'You can give a total of',
247 you_can_sell: 'You can sell everything for',
248 stat_points_need: 'Stat points buyable to max',
249 money_need: 'Money required to max',
250 money_spent: 'Money spent in market',
251 points_from_level: 'Level-based stat points',
252 bought_points: 'Market-bought stat points',
253 equipment_points: 'Equipments stat points',
254 ginseng_points: 'Boosters stat points',
255 club_points: 'Club bonus stat points',
256 Xp: 'XP',
257 starting: 'Starting',
258 common: 'Common',
259 rare: 'Rare',
260 epic: 'Epic',
261 legendary: 'Legendary',
262 mythic: 'Mythic',
263 day: 'd',
264 hour: 'h',
265 minute: 'm',
266 second: 's',
267 demote_up: 'To <u>demote</u> you can have a maximum of ',
268 demote_down: 'To <u>demote</u> you must be passed by players with as few as ',
269 demote_holdzero: 'To <u>demote</u> you must remain at ',
270 stagnate_up: 'To <u>not promote</u> you can have a maximum of ',
271 stagnate_down: 'To <u>not promote</u> you must be passed by players with as few as ',
272 stagnate_holdzero: 'To <u>not promote</u> you must remain at ',
273 top15_up: 'To <u>be in the top 15</u> you must have a minimum of ',
274 top15_hold: 'To <u>stay in the top 15</u> you must have a minimum of ',
275 top30_up: 'To <u>be in the top 30</u> you must have a minimum of ',
276 top30_hold: 'To <u>stay in the top 30</u> you must have a minimum of ',
277 top45_up: 'To <u>be in the top 45</u> you must have a minimum of ',
278 top45_hold: 'To <u>stay in the top 45</u> you must have a minimum of ',
279 points: 'points',
280 challenges_regen: 'Natural regeneration: ',
281 challenges_left: '<br />Challenges left: ',
282 season_fights: 'Season fights: ',
283 in: 'in',
284 pop: 'Places',
285 season: 'Season',
286 full_in: 'Full in',
287 full: 'Full',
288 league: 'League',
289 boosters_end: 'Boosters end',
290 victories: 'Victories',
291 defeats: 'Defeats',
292 unknown: 'Unknown',
293 opponents: 'Opponents',
294 notPlayed: 'Not played',
295 league_ending: 'League ending on ',
296 league_finished: 'League finished on ',
297 current_league: 'Current league',
298 averageScore: 'Average score per fight: ',
299 scoreExpected: 'Score expected: ',
300 available_girls: 'Available girls: '
301};
302
303texts.fr = {
304 optionsRefresh: 'Rafraîchir page d\'accueil',
305 optionsVillain: 'Menu combats un troll',
306 optionsTiers: 'Montrer les paliers/filles',
307 optionsXP: 'XP + précise',
308 optionsMoney: 'Argent + précis',
309 optionsMarket: 'Infos marché',
310 optionsMarket_XP_Aff: 'XP et affection au marché',
311 optionsHarem: 'Infos harem',
312 optionsLeague: 'Infos ligue',
313 optionsLeagueBoard: 'Montrer les tops ligue',
314 optionsSim: 'Simu ligue',
315 optionsChampions: 'Infos champions',
316 optionsLinks: 'Raccourcis/Timers',
317 optionsSeasonSim: 'Simu saison',
318 optionsPachinkoNames: 'Montrer noms au Pachinko',
319 optionsEpicPachinkoNames: 'Montrer noms au PE',
320 and: 'et',
321 or: 'ou',
322 affection: 'affection',
323 harem_stats: 'Stats du harem',
324 haremettes: 'haremettes',
325 hardcore: 'Hardcore',
326 charm: 'Charme',
327 know_how: 'Savoir-faire',
328 harem_level: 'niveau de harem',
329 to_go: 'restant',
330 unlocked_scenes: 'scènes débloquées',
331 money_income: 'Revenus',
332 per_hour: 'par heure',
333 when_all_collectable: 'quand tout est disponible',
334 required_to_unlock: 'Requis pour débloquer la scène',
335 required_to_get_max_level: 'Requis pour obtenir toutes les filles au niveau maximum',
336 my_stocks: 'Mes stocks',
337 equipments: 'équipements',
338 boosters: 'boosters',
339 books: 'livres',
340 gifts: 'cadeaux',
341 currently_buyable: 'Stock disponible au marché',
342 visit_the: 'Visite le <a href="../shop.html">marché</a> first.',
343 not_compatible: 'Votre navigateur n\'est pas compatible.',
344 or_level: 'ou niveau',
345 restock: 'Restock',
346 wiki: 'Page wiki de ',
347 evolution_costs: 'Ses couts d\'évolution sont',
348 world: 'Monde ',
349 villain: ' troll',
350 fight_villain: 'Combats un troll',
351 you_own: 'Tu possèdes',
352 you_can_give: 'Tu peux donner un total de',
353 you_can_sell: 'Tu peux tout vendre pour',
354 stat_points_need: 'Nombre de points requis pour max',
355 money_need: 'Argent demandé pour max',
356 money_spent: 'Argent dépensé dans le marché',
357 points_from_level: 'Points donnés par ton niveau',
358 bought_points: 'Points achetés au marché',
359 equipment_points: 'Points donnés par ton équipement',
360 ginseng_points: 'Points donnés par tes boosters',
361 club_points: 'Points donnés par ton club',
362 Xp: 'XP',
363 starting: 'Fille de départ',
364 common: 'Commun',
365 rare: 'Rare',
366 epic: 'Épique',
367 legendary: 'Légendaire',
368 mythic: 'Mythique',
369 day: 'j',
370 hour: 'h',
371 minute: 'm',
372 second: 's',
373 demote_up: 'Pour <u>être rétrogradé</u> vous pouvez avoir un maximum de ',
374 demote_down: 'Pour <u>être rétrogradé</u> vous devez être dépassé par les joueurs qui ont ',
375 demote_holdzero: 'Pour <u>être rétrogradé</u> vous devez rester avec ',
376 stagnate_up: 'Pour <u>ne pas être promu</u> vous pouvez avoir un maximum de ',
377 stagnate_down: 'Pour <u>ne pas être promu</u> vous devez être dépassé par les joueurs qui ont ',
378 stagnate_holdzero: 'Pour <u>ne pas être promu</u> vous devez rester avec ',
379 top15_up: 'Pour <u>être dans le top 15</u> vous devez avoir un minimum de ',
380 top15_hold: 'Pour <u>rester dans le top 15</u> vous devez avoir un minimum de ',
381 top30_up: 'Pour <u>être dans le top 30</u> vous devez avoir un minimum de ',
382 top30_hold: 'Pour <u>rester dans le top 30</u> vous devez avoir un minimum de ',
383 top45_up: 'Pour <u>être dans le top 45</u> vous devez avoir un minimum de ',
384 top45_hold: 'Pour <u>rester dans le top 45</u> vous devez avoir un minimum de ',
385 points: 'points',
386 challenges_regen: 'Régénération naturelle: ',
387 challenges_left: '<br />Défis restants: ',
388 season_fights: 'Combats de Saison: ',
389 in: 'dans',
390 pop: 'Lieux',
391 season: 'Saison',
392 full_in: 'Remplie dans',
393 full: 'Remplie',
394 league: 'Ligue',
395 boosters_end: 'Fin boosters',
396 victories: 'Victoires',
397 defeats: 'Defaites',
398 unknown: 'Inconnus',
399 opponents: 'Adversaires',
400 notPlayed: 'Non joués',
401 league_ending: 'Ligue terminant le ',
402 league_finished: 'Ligue terminée le ',
403 current_league: 'Ligue actuelle',
404 averageScore: 'Score moyen par combat: ',
405 scoreExpected: 'Score attendu: ',
406 available_girls: 'Filles disponibles: '
407};
408
409texts.es = {
410 optionsRefresh: 'Actualizacion Menu principal',
411 optionsVillain: 'Menu Pelear contra villano',
412 optionsTiers: 'Mostrar Rangos con Chicas',
413 optionsXP: 'Mejor XP',
414 optionsMoney: 'Mejor Dinero',
415 optionsMarket: 'Informacion de Mercado',
416 optionsMarket_XP_Aff: 'El XP y el afecto en el mercado',
417 optionsHarem: 'Informacion de Harén',
418 optionsLeague: 'Informacion de Liga',
419 optionsLeagueBoard: 'Mostrar los mejores de la liga',
420 optionsSim: 'Simulacion de Liga',
421 optionsChampions: 'Informacion de Campeones',
422 optionsLinks: 'Atajos/Temporizadores',
423 optionsSeasonSim: 'Simulacion de temporada',
424 optionsPachinkoNames: 'Mostrar nombres en Pachinko',
425 optionsEpicPachinkoNames: 'Mostrar nombres en Epic Pachinko',
426 and: 'y',
427 or: 'o',
428 in: 'en',
429 affection: 'afecto',
430 harem_stats: 'Estatus del Harén',
431 haremettes: 'haremettes',
432 hardcore: 'Folladas',
433 charm: 'Encanto',
434 know_how: 'Saber-hacer',
435 harem_level: 'nivel de harén',
436 to_go: 'restante',
437 unlocked_scenes: 'escenas desbloqueadas',
438 money_income: 'Ingreso de dinero',
439 per_hour: 'por hora',
440 when_all_collectable: 'cuando todo es coleccionable',
441 required_to_unlock: 'Requerido para desbloquear todas las escenas bloqueadas',
442 required_to_get_max_level: 'Requerido para obtener el máximo nivel de todas las chicas',
443 my_stocks: 'Mi Stock',
444 equipments: 'equipamiento',
445 boosters: 'potenciadores',
446 books: 'libros',
447 gifts: 'regalos',
448 currently_buyable: 'Stocks Comprables Actualmente',
449 visit_the: 'Visita el <a href="../shop.html">Mercado</a> primero.',
450 not_compatible: 'Tu navegador no es compatible.',
451 or_level: 'o nivel',
452 restock: 'Restock',
453 wiki: ' wiki',
454 evolution_costs: 'Sus costo de evolucion son',
455 world: 'Mundo ',
456 villain: ' villano',
457 fight_villain: 'Pelear un villano',
458 you_own: 'Tienes',
459 you_can_give: 'Puedes dar un total de',
460 you_can_sell: 'Puedes vender todo por',
461 stat_points_need: 'Puntos de estatus necesarios para maximo',
462 money_need: 'Dinero necesario para maximo',
463 money_spent: 'Dinero usado en el mercado',
464 points_from_level: 'Puntos de estatus de nivel',
465 bought_points: 'Puntos comprados del mercado',
466 equipment_points: 'Puntos de estatus de equipamiento',
467 ginseng_points: 'Puntos de estatus de los potenciadores',
468 club_points: 'Puntos de estatus del club',
469 Xp: 'XP',
470 starting: 'Principiante',
471 common: 'Común',
472 rare: 'Raro',
473 epic: 'Épico',
474 legendary: 'Legendario',
475 mythic: 'Mítica',
476 day: 'd',
477 hour: 'h',
478 minute: 'm',
479 second: 's',
480 demote_up: 'Para <u>degradar</u> puedes tener un máximo de ',
481 demote_down: 'Para <u>degradar</u> debes ser superado por jugadores con tan solo ',
482 demote_holdzero: 'Para <u>degradar</u> debes mantenerte en ',
483 stagnate_up: 'Para <u>no promocionar</u> puedes tener un máximo de ',
484 stagnate_down: 'Para <u>no promocionar</u> debes ser superado por jugadores con tan solo ',
485 stagnate_holdzero: 'Para <u>no promocionar</u> debes mantenerte en ',
486 top15_up: 'Para <u>estar entre los 15 primeros</u> debes tener un mínimo de ',
487 top15_hold: 'Para <u>quedar entre los 15 primeros</u> debes tener un mínimo de ',
488 top30_up: 'Para <u>estar entre los 30 primeros</u> debes tener un mínimo de ',
489 top30_hold: 'Para <u>quedar entre los 30 primeros</u> debes tener un mínimo de ',
490 top45_up: 'Para <u>estar entre los 45 primeros</u> debes tener un mínimo de ',
491 top45_hold: 'Para <u>quedar entre los 45 primeros</u> debes tener un mínimo de ',
492 points: 'puntos',
493 challenges_regen: 'Regeneracion naturel: ',
494 challenges_left: '<br />Retos pendientes: ',
495 pop: 'Lugares',
496 season: 'Temporada',
497 full_in: 'Completa',
498 full: 'Completa',
499 league: 'Liga',
500 boosters_end: 'Fin potenciadores',
501 victories: 'Victorias',
502 defeats: 'Derrota',
503 unknown: 'Desconocido',
504 opponents: 'Opositores',
505 notPlayed: 'No jugado',
506 league_ending: 'Liga termina el ',
507 league_finished: 'Liga terminó el ',
508 current_league: 'Liga actual',
509 averageScore: 'Puntuación media por combate: ',
510 scoreExpected: 'Puntuación esperada: ',
511 available_girls: 'Chicas disponibles: '
512};
513
514texts.it = {
515 optionsRefresh: 'Refresh pagina Home',
516 optionsVillain: 'Menù battaglia Troll',
517 optionsTiers: 'Mostra battaglie con ragazze',
518 optionsXP: 'Mostra XP mancante al lvl successivo',
519 optionsMoney: 'Migliora soldi',
520 optionsMarket: 'Informazioni negozio',
521 optionsMarket_XP_Aff: 'XP e affetto nel mercato',
522 optionsHarem: 'Informazioni Harem',
523 optionsLeague: 'Informazioni sulle Leghe',
524 optionsLeagueBoard: 'Mostra i top della lega',
525 optionsSim: 'Simulazione Leghe',
526 optionsChampions: 'Informazioni sui Campioni',
527 optionsLinks: 'Scorciatoie/Timer',
528 optionsSeasonSim: 'Simulazione Stagione',
529 optionsPachinkoNames: 'Mostra i nomi in Pachinko',
530 optionsEpicPachinkoNames: 'Mostra i nomi in Epic Pachinko',
531 and: 'e',
532 or: 'o',
533 in: 'in',
534 affection: 'affetto',
535 harem_stats: 'Stato dell Harem',
536 haremettes: 'ragazze dell harem',
537 hardcore: 'Scopata',
538 charm: 'Amante',
539 know_how: 'Esperto',
540 harem_level: 'livello harem',
541 to_go: 'mancanti',
542 unlocked_scenes: 'scene sbloccate',
543 money_income: 'Guadagni',
544 per_hour: 'orario',
545 when_all_collectable: 'quando si può raccogliere tutto',
546 required_to_unlock: 'Necessario per sbloccare tutte le scene',
547 required_to_get_max_level: 'Necessario per livellare tutte le ragazze',
548 my_stocks: 'Mio inventario',
549 equipments: 'equipaggiamento',
550 boosters: 'potenziamenti',
551 books: 'libri',
552 gifts: 'regali',
553 currently_buyable: 'Correntemente acquistabili',
554 visit_the: 'Visita il <a href="../shop.html">negozio</a> prima.',
555 not_compatible: 'Il tuo browser non è compatibile.',
556 or_level: 'o livello',
557 restock: 'Rifornimento',
558 wiki: ' -> wiki',
559 evolution_costs: 'Il costo del potenziamento è',
560 world: 'Mondo ',
561 villain: ' nemico',
562 fight_villain: 'Combattimenti',
563 you_own: 'Possiedi',
564 you_can_give: 'Puoi dare il massimo a',
565 you_can_sell: 'Puoi vendere tutto per',
566 stat_points_need: 'Punti statistica necessari per il massimo',
567 money_need: 'Soldi necessari per il massimo',
568 money_spent: 'Soldi spesi al negozio',
569 points_from_level: 'Punti acquisiti da aumento livello',
570 bought_points: 'Punti comprati al negozio',
571 equipment_points: 'Punti statistica da equipaggiamento',
572 ginseng_points: 'Punti statistica dei potenziamenti',
573 club_points: 'Punti statistica bonus del Club',
574 Xp: 'XP',
575 starting: 'Starter',
576 common: 'Comuni',
577 rare: 'Rare',
578 epic: 'Epiche',
579 legendary: 'Leggendarie',
580 mythic: 'Mitica',
581 day: 'g',
582 hour: 'h',
583 minute: 'm',
584 second: 's',
585 demote_up: 'Per <u>il degrado</u> devi avere al massimo ',
586 demote_down: 'Per <u>il degrado</u> devi essere sorpassato da giocatori con ',
587 demote_holdzero: 'Per <u>il degrado</u> devi rimanere a ',
588 stagnate_up: 'Per <u>restare</u> devi avere al massimo ',
589 stagnate_down: 'Per <u>restare</u> devi essere sorpassato da giocatori con ',
590 stagnate_holdzero: 'Per <u>restare</u> devi rimanere a ',
591 top15_up: 'Per <u>essere tra i primi 15</u> devi avere un minimo di ',
592 top15_hold: 'Per <u>rimanere tra i primi 15</u> devi avere un minimo di ',
593 top30_up: 'Per <u>essere tra i primi 30</u> devi avere un minimo di ',
594 top30_hold: 'Per <u>rimanere tra i primi 30</u> devi avere un minimo di ',
595 top45_up: 'Per <u>essere tra i primi 45</u> devi avere un minimo di ',
596 top45_hold: 'Per <u>rimanere tra i primi 45</u> devi avere un minimo di ',
597 points: 'punti',
598 challenges_regen: 'Rigenerazione naturale: ',
599 challenges_left: '<br />Combattimenti mancanti: ',
600 pop: 'Luoghi',
601 season: 'Stagione',
602 full_in: 'Piena tra',
603 full: 'Piena',
604 league: 'Leghe',
605 boosters_end: 'Fine potenziamenti',
606 victories: 'Vittorie',
607 defeats: 'Sconfitte',
608 unknown: 'Sconosciuto',
609 opponents: 'Avversari',
610 notPlayed: 'Non giocato',
611 league_ending: 'Fine della lega il ',
612 league_finished: 'Lega finita il ',
613 current_league: 'Lega attuale',
614 averageScore: 'Punteggio medio per combattimento: ',
615 scoreExpected: 'Punteggio previsto: ',
616 available_girls: 'Ragazze disponibili: '
617};
618
619texts.de = {
620 optionsRefresh: 'Homepage aktualisieren',
621 optionsVillain: 'Widersacher-Menü',
622 optionsTiers: 'Stufen mit Girls anzeigen',
623 optionsXP: 'Verbesserte XP-Anzeige',
624 optionsMoney: 'Verbesserte Geld-Anzeige',
625 optionsMarket: 'Marktplatz-Informationen',
626 optionsMarket_XP_Aff: 'XP und Zuneigung auf dem Markt',
627 optionsHarem: 'Harem-Informationen',
628 optionsLeague: 'Liga-Informationen',
629 optionsLeagueBoard: 'Die Liga-Spitzen anzeigen',
630 optionsSim: 'Liga-Simulation',
631 optionsChampions: 'Champion-Informationen',
632 optionsLinks: 'Abkürzungen/Zeitgeber',
633 optionsSeasonSim: 'Saison-Simulation',
634 optionsPachinkoNames: 'Namen in Pachinko anzeigen',
635 optionsEpicPachinkoNames: 'Namen in Episch Pachinko anzeigen',
636 and: 'und',
637 or: 'oder',
638 in: 'in',
639 affection: 'Zuneigung',
640 harem_stats: 'Harem-Statistiken',
641 haremettes: 'Harem-Mädchen',
642 hardcore: 'Hardcore',
643 charm: 'Charme',
644 know_how: 'Wissen',
645 harem_level: 'Harem-Level',
646 to_go: 'übrig',
647 unlocked_scenes: 'Szenen freigeschaltet',
648 money_income: 'Einkommen',
649 per_hour: 'pro Stunde',
650 when_all_collectable: 'wenn komplett einsammelbar',
651 required_to_unlock: 'Erforderlich für alle Mädchen-Upgrades',
652 required_to_get_max_level: 'Erforderlich für maximale Mädchen-Level',
653 my_stocks: 'Meine Bestände',
654 equipments: 'Ausrüstungen',
655 boosters: 'Booster',
656 books: 'Bücher',
657 gifts: 'Geschenke',
658 currently_buyable: 'Aktuelle Bestände am Marktplatz',
659 visit_the: 'Besuche zuerst den <a href="../shop.html">Marktplatz</a>.',
660 not_compatible: 'Dein Browser ist nicht kompatibel.',
661 or_level: 'oder Level',
662 restock: 'neue Angebote',
663 wiki: '-Wikiseite',
664 evolution_costs: 'Die Upgradekosten betragen',
665 world: 'Welt ',
666 villain: ' Widersacher',
667 fight_villain: 'Widersacher',
668 you_own: 'Du besitzt',
669 you_can_give: 'Insgesamt verteilbar:',
670 you_can_sell: 'Du kannst alles verkaufen für',
671 stat_points_need: 'bis Maximum käufliche Statpunkte',
672 money_need: 'zum Maximieren nötiges Geld',
673 money_spent: 'bisher ausgegebenes Geld',
674 points_from_level: 'Statpunkte durch Heldenlevel',
675 bought_points: 'Statpunkte durch Markt-Käufe',
676 equipment_points: 'Statpunkte durch Ausrüstungen',
677 ginseng_points: 'Statpunkte durch Booster',
678 club_points: 'Statpunkte durch Club-Boni',
679 Xp: 'XP',
680 starting: 'Starting',
681 common: 'Gemeinsame',
682 rare: 'Seltene',
683 epic: 'Epische',
684 legendary: 'Legendäre',
685 mythic: 'Mythische',
686 day: 'd',
687 hour: 'h',
688 minute: 'm',
689 second: 'z',
690 demote_up: 'Für den <u>Abstieg</u> maximal möglich: ',
691 demote_down: 'Für den <u>Abstieg</u> musst du überholt werden von Spielern mit höchstens ',
692 demote_holdzero: 'Für den <u>Abstieg</u> musst du verbleiben bei ',
693 stagnate_up: 'Für den <u>Nichtaufstieg</u> maximal möglich: ',
694 stagnate_down: 'Für den <u>Nichtaufstieg</u> musst du überholt werden von Spielern mit höchstens ',
695 stagnate_holdzero: 'Für den <u>Nichtaufstieg</u> musst du verbleiben bei ',
696 top15_up: 'Um <u>in den Top 15 zu kommen</u>, musst du mindestens folgende Voraussetzungen erfüllen ',
697 top15_hold: 'Um <u>in den Top 15 zu bleiben</u>, musst du mindestens folgende Voraussetzungen erfüllen ',
698 top30_up: 'Um <u>in den Top 30 zu kommen</u>, musst du mindestens folgende Voraussetzungen erfüllen ',
699 top30_hold: 'Um <u>in den Top 30 zu bleiben</u>, musst du mindestens folgende Voraussetzungen erfüllen ',
700 top45_up: 'Um <u>in den Top 45 zu kommen</u>, musst du mindestens folgende Voraussetzungen erfüllen ',
701 top45_hold: 'Um <u>in den Top 45 zu bleiben</u>, musst du mindestens folgende Voraussetzungen erfüllen ',
702 points: 'Punkte',
703 challenges_regen: 'Natürliche Regeneration: ',
704 challenges_left: '<br />verbleibende Kämpfe: ',
705 pop: 'Orte',
706 season: 'Saison',
707 full_in: 'Voll in',
708 full: 'Voll',
709 league: 'Liga',
710 boosters_end: 'Ende boosters',
711 victories: 'Siegen',
712 defeats: 'Niederlagen',
713 unknown: 'Unbekannt',
714 opponents: 'Gegenspieler',
715 notPlayed: 'Nicht gespielt',
716 league_ending: 'Liga Ende ',
717 league_finished: 'Liga endete am',
718 current_league: 'Aktuelle Liga',
719 averageScore: 'Durchschnittsnote pro Kampf: ',
720 scoreExpected: 'Erwartetes Ergebnis: ',
721 available_girls: 'Freie Mädchen: '
722};
723
724var tierGirlsID = [
725 ['8', '9', '10', '7270263', '979916751'],
726 ['14', '13', '12', '318292466', '936580004'],
727 ['19', '16', '18', '610468472', '54950499'],
728 ['29', '28', '26', '4749652', '345655744'],
729 ['39', '40', '41', '267784162', '763020698'],
730 ['64', '63', '31', '406004250', '864899873'],
731 ['85', '86', '84', '267120960', '536361248'],
732 ['114', '115', '116', '379441499', '447396000'],
733 ['1247315', '4649579', '7968301', '46227677', '933487713'],
734 ['1379661', '4479579', '1800186', '985085118', '339765042'],
735 ['24316446', '219651566', '501847856', '383709663', '90685795'],
736 ['225365882', '478693885', '231765083', 155415482, 769649470],
737 ['86962133', '243793871', '284483399', 0, 0]
738];
739
740var GIRLS_EXP_LEVELS = [];
741
742 GIRLS_EXP_LEVELS.starting = [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, 25543, 25744, 25946, 26150, 26355, 26562, 26770, 26980, 27191, 27404, 27619, 27835, 28053, 28272, 28493, 28716, 28940, 29166, 29394, 29623, 29854, 30087, 30322, 30558, 30796, 31036, 31278, 31522, 31767, 32014, 32263, 32514, 32767, 33022, 33279, 33537, 33797, 34059, 34323, 34589, 34857, 35127, 35399, 35673, 35949, 36228, 36509, 36792, 37077, 37364, 37653, 37944, 38237, 38533, 38831, 39131, 39433, 39738, 40045, 40354, 40665, 40979, 41295, 41614, 41935, 42258, 42584, 42912, 43243, 43576, 43912, 44250, 44591, 44934, 45280, 45628, 45979, 46333, 46689, 47048, 47410, 47774, 48141, 48511, 48884, 49259, 49637, 50018, 50402, 50789, 51179, 51572, 51967, 52365, 52766, 53170, 53577, 53988, 54402, 54819];
743
744 GIRLS_EXP_LEVELS.common = [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, 25543, 25744, 25946, 26150, 26355, 26562, 26770, 26980, 27191, 27404, 27619, 27835, 28053, 28272, 28493, 28716, 28940, 29166, 29394, 29623, 29854, 30087, 30322, 30558, 30796, 31036, 31278, 31522, 31767, 32014, 32263, 32514, 32767, 33022, 33279, 33537, 33797, 34059, 34323, 34589, 34857, 35127, 35399, 35673, 35949, 36228, 36509, 36792, 37077, 37364, 37653, 37944, 38237, 38533, 38831, 39131, 39433, 39738, 40045, 40354, 40665, 40979, 41295, 41614, 41935, 42258, 42584, 42912, 43243, 43576, 43912, 44250, 44591, 44934, 45280, 45628, 45979, 46333, 46689, 47048, 47410, 47774, 48141, 48511, 48884, 49259, 49637, 50018, 50402, 50789, 51179, 51572, 51967, 52365, 52766, 53170, 53577, 53988, 54402, 54819];
745
746 GIRLS_EXP_LEVELS.rare = [12, 25, 38, 51, 64, 77, 90, 103, 116, 129, 142, 156, 170, 184, 198, 212, 226, 240, 254, 268, 282, 297, 312, 327, 342, 357, 372, 387, 402, 417, 433, 449, 465, 481, 497, 513, 529, 545, 561, 578, 595, 612, 629, 646, 663, 680, 697, 715, 733, 751, 769, 787, 805, 823, 841, 860, 879, 898, 917, 936, 955, 974, 994, 1014, 1034, 1054, 1074, 1094, 1114, 1135, 1156, 1177, 1198, 1219, 1240, 1262, 1284, 1306, 1328, 1350, 1372, 1394, 1417, 1440, 1463, 1486, 1509, 1532, 1556, 1580, 1604, 1628, 1652, 1677, 1702, 1727, 1752, 1777, 1802, 1828, 1854, 1880, 1906, 1932, 1959, 1986, 2013, 2040, 2067, 2095, 2123, 2151, 2179, 2207, 2236, 2265, 2294, 2323, 2352, 2382, 2412, 2442, 2472, 2503, 2534, 2565, 2596, 2627, 2659, 2691, 2723, 2755, 2788, 2821, 2854, 2887, 2921, 2955, 2989, 3023, 3058, 3093, 3128, 3163, 3199, 3235, 3271, 3307, 3344, 3381, 3418, 3456, 3494, 3532, 3570, 3609, 3648, 3687, 3727, 3767, 3807, 3847, 3888, 3929, 3970, 4012, 4054, 4096, 4139, 4182, 4225, 4269, 4313, 4357, 4402, 4447, 4492, 4538, 4584, 4630, 4677, 4724, 4771, 4819, 4867, 4915, 4964, 5013, 5062, 5112, 5162, 5213, 5264, 5315, 5367, 5419, 5471, 5524, 5577, 5631, 5685, 5739, 5794, 5849, 5905, 5961, 6017, 6074, 6131, 6189, 6247, 6306, 6365, 6424, 6484, 6544, 6605, 6666, 6728, 6790, 6853, 6916, 6980, 7044, 7108, 7173, 7238, 7304, 7370, 7437, 7504, 7572, 7640, 7709, 7778, 7848, 7918, 7989, 8061, 8133, 8206, 8279, 8353, 8427, 8502, 8577, 8653, 8729, 8806, 8884, 8962, 9041, 9120, 9200, 9281, 9362, 9444, 9526, 9609, 9693, 9777, 9862, 9947, 10033, 10120, 10207, 10295, 10384, 10473, 10563, 10654, 10745, 10837, 10930, 11023, 11117, 11212, 11308, 11404, 11501, 11599, 11697, 11796, 11896, 11997, 12098, 12200, 12303, 12407, 12511, 12616, 12722, 12829, 12937, 13045, 13154, 13264, 13375, 13487, 13600, 13713, 13827, 13942, 14058, 14175, 14293, 14412, 14531, 14651, 14772, 14894, 15017, 15141, 15266, 15392, 15519, 15647, 15776, 15906, 16037, 16169, 16302, 16436, 16571, 16707, 16844, 16982, 17121, 17261, 17402, 17544, 17687, 17831, 17976, 18122, 18269, 18417, 18566, 18716, 18868, 19021, 19175, 19330, 19486, 19643, 19802, 19962, 20123, 20285, 20448, 20613, 20779, 20946, 21114, 21284, 21455, 21627, 21800, 21975, 22151, 22328, 22507, 22687, 22868, 23051, 23235, 23420, 23607, 23795, 23985, 24176, 24368, 24562, 24757, 24954, 25152, 25352, 25553, 25756, 25960, 26166, 26373, 26582, 26792, 27004, 27218, 27433, 27650, 27868, 28088, 28310, 28533, 28758, 28985, 29213, 29443, 29675, 29909, 30144, 30381, 30620, 30861, 31103, 31347, 31593, 31841, 32091, 32343, 32597, 32852, 33109, 33368, 33629, 33892, 34157, 34424, 34693, 34964, 35237, 35512, 35789, 36068, 36349, 36633, 36919, 37207, 37497, 37789, 38083, 38380, 38679, 38980, 39283, 39588, 39896, 40206, 40518, 40833, 41150, 41469, 41791, 42115, 42442, 42771, 43103, 43437, 43774, 44113, 44455, 44799, 45146, 45495, 45847, 46202, 46559, 46919, 47282, 47647, 48015, 48386, 48760, 49136, 49515, 49897, 50282, 50670, 51061, 51455, 51852, 52252, 52655, 53061, 53470, 53882, 54297, 54715, 55136, 55560, 55987, 56418, 56852, 57289, 57729, 58173, 58620, 59070, 59524, 59981, 60442, 60906, 61373, 61844, 62318, 62796, 63278, 63763, 64252, 64745, 65241, 65741];
747
748 GIRLS_EXP_LEVELS.epic = [14, 29, 44, 59, 74, 89, 104, 119, 134, 149, 165, 181, 197, 213, 229, 245, 261, 277, 294, 311, 328, 345, 362, 379, 396, 413, 431, 449, 467, 485, 503, 521, 539, 557, 576, 595, 614, 633, 652, 671, 690, 710, 730, 750, 770, 790, 810, 830, 851, 872, 893, 914, 935, 956, 977, 999, 1021, 1043, 1065, 1087, 1109, 1132, 1155, 1178, 1201, 1224, 1247, 1271, 1295, 1319, 1343, 1367, 1391, 1416, 1441, 1466, 1491, 1516, 1542, 1568, 1594, 1620, 1646, 1673, 1700, 1727, 1754, 1781, 1809, 1837, 1865, 1893, 1921, 1950, 1979, 2008, 2037, 2066, 2096, 2126, 2156, 2186, 2217, 2248, 2279, 2310, 2341, 2373, 2405, 2437, 2469, 2502, 2535, 2568, 2601, 2635, 2669, 2703, 2737, 2772, 2807, 2842, 2877, 2913, 2949, 2985, 3021, 3058, 3095, 3132, 3169, 3207, 3245, 3283, 3322, 3361, 3400, 3439, 3479, 3519, 3559, 3600, 3641, 3682, 3724, 3766, 3808, 3850, 3893, 3936, 3979, 4023, 4067, 4111, 4156, 4201, 4246, 4292, 4338, 4384, 4431, 4478, 4525, 4573, 4621, 4670, 4719, 4768, 4818, 4868, 4918, 4969, 5020, 5071, 5123, 5175, 5228, 5281, 5334, 5388, 5442, 5497, 5552, 5607, 5663, 5719, 5776, 5833, 5891, 5949, 6007, 6066, 6125, 6185, 6245, 6306, 6367, 6429, 6491, 6553, 6616, 6679, 6743, 6807, 6872, 6937, 7003, 7069, 7136, 7203, 7271, 7339, 7408, 7477, 7547, 7617, 7688, 7759, 7831, 7903, 7976, 8049, 8123, 8198, 8273, 8349, 8425, 8502, 8579, 8657, 8736, 8815, 8895, 8975, 9056, 9138, 9220, 9303, 9386, 9470, 9555, 9640, 9726, 9813, 9900, 9988, 10076, 10165, 10255, 10345, 10436, 10528, 10621, 10714, 10808, 10903, 10998, 11094, 11191, 11288, 11386, 11485, 11585, 11685, 11786, 11888, 11991, 12094, 12198, 12303, 12409, 12516, 12623, 12731, 12840, 12950, 13061, 13172, 13284, 13397, 13511, 13626, 13742, 13859, 13976, 14094, 14213, 14333, 14454, 14576, 14699, 14823, 14948, 15074, 15200, 15327, 15455, 15584, 15714, 15845, 15977, 16110, 16244, 16379, 16515, 16652, 16790, 16929, 17069, 17210, 17352, 17496, 17641, 17787, 17934, 18082, 18231, 18381, 18532, 18684, 18837, 18992, 19148, 19305, 19463, 19622, 19782, 19944, 20107, 20271, 20436, 20603, 20771, 20940, 21110, 21282, 21455, 21629, 21804, 21981, 22159, 22338, 22519, 22701, 22884, 23069, 23255, 23443, 23632, 23822, 24014, 24207, 24402, 24598, 24796, 24995, 25196, 25398, 25602, 25807, 26014, 26222, 26432, 26643, 26856, 27071, 27287, 27505, 27724, 27945, 28168, 28392, 28618, 28846, 29075, 29306, 29539, 29774, 30010, 30248, 30488, 30730, 30974, 31219, 31466, 31715, 31966, 32219, 32474, 32731, 32990, 33250, 33512, 33776, 34042, 34310, 34580, 34852, 35126, 35402, 35681, 35962, 36245, 36530, 36817, 37106, 37397, 37690, 37986, 38284, 38584, 38886, 39191, 39498, 39807, 40119, 40433, 40749, 41068, 41389, 41712, 42038, 42366, 42697, 43030, 43366, 43704, 44045, 44388, 44734, 45082, 45433, 45787, 46143, 46502, 46864, 47228, 47595, 47965, 48338, 48713, 49091, 49472, 49856, 50243, 50633, 51026, 51422, 51821, 52223, 52628, 53036, 53447, 53861, 54278, 54698, 55121, 55547, 55976, 56409, 56845, 57284, 57726, 58172, 58621, 59073, 59529, 59988, 60451, 60917, 61387, 61860, 62337, 62817, 63301, 63789, 64280, 64775, 65274, 65776, 66282, 66792, 67306, 67823, 68344, 68869, 69398, 69931, 70468, 71009, 71554, 72103, 72656, 73214, 73776, 74342, 74912, 75487, 76066, 76649];
749
750 GIRLS_EXP_LEVELS.legendary = [16, 33, 50, 67, 84, 101, 118, 135, 152, 170, 188, 206, 224, 242, 260, 278, 297, 316, 335, 354, 373, 392, 411, 431, 451, 471, 491, 511, 531, 551, 572, 593, 614, 635, 656, 677, 698, 720, 742, 764, 786, 808, 830, 853, 876, 899, 922, 945, 968, 992, 1016, 1040, 1064, 1088, 1112, 1137, 1162, 1187, 1212, 1237, 1263, 1289, 1315, 1341, 1367, 1394, 1421, 1448, 1475, 1502, 1529, 1557, 1585, 1613, 1641, 1670, 1699, 1728, 1757, 1786, 1816, 1846, 1876, 1906, 1936, 1967, 1998, 2029, 2060, 2092, 2124, 2156, 2188, 2221, 2254, 2287, 2320, 2354, 2388, 2422, 2456, 2491, 2526, 2561, 2596, 2632, 2668, 2704, 2740, 2777, 2814, 2851, 2888, 2926, 2964, 3002, 3041, 3080, 3119, 3158, 3198, 3238, 3278, 3319, 3360, 3401, 3443, 3485, 3527, 3569, 3612, 3655, 3698, 3742, 3786, 3830, 3875, 3920, 3965, 4011, 4057, 4103, 4150, 4197, 4244, 4292, 4340, 4388, 4437, 4486, 4536, 4586, 4636, 4687, 4738, 4789, 4841, 4893, 4946, 4999, 5052, 5106, 5160, 5215, 5270, 5325, 5381, 5437, 5494, 5551, 5608, 5666, 5724, 5783, 5842, 5902, 5962, 6023, 6084, 6145, 6207, 6269, 6332, 6395, 6459, 6523, 6588, 6653, 6719, 6785, 6852, 6919, 6987, 7055, 7124, 7193, 7263, 7333, 7404, 7475, 7547, 7619, 7692, 7765, 7839, 7914, 7989, 8065, 8141, 8218, 8295, 8373, 8451, 8530, 8610, 8690, 8771, 8852, 8934, 9017, 9100, 9184, 9269, 9354, 9440, 9526, 9613, 9701, 9789, 9878, 9968, 10058, 10149, 10241, 10333, 10426, 10520, 10615, 10710, 10806, 10903, 11000, 11098, 11197, 11297, 11397, 11498, 11600, 11703, 11806, 11910, 12015, 12121, 12227, 12334, 12442, 12551, 12661, 12771, 12882, 12994, 13107, 13221, 13336, 13452, 13568, 13685, 13803, 13922, 14042, 14163, 14285, 14408, 14532, 14656, 14781, 14907, 15034, 15162, 15291, 15421, 15552, 15684, 15817, 15951, 16086, 16222, 16359, 16497, 16636, 16776, 16917, 17059, 17202, 17346, 17492, 17639, 17787, 17936, 18086, 18237, 18389, 18542, 18696, 18852, 19009, 19167, 19326, 19486, 19648, 19811, 19975, 20140, 20306, 20474, 20643, 20813, 20984, 21157, 21331, 21506, 21683, 21861, 22040, 22221, 22403, 22586, 22771, 22957, 23144, 23333, 23523, 23715, 23908, 24103, 24299, 24496, 24695, 24895, 25097, 25300, 25505, 25712, 25920, 26130, 26341, 26554, 26768, 26984, 27202, 27421, 27642, 27865, 28089, 28315, 28543, 28772, 29003, 29236, 29470, 29706, 29944, 30184, 30426, 30669, 30914, 31161, 31410, 31661, 31914, 32168, 32424, 32682, 32942, 33204, 33468, 33734, 34002, 34272, 34544, 34818, 35094, 35372, 35652, 35934, 36219, 36506, 36795, 37086, 37379, 37674, 37972, 38272, 38574, 38878, 39185, 39494, 39805, 40119, 40435, 40753, 41074, 41397, 41722, 42050, 42380, 42713, 43048, 43386, 43726, 44069, 44415, 44763, 45114, 45467, 45823, 46182, 46543, 46907, 47274, 47644, 48016, 48391, 48769, 49150, 49534, 49920, 50309, 50701, 51096, 51494, 51895, 52299, 52706, 53116, 53529, 53945, 54364, 54787, 55213, 55642, 56074, 56509, 56948, 57390, 57835, 58284, 58736, 59191, 59650, 60112, 60578, 61047, 61520, 61996, 62476, 62959, 63446, 63937, 64431, 64929, 65431, 65937, 66446, 66959, 67476, 67997, 68522, 69051, 69584, 70121, 70662, 71207, 71756, 72309, 72866, 73427, 73992, 74562, 75136, 75714, 76297, 76884, 77475, 78071, 78671, 79276, 79885, 80499, 81117, 81740, 82368, 83000, 83637, 84279, 84926, 85578, 86235, 86896, 87562];
751
752 GIRLS_EXP_LEVELS.mythic = []
753 for (var i=0; i<500; i++)
754 GIRLS_EXP_LEVELS.mythic[i] = Math.ceil(GIRLS_EXP_LEVELS.legendary[i]*2.5);
755
756/* ==================
757 WHEN TO RUN WHAT
758 ================== */
759
760var currentPage = window.location.pathname;
761if (currentPage.indexOf('home') != -1) options();
762
763// Show which modules are enabled and if so, run them when appropriate
764if (localStorage.getItem('HHS.refresh') === '1') {
765 $('#hhsRefresh').attr('checked', 'checked');
766 if (currentPage.indexOf('home') != -1) {
767 moduleRefresh();
768 }
769}
770if (localStorage.getItem('HHS.villain') === '1') {
771 $('#hhsVillain').attr('checked', 'checked');
772 moduleVillain();
773}
774if (localStorage.getItem('HHS.tiers') === '1') {
775 $('#hhsTiers').attr('checked', 'checked');
776}
777if (localStorage.getItem('HHS.xp') === '1') {
778 $('#hhsXP').attr('checked', 'checked');
779 moduleXP();
780}
781if (localStorage.getItem('HHS.money') === '1') {
782 $('#hhsMoney').attr('checked', 'checked');
783 moduleMoney();
784}
785if (localStorage.getItem('HHS.market') === '1') {
786 $('#hhsMarket').attr('checked', 'checked');
787 if (currentPage.indexOf('shop') != -1) {
788 moduleMarket();
789 }
790}
791if (localStorage.getItem('HHS.market_xp_aff') === '1') {
792 $('#hhsMarket_XP_Aff').attr('checked', 'checked');
793 if (currentPage.indexOf('shop') != -1) {
794 moduleMarket_XP_Aff();
795 }
796}
797if (localStorage.getItem('HHS.harem') === '1') {
798 $('#hhsHarem').attr('checked', 'checked');
799 if (currentPage.indexOf('harem') != -1) {
800 moduleHarem();
801 }
802}
803if (localStorage.getItem('HHS.league') === '1') {
804 $('#hhsLeague').attr('checked', 'checked');
805 if (currentPage.indexOf('tower-of-fame') != -1) {
806 moduleLeague();
807 }
808}
809if (localStorage.getItem('HHS.leagueBoard') === '1') {
810 $('#hhsLeagueBoard').attr('checked', 'checked');
811}
812if (localStorage.getItem('HHS.sim') === '1') {
813 $('#hhsSim').attr('checked', 'checked');
814 if (currentPage.indexOf('tower-of-fame') != -1) {
815 moduleSim();
816 }
817}
818if (localStorage.getItem('HHS.champions') === '1') {
819 $('#hhsChampions').attr('checked', 'checked');
820 moduleChampions();
821}
822if (localStorage.getItem('HHS.seasonsim') === '1') {
823 $('#hhsSeasonSim').attr('checked', 'checked');
824 if (currentPage.indexOf('season-arena') != -1) {
825 moduleSeasonSim();
826 }
827}
828if (localStorage.getItem('HHS.links') === '1') {
829 $('#hhsLinks').attr('checked', 'checked');
830 moduleLinks();
831}
832if (localStorage.getItem('HHS.pachinkoNames') === '1') {
833 $('#hhsPachinkoNames').attr('checked', 'checked');
834 modulePachinkoNames();
835}
836if (localStorage.getItem('HHS.pachinkoNamesMulti') == '1') {
837 $('#hhsPachinkoNamesMulti').attr('checked', 'checked');
838}
839
840
841/* =========
842 OPTIONS
843 ========= */
844
845function options() {
846 // Create localStorage if it doesn't exist yet
847 if (localStorage.getItem('HHS.refresh') === null) {
848 localStorage.setItem('HHS.refresh', '0');
849 }
850 if (localStorage.getItem('HHS.villain') === null) {
851 localStorage.setItem('HHS.villain', '1');
852 }
853 if (localStorage.getItem('HHS.tiers') === null) {
854 localStorage.setItem('HHS.tiers', '1');
855 }
856 if (localStorage.getItem('HHS.xp') === null) {
857 localStorage.setItem('HHS.xp', '1');
858 }
859 if (localStorage.getItem('HHS.money') === null) {
860 localStorage.setItem('HHS.money', '1');
861 }
862 if (localStorage.getItem('HHS.market') === null) {
863 localStorage.setItem('HHS.market', '1');
864 }
865 if (localStorage.getItem('HHS.market_xp_aff') === null) {
866 localStorage.setItem('HHS.market_xp_aff', '1');
867 }
868 if (localStorage.getItem('HHS.harem') === null) {
869 localStorage.setItem('HHS.harem', '1');
870 }
871 if (localStorage.getItem('HHS.league') === null) {
872 localStorage.setItem('HHS.league', '1');
873 }
874 if (localStorage.getItem('HHS.leagueBoard') === null) {
875 localStorage.setItem('HHS.leagueBoard', '1');
876 }
877 if (localStorage.getItem('HHS.sim') === null) {
878 localStorage.setItem('HHS.sim', '1');
879 }
880 if (localStorage.getItem('HHS.champions') === null) {
881 localStorage.setItem('HHS.champions', '1');
882 }
883 if (localStorage.getItem('HHS.seasonsim') === null) {
884 localStorage.setItem('HHS.seasonsim', '1');
885 }
886 if (localStorage.getItem('HHS.links') === null) {
887 localStorage.setItem('HHS.links', '1');
888 }
889 if (localStorage.getItem('HHS.pachinkoNames') === null) {
890 localStorage.setItem('HHS.pachinkoNames', '1');
891 }
892 if (localStorage.getItem('HHS.pachinkoNamesMulti') === null) {
893 localStorage.setItem('HHS.pachinkoNamesMulti', '1');
894 }
895
896 // Options menu
897 $('div#contains_all').append('<a href="#"><img src="https://i.postimg.cc/c1F37PYz/icon-options.png" id="hhsButton"></a>');
898 $('div#contains_all').append('<div id="hhsOptions" class="hhsTooltip" style="display: none;">'
899 + '<label class="switch"><input type="checkbox" id="hhsRefresh"><span class="slider"></span></label>' + texts[lang].optionsRefresh + '<br />'
900 + '<label class="switch"><input type="checkbox" id="hhsVillain"><span class="slider"></span></label>' + texts[lang].optionsVillain + '<br />'
901 + ' <label class="switch"><input type="checkbox" id="hhsTiers"><span class="slider"></span></label>' + texts[lang].optionsTiers + '<br />'
902 + '<label class="switch"><input type="checkbox" id="hhsXP"><span class="slider"></span></label>' + texts[lang].optionsXP + '<br />'
903 + '<label class="switch"><input type="checkbox" id="hhsMoney"><span class="slider"></span></label>' + texts[lang].optionsMoney + '<br />'
904 + '<label class="switch"><input type="checkbox" id="hhsMarket"><span class="slider"></span></label>' + texts[lang].optionsMarket + '<br />'
905 + '<label class="switch"><input type="checkbox" id="hhsMarket_XP_Aff"><span class="slider"></span></label>' + texts[lang].optionsMarket_XP_Aff + '<br />'
906 + '<label class="switch"><input type="checkbox" id="hhsHarem"><span class="slider"></span></label>' + texts[lang].optionsHarem + '<br />'
907 + '<label class="switch"><input type="checkbox" id="hhsLeague"><span class="slider"></span></label>' + texts[lang].optionsLeague + '<br />'
908 + ' <label class="switch"><input type="checkbox" id="hhsLeagueBoard"><span class="slider"></span></label>' + texts[lang].optionsLeagueBoard + '<br />'
909 + '<label class="switch"><input type="checkbox" id="hhsSim"><span class="slider"></span></label>' + texts[lang].optionsSim + '<br />'
910 + '<label class="switch"><input type="checkbox" id="hhsChampions"><span class="slider"></span></label>' + texts[lang].optionsChampions + '<br />'
911 + '<label class="switch"><input type="checkbox" id="hhsSeasonSim"><span class="slider"></span></label>' + texts[lang].optionsSeasonSim + '<br />'
912 + '<label class="switch"><input type="checkbox" id="hhsLinks"><span class="slider"></span></label>' + texts[lang].optionsLinks + '<br />'
913 + '<label class="switch"><input type="checkbox" id="hhsPachinkoNames"><span class="slider"></span></label>' + texts[lang].optionsPachinkoNames + '<br />'
914 + ' <label class="switch"><input type="checkbox" id="hhsPachinkoNamesMulti"><span class="slider"></span></label>' + texts[lang].optionsEpicPachinkoNames
915 + '</div>');
916
917 // Show and hide options menu
918 $('#hhsButton').click(function() {
919 var x = document.getElementById('hhsOptions');
920 if (x.style.display === 'none') {
921 x.style.display = 'block';
922 }
923 else {
924 x.style.display = 'none';
925 }
926 });
927
928 // Dependency of villain menu options
929 $('#hhsVillain').click(function(event) {
930 if (!$(this).is(':checked')) {
931 $('#hhsTiers').prop('checked', false);
932 }
933 });
934 $('#hhsTiers').click(function(event) {
935 if ($(this).is(':checked')) {
936 $('#hhsVillain').prop('checked', true);
937 }
938 });
939
940 // Dependency of league info options
941 $('#hhsLeague').click(function(event) {
942 if (!$(this).is(':checked')) {
943 $('#hhsLeagueBoard').prop('checked', false);
944 }
945 });
946 $('#hhsLeagueBoard').click(function(event) {
947 if ($(this).is(':checked')) {
948 $('#hhsLeague').prop('checked', true);
949 }
950 });
951
952 $('#hhsPachinkoNames').click(function(event) {
953 if (!$(this).is(':checked')) {
954 $('#hhsPachinkoNamesMulti').prop('checked', false);
955 }
956 });
957 $('#hhsPachinkoNamesMulti').click(function(event) {
958 if ($(this).is(':checked')) {
959 $('#hhsPachinkoNames').prop('checked', true);
960 }
961 });
962
963 // Save changed options
964 $('#hhsRefresh').click(function() {
965 if (document.getElementById('hhsRefresh').checked == true) {
966 localStorage.setItem('HHS.refresh', '1');
967 }
968 if (document.getElementById('hhsRefresh').checked == false) {
969 localStorage.setItem('HHS.refresh', '0');
970 }
971 });
972
973 $('#hhsVillain').click(function() {
974 if (document.getElementById('hhsVillain').checked == true) {
975 localStorage.setItem('HHS.villain', '1');
976 }
977 if (document.getElementById('hhsVillain').checked == false) {
978 localStorage.setItem('HHS.villain', '0');
979 localStorage.setItem('HHS.tiers', '0');
980 }
981 });
982
983 $('#hhsTiers').click(function() {
984 if (document.getElementById('hhsTiers').checked == true) {
985 localStorage.setItem('HHS.villain', '1');
986 localStorage.setItem('HHS.tiers', '1');
987 }
988 if (document.getElementById('hhsTiers').checked == false) {
989 localStorage.setItem('HHS.tiers', '0');
990 }
991 });
992
993 $('#hhsXP').click(function() {
994 if (document.getElementById('hhsXP').checked == true) {
995 localStorage.setItem('HHS.xp', '1');
996 }
997 if (document.getElementById('hhsXP').checked == false) {
998 localStorage.setItem('HHS.xp', '0');
999 }
1000 });
1001
1002 $('#hhsMoney').click(function() {
1003 if (document.getElementById('hhsMoney').checked == true) {
1004 localStorage.setItem('HHS.money', '1');
1005 }
1006 if (document.getElementById('hhsMoney').checked == false) {
1007 localStorage.setItem('HHS.money', '0');
1008 }
1009 });
1010
1011 $('#hhsMarket').click(function() {
1012 if (document.getElementById('hhsMarket').checked == true) {
1013 localStorage.setItem('HHS.market', '1');
1014 }
1015 if (document.getElementById('hhsMarket').checked == false) {
1016 localStorage.setItem('HHS.market', '0');
1017 }
1018 });
1019
1020 $('#hhsMarket_XP_Aff').click(function() {
1021 if (document.getElementById('hhsMarket_XP_Aff').checked == true) {
1022 localStorage.setItem('HHS.market_xp_aff', '1');
1023 }
1024 if (document.getElementById('hhsMarket_XP_Aff').checked == false) {
1025 localStorage.setItem('HHS.market_xp_aff', '0');
1026 }
1027 });
1028
1029 $('#hhsHarem').click(function() {
1030 if (document.getElementById('hhsHarem').checked == true) {
1031 localStorage.setItem('HHS.harem', '1');
1032 }
1033 if (document.getElementById('hhsHarem').checked == false) {
1034 localStorage.setItem('HHS.harem', '0');
1035 }
1036 });
1037
1038 $('#hhsLeague').click(function() {
1039 if (document.getElementById('hhsLeague').checked == true) {
1040 localStorage.setItem('HHS.league', '1');
1041 }
1042 if (document.getElementById('hhsLeague').checked == false) {
1043 localStorage.setItem('HHS.league', '0');
1044 localStorage.setItem('HHS.leagueBoard', '0');
1045 }
1046 });
1047
1048 $('#hhsLeagueBoard').click(function() {
1049 if (document.getElementById('hhsLeagueBoard').checked == true) {
1050 localStorage.setItem('HHS.leagueBoard', '1');
1051 localStorage.setItem('HHS.league', '1');
1052 }
1053 if (document.getElementById('hhsLeagueBoard').checked == false) {
1054 localStorage.setItem('HHS.leagueBoard', '0');
1055 }
1056 });
1057
1058 $('#hhsSim').click(function() {
1059 if (document.getElementById('hhsSim').checked == true) {
1060 localStorage.setItem('HHS.sim', '1');
1061 }
1062 if (document.getElementById('hhsSim').checked == false) {
1063 localStorage.setItem('HHS.sim', '0');
1064 }
1065 });
1066
1067 $('#hhsChampions').click(function() {
1068 if (document.getElementById('hhsChampions').checked == true) {
1069 localStorage.setItem('HHS.champions', '1');
1070 }
1071 if (document.getElementById('hhsChampions').checked == false) {
1072 localStorage.setItem('HHS.champions', '0');
1073 }
1074 });
1075
1076 $('#hhsSeasonSim').click(function() {
1077 if (document.getElementById('hhsSeasonSim').checked == true) {
1078 localStorage.setItem('HHS.seasonsim', '1');
1079 }
1080 if (document.getElementById('hhsSeasonSim').checked == false) {
1081 localStorage.setItem('HHS.seasonsim', '0');
1082 }
1083 });
1084
1085 $('#hhsLinks').click(function() {
1086 if (document.getElementById('hhsLinks').checked == true) {
1087 localStorage.setItem('HHS.links', '1');
1088 }
1089 if (document.getElementById('hhsLinks').checked == false) {
1090 localStorage.setItem('HHS.links', '0');
1091 }
1092 });
1093
1094 $('#hhsPachinkoNames').click(function() {
1095 if (document.getElementById('hhsPachinkoNames').checked == true) {
1096 localStorage.setItem('HHS.pachinkoNames', '1');
1097 }
1098 if (document.getElementById('hhsPachinkoNames').checked == false) {
1099 localStorage.setItem('HHS.pachinkoNames', '0');
1100 localStorage.setItem('HHS.pachinkoNamesMulti', '0');
1101 }
1102 });
1103
1104 $('#hhsPachinkoNamesMulti').click(function() {
1105 if (document.getElementById('hhsPachinkoNamesMulti').checked == true) {
1106 localStorage.setItem('HHS.pachinkoNamesMulti', '1');
1107 localStorage.setItem('HHS.pachinkoNames', '1');
1108 }
1109 if (document.getElementById('hhsLeague').checked == false) {
1110 localStorage.setItem('HHS.pachinkoNamesMulti', '0');
1111 }
1112 });
1113
1114 //CSS
1115 sheet.insertRule('#hhsButton {'
1116 + 'height: 35px; '
1117 + 'position: absolute; '
1118 + 'top: 85px; '
1119 + 'right: 15px; '
1120 + 'filter: drop-shadow(0px 0px 5px white);}'
1121 );
1122
1123 sheet.insertRule('.hhsTooltip {'
1124 + 'font-size: 12px; '
1125 + 'text-align: left; '
1126 + 'z-index: 99; '
1127 + 'padding: 3px 5px 3px 5px; '
1128 + 'border: 2px solid #905312; '
1129 + 'border-radius: 6px; '
1130 + 'background-color: rgba(32,3,7,.9); '
1131 + 'position: absolute; right: 55px; top: 85px;}'
1132 );
1133
1134 sheet.insertRule('.switch {'
1135 + 'position: relative; '
1136 + 'display: inline-block; '
1137 + 'width: 34px; '
1138 + 'height: 17px;}'
1139 );
1140
1141 sheet.insertRule('.slider {'
1142 + 'position: absolute; '
1143 + 'cursor: pointer; '
1144 + 'top: 0; '
1145 + 'left: 0; '
1146 + 'right: 0; '
1147 + 'bottom: 0; '
1148 + 'background-color: #CCCCCC; '
1149 + '-webkit-transition: .4s; '
1150 + 'transition: .4s; '
1151 + 'border-radius: 17px; '
1152 + 'margin-right: 4px;}'
1153 );
1154
1155 sheet.insertRule('.slider:before {'
1156 + 'position: absolute; '
1157 + 'content: \'\'; '
1158 + 'height: 13px; '
1159 + 'width: 13px; '
1160 + 'left: 2px; '
1161 + 'bottom: 2px; '
1162 + 'background-color: white; '
1163 + '-webkit-transition: .4s; '
1164 + 'transition: .4s; '
1165 + 'border-radius: 50%;}'
1166 );
1167
1168 sheet.insertRule('input:checked + .slider {'
1169 + 'background-color: #F11F64;}'
1170 );
1171
1172 sheet.insertRule('input:checked + .slider:before {'
1173 + '-webkit-transform: translateX(13px); '
1174 + '-ms-transform: translateX(13px); '
1175 + 'transform: translateX(13px);}'
1176 );
1177}
1178
1179/* =====================
1180 HOME SCREEN REFRESH
1181 ===================== */
1182
1183function moduleRefresh() {
1184 setInterval(function() {
1185 window.location.reload();
1186 }, 600000);
1187}
1188
1189/* ======================
1190 FIGHT A VILLAIN MENU
1191 ====================== */
1192
1193function moduleVillain() {
1194 //Create localStorage if it doesn't exist yet
1195 if (localStorage.getItem('eventTrolls') === null) {
1196 localStorage.setItem('eventTrolls', '[]');
1197 }
1198 if (localStorage.getItem('tierGirlsOwned') === null) {
1199 localStorage.setItem('tierGirlsOwned', '[[], [], [], [], [], [], [], [], [], [], [], [], []]');
1200 }
1201
1202 var eventTrolls = JSON.parse(localStorage.getItem('eventTrolls'));
1203 var tierGirlsOwned = JSON.parse(localStorage.getItem('tierGirlsOwned'));
1204 var includeTiers = false;
1205
1206 if (localStorage.getItem('HHS.tiers') === '1') {
1207 includeTiers = true;
1208 }
1209
1210 if (currentPage.indexOf('home') != -1) {
1211
1212 //Check if event girls have been collected
1213 eventTrolls = [];
1214 if (typeof event_data !== 'undefined') {
1215 event_data.girls.forEach(function(girl) {
1216 if (girl.troll !== null) {
1217 if (girl.shards !== 100) {
1218 eventTrolls.push(girl.troll.id_troll);
1219 }
1220 }
1221 });
1222 }
1223 localStorage.setItem('eventTrolls', JSON.stringify(eventTrolls));
1224
1225 if (includeTiers) {
1226 //Check if villain tier girls have been collected
1227 tierGirlsOwned = [[], [], [], [], [], [], [], [], [], [], [], [], []];
1228
1229 for (var tIdx = 0; tIdx < tierGirlsID.length; tIdx++) {
1230 for (var gIdx = 0; gIdx < 5; gIdx++) {
1231 if (girlsDataList.hasOwnProperty(tierGirlsID[tIdx][gIdx]) || tierGirlsID[tIdx][gIdx] == 0) {
1232 tierGirlsOwned[tIdx][gIdx] = true;
1233 }
1234 else {
1235 tierGirlsOwned[tIdx][gIdx] = false;
1236 }
1237 }
1238 }
1239 localStorage.setItem('tierGirlsOwned', JSON.stringify(tierGirlsOwned));
1240 }
1241 }
1242
1243 //Add the actual menu
1244 var trolls = ['Dark Lord', 'Ninja Spy', 'Gruntt', 'Edwarda', 'Donatien', 'Silvanus', 'Bremen', 'Finalmecia', 'Roko Senseï', 'Karole', 'Jackson’s Crew', 'Pandora Witch', 'Nike'];
1245 if (lang == 'fr') {
1246 trolls[1] = 'Espion Ninja';
1247 trolls[10] = 'Éq. de Jackson';
1248 trolls[11] = 'Sorcière Pandora';
1249 }
1250 if (lang == 'es') {
1251 trolls[0] = 'Señor Oscuro';
1252 trolls[1] = 'Ninja espía';
1253 }
1254 if (lang == 'it') {
1255 trolls[0] = 'Signore Oscuro';
1256 trolls[1] = 'Spia Ninja';
1257 trolls[10] ='Ciurma di Jackson';
1258 trolls[11] ='Strega Pandora';
1259 }
1260 if (lang == 'de') {
1261 trolls[0] = 'Dunkler Lord';
1262 }
1263
1264 var currentWorld = Hero.infos.questing.id_world - 1,
1265 trollName = '',
1266 trollNameTiers = '',
1267 trollsMenu = '';
1268
1269 for (var i = 0; i < currentWorld; i++) {
1270 if (typeof trolls[i] !== typeof undefined && trolls[i] !== false) {
1271 trollName = trolls[i];
1272 if (includeTiers) {
1273 trollNameTiers = ' ';
1274 if (!(tierGirlsOwned[i][0] && tierGirlsOwned[i][1] && tierGirlsOwned[i][2])) {
1275 trollNameTiers = trollNameTiers + '¹';
1276 }
1277 if (!(tierGirlsOwned[i][3])) {
1278 trollNameTiers = trollNameTiers + '²';
1279 }
1280 if (!(tierGirlsOwned[i][4])) {
1281 trollNameTiers = trollNameTiers + '³';
1282 }
1283 }
1284 }
1285 else trollName = texts[lang].world + ' ' + (i + 2) + ' ' + texts[lang].villain;
1286 var type = 'regular';
1287 for (var j = 0, len = eventTrolls.length; j < len; j++) {
1288 if (eventTrolls[j] == (i + 1)) {
1289 type = 'eventTroll';
1290 }
1291 }
1292 trollsMenu += '<a class="' + type + '" href="/battle.html?id_troll=' + (i + 1) + '">' + trollName + trollNameTiers + '</a><br />';
1293 }
1294
1295 $('#contains_all > header').children('[type=fight]').append('<div class="TrollsMenu" id="TrollsID">' + trollsMenu + '</div>');
1296
1297 //CSS
1298 sheet.insertRule('.TrollsMenu {'
1299 + 'position: absolute; '
1300 + 'z-index: 99; '
1301 //+ 'width: 80%; '
1302 + 'display: none; '
1303 + 'margin: 0 0 0 13px; '
1304 + 'border-radius: 8px 10px 10px 8px; '
1305 + 'background-color: rgba(0,0,0,.8); '
1306 + 'box-shadow: 0 0 0 1px rgba(255,255,255,0.73); '
1307 + 'font-size: 14px; '
1308 + 'font-weight: 400; '
1309 + 'letter-spacing: .22px; '
1310 + 'color: #fff; '
1311 + 'text-align: center;}'
1312 );
1313
1314 sheet.insertRule('@media only screen and (max-width: 1025px) {'
1315 + '.TrollsMenu {'
1316 + 'position: absolute; '
1317 + 'z-index: 99; '
1318 //+ 'width: 80%; '
1319 + 'display: none; '
1320 + 'margin: 0 0 0 13px; '
1321 + 'border-radius: 8px 10px 10px 8px; '
1322 + 'background-color: rgba(0,0,0,.8); '
1323 + 'box-shadow: 0 0 0 1px rgba(255,255,255,0.73); '
1324 + 'font-size: 16px !important; '
1325 + 'font-weight: 400; '
1326 + 'letter-spacing: .22px; '
1327 + 'color: #fff; '
1328 + 'text-align: center;}}'
1329 );
1330
1331 sheet.insertRule('.TrollsMenu a {'
1332 + 'font-family: \'Carter One\', \'Alegreya Sans\', cursive !important; '
1333 + 'color: rgb(255, 255, 255); '
1334 + 'text-decoration: none;}'
1335 );
1336
1337 sheet.insertRule('.eventTroll {'
1338 + 'color: #f70 !important;}'
1339 );
1340
1341 sheet.insertRule('.eventTroll:hover {'
1342 + 'color: #fa0 !important;}'
1343 );
1344
1345 sheet.insertRule('@media only screen and (max-width: 1025px) {'
1346 + '.energy_counter > .TrollsMenu {'
1347 + 'position: absolute; '
1348 + 'width: 88%; '
1349 + 'margin-left: 18px; '
1350 + 'border-radius: 0px 0 8px 8px; '
1351 + 'background-color: rgba(0,0,0,.8); '
1352 + 'line-height: 40px !important; '
1353 + 'opacity: 0; '
1354 + 'visibility: hidden;'
1355 + 'transition: opacity 400ms, visibility 400ms;}}'
1356 );
1357
1358 sheet.insertRule('.energy_counter > .TrollsMenu {'
1359 + 'position: absolute; '
1360 + 'width: 88%; '
1361 + 'margin-left: 18px; '
1362 + 'border-radius: 0px 0 8px 8px; '
1363 + 'background-color: rgba(0,0,0,.8); '
1364 + 'line-height: 22px; '
1365 + 'opacity: 0; '
1366 + 'visibility: hidden;'
1367 + 'transition: opacity 400ms, visibility 400ms;}'
1368 );
1369
1370 sheet.insertRule('.energy_counter:hover > .TrollsMenu {'
1371 + 'opacity: 1; '
1372 + 'display: block; '
1373 + 'visibility: visible;}'
1374 );
1375
1376 sheet.insertRule('#TrollsID a {'
1377 + 'color: rgb(255, 255, 255); '
1378 + 'text-decoration: none;}'
1379 );
1380
1381 sheet.insertRule('#TrollsID a:hover {'
1382 + 'color: rgb(255, 247, 204); '
1383 + 'text-decoration: underline;}'
1384 );
1385}
1386
1387/* ===========
1388 BETTER XP
1389 =========== */
1390
1391function moduleXP() {
1392 function betterXP() {
1393 $('span[hero="xp"]').empty().append('Next: ');
1394 $('span[hero="xp_sep"]').empty().append(nThousand(Hero.infos.Xp.left));
1395 $('span[hero="xp_max"]').empty().append(' XP');
1396 };
1397
1398 betterXP();
1399
1400 $('.button_glow').click(function() {
1401 setInterval(function() {
1402 betterXP();
1403 }, 3000)
1404 });
1405}
1406
1407/* ==============
1408 BETTER MONEY
1409 ============== */
1410
1411function moduleMoney() {
1412 function betterMoney() {
1413 $('div[hero="soft_currency"]').empty().append(nRounding(Hero.infos.soft_currency, 3, -1));
1414 };
1415
1416 betterMoney();
1417
1418 $('.button_glow').click(function() {
1419 setInterval(function() {
1420 betterMoney();
1421 }, 3000)
1422 });
1423
1424 $('#collect_all').click(function() {
1425 setInterval(function() {
1426 betterMoney();
1427 }, 3000)
1428 });
1429
1430 $('.collect_money').click(function() {
1431 setInterval(function() {
1432 betterMoney();
1433 }, 3000)
1434 });
1435}
1436
1437/* ====================
1438 MARKET INFORMATION
1439 ==================== */
1440
1441function moduleMarket() {
1442 //var marketTime = Hero.infos.recharge_timers.calculation_timestamp + $( "#shop>.shop_count> span").attr( "time" )*1000;
1443 //localStorage.setItem("marketTime", marketTime);
1444 var loc2 = $('.hero_stats').children();
1445 loc2.each(function() {
1446 var stat = $(this).attr('hero');
1447 if (stat == 'carac1' || stat == 'carac2' || stat == 'carac3') {
1448 $(this).append('<span class="CustomStats"></span><div id="CustomStats' + stat + '" class="StatsTooltip"></div>');
1449 }
1450 });
1451
1452 updateStats();
1453
1454 function updateStats() {
1455 var loc2 = $('.hero_stats').children();
1456 var last_cost = 0,
1457 levelMoney = 0,
1458 levelPoints = Hero.infos.level * 30;
1459 levelMoney = calculateTotalPrice(levelPoints);
1460 loc2.each(function() {
1461 var stat = $(this).attr('hero');
1462 $('.CustomStats').html('');
1463 if (stat == 'carac1' || stat == 'carac2' || stat == 'carac3') {
1464 var boughtPoints = Hero.infos[stat],
1465 remainingPoints = levelPoints - boughtPoints,
1466 spentMoney = calculateTotalPrice(boughtPoints),
1467 remainingMoney = levelMoney - spentMoney;
1468
1469 var totalPoints = Hero.infos.caracs[stat],
1470 skillPoints = Hero.infos.caracs['stat' + stat.substr(5)] - boughtPoints;
1471
1472 var equipmentsData = $('.armor#equiped .armor').children(),
1473 itemPoints = 0;
1474 equipmentsData.each(function() {
1475 var equipmentsStats = $(this).attr('data-d'),
1476 statPosStart = equipmentsStats.indexOf(stat + '_equip') + 15,
1477 statPosEnd = equipmentsStats.substr(statPosStart).indexOf(',');
1478 itemPoints = itemPoints + parseInt(equipmentsStats.substr(statPosStart, statPosEnd - 1));
1479 });
1480
1481 var boostersData = $('.armor#equiped .sub_block .booster').children(),
1482 ginsengPoints = 0,
1483 ginsengLegendary = 0;
1484 boostersData.each(function() {
1485 if ($(this).attr('class') != 'slot empty') {
1486 if ($(this).attr('id_item') == '7') {
1487 ginsengPoints = ginsengPoints + 100;
1488 }
1489 else if ($(this).attr('id_item') == '8') {
1490 ginsengPoints = ginsengPoints + 350;
1491 }
1492 else if ($(this).attr('id_item') == '9') {
1493 ginsengPoints = ginsengPoints + 1225;
1494 }
1495 else if ($(this).attr('id_item') == '316') {
1496 ginsengLegendary = ginsengLegendary + 1;
1497 }
1498 }
1499 });
1500 ginsengPoints = ginsengPoints + Math.ceil((skillPoints + boughtPoints + itemPoints + ginsengPoints) * 0.06 * ginsengLegendary);
1501
1502 var clubPoints = totalPoints - skillPoints - boughtPoints - itemPoints - ginsengPoints;
1503
1504 $('#CustomStats' + stat).html(
1505 '<b>' + texts[lang].stat_points_need + ':</b> ' + nThousand(remainingPoints) + '<br />' +
1506 '<b>' + texts[lang].money_need + ':</b> ' + nThousand(remainingMoney) + '<br />' +
1507 '<b>' + texts[lang].money_spent + ':</b> ' + nThousand(spentMoney) + '<br /><br />' +
1508 '<b>' + texts[lang].points_from_level + ':</b> ' + nThousand(skillPoints) + '<br />' +
1509 '<b>' + texts[lang].bought_points + ':</b> ' + nThousand(boughtPoints) + '<br />' +
1510 '<b>' + texts[lang].equipment_points + ':</b> ' + nThousand(itemPoints) + '<br />' +
1511 '<b>' + texts[lang].ginseng_points + ':</b> ' + nThousand(ginsengPoints) + '<br />' +
1512 '<b>' + texts[lang].club_points + ':</b> ' + nThousand(clubPoints) + '<br />'
1513 );
1514 }
1515 });
1516 }
1517
1518 function calculateTotalPrice(points) {
1519 var last_price = calculateStatPrice(points);
1520 var price = 0;
1521 if (points < 2000) {
1522 price = (7 + last_price) / 2 * points;
1523 }
1524 else if (points < 4000) {
1525 price = 4012000 + (4009 + last_price) / 2 * (points - 2000);
1526 }
1527 else if (points < 6000) {
1528 price = 20026000 + (12011 + last_price) / 2 * (points - 4000);
1529 }
1530 else if (points < 8000) {
1531 price = 56042000 + (24013 + last_price) / 2 * (points - 6000);
1532 }
1533 else if (points < 10000) {
1534 price = 120060000 + (40015 + last_price) / 2 * (points - 8000);
1535 }
1536 else if (points < 12000) {
1537 price = 220080000 + (60017 + last_price) / 2 * (points - 10000);
1538 }
1539 else if (points < 14000) {
1540 price = 364102000 + (84019 + last_price) / 2 * (points - 12000);
1541 }
1542 else if (points < 16000) {
1543 price = 560126000 + (112021 + last_price) / 2 * (points - 14000);
1544 }
1545 return price;
1546 }
1547
1548 function calculateStatPrice(points) {
1549 var cost = 0;
1550 if (points < 2000) {
1551 cost = 5 + points * 2;
1552 }
1553 else if (points < 4000) {
1554 cost = 4005 + (points - 2000) * 4;
1555 }
1556 else if (points < 6000) {
1557 cost = 12005 + (points - 4000) * 6;
1558 }
1559 else if (points < 8000) {
1560 cost = 24005 + (points - 6000) * 8;
1561 }
1562 else if (points < 10000) {
1563 cost = 40005 + (points - 8000) * 10;
1564 }
1565 else if (points < 12000) {
1566 cost = 60005 + (points - 10000) * 12;
1567 }
1568 else if (points < 14000) {
1569 cost = 84005 + (points - 12000) * 14;
1570 }
1571 else if (points < 16000) {
1572 cost = 112005 + (points - 14000) * 16;
1573 }
1574 return cost;
1575 }
1576
1577 var lsMarket = {};
1578 lsMarket.buyable = {};
1579 lsMarket.stocks = {};
1580 lsMarket.restock = {};
1581
1582 setTimeout(function() {
1583 var restocktime = 0;
1584 var time = $('#shop > .shop_count > span').text();
1585 if (time.indexOf('h') > -1) {
1586 restocktime = parseInt(time.substring(0, time.indexOf('h'))) * 3600;
1587 time = time.substring(time.indexOf('h') + 1);
1588 }
1589 if (time.indexOf('m') > -1) {
1590 restocktime += parseInt(time.substring(0, time.indexOf('m'))) * 60;
1591 time = time.substring(time.indexOf('h') + 1);
1592 }
1593 if (time.indexOf('s') > -1) {
1594 restocktime += parseInt(time.substring(0, time.indexOf('s')));
1595 }
1596
1597 lsMarket.restock.herolvl = Hero.infos.level;
1598 lsMarket.restock.time = (new Date()).getTime() + restocktime * 1000;
1599
1600 get_buyableStocks('potion');
1601 get_buyableStocks('gift');
1602 equipments_shop(0);
1603 boosters_shop(0);
1604 books_shop(0);
1605 gifts_shop(0);
1606 }, 500);
1607
1608 var timer;
1609 $('#shop > button, #inventory > button').click(function() {
1610 var clickedButton = $(this).attr('rel'),
1611 opened_shop = $('#shop').children('.selected');
1612 clearTimeout(timer);
1613 timer = setTimeout(function() {
1614 if (opened_shop.hasClass('armor')) {
1615 equipments_shop(1);
1616 }
1617 else if (opened_shop.hasClass('booster')) {
1618 boosters_shop(1);
1619 }
1620 else if (opened_shop.hasClass('potion')) {
1621 if (clickedButton == 'buy' || clickedButton == 'shop_reload') get_buyableStocks('potion');
1622 books_shop(1);
1623 }
1624 else if (opened_shop.hasClass('gift')) {
1625 if (clickedButton == 'buy' || clickedButton == 'shop_reload') get_buyableStocks('gift');
1626 gifts_shop(1);
1627 }
1628 }, 500);
1629 });
1630
1631 function get_buyableStocks(loc_class) {
1632 var itemsNb = 0,
1633 itemsXp = 0,
1634 itemsPrice = 0,
1635 loc = $('#shop').children('.' + loc_class);
1636 loc.find('.slot').each(function() {
1637 if ($(this).hasClass('empty')) return false;
1638 var item = $(this).data('d');
1639 itemsNb++;
1640 itemsXp += parseInt(item.value, 10);
1641 itemsPrice += parseInt(item.price, 10);
1642 });
1643 lsMarket.buyable[loc_class] = {'Nb':itemsNb, 'Xp':itemsXp, 'Value':itemsPrice};
1644 }
1645
1646 function equipments_shop(update) {
1647 tt_create(update, 'armor', 'EquipmentsTooltip', 'equipments', '');
1648 }
1649 function boosters_shop(update) {
1650 tt_create(update, 'booster', 'BoostersTooltip', 'boosters', '');
1651 }
1652 function books_shop(update) {
1653 tt_create(update, 'potion', 'BooksTooltip', 'books', 'Xp');
1654 }
1655 function gifts_shop(update) {
1656 tt_create(update, 'gift', 'GiftsTooltip', 'gifts', 'affection');
1657 }
1658
1659 function tt_create(update, loc_class, tt_class, itemName, itemUnit) {
1660 var itemsNb = 0,
1661 itemsXp = (itemUnit === '') ? -1 : 0,
1662 itemsSell = 0,
1663 loc = $('#inventory').children('.' + loc_class);
1664
1665 loc.find('.slot').each(function() {
1666 if ($(this).hasClass('empty')) return false;
1667 var item = $(this).data('d'),
1668 Nb = parseInt(item.count, 10);
1669 itemsNb += Nb;
1670 itemsSell += Nb * parseInt(item.price_sell, 10);
1671 if (itemsXp != -1) itemsXp += Nb * parseInt(item.value, 10);
1672 });
1673
1674 var tooltip = texts[lang].you_own + ' <b>' + nThousand(itemsNb) + '</b> ' + texts[lang][itemName] + '.<br />' +
1675 (itemsXp == -1 ? '' : texts[lang].you_can_give + ' <b>' + nThousand(itemsXp) + '</b> ' + texts[lang][itemUnit] + '.<br />') +
1676 texts[lang].you_can_sell + ' <b>' + nThousand(itemsSell) + '</b> <span class="imgMoney"></span>.';
1677
1678 lsMarket.stocks[loc_class] = (loc_class == 'potion' || loc_class == 'gift') ? {'Nb':itemsNb, 'Xp':itemsXp} : {'Nb':itemsNb};
1679 localStorage.setItem('lsMarket', JSON.stringify(lsMarket));
1680
1681 if (update === 0) {
1682 loc.prepend('<span class="CustomTT"></span><div class="' + tt_class + '">' + tooltip + '</div>');
1683 }
1684 else {
1685 loc.children('.' + tt_class).html(tooltip);
1686 }
1687 }
1688 $('plus').on('click', function (event) {
1689 var stat = 'carac' + $(this).attr('for_carac');
1690 Hero.infos[stat]++;
1691 timer = setTimeout(function() {
1692 updateStats();
1693 }, 400);
1694 });
1695
1696 //CSS
1697 sheet.insertRule('#inventory .CustomTT {'
1698 + 'float: right; '
1699 + 'margin: 11px 1px 0 0; '
1700 + 'background-image: url("https://i.postimg.cc/qBDt6yHV/icon-question.png"); '
1701 + 'background-size: 20px 20px; '
1702 + 'width: 20px; '
1703 + 'height: 20px;}'
1704 );
1705
1706 sheet.insertRule('#inventory .CustomTT:hover {'
1707 + 'cursor: help;}'
1708 );
1709
1710 sheet.insertRule('#inventory .CustomTT:hover + div {'
1711 + 'opacity: 1; '
1712 + 'visibility: visible;}'
1713 );
1714
1715 sheet.insertRule('#inventory .EquipmentsTooltip, #inventory .BoostersTooltip, #inventory .BooksTooltip, #inventory .GiftsTooltip {'
1716 + 'position: absolute; '
1717 + 'z-index: 99; '
1718 + 'width: 240px; '
1719 + 'border: 1px solid rgb(162, 195, 215); '
1720 + 'border-radius: 8px; '
1721 + 'box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.1); '
1722 + 'padding: 3px 7px 4px 7px; '
1723 + 'background-color: #F2F2F2; '
1724 + 'font: normal 10px/17px Tahoma, Helvetica, Arial, sans-serif; '
1725 + 'color: #057; '
1726 + 'opacity: 0; '
1727 + 'visibility: hidden; '
1728 + 'transition: opacity 400ms, visibility 400ms;}'
1729 );
1730
1731 sheet.insertRule('#inventory .EquipmentsTooltip, #inventory .BoostersTooltip {'
1732 + 'margin: -33px 0 0 210px; '
1733 + 'height: 43px;}'
1734 );
1735
1736 sheet.insertRule('#inventory .BooksTooltip, #inventory .GiftsTooltip {'
1737 + 'margin: -50px 0 0 210px; '
1738 + 'height: 60px;}'
1739 );
1740
1741 sheet.insertRule('#inventory .EquipmentsTooltip b, #inventory .BoostersTooltip b, #inventory .BooksTooltip b, #inventory .GiftsTooltip b {'
1742 + 'font-weight: bold;}'
1743 );
1744
1745 sheet.insertRule('#inventory .imgMoney {'
1746 + 'background-size: 12px 12px; '
1747 + 'background-repeat: no-repeat; '
1748 + 'width: 12px; '
1749 + 'height: 14px; '
1750 + 'vertical-align: text-bottom; '
1751 + 'background-image: url("https://i.postimg.cc/wv01VstN/icon-currency-ymen.png"); '
1752 + 'display: inline-block;}'
1753 );
1754
1755 sheet.insertRule('.hero_stats .CustomStats:hover {'
1756 + 'cursor: help;}'
1757 );
1758
1759 sheet.insertRule('.hero_stats .CustomStats {'
1760 + 'float: left; '
1761 + 'margin-left: -20px; '
1762 + 'margin-top: 0px; '
1763 + 'background-image: url("https://i.postimg.cc/qBDt6yHV/icon-question.png"); '
1764 + 'background-size: 18px 18px; '
1765 + 'background-position: center; '
1766 + 'background-repeat: no-repeat; '
1767 + 'width: 18px; '
1768 + 'height: 100%; '
1769 + 'visibility: none;}'
1770 );
1771
1772 sheet.insertRule('.hero_stats .CustomStats:hover + div {'
1773 + 'opacity: 1; '
1774 + 'visibility: visible;}'
1775 );
1776
1777 sheet.insertRule('.hero_stats .StatsTooltip {'
1778 + 'position: absolute; '
1779 + 'z-index: 99; '
1780 + 'margin: -50px 0 0 -50px; '
1781 + 'border: 1px solid rgb(162, 195, 215); '
1782 + 'border-radius: 8px; '
1783 + 'box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.1); '
1784 + 'padding: 2px 17px 2px 7px; '
1785 + 'background-color: #F2F2F2; '
1786 + 'font: normal 10px/17px Tahoma, Helvetica, Arial, sans-serif; '
1787 + 'text-align: left; '
1788 + 'white-space: nowrap; '
1789 + 'opacity: 0; '
1790 + 'visibility: hidden; '
1791 + 'transition: opacity 400ms, visibility 400ms;}'
1792 );
1793
1794 sheet.insertRule('.hero_stats .StatsTooltip b {'
1795 + 'font-weight: bold;}'
1796 );
1797}
1798
1799/* =====================================
1800 MARKET XP AND AFFECTION INFORMATION
1801 ===================================== */
1802
1803function moduleMarket_XP_Aff() {
1804 const timeout = 250;
1805
1806 function updateGirlXP(girl) {
1807 var xp_current = parseInt(girl.find('div div.bar-wrap[rel="xp"] div.over span.xp_val').text().replace(/\D/g, ''));
1808 var xp_next_level = parseInt(girl.find('div div.bar-wrap[rel="xp"] div.over span.xp_max').text().replace(/\D/g, ''));
1809 var xp_next_remaining = xp_next_level - xp_current;
1810 var girl_data = JSON.parse(girl.attr('girl-tooltip-data'));
1811 var girl_rarity = girl_data.rarity;
1812 var lvl_max = Hero.infos.level;
1813 var xp_total = 0;
1814 switch (girl_rarity) {
1815 case "starting":
1816 xp_total = GIRLS_EXP_LEVELS.starting[lvl_max-2];
1817 break;
1818 case "common":
1819 xp_total = GIRLS_EXP_LEVELS.common[lvl_max-2];
1820 break;
1821 case "rare":
1822 xp_total = GIRLS_EXP_LEVELS.rare[lvl_max-2];
1823 break;
1824 case "epic":
1825 xp_total = GIRLS_EXP_LEVELS.epic[lvl_max-2];
1826 break;
1827 case "legendary":
1828 xp_total = GIRLS_EXP_LEVELS.legendary[lvl_max-2];
1829 break;
1830 case "mythic":
1831 xp_total = GIRLS_EXP_LEVELS.mythic[lvl_max-2];
1832 break;
1833 }
1834 var xp_total_remaining = xp_total - xp_current;
1835
1836 if( xp_total_remaining > 0) {
1837 girl.find('div div.bar-wrap[rel="xp"] div.over').css('visibility', 'hidden');
1838 girl.find('div div.bar-wrap[rel="xp"] div.over span.new_over').remove();
1839 girl.find('div div.bar-wrap[rel="xp"] div.over').prepend('<span class="new_over" style="visibility: visible">-> ' + nThousand(xp_next_remaining)
1840 + ' / Max: ' + nThousand(xp_total_remaining) + '</span>');
1841
1842 } else {
1843 girl.find('div div.bar-wrap[rel="xp"] div.over').css('visibility', 'visible');
1844 girl.find('div div.bar-wrap[rel="xp"] div.over span.new_over').remove();
1845 }
1846 }
1847
1848 function updateGirlAff(girl) {
1849 var girl_gata_g = JSON.parse(girl.attr('data-g'));
1850 var aff_current_1 = girl_gata_g.Affection.cur;
1851 var aff_current_2 = parseInt(girl.find('div.bar-wrap[rel="aff"] div.over.less_stars span.aff_current').text()) || 0;
1852 var aff_current = Math.max(aff_current_1, aff_current_2) || aff_current_1;
1853 var aff_max = parseInt(girl_gata_g.Affection.max);
1854 var aff_remaining = aff_max - aff_current;
1855 girl.find('div div.bar-wrap[rel="aff"] div.over.less_stars span').css('visibility', 'hidden');
1856 girl.find('div div.bar-wrap[rel="aff"] div.over.less_stars span.aff_current').remove();
1857 girl.find('div.bar-wrap[rel="aff"] div.over.less_stars').append('<span class=aff_current style="visibility: hidden">' + aff_current + '</span>');
1858 girl.find('div div.bar-wrap[rel="aff"] div.over.less_stars span.new_over_aff').remove();
1859 girl.find('div.bar-wrap[rel="aff"] div.over.less_stars').append('<span class=new_over_aff>'
1860 + 'Next: ' + nThousand(aff_remaining) + '</span>');
1861 }
1862
1863 setTimeout(function(){
1864 var girl = $('div.girl-ico:not(.not-selected)');
1865 updateGirlXP(girl);
1866 updateGirlAff(girl);
1867 }, 1000);
1868
1869 $('#type_item > div:nth-child(3)').click(function(event) {
1870 setTimeout(function(){
1871 var girl = $('div.girl-ico:not(.not-selected)');
1872 updateGirlXP(girl);
1873 updateGirlAff(girl);
1874 }, 1000)
1875 });
1876
1877 $('#type_item > div:nth-child(4)').click(function(event) {
1878 setTimeout(function(){
1879 var girl = $('div.girl-ico:not(.not-selected)');
1880 updateGirlXP(girl);
1881 updateGirlAff(girl);
1882 }, 1000)
1883 });
1884
1885 $('.g1 > span:nth-child(1)').click(function(event) {
1886 setTimeout(function(){
1887 var girl = $('div.girl-ico:not(.not-selected)');
1888 updateGirlXP(girl);
1889 updateGirlAff(girl);
1890 }, timeout)
1891 });
1892
1893 $('.g1 > span:nth-child(2)').click(function(event) {
1894 setTimeout(function(){
1895 var girl = $('div.girl-ico:not(.not-selected)');
1896 updateGirlXP(girl);
1897 updateGirlAff(girl);
1898 }, timeout)
1899 });
1900
1901 let button = document.querySelector('#inventory button.blue_text_button');
1902 button.addEventListener('click', function(){
1903 var girl = $('div.girl-ico:not(.not-selected)');
1904
1905 setTimeout(function(){
1906 var gift = $('#inventory.sub_block div.gift.selected').find('div.inventory_slots div.ui-droppable div.selected');
1907 var gift_value = 0;
1908 if (gift.text() != "") {
1909 var gift_data = JSON.parse(gift.attr('data-d'));
1910 gift_value = parseInt(gift_data.value);
1911 }
1912 var aff_current = parseInt(girl.find('div.bar-wrap[rel="aff"] div.over.less_stars span.aff_current').text());
1913 var girl_gata_g = JSON.parse(girl.attr('data-g'));
1914 var aff_max = parseInt(girl_gata_g.Affection.max);
1915 aff_current += gift_value;
1916 var aff_remaining = aff_max - aff_current;
1917 girl.find('div div.bar-wrap[rel="aff"] div.over.less_stars span.aff_current').remove();
1918 girl.find('div.bar-wrap[rel="aff"] div.over.less_stars').append('<span class=aff_current style="visibility: hidden">' + aff_current + '</span>');
1919 girl.find('div div.bar-wrap[rel="aff"] div.over.less_stars span.new_over_aff').remove();
1920 girl.find('div.bar-wrap[rel="aff"] div.over.less_stars').append('<span class=new_over_aff>'
1921 + 'Next: ' + nThousand(aff_remaining) + '</span>');
1922 }, 90);
1923
1924 setInterval(function(){updateGirlXP(girl);}, 3000)});
1925}
1926
1927/* ===================
1928 HAREM INFORMATION
1929 =================== */
1930
1931function moduleHarem() {
1932 var stats = [];
1933 var girlsList = [];
1934 var haremRight = $('#harem_right');
1935
1936 stats.girls = 0;
1937 stats.hourlyMoney = 0;
1938 stats.allCollect = 0;
1939 stats.unlockedScenes = 0;
1940 stats.allScenes = 0;
1941 stats.rarities = {starting: 0, common: 0, rare: 0, epic: 0, legendary: 0, mythic: 0};
1942 stats.caracs = {1: 0, 2: 0, 3: 0};
1943 stats.stars = {affection: 0, money: 0, kobans: 0};
1944 stats.xp = 0;
1945 stats.affection = 0;
1946 stats.money = 0;
1947 stats.kobans = 0;
1948
1949 var EvoReq = [];
1950
1951 var starting = [];
1952 starting.push({affection: 90, money: 36000, kobans: 36, taffection: 90, tmoney: 36000, tkobans: 36});
1953 starting.push({affection: 225, money: 90000, kobans: 60, taffection: 315, tmoney: 126000, tkobans: 96});
1954 starting.push({affection: 563, money: 225000, kobans: 114, taffection: 878, tmoney: 351000, tkobans: 210});
1955 starting.push({affection: 1125, money: 450000, kobans: 180, taffection: 2003, tmoney: 801000, tkobans: 390});
1956 starting.push({affection: 2250, money: 900000, kobans: 300, taffection: 4253, tmoney: 1701000, tkobans: 690});
1957 EvoReq.starting = starting;
1958
1959 var commonGirls = [];
1960 commonGirls.push({affection: 180, money: 72000, kobans: 72, taffection: 180, tmoney: 72000, tkobans: 72});
1961 commonGirls.push({affection: 450, money: 180000, kobans: 120, taffection: 630, tmoney: 252000, tkobans: 192});
1962 commonGirls.push({affection: 1125, money: 450000, kobans: 228, taffection: 1755, tmoney: 702000, tkobans: 420});
1963 commonGirls.push({affection: 2250, money: 900000, kobans: 360, taffection: 4005, tmoney: 1602000, tkobans: 780});
1964 commonGirls.push({affection: 4500, money: 1800000, kobans: 600, taffection: 8505, tmoney: 3402000, tkobans: 1380});
1965 EvoReq.common = commonGirls;
1966
1967 var rareGirls = [];
1968 rareGirls.push({affection: 540, money: 216000, kobans: 216, taffection: 540, tmoney: 216000, tkobans: 216});
1969 rareGirls.push({affection: 1350, money: 540000, kobans: 360, taffection: 1890, tmoney: 756000, tkobans: 576});
1970 rareGirls.push({affection: 3375, money: 1350000, kobans: 678, taffection: 5265, tmoney: 2106000, tkobans: 1254});
1971 rareGirls.push({affection: 6750, money: 2700000, kobans: 1080, taffection: 12015, tmoney: 4806000, tkobans: 2334});
1972 rareGirls.push({affection: 13500, money: 5400000, kobans: 1800, taffection: 25515, tmoney: 10206000, tkobans: 4134});
1973 EvoReq.rare = rareGirls;
1974
1975 var epicGirls = [];
1976 epicGirls.push({affection: 1260, money: 504000, kobans: 504, taffection: 1260, tmoney: 504000, tkobans: 504});
1977 epicGirls.push({affection: 3150, money: 1260000, kobans: 840, taffection: 4410, tmoney: 1764000, tkobans: 1344});
1978 epicGirls.push({affection: 7875, money: 3150000, kobans: 1578, taffection: 12285, tmoney: 4914000, tkobans: 2922});
1979 epicGirls.push({affection: 15750, money: 6300000, kobans: 2520, taffection: 28035, tmoney: 11214000, tkobans: 5442});
1980 epicGirls.push({affection: 31500, money: 12600000, kobans: 4200, taffection: 59535, tmoney: 23814000, tkobans: 9642});
1981 EvoReq.epic = epicGirls;
1982
1983 var legendGirls = [];
1984 legendGirls.push({affection: 1800, money: 720000, kobans: 720, taffection: 1800, tmoney: 720000, tkobans: 720});
1985 legendGirls.push({affection: 4500, money: 1800000, kobans: 1200, taffection: 6300, tmoney: 2520000, tkobans: 1920});
1986 legendGirls.push({affection: 11250, money: 4500000, kobans: 2250, taffection: 17550, tmoney: 7020000, tkobans: 4170});
1987 legendGirls.push({affection: 22500, money: 9000000, kobans: 3600, taffection: 40050, tmoney: 16020000, tkobans: 7770});
1988 legendGirls.push({affection: 45000, money: 18000000, kobans: 6000, taffection: 85050, tmoney: 34020000, tkobans: 13770});
1989 EvoReq.legendary = legendGirls;
1990
1991 var mythicGirls = [];
1992 mythicGirls.push({affection: 4500, money: 1800000, kobans: 1800, taffection: 4500, tmoney: 1800000, tkobans: 1800});
1993 mythicGirls.push({affection: 11250, money: 4500000, kobans: 3000, taffection: 15750, tmoney: 6300000, tkobans: 4800});
1994 mythicGirls.push({affection: 28125, money: 11300000, kobans: 5628, taffection: 43875, tmoney: 17600000, tkobans: 10428});
1995 mythicGirls.push({affection: 56250 , money: 22500000, kobans: 9000, taffection: 100125, tmoney: 40100000, tkobans: 19428});
1996 mythicGirls.push({affection: 112500, money: 45000000, kobans: 15000, taffection: 212625, tmoney: 85100000, tkobans: 34428});
1997 mythicGirls.push({affection: 225000, money: 90000000, kobans: 18000, taffection: 437625, tmoney: 175100000, tkobans: 52428});
1998 EvoReq.mythic = mythicGirls;
1999
2000 for (var id in girlsDataList) {
2001 var girl = jQuery.extend(true, {}, girlsDataList[id]);
2002 if (girl.own) {
2003 stats.allCollect += girl.salary;
2004 stats.rarities[girl.rarity]++;
2005 stats.caracs[girl.class]++;
2006 stats.girls++;
2007 stats.hourlyMoney += Math.round(girl.salary_per_hour);
2008 stats.unlockedScenes += girl.graded;
2009 stats.allScenes += parseInt(girl.nb_grades);
2010 var nbgrades = parseInt(girl.nb_grades);
2011 if (girl.graded != nbgrades) {
2012 stats.affection += EvoReq[girl.rarity][nbgrades - 1].taffection - girl.Affection.cur;
2013 var currentLevelMoney = 0,
2014 currentLevelKobans = 0;
2015 if (girl.graded != 0) {
2016 currentLevelMoney = EvoReq[girl.rarity][girl.graded - 1].tmoney;
2017 currentLevelKobans = EvoReq[girl.rarity][girl.graded - 1].tkobans;
2018 }
2019 stats.money += EvoReq[girl.rarity][nbgrades - 1].tmoney - currentLevelMoney;
2020 if (hh_nutaku) {
2021 stats.kobans += Math.ceil((EvoReq[girl.rarity][nbgrades - 1].tkobans - currentLevelKobans) / 6);
2022 }
2023 else {
2024 stats.kobans += EvoReq[girl.rarity][nbgrades - 1].tkobans - currentLevelKobans;
2025 }
2026 }
2027
2028 var expToMax = (GIRLS_EXP_LEVELS[girl.rarity][Hero.infos.level - 2] - girl.Xp.cur);
2029 if (expToMax < 0) expToMax = 0;
2030 stats.xp += expToMax;
2031 }
2032 }
2033
2034 try {
2035 var lsMarket = JSON.parse(localStorage.getItem('lsMarket')),
2036 d = new Date(lsMarket.restock.time),
2037 RestockInfo;
2038
2039 if (new Date() > lsMarket.restock.time || Hero.infos.level > lsMarket.restock.herolvl) {
2040
2041 RestockInfo = '> The <a href="../shop.html">Market</a> restocked since your last visit.';
2042 }
2043 else {
2044 var marketBookTxt = lsMarket.buyable.potion.Nb + ' ' + texts[lang].books + ' (' + nThousand(lsMarket.buyable.potion.Xp) + ' ' + texts[lang].Xp + ')',
2045 marketGiftTxt = lsMarket.buyable.gift.Nb + ' ' + texts[lang].gifts + ' (' + nThousand(lsMarket.buyable.gift.Xp) + ' ' + texts[lang].affection + ')';
2046 RestockInfo = '- ' + marketBookTxt + ' = ' + nThousand(lsMarket.buyable.potion.Value) + ' <span class="imgMoney"></span>'
2047 + '<br />- ' + marketGiftTxt + ' = ' + nThousand(lsMarket.buyable.gift.Value) + ' <span class="imgMoney"></span>'
2048 + '<br /><font style="color: gray;">' + texts[lang].restock + ': ' + d.toLocaleString() + ' (' + texts[lang].or_level + ' ' + (Hero.infos.level+1) + ')</font>';
2049 }
2050
2051 var myArmorTxt = nThousand(lsMarket.stocks.armor.Nb) + (lsMarket.stocks.armor.Nb > 99 ? '+ ' : ' ') + ' ' + texts[lang].equipments,
2052 myBoosterTxt = nThousand(lsMarket.stocks.booster.Nb) + ' ' + texts[lang].boosters,
2053 myBookTxt = nThousand(lsMarket.stocks.potion.Nb) + ' ' + texts[lang].books + ' (' + nThousand(lsMarket.stocks.potion.Xp) + ' ' + texts[lang].Xp + ')',
2054 myGiftTxt = nThousand(lsMarket.stocks.gift.Nb) + ' ' + texts[lang].gifts + ' (' + nThousand(lsMarket.stocks.gift.Xp) + ' ' + texts[lang].affection + ')',
2055 MarketStocks = '- ' + myArmorTxt + ', ' + myBoosterTxt
2056 + '<br />- ' + myBookTxt
2057 + '<br />- ' + myGiftTxt
2058 + '<span class="subTitle">' + texts[lang].currently_buyable + ':</span>'
2059 + RestockInfo;
2060 } catch(e) {
2061 MarketStocks = (lsAvailable == 'yes') ? '> ' + texts[lang].visit_the : '> ' + texts[lang].not_compatible;
2062 }
2063
2064 var StatsString = '<div class="StatsContent"><span class="Title">' + texts[lang].harem_stats + ':</span>' +
2065 '<span class="subTitle" style="margin-top: -10px;">' + stats.girls + ' ' + texts[lang].haremettes + ':</span>' +
2066 '- ' + stats.caracs[1] + ' ' + texts[lang].hardcore + ', ' + stats.caracs[2] + ' ' + texts[lang].charm + ', ' + stats.caracs[3] + ' ' + texts[lang].know_how + '<br />- '
2067 + (stats.rarities.starting + stats.rarities.common) + ' ' + texts[lang].common + ', ' + stats.rarities.rare + ' ' + texts[lang].rare + ', ' + stats.rarities.epic + ' ' + texts[lang].epic + ', ' + stats.rarities.legendary + ' ' + texts[lang].legendary + ', ' + stats.rarities.mythic + ' ' + texts[lang].mythic + ' <br />- '
2068 + nThousand(parseInt(document.getElementsByClassName('focus_text')[0].innerHTML.replace(/\D/g, ''))) + '/' + nThousand(Hero.infos.level * stats.girls) + ' ' + texts[lang].harem_level + ' (' + nThousand(Hero.infos.level * stats.girls - parseInt(document.getElementsByClassName('focus_text')[0].innerHTML.replace(/\D/g, ''))) + ' ' + texts[lang].to_go + ')<br />- '
2069 + stats.unlockedScenes + '/' + stats.allScenes + ' ' + texts[lang].unlocked_scenes + ' (' + nThousand(stats.allScenes - stats.unlockedScenes) + ' ' + texts[lang].to_go + ')'
2070 + '<span class="subTitle">' + texts[lang].money_income + ':</span>'
2071 + '~' + nThousand(stats.hourlyMoney) + ' <span class="imgMoney"></span> ' + texts[lang].per_hour
2072 + '<br />' + nThousand(stats.allCollect) + ' <span class="imgMoney"></span> ' + texts[lang].when_all_collectable
2073 + '<span class="subTitle">' + texts[lang].required_to_unlock + ':</span>'
2074 + addPriceRow('', stats.affection, stats.money, stats.kobans)
2075 + '<span class="subTitle">' + texts[lang].required_to_get_max_level + ':</span>'
2076 + nThousand(stats.xp) + ' ' + texts[lang].Xp + ' (' + nThousand(stats.xp * 200) + ' <span class="imgMoney"></span>) <br />'
2077 + '<span class="subTitle">' + texts[lang].my_stocks + ':</span>'
2078 + MarketStocks
2079 + '</div>';
2080
2081 $('#harem_left').append('<div id="CustomBar">'
2082 + '<img f="stats" src="https://i.postimg.cc/8cYj8QmP/icon-info.png">'
2083 + '</div>'
2084 + '<div id="TabsContainer">' + StatsString + '</div>');
2085
2086 var TabsContainer = $('#TabsContainer');
2087 var Stats = TabsContainer.children('.StatsContent');
2088
2089 $('body').click(function(e) {
2090 var clickOn = e.target.getAttribute('f');
2091 switch (clickOn) {
2092 case 'stats':
2093 toggleTabs(Stats);
2094 break;
2095 default:
2096 var clickedContainer = $(e.target).closest('[id]').attr('id');
2097 if (clickedContainer == 'TabsContainer') return;
2098 TabsContainer.fadeOut(400);
2099 }
2100 });
2101
2102 function toggleTabs(tabIn) {
2103 if (TabsContainer.css('display') == 'block') {
2104 setTimeout(function() { tabIn.fadeIn(300); }, 205);
2105 TabsContainer.fadeOut(400);
2106 }
2107 else {
2108 tabIn.toggle(true);
2109 TabsContainer.fadeIn(400);
2110 }
2111 }
2112
2113 function addPriceRow(rowName, affection, money, kobans) {
2114 return '<b>' + rowName + '</b> ' +
2115 nThousand(affection) + ' ' + texts[lang].affection + ' (' + nThousand(affection * 417) + ' <span class="imgMoney"></span>) ' + texts[lang].and + ' <br />' +
2116 nThousand(money) + ' <span class="imgMoney"></span> ' + texts[lang].or + ' ' +
2117 nThousand(kobans) + ' <span class="imgKobans"></span><br />';
2118 }
2119
2120 function addPriceRowGirl(rowName, affection, money, kobans) {
2121 return '<b>' + rowName + ':</b> ' +
2122 nThousand(affection) + ' ' + texts[lang].affection + ' (' + nThousand(affection * 417) + ' <span class="imgMoney"></span>) ' + texts[lang].and + ' ' +
2123 nThousand(money) + ' <span class="imgMoney"></span> ' + texts[lang].or + ' ' +
2124 nThousand(kobans) + ' <span class="imgKobans"></span><br />';
2125 }
2126
2127 $('.girls_list div[id_girl]').click(function() {
2128 updateInfo();
2129 });
2130
2131 updateInfo();
2132
2133 function updateInfo() {
2134 setTimeout(function () {
2135 haremRight.children('[girl]').each(function() {
2136 var girl = girlsDataList[$(this).attr('girl')];
2137 //for Wiki FR
2138 var girlName = girl.Name.replace("’", "-");
2139
2140 if (!girl.own) {
2141 if (HH_UNIVERSE == 'gay') {
2142 $(this).find('p').after('<div class="WikiLinkDialogbox"><a href="https://harem-battle.club/wiki/Gay-Harem/GH:' + girl.Name + '" target="_blank"> ' + girl.Name + texts[lang].wiki + ' </a></div>');
2143 }
2144 else if (lang == 'fr') {
2145 $(this).find('p').after('<div class="WikiLinkDialogbox"><a href="http://hentaiheroes.wikidot.com/' + girlName + '" target="_blank"> ' + texts[lang].wiki + girl.Name + ' </a></div>');
2146 }
2147 else {
2148 $(this).find('p').after('<div class="WikiLinkDialogbox"><a href="https://harem-battle.club/wiki/Harem-Heroes/HH:' + girl.Name + '" target="_blank"> ' + girl.Name + texts[lang].wiki + ' </a></div>');
2149 }
2150 }
2151 if (girl.own) {
2152 if (HH_UNIVERSE == 'gay') {
2153 $(this).find('h3').after('<div class="WikiLink"><a href="https://harem-battle.club/wiki/Gay-Harem/GH:' + girl.Name + '" target="_blank"> ' + girl.Name + texts[lang].wiki + ' </a></div>');
2154 }
2155 else if (lang == 'fr') {
2156 $(this).find('h3').after('<div class="WikiLink"><a href="http://hentaiheroes.wikidot.com/' + girlName + '" target="_blank"> ' + texts[lang].wiki + girl.Name + ' </a></div>');
2157 }
2158 else {
2159 $(this).find('h3').after('<div class="WikiLink"><a href="https://harem-battle.club/wiki/Harem-Heroes/HH:' + girl.Name + '" target="_blank"> ' + girl.Name + texts[lang].wiki + ' </a></div>');
2160 }
2161 }
2162 var j = 0,
2163 FirstLockedScene = 1,
2164 AffectionTT = texts[lang].evolution_costs + ':<br />',
2165 ScenesLink = '',
2166 girl_quests = $(this).find('.girl_quests');
2167 girl_quests.find('g').each(function() {
2168
2169 j++;
2170 var aff = 0,
2171 money = 0,
2172 kobans = 0;
2173 var currentLevelMoney = 0,
2174 currentLevelKobans = 0;
2175 if (girl.graded != 0) {
2176 currentLevelMoney = EvoReq[girl.rarity][girl.graded - 1].tmoney;
2177 currentLevelKobans = EvoReq[girl.rarity][girl.graded - 1].tkobans;
2178 }
2179 if (girl.graded >= j) {
2180 }
2181 else if ((girl.graded + 1) == j && girl.Affection.level == j) {
2182 money = EvoReq[girl.rarity][j - 1].tmoney - currentLevelMoney;
2183 if (hh_nutaku) {
2184 kobans = Math.ceil((EvoReq[girl.rarity][j - 1].tkobans - currentLevelKobans) / 6);
2185 }
2186 else {
2187 kobans = EvoReq[girl.rarity][j - 1].tkobans - currentLevelKobans;
2188 }
2189 }
2190 else {
2191 aff = EvoReq[girl.rarity][j - 1].taffection - girl.Affection.cur;
2192 money = EvoReq[girl.rarity][j - 1].tmoney - currentLevelMoney;
2193 if (hh_nutaku) {
2194 kobans = Math.ceil((EvoReq[girl.rarity][j - 1].tkobans - currentLevelKobans) / 6);
2195 }
2196 else {
2197 kobans = EvoReq[girl.rarity][j - 1].tkobans - currentLevelKobans;
2198 }
2199 }
2200 AffectionTT += addPriceRowGirl(j + '</b><span class="imgStar"></span>', aff, money, kobans);
2201 ScenesLink += (ScenesLink === '') ? 'hh_scenes=' : ',';
2202 var SceneHref = $(this).parent().attr('href');
2203 if ($(this).hasClass('grey') || $(this).hasClass('green')) {
2204 if (FirstLockedScene === 0) {
2205 ScenesLink += '0';
2206 }
2207 else {
2208 FirstLockedScene = 0;
2209 var XpLeft = girl_quests.parent().parent().children('.girl_exp_left');
2210 var isUpgradable = girl_quests.parent().children('.green_text_button');
2211 ScenesLink += (isUpgradable.length) ? '0.' + isUpgradable.attr('href').substr(7) : '0';
2212 }
2213 }
2214 else {
2215 var attrHref = $(this).parent().attr('href');
2216 if (typeof attrHref != 'undefined') {
2217 ScenesLink += attrHref.substr(7);
2218 }
2219 }
2220 });
2221
2222 girl_quests.children('a').each(function() {
2223 var attr = $(this).attr('href');
2224 if (typeof attr !== typeof undefined && attr !== false) {
2225 $(this).attr('href', attr + '?' + ScenesLink);
2226 }
2227 });
2228 ScenesLink = '';
2229
2230 girl_quests.parent().children('h4').prepend('<span class="CustomTT"></span><div class="AffectionTooltip">' + AffectionTT + '</div>');
2231
2232 });
2233 }, 50);
2234 }
2235
2236 //CSS
2237 sheet.insertRule('#harem_left .HaremetteNb {'
2238 + 'float: right; '
2239 + 'line-height: 14px; '
2240 + 'font-size: 12px;}'
2241 );
2242
2243 sheet.insertRule('#CustomBar {'
2244 + 'z-index: 99; '
2245 + 'width: 100%; '
2246 + 'padding: 3px 10px 0 3px; '
2247 + 'font: bold 10px Tahoma, Helvetica, Arial, sans-serif; '
2248 + 'position: absolute; bottom: 3px; left: 0px;}'
2249 );
2250
2251 sheet.insertRule('#CustomBar img {'
2252 + 'width: 20px; '
2253 + 'height: 20px; '
2254 + 'margin-right: 3px; '
2255 + 'margin-bottom: 3px; '
2256 + 'opacity: 0.5;}'
2257 );
2258
2259 sheet.insertRule('#CustomBar img:hover {'
2260 + 'opacity: 1; '
2261 + 'cursor: pointer;}'
2262 );
2263
2264 sheet.insertRule('#CustomBar .TopBottomLinks {'
2265 + 'float: right; '
2266 + 'margin-top: 2px;}'
2267 );
2268
2269 sheet.insertRule('#CustomBar a, #TabsContainer a {'
2270 + 'color: #008; '
2271 + 'text-decoration: none;}'
2272 );
2273
2274 sheet.insertRule('#harem_whole .WikiLink a {'
2275 + 'color: #87CEFA; '
2276 + 'text-decoration: none;}'
2277 );
2278
2279 sheet.insertRule('#CustomBar a:hover, #TabsContainer a:hover, #harem_right .WikiLink a:hover {'
2280 + 'color: #B14; '
2281 + 'text-decoration: underline;}'
2282 );
2283
2284 sheet.insertRule('#TabsContainer {'
2285 + 'z-index: 99; '
2286 + 'position: absolute; '
2287 + 'bottom: 30px; '
2288 + 'left: 12px; '
2289 + 'box-sizing: content-box; '
2290 + 'border: 1px solid rgb(156, 182, 213); '
2291 + 'box-shadow: 1px -1px 1px 0px rgba(0,0,0,0.3); '
2292 + 'font: normal 10px/16px Tahoma, Helvetica, Arial, sans-serif; '
2293 + 'color: #000000; '
2294 + 'background-color: #ffffff; '
2295 + 'display: none;}'
2296 );
2297
2298 sheet.insertRule('#TabsContainer > div {'
2299 + 'padding: 1px 10px 8px 10px;}'
2300 );
2301
2302 sheet.insertRule('#TabsContainer .Title {'
2303 + 'margin-left: -5px; '
2304 + 'font: bold 12px/22px Tahoma, Helvetica, Arial, sans-serif; '
2305 + 'color: #B14;}'
2306 );
2307
2308 sheet.insertRule('#TabsContainer .subTitle {'
2309 + 'padding-top: 10px; '
2310 + 'font-weight: bold; '
2311 + 'display: block;}'
2312 );
2313
2314 sheet.insertRule('#TabsContainer img {'
2315 + 'width: 14px; '
2316 + 'height: 14px; '
2317 + 'vertical-align: text-bottom;}'
2318 );
2319
2320 sheet.insertRule('.StatsContent, #TabsContainer span, #TabsContainer img, #TabsContainer a, #TabsContainer b, #TabsContainer br {'
2321 + 'box-sizing: content-box;}'
2322 );
2323
2324 sheet.insertRule('#harem_whole .CustomTT {'
2325 + 'float: right; '
2326 + 'margin-left: -25px; '
2327 + 'margin-top: -5px; '
2328 + 'background-image: url("https://i.postimg.cc/qBDt6yHV/icon-question.png"); '
2329 + 'background-size: 18px 18px; '
2330 + 'width: 18px; '
2331 + 'height: 18px; '
2332 + 'visibility: none;}'
2333 );
2334
2335 sheet.insertRule('#harem_whole .CustomTT:hover {'
2336 + 'cursor: help;}'
2337 );
2338
2339 sheet.insertRule('#harem_whole .CustomTT:hover + div {'
2340 + 'opacity: 1; '
2341 + 'visibility: visible;}'
2342 );
2343
2344 sheet.insertRule('#harem_whole .AffectionTooltip {'
2345 + 'position: absolute; '
2346 + 'z-index: 99; '
2347 + 'margin: 20px 0 0 0; '
2348 + 'display: block; overflow: auto; '
2349 + 'border: 1px solid rgb(162, 195, 215); '
2350 + 'border-radius: 8px; '
2351 + 'box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.1); '
2352 + 'padding: 3px 7px 4px 7px; '
2353 + 'background-color: #F2F2F2; '
2354 + 'color: #1E90FF; '
2355 + 'font: normal 9px/17px Tahoma, Helvetica, Arial, sans-serif; '
2356 + 'text-align: left; '
2357 + 'text-shadow: none; '
2358 + 'opacity: 0; '
2359 + 'visibility: hidden; '
2360 + 'transition: opacity 400ms, visibility 400ms;}'
2361 );
2362
2363 sheet.insertRule('#collect_all_container {'
2364 + 'margin-top: 0px !important;}'
2365 );
2366
2367 sheet.insertRule('#harem_whole .AffectionTooltip b {'
2368 + 'font-weight: bold;}'
2369 );
2370
2371 sheet.insertRule('#harem_whole .WikiLink {'
2372 + 'font-size: 12px;}'
2373 );
2374
2375 sheet.insertRule('#harem_whole .WikiLinkDialogbox a {'
2376 + 'text-decoration: none; '
2377 + 'color: #24a0ff !important;}'
2378 );
2379
2380 sheet.insertRule('#harem_whole .imgStar, #harem_whole .imgMoney, #harem_whole .imgKobans, #haremwhole .imgStar, #harem_whole .imgMoney, #harem_whole .imgKobans {'
2381 + 'background-size: 10px 10px; '
2382 + 'background-repeat: no-repeat; '
2383 + 'width: 10px; '
2384 + 'height: 14px; '
2385 + 'display: inline-block;}'
2386 );
2387
2388 sheet.insertRule('#harem_whole .imgStar, #harem_left .imgStar {'
2389 + 'background-image: url("https://i.postimg.cc/L6h1xv38/icon-star.png");}'
2390 );
2391
2392 sheet.insertRule('#harem_whole .imgMoney, #harem_left .imgMoney {'
2393 + 'background-image: url("https://i.postimg.cc/wv01VstN/icon-currency-ymen.png");}'
2394 );
2395
2396 sheet.insertRule('#harem_whole .imgKobans, #harem_left .imgKobans {'
2397 + 'background-image: url("https://i.postimg.cc/9fPRDkCJ/icon-currency-koban.png");}'
2398 );
2399}
2400
2401/* ====================
2402 LEAGUE INFORMATION
2403 ==================== */
2404
2405function moduleLeague() {
2406 //var seasonEnds;
2407 var playersTotal;
2408 var challengesLeft;
2409 //var challengesPossibleParse;
2410 var challengesPossibleMinutes;
2411 var challengesPossible;
2412 var challengesDone;
2413 var playerCurrentParse;
2414 var playerCurrentPos;
2415 var playerCurrentPoints;
2416 var maxDemoteParse;
2417 var maxDemotePoints;
2418 var maxDemoteDiff;
2419 var maxDemoteDisplay;
2420 var textDemote;
2421 var maxStagnateParse;
2422 var maxStagnatePoints;
2423 var maxStagnateDiff;
2424 var maxStagnateDisplay;
2425 var textStagnate;
2426 var textTop15;
2427 var minTop30Parse;
2428 var minTop30Points;
2429 var minTop30Diff;
2430 var minTop30Display;
2431 var textTop30;
2432 var minTop45Parse;
2433 var minTop45Points;
2434 var minTop45Diff;
2435 var minTop45Display;
2436 var textTop45;
2437 var avgScore;
2438 var scoreExpected;
2439
2440 var includeBoard = false;
2441
2442 if (localStorage.getItem('HHS.leagueBoard') === '1') {
2443 includeBoard = true;
2444 }
2445
2446 challengesPossibleMinutes = parseInt(Math.floor(season_end_at/60));
2447
2448 playersTotal = (' ' + $('div.leagues_table table tbody.leadTable').text() + ' ').split('/3').length; // splits string into 'number of opponents' + 1 parts
2449 if (screen.width < 1026)
2450 playersTotal += 1;
2451 challengesLeft = 3 * ((' ' + $('div.leagues_table table tbody.leadTable').text() + ' ').split('0/').length - 1) + 2 * ((' ' + $('div.leagues_table table tbody.leadTable').text() + ' ').split('1/').length - 1) + ((' ' + $('div.leagues_table table tbody.leadTable').text() + ' ').split('2/').length - 1);
2452 if (screen.width < 1026)
2453 challengesLeft += (3-(' ' + $('div.leagues_table table tbody.leadTable tr.lead_table_default.selected-player-leagues td div div div.wrapper div:nth-child(1)').text() + ' ').trim().length - (' ' + $('div.leagues_table table tbody.leadTable tr.lead_table_default.selected-player-leagues td div div div.wrapper div:nth-child(2)').text() + ' ').trim().length - (' ' + $('div.leagues_table table tbody.leadTable tr.lead_table_default.selected-player-leagues td div div div.wrapper div:nth-child(3)').text() + ' ').trim().length);
2454 challengesPossible = Math.floor(challengesPossibleMinutes/35) + parseInt(Hero.energies.challenge.amount);
2455 challengesDone = 3*(playersTotal-1)-challengesLeft;
2456
2457 playerCurrentParse = $('div.leagues_table table tr td:nth-child(4):contains(-)').parent().text();
2458 playerCurrentPos = parseInt(playerCurrentParse.trim().substr(0, 3).replace(/\D/g, ''));
2459 playerCurrentPoints = parseInt(playerCurrentParse.substr(playerCurrentParse.lastIndexOf('-') + 1).replace(/\D/g, ''));
2460
2461 if (challengesDone != 0)
2462 avgScore = playerCurrentPoints/challengesDone;
2463 else
2464 avgScore =0;
2465 scoreExpected = Math.floor(avgScore*3*(playersTotal-1));
2466
2467 var playerSelectedPos = parseInt($('div.leagues_table table tbody.leadTable tr.lead_table_default.selected-player-leagues td div div p.rank').text());
2468
2469 if (playerCurrentPos > (playersTotal - 15)) {
2470 maxDemoteParse = $('div.leagues_table table tr td:nth-child(1):contains(' + (playersTotal - 15) + ')').parent().text();
2471 maxDemotePoints = parseInt(maxDemoteParse.substr(maxDemoteParse.lastIndexOf('/3') + 2).replace(/\D/g, ''));
2472 if ((screen.width < 1026) && (playerSelectedPos == (playersTotal - 15)))
2473 maxDemotePoints = parseInt((playerLeaguesData.points).replace(/\D/g, ''));
2474 maxDemoteDiff = maxDemotePoints - playerCurrentPoints;
2475 if (playerCurrentPoints == 0 && maxDemotePoints == 0) {
2476 maxDemoteDisplay = '±' + nThousand(maxDemoteDiff);
2477 textDemote = texts[lang].demote_holdzero;
2478 }
2479 else {
2480 maxDemoteDisplay = '+' + nThousand(maxDemoteDiff);
2481 textDemote = texts[lang].demote_up;
2482 }
2483 }
2484 else {
2485 maxDemoteParse = $('div.leagues_table table tr td:nth-child(1):contains(' + (playersTotal - 14) + ')').parent().text();
2486 maxDemotePoints = parseInt(maxDemoteParse.substr(maxDemoteParse.lastIndexOf('/3') + 2).replace(/\D/g, ''));
2487 if ((screen.width < 1026) && (playerSelectedPos == (playersTotal - 14)))
2488 maxDemotePoints = parseInt((playerLeaguesData.points).replace(/\D/g, ''));
2489 maxDemoteDiff = maxDemotePoints - playerCurrentPoints;
2490 if (playerCurrentPoints == 0 && maxDemotePoints == 0) {
2491 maxDemoteDisplay = '±' + nThousand(maxDemoteDiff);
2492 textDemote = texts[lang].demote_holdzero;
2493 }
2494 else {
2495 if (maxDemoteDiff == 0) {
2496 maxDemoteDisplay = '-' + nThousand(maxDemoteDiff);
2497 }
2498 else {
2499 maxDemoteDisplay = nThousand(maxDemoteDiff);
2500 }
2501 textDemote = texts[lang].demote_down;
2502 }
2503 }
2504
2505 if (playerCurrentPos > 15) {
2506 maxStagnateParse = $('div.leagues_table table tr td:nth-child(1):contains(\t15 )').parent().text() + $('div.leagues_table table tr td:nth-child(1):contains(\t15\t)').parent().text();
2507 maxStagnatePoints = parseInt(maxStagnateParse.substr(maxStagnateParse.lastIndexOf('/3') + 2).replace(/\D/g, ''));
2508 if ((screen.width < 1026) && (playerSelectedPos == 15))
2509 maxStagnatePoints = parseInt((playerLeaguesData.points).replace(/\D/g, ''));
2510 maxStagnateDiff = maxStagnatePoints - playerCurrentPoints;
2511 if (playerCurrentPoints == 0 && maxStagnatePoints == 0) {
2512 maxStagnateDisplay = '±' + nThousand(maxStagnateDiff);
2513 textStagnate = texts[lang].stagnate_holdzero;
2514 textTop15 = texts[lang].top15_up;
2515 }
2516 else {
2517 maxStagnateDisplay = '+' + nThousand(maxStagnateDiff);
2518 textStagnate = texts[lang].stagnate_up;
2519 textTop15 = texts[lang].top15_up;
2520 }
2521 }
2522 else {
2523 maxStagnateParse = $('div.leagues_table table tr td:nth-child(1):contains(\t16\t)').parent().text();
2524 maxStagnatePoints = parseInt(maxStagnateParse.substr(maxStagnateParse.lastIndexOf('/3') + 2).replace(/\D/g, ''));
2525 if ((screen.width < 1026) && (playerSelectedPos == 16))
2526 maxStagnatePoints = parseInt((playerLeaguesData.points).replace(/\D/g, ''));
2527 maxStagnateDiff = maxStagnatePoints - playerCurrentPoints;
2528 if (playerCurrentPoints == 0 && maxStagnatePoints == 0) {
2529 maxStagnateDisplay = '±' + nThousand(maxStagnateDiff);
2530 textStagnate = texts[lang].stagnate_holdzero;
2531 textTop15 = texts[lang].top15_hold;
2532 }
2533 else {
2534 if (maxStagnateDiff == 0) {
2535 maxStagnateDisplay = '-' + nThousand(maxStagnateDiff);
2536 }
2537 else {
2538 maxStagnateDisplay = nThousand(maxStagnateDiff);
2539 }
2540 textStagnate = texts[lang].stagnate_down;
2541 textTop15 = texts[lang].top15_hold;
2542 }
2543 }
2544
2545 if (playerCurrentPos > 30) {
2546 minTop30Parse = $('div.leagues_table table tr td:nth-child(1):contains(\t30\t)').parent().text();
2547 minTop30Points = parseInt(minTop30Parse.substr(minTop30Parse.lastIndexOf('/3') + 2).replace(/\D/g, ''))+1;
2548 if ((screen.width < 1026) && (playerSelectedPos == 30))
2549 minTop30Points = parseInt((playerLeaguesData.points).replace(/\D/g, ''))+1;
2550 minTop30Diff = minTop30Points - playerCurrentPoints;
2551 if (minTop30Diff > 0) {
2552 minTop30Display = '+' + (nThousand(minTop30Diff));
2553 textTop30 = texts[lang].top30_up;
2554 }
2555 else {
2556 minTop30Display = nThousand(minTop30Diff);
2557 textTop30 = texts[lang].top30_hold;
2558 }
2559 }
2560 else {
2561 minTop30Parse = $('div.leagues_table table tr td:nth-child(1):contains(\t31\t)').parent().text();
2562 minTop30Points = parseInt(minTop30Parse.substr(minTop30Parse.lastIndexOf('/3') + 2).replace(/\D/g, ''));
2563 if ((screen.width < 1026) && (playerSelectedPos == 31))
2564 minTop30Points = parseInt((playerLeaguesData.points).replace(/\D/g, ''));
2565 minTop30Diff = minTop30Points - playerCurrentPoints;
2566 if (minTop30Diff < 0) {
2567 minTop30Display = nThousand(minTop30Diff);
2568 textTop30 = texts[lang].top30_hold;
2569 }
2570 else {
2571 minTop30Display = '+' + (nThousand(minTop30Diff));
2572 textTop30 = texts[lang].top30_hold;
2573 }
2574 }
2575
2576 if (playerCurrentPos > 45) {
2577 minTop45Parse = $('div.leagues_table table tr td:nth-child(1):contains(\t45\t)').parent().text();
2578 minTop45Points = parseInt(minTop45Parse.substr(minTop45Parse.lastIndexOf('/3') + 2).replace(/\D/g, ''))+1;
2579 if ((screen.width < 1026) && (playerSelectedPos == 45))
2580 minTop45Points = parseInt((playerLeaguesData.points).replace(/\D/g, ''))+1;
2581 minTop45Diff = minTop45Points - playerCurrentPoints;
2582 if (minTop45Diff > 0) {
2583 minTop45Display = '+' + (nThousand(minTop45Diff));
2584 textTop45 = texts[lang].top45_up;
2585 }
2586 else {
2587 minTop45Display = nThousand(minTop45Diff);
2588 textTop45 = texts[lang].top45_hold;
2589 }
2590 }
2591 else {
2592 minTop45Parse = $('div.leagues_table table tr td:nth-child(1):contains(\t46\t)').parent().text();
2593 minTop45Points = parseInt(minTop45Parse.substr(minTop45Parse.lastIndexOf('/3') + 2).replace(/\D/g, ''));
2594 if ((screen.width < 1026) && (playerSelectedPos == 46))
2595 minTop45Points = parseInt((playerLeaguesData.points).replace(/\D/g, ''));
2596 minTop45Diff = minTop45Points - playerCurrentPoints;
2597 if (minTop45Diff > 0) {
2598 minTop45Display = '+' + (nThousand(minTop45Diff));
2599 textTop45 = texts[lang].top45_hold;
2600 }
2601 else {
2602 minTop45Display = nThousand(minTop45Diff);
2603 textTop45 = texts[lang].top45_hold;
2604 }
2605 }
2606
2607 if (league_tag == 9) {
2608 $('div.league_end_in').append('<span class="scriptLeagueInfo">'
2609 + '<span class="averageScore"><img src="https://www.flaticon.com/svg/static/icons/svg/1753/1753830.svg" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 2px;"> ' + nThousand(Math.round(avgScore*100)/100)
2610 + '<span class="scriptLeagueInfoTooltip averageScoreTooltip">' + texts[lang].averageScore + nThousand(Math.round(avgScore*100)/100) + '<BR>' + texts[lang].scoreExpected + nThousand(scoreExpected) + '</span></span>'
2611 + '<span class="possibleChallenges"><img src="https://i.postimg.cc/ydVJcTNB/icon-bluesquare.png" style="margin-left: 10px; margin-bottom: 2px;"> ' + challengesPossible + '/' + challengesLeft
2612 + '<span class="scriptLeagueInfoTooltip possibleChallengesTooltip">' + texts[lang].challenges_regen + challengesPossible + texts[lang].challenges_left + challengesLeft + '</span></span>'
2613 + '<span class="minTop15"><img src="https://upload.wikimedia.org/wikipedia/commons/c/cc/France_road_sign_B14_%2815%29.svg" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 2px;"> ' + maxStagnateDisplay
2614 + '<span class="scriptLeagueInfoTooltip minTop15Tooltip">' + textTop15 + nThousand(maxStagnatePoints) + ' ' + texts[lang].points + '.</span></span>'
2615 + '<span class="minTop30"><img src="https://www.flaticon.com/premium-icon/icons/svg/2773/2773307.svg" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 2px;"> ' + minTop30Display
2616 + '<span class="scriptLeagueInfoTooltip minTop30Tooltip">' + textTop30 + nThousand(minTop30Points) + ' ' + texts[lang].points + '.</span></span>'
2617 + '<span class="minTop45"><img src="https://www.drodd.com/images16/45-10.png" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 2px;"> ' + minTop45Display
2618 + '<span class="scriptLeagueInfoTooltip minTop45Tooltip">' + textTop45 + nThousand(minTop45Points) + ' ' + texts[lang].points + '.</span></span>'
2619 + '<span class="maxDemote"><img src="https://i.postimg.cc/qqqzZMn5/icon-league-demote.png" style="margin-left: 10px; margin-bottom: 2px;"> ' + maxDemoteDisplay
2620 + '<span class="scriptLeagueInfoTooltip maxDemoteTooltip">' + textDemote + nThousand(maxDemotePoints) + ' ' + texts[lang].points + '.</span></span>'
2621 + '</span>');
2622
2623 $('div.leagues-btn-mobile-refill-multi').append('<span class="scriptMobileLeagueInfo">'
2624 + '<span class="averageScoreMobile"><img src="https://www.flaticon.com/svg/static/icons/svg/1753/1753830.svg" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 5px;"> ' + nThousand(Math.round(avgScore*100)/100)
2625 + '<span class="scriptLeagueInfoTooltip averageScoreMobileTooltip">' + texts[lang].averageScore + nThousand(Math.round(avgScore*100)/100) + '<BR>' + texts[lang].scoreExpected + nThousand(scoreExpected) + '</span></span>'
2626 + '<span class="possibleChallengesMobile"><img src="https://i.postimg.cc/ydVJcTNB/icon-bluesquare.png" style="margin-left: 10px; margin-bottom: 5px;"> ' + challengesPossible + '/' + challengesLeft
2627 + '<span class="scriptMobileLeagueInfoTooltip possibleChallengesMobileTooltip">' + texts[lang].challenges_regen + challengesPossible + texts[lang].challenges_left + challengesLeft + '</span></span>'
2628 + '<span class="minTop15Mobile"><img src="https://upload.wikimedia.org/wikipedia/commons/c/cc/France_road_sign_B14_%2815%29.svg" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 5px;"> ' + maxStagnateDisplay
2629 + '<span class="scriptMobileLeagueInfoTooltip minTop15MobileTooltip">' + textTop15 + nThousand(maxStagnatePoints) + ' ' + texts[lang].points + '.</span></span>'
2630 + '<span class="minTop30Mobile"><img src="https://www.flaticon.com/premium-icon/icons/svg/2773/2773307.svg" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 5px;"> ' + minTop30Display
2631 + '<span class="scriptMobileLeagueInfoTooltip minTop30MobileTooltip">' + textTop30 + nThousand(minTop30Points) + ' ' + texts[lang].points + '.</span></span>'
2632 + '<span class="minTop45Mobile"><img src="https://www.drodd.com/images16/45-10.png" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 5px;"> ' + minTop45Display
2633 + '<span class="scriptMobileLeagueInfoTooltip minTop45MobileTooltip">' + textTop45 + nThousand(minTop45Points) + ' ' + texts[lang].points + '.</span></span>'
2634 + '<span class="maxDemoteMobile"><img src="https://i.postimg.cc/qqqzZMn5/icon-league-demote.png" style="margin-left: 10px; margin-bottom: 5px;"> ' + maxDemoteDisplay
2635 + '<span class="scriptMobileLeagueInfoTooltip maxDemoteMobileTooltip">' + textDemote + nThousand(maxDemotePoints) + ' ' + texts[lang].points + '.</span></span>'
2636 + '</span>');
2637
2638 if (includeBoard == false) {
2639 $('div.league_end_in span.scriptLeagueInfo span.minTop15').empty();
2640 $('div.league_end_in span.scriptLeagueInfo span.minTop30').empty();
2641 $('div.league_end_in span.scriptLeagueInfo span.minTop45').empty();
2642 $('div.leagues-btn-mobile-refill-multi span.scriptMobileLeagueInfo span.minTop15Mobile').empty();
2643 $('div.leagues-btn-mobile-refill-multi span.scriptMobileLeagueInfo span.minTop30Mobile').empty();
2644 $('div.leagues-btn-mobile-refill-multi span.scriptMobileLeagueInfo span.minTop45Mobile').empty();
2645 }
2646 }
2647 else if (league_tag == 1) {
2648 $('div.league_end_in').append('<span class="scriptLeagueInfo">'
2649 + '<span class="averageScore"><img src="https://www.flaticon.com/svg/static/icons/svg/1753/1753830.svg" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 2px;"> ' + nThousand(Math.round(avgScore*100)/100)
2650 + '<span class="scriptLeagueInfoTooltip averageScoreTooltip">' + texts[lang].averageScore + nThousand(Math.round(avgScore*100)/100) + '<BR>' + texts[lang].scoreExpected + nThousand(scoreExpected) + '</span></span>'
2651 + '<span class="possibleChallenges"><img src="https://i.postimg.cc/ydVJcTNB/icon-bluesquare.png" style="margin-left: 10px; margin-bottom: 2px;"> ' + challengesPossible + '/' + challengesLeft
2652 + '<span class="scriptLeagueInfoTooltip possibleChallengesTooltip">' + texts[lang].challenges_regen + challengesPossible + texts[lang].challenges_left + challengesLeft + '</span></span>'
2653 + '<span class="maxStagnate"><img src="https://i.postimg.cc/HnkyDtG3/icon-league-hold.png" style="margin-left: 10px; margin-bottom: 2px;"> ' + maxStagnateDisplay
2654 + '<span class="scriptLeagueInfoTooltip maxStagnateTooltip">' + textStagnate + nThousand(maxStagnatePoints) + ' ' + texts[lang].points + '.</span></span>'
2655 + '<span class="minTop30"><img src="https://www.flaticon.com/premium-icon/icons/svg/2773/2773307.svg" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 2px;"> ' + minTop30Display
2656 + '<span class="scriptLeagueInfoTooltip minTop30Tooltip">' + textTop30 + nThousand(minTop30Points) + ' ' + texts[lang].points + '.</span></span>'
2657 + '</span>');
2658
2659 $('div.leagues-btn-mobile-refill-multi').append('<span class="scriptMobileLeagueInfo">'
2660 + '<span class="averageScoreMobile"><img src="https://www.flaticon.com/svg/static/icons/svg/1753/1753830.svg" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 5px;"> ' + nThousand(Math.round(avgScore*100)/100)
2661 + '<span class="scriptLeagueInfoTooltip averageScoreMobileTooltip">' + texts[lang].averageScore + nThousand(Math.round(avgScore*100)/100) + '<BR>' + texts[lang].scoreExpected + nThousand(scoreExpected) + '</span></span>'
2662 + '<span class="possibleChallengesMobile"><img src="https://i.postimg.cc/ydVJcTNB/icon-bluesquare.png" style="margin-left: 10px; margin-bottom: 5px;"> ' + challengesPossible + '/' + challengesLeft
2663 + '<span class="scriptMobileLeagueInfoTooltip possibleChallengesMobileTooltip">' + texts[lang].challenges_regen + challengesPossible + texts[lang].challenges_left + challengesLeft + '</span></span>'
2664 + '<span class="maxStagnateMobile"><img src="https://i.postimg.cc/HnkyDtG3/icon-league-hold.png" style="margin-left: 10px; margin-bottom: 5px;"> ' + maxStagnateDisplay
2665 + '<span class="scriptMobileLeagueInfoTooltip maxStagnateMobileTooltip">' + textStagnate + nThousand(maxStagnatePoints) + ' ' + texts[lang].points + '.</span></span>'
2666 + '<span class="minTop30Mobile"><img src="https://www.flaticon.com/premium-icon/icons/svg/2773/2773307.svg" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 5px;"> ' + minTop30Display
2667 + '<span class="scriptMobileLeagueInfoTooltip minTop30MobileTooltip">' + textTop30 + nThousand(minTop30Points) + ' ' + texts[lang].points + '.</span></span>'
2668 + '</span>');
2669
2670 if (includeBoard == false) {
2671 $('div.league_end_in span.scriptLeagueInfo span.minTop30').empty();
2672 $('div.leagues-btn-mobile-refill-multi span.scriptMobileLeagueInfo span.minTop30Mobile').empty();
2673 }
2674 }
2675 else {
2676 $('div.league_end_in').append('<span class="scriptLeagueInfo">'
2677 + '<span class="averageScore"><img src="https://www.flaticon.com/svg/static/icons/svg/1753/1753830.svg" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 2px;"> ' + nThousand(Math.round(avgScore*100)/100)
2678 + '<span class="scriptLeagueInfoTooltip averageScoreTooltip">' + texts[lang].averageScore + nThousand(Math.round(avgScore*100)/100) + '<BR>' + texts[lang].scoreExpected + nThousand(scoreExpected) + '</span></span>'
2679 + '<span class="possibleChallenges"><img src="https://i.postimg.cc/ydVJcTNB/icon-bluesquare.png" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 2px;"> ' + challengesPossible + '/' + challengesLeft
2680 + '<span class="scriptLeagueInfoTooltip possibleChallengesTooltip">' + texts[lang].challenges_regen + challengesPossible + texts[lang].challenges_left + challengesLeft + '</span></span>'
2681 + '<span class="maxStagnate"><img src="https://i.postimg.cc/HnkyDtG3/icon-league-hold.png" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 2px;"> ' + maxStagnateDisplay
2682 + '<span class="scriptLeagueInfoTooltip maxStagnateTooltip">' + textStagnate + nThousand(maxStagnatePoints) + ' ' + texts[lang].points + '.</span></span>'
2683 + '<span class="minTop30"><img src="https://www.flaticon.com/premium-icon/icons/svg/2773/2773307.svg" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 2px;"> ' + minTop30Display
2684 + '<span class="scriptLeagueInfoTooltip minTop30Tooltip">' + textTop30 + nThousand(minTop30Points) + ' ' + texts[lang].points + '.</span></span>'
2685 + '<span class="maxDemote"><img src="https://i.postimg.cc/qqqzZMn5/icon-league-demote.png" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 2px;"> ' + maxDemoteDisplay
2686 + '<span class="scriptLeagueInfoTooltip maxDemoteTooltip">' + textDemote + nThousand(maxDemotePoints) + ' ' + texts[lang].points + '.</span></span>'
2687 + '</span>');
2688
2689 $('div.leagues-btn-mobile-refill-multi').append('<span class="scriptMobileLeagueInfo">'
2690 + '<span class="averageScoreMobile"><img src="https://www.flaticon.com/svg/static/icons/svg/1753/1753830.svg" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 5px;"> ' + nThousand(Math.round(avgScore*100)/100)
2691 + '<span class="scriptLeagueInfoTooltip averageScoreMobileTooltip">' + texts[lang].averageScore + nThousand(Math.round(avgScore*100)/100) + '<BR>' + texts[lang].scoreExpected + nThousand(scoreExpected) + '</span></span>'
2692 + '<span class="possibleChallengesMobile"><img src="https://i.postimg.cc/ydVJcTNB/icon-bluesquare.png" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 5px;"> ' + challengesPossible + '/' + challengesLeft
2693 + '<span class="scriptMobileLeagueInfoTooltip possibleChallengesMobileTooltip">' + texts[lang].challenges_regen + challengesPossible + texts[lang].challenges_left + challengesLeft + '</span></span>'
2694 + '<span class="maxStagnateMobile"><img src="https://i.postimg.cc/HnkyDtG3/icon-league-hold.png" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 5px;"> ' + maxStagnateDisplay
2695 + '<span class="scriptMobileLeagueInfoTooltip maxStagnateMobileTooltip">' + textStagnate + nThousand(maxStagnatePoints) + ' ' + texts[lang].points + '.</span></span>'
2696 + '<span class="minTop30Mobile"><img src="https://www.flaticon.com/premium-icon/icons/svg/2773/2773307.svg" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 5px;"> ' + minTop30Display
2697 + '<span class="scriptMobileLeagueInfoTooltip minTop30MobileTooltip">' + textTop30 + nThousand(minTop30Points) + ' ' + texts[lang].points + '.</span></span>'
2698 + '<span class="maxDemoteMobile"><img src="https://i.postimg.cc/qqqzZMn5/icon-league-demote.png" style="height: 15px; width: 16px; margin-left: 10px; margin-bottom: 5px;"> ' + maxDemoteDisplay
2699 + '<span class="scriptMobileLeagueInfoTooltip maxDemoteMobileTooltip">' + textDemote + nThousand(maxDemotePoints) + ' ' + texts[lang].points + '.</span></span>'
2700 + '</span>');
2701
2702 if (includeBoard == false) {
2703 $('div.league_end_in span.scriptLeagueInfo span.minTop30').empty();
2704 $('div.leagues-btn-mobile-refill-multi span.scriptMobileLeagueInfo span.minTop30Mobile').empty();
2705 }
2706 }
2707
2708 //CSS
2709 sheet.insertRule('@media only screen and (min-width: 1026px) {'
2710 + '#leagues_middle .league_end_in {'
2711 + 'line-height: 16px;}}'
2712 );
2713
2714 sheet.insertRule('@media only screen and (min-width: 1026px) {'
2715 + '.scriptLeagueInfo {'
2716 + 'font-size: 13px; '
2717 + 'display: block; '
2718 + 'float: right; '
2719 + 'margin-right: 10px;}}'
2720 );
2721
2722 sheet.insertRule('@media only screen and (max-width: 1025px) {'
2723 + '.scriptLeagueInfo {'
2724 + 'display: none;}}'
2725 );
2726
2727 sheet.insertRule('.scriptLeagueInfoTooltip {'
2728 + 'visibility: hidden; '
2729 + 'font-size: 12px; '
2730 + 'background-color: black; '
2731 + 'color: #fff; '
2732 + 'text-align: center; '
2733 + 'padding: 3px 5px 3px 5px; '
2734 + 'border: 2px solid #905312; '
2735 + 'border-radius: 6px; '
2736 + 'background-color: rgba(32,3,7,.9); '
2737 + 'position: absolute; '
2738 + 'margin-top: 5px; '
2739 + 'z-index: 9;}'
2740 );
2741
2742 sheet.insertRule('.scriptLeagueInfoTooltip::after {'
2743 + 'content: " "; '
2744 + 'position: absolute; '
2745 + 'bottom: 100%; '
2746 + 'left: 50%; '
2747 + 'margin-left: -10px; '
2748 + 'border-width: 10px; '
2749 + 'border-style: solid; '
2750 + 'border-color: transparent transparent #905312 transparent;}'
2751 );
2752
2753 sheet.insertRule('.kobanWinningsTooltip {'
2754 + 'top: 65px; '
2755 + 'margin-left: -95px;}'
2756 );
2757
2758 sheet.insertRule('.kobanWinnings:hover .kobanWinningsTooltip {'
2759 + 'visibility: visible;}'
2760 );
2761
2762 sheet.insertRule('.averageScoreTooltip {'
2763 + 'top: 65px; '
2764 + 'margin-left: -135px;}'
2765 );
2766
2767 sheet.insertRule('.averageScore:hover .averageScoreTooltip {'
2768 + 'visibility: visible;}'
2769 );
2770
2771 sheet.insertRule('.possibleChallengesTooltip {'
2772 + 'top: 65px; '
2773 + 'margin-left: -110px;}'
2774 );
2775
2776 sheet.insertRule('.possibleChallenges:hover .possibleChallengesTooltip {'
2777 + 'visibility: visible;}'
2778 );
2779
2780 sheet.insertRule('.maxStagnateTooltip {'
2781 + 'max-width: 190px; '
2782 + 'top: 65px; '
2783 + 'margin-left: -115px;}'
2784 );
2785
2786 sheet.insertRule('.maxStagnate:hover .maxStagnateTooltip {'
2787 + 'visibility: visible;}'
2788 );
2789
2790 sheet.insertRule('.minTop15Tooltip {'
2791 + 'max-width: 190px; '
2792 + 'top: 65px; '
2793 + 'margin-left: -115px;}'
2794 );
2795
2796 sheet.insertRule('.minTop15:hover .minTop15Tooltip {'
2797 + 'visibility: visible;}'
2798 );
2799
2800 sheet.insertRule('.minTop30Tooltip {'
2801 + 'max-width: 190px; '
2802 + 'top: 65px; '
2803 + 'margin-left: -115px;}'
2804 );
2805
2806 sheet.insertRule('.minTop30:hover .minTop30Tooltip {'
2807 + 'visibility: visible;}'
2808 );
2809
2810 sheet.insertRule('.minTop45Tooltip {'
2811 + 'max-width: 190px; '
2812 + 'top: 65px; '
2813 + 'margin-left: -115px;}'
2814 );
2815
2816 sheet.insertRule('.minTop45:hover .minTop45Tooltip {'
2817 + 'visibility: visible;}'
2818 );
2819
2820 sheet.insertRule('.maxDemoteTooltip {'
2821 + 'max-width: 170px; '
2822 + 'top: 65px; '
2823 + 'margin-left: -100px;}'
2824 );
2825
2826 sheet.insertRule('.maxDemote:hover .maxDemoteTooltip {'
2827 + 'visibility: visible;}'
2828 );
2829
2830 sheet.insertRule('@media only screen and (max-width: 1025px) {'
2831 + '.scriptMobileLeagueInfo {'
2832 + 'position : absolute; '
2833 + 'width : 400px; '
2834 + 'left : -430px; '
2835 + 'top : 25px; '
2836 + 'font-size: 14px; '
2837 + 'display: block; '
2838 + 'float: right; '
2839 + 'margin-right: 10px;}}'
2840 );
2841
2842 sheet.insertRule('@media only screen and (min-width: 1026px) {'
2843 + '.scriptMobileLeagueInfo {'
2844 + 'display: none;}}'
2845 );
2846
2847 sheet.insertRule('.scriptMobileLeagueInfoTooltip {'
2848 + 'visibility: hidden; '
2849 + 'font-size: 14px; '
2850 + 'background-color: black; '
2851 + 'color: #fff; '
2852 + 'text-align: center; '
2853 + 'padding: 3px 5px 3px 5px; '
2854 + 'border: 2px solid #905312; '
2855 + 'border-radius: 6px; '
2856 + 'background-color: rgba(32,3,7,.9); '
2857 + 'position: absolute; '
2858 + 'margin-top: 5px; '
2859 + 'z-index: 9;}'
2860 );
2861
2862 sheet.insertRule('.scriptMobileLeagueInfoTooltip::after {'
2863 + 'content: " "; '
2864 + 'position: absolute; '
2865 + 'bottom: 100%; '
2866 + 'left: 50%; '
2867 + 'margin-left: -10px; '
2868 + 'border-width: 10px; '
2869 + 'border-style: solid; '
2870 + 'border-color: transparent transparent #905312 transparent;}'
2871 );
2872
2873 sheet.insertRule('.averageScoreMobileTooltip {'
2874 + 'top: 25px; '
2875 + 'margin-left: -115px;}'
2876 );
2877
2878 sheet.insertRule('.averageScoreMobile:hover .averageScoreMobileTooltip {'
2879 + 'visibility: visible;}'
2880 );
2881
2882 sheet.insertRule('.possibleChallengesMobileTooltip {'
2883 + 'top: 25px; '
2884 + 'margin-left: -115px;}'
2885 );
2886
2887 sheet.insertRule('.possibleChallengesMobile:hover .possibleChallengesMobileTooltip {'
2888 + 'visibility: visible;}'
2889 );
2890
2891 sheet.insertRule('.maxStagnateMobileTooltip {'
2892 + 'max-width: 190px; '
2893 + 'top: 25px; '
2894 + 'margin-left: -115px;}'
2895 );
2896
2897 sheet.insertRule('.maxStagnateMobile:hover .maxStagnateMobileTooltip {'
2898 + 'visibility: visible;}'
2899 );
2900
2901 sheet.insertRule('.minTop15MobileTooltip {'
2902 + 'max-width: 190px; '
2903 + 'top: 25px; '
2904 + 'margin-left: -115px;}'
2905 );
2906
2907 sheet.insertRule('.minTop15Mobile:hover .minTop15MobileTooltip {'
2908 + 'visibility: visible;}'
2909 );
2910
2911 sheet.insertRule('.minTop30MobileTooltip {'
2912 + 'max-width: 190px; '
2913 + 'top: 25px; '
2914 + 'margin-left: -115px;}'
2915 );
2916
2917 sheet.insertRule('.minTop30Mobile:hover .minTop30MobileTooltip {'
2918 + 'visibility: visible;}'
2919 );
2920
2921 sheet.insertRule('.minTop45MobileTooltip {'
2922 + 'max-width: 190px; '
2923 + 'top: 25px; '
2924 + 'margin-left: -115px;}'
2925 );
2926
2927 sheet.insertRule('.minTop45Mobile:hover .minTop45MobileTooltip {'
2928 + 'visibility: visible;}'
2929 );
2930
2931 sheet.insertRule('.maxDemoteMobileTooltip {'
2932 + 'max-width: 170px; '
2933 + 'top: 25px; '
2934 + 'margin-left: -100px;}'
2935 );
2936
2937 sheet.insertRule('.maxDemoteMobile:hover .maxDemoteMobileTooltip {'
2938 + 'visibility: visible;}'
2939 );
2940}
2941
2942/* ============
2943 LEAGUE SIM
2944 ============ */
2945
2946function moduleSim() {
2947 var playerEgo;
2948 var playerEgoCheck;
2949 var playerDefHC;
2950 var playerDefKH;
2951 var playerDefCH;
2952 var playerAtk;
2953 var playerClass;
2954 var playerAlpha;
2955 var playerBeta;
2956 var playerOmega;
2957 var playerExcitement;
2958 var playerBetaAdd;
2959 var playerOmegaAdd;
2960 var opponentEgo;
2961 var opponentDefHC;
2962 var opponentDefKH;
2963 var opponentDefCH;
2964 var opponentAtk;
2965 var opponentClass;
2966 var opponentAlpha;
2967 var opponentBeta;
2968 var opponentOmega;
2969 var opponentExcitement;
2970 var opponentBetaAdd;
2971 var opponentOmegaAdd;
2972 var opponentProcHCBase;
2973 var opponentProcHCAddOrgasm1;
2974 var opponentProcHCAddOrgasm2;
2975 var opponentProcHCAddOrgasm3;
2976 var opponentProcCH;
2977 var opponentProcKH;
2978 var opponentAlphaClass;
2979 var playerDef;
2980 var opponentDef;
2981 var playerOrgasm;
2982 var playerOrgasmCount;
2983 var opponentOrgasm;
2984 var opponentOrgasmCount;
2985 var matchRating;
2986
2987 var opponentClassLog;
2988 var opponentEgoLog;
2989 var opponentDefLog;
2990 var opponentAtkLog;
2991
2992 function calculatePower() {
2993 // player stats
2994 playerEgo = Math.round(Hero.infos.caracs.ego);
2995 playerDefHC = Math.round(Hero.infos.caracs.def_carac1);
2996 playerDefCH = Math.round(Hero.infos.caracs.def_carac2);
2997 playerDefKH = Math.round(Hero.infos.caracs.def_carac3);
2998 playerAtk = Math.round(Hero.infos.caracs.damage);
2999 playerClass = $('div#leagues_left .icon').attr('carac');
3000 playerAlpha = JSON.parse($('div#leagues_left .girls_wrapper .team_girl[g=1]').attr('girl-tooltip-data'));
3001 playerBeta = JSON.parse($('div#leagues_left .girls_wrapper .team_girl[g=2]').attr('girl-tooltip-data'));
3002 playerOmega = JSON.parse($('div#leagues_left .girls_wrapper .team_girl[g=3]').attr('girl-tooltip-data'));
3003 playerExcitement = Math.round((playerAlpha.caracs.carac1 + playerAlpha.caracs.carac2 + playerAlpha.caracs.carac3) * 28);
3004
3005 if (playerClass == 'class1') {
3006 playerBetaAdd = playerBeta.caracs.carac1;
3007 playerOmegaAdd = playerOmega.caracs.carac1;
3008 }
3009 if (playerClass == 'class2') {
3010 playerBetaAdd = playerBeta.caracs.carac2;
3011 playerOmegaAdd = playerOmega.caracs.carac2;
3012 }
3013 if (playerClass == 'class3') {
3014 playerBetaAdd = playerBeta.caracs.carac3;
3015 playerOmegaAdd = playerOmega.caracs.carac3;
3016 }
3017
3018 // opponent stats
3019 opponentEgo = parseInt($('div#leagues_right div.lead_ego div:nth-child(2)').text().replace(/[^0-9]/gi, ''));
3020
3021 opponentDefHC = $('div#leagues_right div.stats_wrap div:nth-child(2)').text();
3022 if (opponentDefHC.includes('.') || opponentDefHC.includes(',')) {
3023 opponentDefHC = parseInt(opponentDefHC.replace('K', '00').replace(/[^0-9]/gi, ''));
3024 }
3025 else {
3026 opponentDefHC = parseInt(opponentDefHC.replace('K', '000').replace(/[^0-9]/gi, ''));
3027 }
3028
3029 opponentDefCH = $('div#leagues_right div.stats_wrap div:nth-child(4)').text();
3030 if (opponentDefCH.includes('.') || opponentDefCH.includes(',')) {
3031 opponentDefCH = parseInt(opponentDefCH.replace('K', '00').replace(/[^0-9]/gi, ''));
3032 }
3033 else {
3034 opponentDefCH = parseInt(opponentDefCH.replace('K', '000').replace(/[^0-9]/gi, ''));
3035 }
3036
3037 opponentDefKH = $('div#leagues_right div.stats_wrap div:nth-child(6)').text();
3038 if (opponentDefKH.includes('.') || opponentDefKH.includes(',')) {
3039 opponentDefKH = parseInt(opponentDefKH.replace('K', '00').replace(/[^0-9]/gi, ''));
3040 }
3041 else {
3042 opponentDefKH = parseInt(opponentDefKH.replace('K', '000').replace(/[^0-9]/gi, ''));
3043 }
3044
3045 opponentAtk = $('div#leagues_right div.stats_wrap div:nth-child(8)').text();
3046 if (opponentAtk.includes('.') || opponentAtk.includes(',')) {
3047 opponentAtk = parseInt(opponentAtk.replace('K', '00').replace(/[^0-9]/gi, ''));
3048 }
3049 else {
3050 opponentAtk = parseInt(opponentAtk.replace('K', '000').replace(/[^0-9]/gi, ''));
3051 }
3052
3053 opponentClass = $('div#leagues_right .icon').attr('carac');
3054 opponentAlpha = JSON.parse($('div#leagues_right .girls_wrapper .team_girl[g=1]').attr('girl-tooltip-data'));
3055 opponentBeta = JSON.parse($('div#leagues_right .girls_wrapper .team_girl[g=2]').attr('girl-tooltip-data'));
3056 opponentOmega = JSON.parse($('div#leagues_right .girls_wrapper .team_girl[g=3]').attr('girl-tooltip-data'));
3057 opponentExcitement = Math.round((opponentAlpha.caracs.carac1 + opponentAlpha.caracs.carac2 + opponentAlpha.caracs.carac3) * 28);
3058
3059 if (opponentClass == 'class1') {
3060 opponentBetaAdd = opponentBeta.caracs.carac1;
3061 opponentOmegaAdd = opponentOmega.caracs.carac1;
3062 }
3063 if (opponentClass == 'class2') {
3064 opponentBetaAdd = opponentBeta.caracs.carac2;
3065 opponentOmegaAdd = opponentOmega.caracs.carac2;
3066 }
3067 if (opponentClass == 'class3') {
3068 opponentBetaAdd = opponentBeta.caracs.carac3;
3069 opponentOmegaAdd = opponentOmega.caracs.carac3;
3070 }
3071
3072 //Determine each side's actual defense
3073 if (playerClass == 'class1') {
3074 opponentDef = opponentDefHC;
3075 }
3076 if (playerClass == 'class2') {
3077 opponentDef = opponentDefCH;
3078 }
3079 if (playerClass == 'class3') {
3080 opponentDef = opponentDefKH;
3081 }
3082
3083 if (opponentClass == 'class1') {
3084 playerDef = playerDefHC;
3085 opponentClassLog = 'Hardcore';
3086 }
3087 if (opponentClass == 'class2') {
3088 playerDef = playerDefCH;
3089 opponentClassLog = 'Charme';
3090 }
3091 if (opponentClass == 'class3') {
3092 playerDef = playerDefKH;
3093 opponentClassLog = 'Savoir-Faire';
3094 }
3095
3096 //Calculate opponent proc values, determine applicable alpha class and adjust starting ego values for proc
3097 opponentProcHCBase = Math.round(opponentAtk * 0.5);
3098 opponentProcHCAddOrgasm1 = Math.round(opponentAtk * 0.25);
3099 opponentProcHCAddOrgasm2 = Math.round(opponentBetaAdd * 1.3 * 0.75);
3100 opponentProcHCAddOrgasm3 = Math.round(opponentOmegaAdd * 1.3 * 0.75);
3101 opponentProcCH = opponentDef * 2;
3102 opponentProcKH = Math.round(opponentEgo * 0.1);
3103 opponentAlphaClass = opponentAlpha.class;
3104
3105 if (opponentAlphaClass == '1') {
3106 playerEgo -= opponentProcHCBase;
3107 }
3108 if (opponentAlphaClass == '2') {
3109 opponentEgo += opponentProcCH;
3110 }
3111 if (opponentAlphaClass == '3') {
3112 opponentEgo += opponentProcKH;
3113 }
3114
3115 opponentEgoLog = parseInt($('div#leagues_right div.lead_ego div:nth-child(2)').text().replace(/[^0-9]/gi, ''));
3116 opponentDefLog = opponentDef;
3117 opponentAtkLog = opponentAtk;
3118
3119
3120 //Log opponent name and starting egos for sim
3121 console.log('Simulation log for: ' + $('div#leagues_right div.player_block div.title').text());
3122 console.log('Starting Egos adjusted for worst-case proc scenario:');
3123 console.log('Player Ego: ' + playerEgo);
3124 console.log('Opponent Ego: ' + opponentEgo);
3125
3126 playerOrgasm = 0;
3127 playerOrgasmCount = 0;
3128 opponentOrgasm = 0;
3129 opponentOrgasmCount = 0;
3130
3131 function playerTurn() {
3132 //Orgasm
3133 if (playerOrgasm >= playerExcitement) {
3134 //Orgasm damage
3135 opponentEgo -= Math.round(playerAtk * 1.5 - opponentDef);
3136 playerOrgasmCount++;
3137
3138 //Log results
3139 console.log('Round ' + (turns + 1) + ': Player orgasm! -' + Math.round(playerAtk * 1.5 - opponentDef));
3140
3141 //Orgasm 1
3142 if (playerOrgasmCount == 1) {
3143 playerAtk += Math.round(playerBetaAdd * 1.3);
3144 opponentDef += Math.round(opponentBetaAdd * 1.75);
3145 }
3146
3147 //Orgasm 2
3148 if (playerOrgasmCount == 2) {
3149 playerAtk += Math.round(playerOmegaAdd * 1.3);
3150 opponentDef += Math.round(opponentOmegaAdd * 1.75);
3151 }
3152
3153 //Reset excitement value
3154 playerOrgasm = 0;
3155 }
3156
3157 //No orgasm
3158 else {
3159 opponentEgo -= playerAtk - opponentDef;
3160 playerOrgasm += playerAtk * 2;
3161 console.log('Round ' + (turns + 1) + ': Player hit! -' + (playerAtk - opponentDef));
3162 }
3163
3164 //Log results
3165 console.log('after Round ' + (turns + 1) + ': Opponent ego: ' + opponentEgo);
3166 }
3167
3168 function opponentTurn() {
3169 //Orgasm
3170 if (opponentOrgasm >= opponentExcitement) {
3171 //Orgasm damage
3172 playerEgo -= Math.round(opponentAtk * 1.5 - playerDef);
3173 opponentOrgasmCount++;
3174
3175 //Log results
3176 console.log('Round ' + (turns + 1) + ': Opponent orgasm! -' + Math.round(opponentAtk * 1.5 - playerDef));
3177
3178 //Orgasm 1
3179 if (opponentOrgasmCount == 1) {
3180 opponentAtk += Math.round(opponentBetaAdd * 1.3);
3181 playerDef += Math.round(playerBetaAdd * 1.75);
3182 if (opponentAlphaClass == '1') {
3183 playerEgo -= opponentProcHCAddOrgasm1;
3184 console.log('Round ' + (turns + 1) + ': HC opponent possibility of Wild Burst on first orgasm! -' + opponentProcHCAddOrgasm1);
3185 }
3186 }
3187
3188 //Orgasm 2
3189 if (opponentOrgasmCount == 2) {
3190 opponentAtk += Math.round(opponentOmegaAdd * 1.3);
3191 playerDef += Math.round(playerOmegaAdd * 1.75);
3192 if (opponentAlphaClass == '1') {
3193 playerEgo -= opponentProcHCAddOrgasm2;
3194 console.log('Round ' + (turns + 1) + ': HC opponent possibility of Wild Burst on second orgasm! -' + opponentProcHCAddOrgasm2);
3195 }
3196 }
3197
3198 //Orgasm 3
3199 if (opponentOrgasmCount == 3) {
3200 if (opponentAlphaClass == '1') {
3201 playerEgo -= opponentProcHCAddOrgasm3;
3202 console.log('Round ' + (turns + 1) + ': HC opponent possibility of Wild Burst on third orgasm! -' + opponentProcHCAddOrgasm3);
3203 }
3204 }
3205
3206 //Reset excitement value
3207 opponentOrgasm = 0;
3208 }
3209
3210 //No orgasm
3211 else {
3212 playerEgo -= opponentAtk - playerDef;
3213 opponentOrgasm += opponentAtk * 2;
3214 console.log('Round ' + (turns + 1) + ': Opponent hit! -' + (opponentAtk - playerDef));
3215 }
3216
3217 //Log results
3218 console.log('after Round ' + (turns + 1) + ': Player ego: ' + playerEgo);
3219 }
3220
3221 //Simulate challenge
3222 for (var turns = 0; turns < 99; turns++) {
3223 if (playerEgo > 0) {
3224 playerTurn()
3225 }
3226 else {
3227 break
3228 }
3229 if (opponentEgo > 0) {
3230 opponentTurn()
3231 }
3232 else {
3233 //Check if victory is only a one-turn advantage
3234 playerEgoCheck = playerEgo;
3235
3236 //Orgasm
3237 if (opponentOrgasm >= opponentExcitement) {
3238 playerEgoCheck -= Math.round(opponentAtk * 1.5 - playerDef);
3239 opponentOrgasmCount++;
3240
3241 //Log results
3242 console.log('Round ' + (turns + 1) + ': Possibly next: Opponent orgasm! -' + Math.round(opponentAtk * 1.5 - playerDef));
3243
3244 if (opponentAlphaClass == '1') {
3245 if (opponentOrgasmCount == 1) {
3246 playerEgoCheck -= opponentProcHCAddOrgasm1;
3247 console.log('Round ' + (turns + 1) + ': Possibly next: HC opponent possibility of Wild Burst on first orgasm! -' + opponentProcHCAddOrgasm1);
3248 }
3249 if (opponentOrgasmCount == 2) {
3250 playerEgoCheck -= opponentProcHCAddOrgasm2;
3251 console.log('Round ' + (turns + 1) + ': Possibly next: HC opponent possibility of Wild Burst on second orgasm! -' + opponentProcHCAddOrgasm2);
3252 }
3253 if (opponentOrgasmCount == 3) {
3254 playerEgoCheck -= opponentProcHCAddOrgasm3;
3255 console.log('Round ' + (turns + 1) + ': Possibly next: HC opponent possibility of Wild Burst on third orgasm! -' + opponentProcHCAddOrgasm3);
3256 }
3257 }
3258 }
3259 //No orgasm
3260 else {
3261 playerEgoCheck -= opponentAtk - playerDef;
3262 console.log('Round ' + (turns + 1) + ': Possibly next: Opponent hit! -' + (opponentAtk - playerDef));
3263 }
3264
3265 if (playerEgoCheck <= 0) {
3266 console.log('Close call! After Round ' + (turns + 1) + ': Player ego: ' + playerEgoCheck);
3267 }
3268 break
3269 }
3270 }
3271
3272 //Round defeated player's ego up to 0 to not skew results
3273 if (playerEgo < 0) {
3274 playerEgo = 0;
3275 }
3276 if (opponentEgo < 0) {
3277 opponentEgo = 0;
3278 }
3279
3280 //Publish the ego difference as a match rating
3281 matchRating = playerEgo - opponentEgo;
3282
3283 $('.lead_table_default > td:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(3) > div.matchRating1').remove();
3284
3285 if (matchRating >= 0) {
3286 matchRating = '+' + nThousand(matchRating);
3287
3288 if (playerEgoCheck <= 0) {
3289 $('div#leagues_right .lead_player_profile').append('<div class="matchRating close"><img id="powerLevelScouter" src="https://i.postimg.cc/3xvDTR6M/icon-sim-yellow.png">' + matchRating + '</div>');
3290 $('.lead_table_default > td:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(3)').append('<div class="matchRating1 close"><img id="powerLevelScouter" src="https://i.postimg.cc/3xvDTR6M/icon-sim-yellow.png">' + matchRating + '</div>');
3291 }
3292 else {
3293 $('div#leagues_right .lead_player_profile').append('<div class="matchRating plus"><img id="powerLevelScouter" src="https://i.postimg.cc/J0YB1BM8/icon-sim-green.png">' + matchRating + '</div>');
3294 $('.lead_table_default > td:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(3)').append('<div class="matchRating1 plus"><img id="powerLevelScouter" src="https://i.postimg.cc/J0YB1BM8/icon-sim-green.png">' + matchRating + '</div>');
3295 }
3296 }
3297 else {
3298 matchRating = nThousand(matchRating);
3299 $('div#leagues_right .lead_player_profile').append('<div class="matchRating minus"><img id="powerLevelScouter" src="https://i.postimg.cc/8P3r9WZB/icon-sim-red.png">' + matchRating + '</div>');
3300 $('.lead_table_default > td:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(3)').append('<div class="matchRating1 minus"><img id="powerLevelScouter" src="https://i.postimg.cc/8P3r9WZB/icon-sim-red.png">' + matchRating + '</div>');
3301 }
3302
3303 //Replace opponent excitement with the correct value
3304 $('div#leagues_right div.stats_wrap div:nth-child(9) span:nth-child(2)').empty().append(nRounding(opponentExcitement, 0, 1));
3305
3306 saveVictories();
3307 }
3308
3309 calculatePower();
3310
3311 //Replace player excitement with the correct value
3312 $('div#leagues_left div.stats_wrap div:nth-child(9) span:nth-child(2)').empty().append(nRounding(playerExcitement, 0, 1));
3313
3314 // Refresh sim on new opponent selection (Credit: BenBrazke)
3315 var opntName;
3316 $('.leadTable').click(function() {
3317 opntName=''
3318 })
3319 function waitOpnt() {
3320 setTimeout(function() {
3321 if (JSON.parse($('div#leagues_right .girls_wrapper .team_girl[g=3]').attr('girl-tooltip-data'))) {
3322 sessionStorage.setItem('opntName', opntName);
3323 calculatePower();
3324 }
3325 else {
3326 waitOpnt()
3327 }
3328 }, 50);
3329 }
3330 var observeCallback = function() {
3331 var opntNameNew = $('div#leagues_right div.player_block div.title')[0].innerHTML
3332 if (opntName !== opntNameNew) {
3333 opntName = opntNameNew;
3334 waitOpnt();
3335 }
3336 }
3337 var observer = new MutationObserver(observeCallback);
3338 var test = document.getElementById('leagues_right');
3339 observer.observe(test, {attributes: false, childList: true, subtree: false});
3340
3341
3342 function saveVictories() {
3343
3344 let date_20201126 = 1606392000;
3345
3346 let current_date_ts = Math.floor(new Date().getTime()/1000);
3347 let league_duration = (current_date_ts - date_20201126)%604800;
3348 let date_end_league = date_20201126 + Math.ceil((current_date_ts - date_20201126)/604800)*604800;
3349
3350 let time_results = localStorage.getItem('leagueTime');
3351 if (time_results == null) {
3352 time_results = parseInt(date_end_league);
3353 localStorage.setItem('leagueTime', time_results);
3354 localStorage.setItem('leagueResults', null);
3355 }
3356
3357
3358
3359 if (current_date_ts > time_results) {
3360 localStorage.setItem('oldLeagueResults', localStorage.getItem('leagueResults'));
3361 localStorage.setItem('oldLeagueTime', localStorage.getItem('leagueTime'));
3362 localStorage.setItem('oldLeaguePlayers', localStorage.getItem('leaguePlayers'));
3363 //localStorage.setItem('leagueResults', null);
3364 localStorage.removeItem('leagueResults');
3365 localStorage.setItem('leagueTime', date_end_league);
3366 }
3367
3368 let data = JSON.parse(localStorage.getItem('leagueResults')) || {};
3369
3370 let player = $('div#leagues_right div.player_block .avatar_border > img').attr('onclick').slice(23,-3);
3371
3372 let results = $('div#leagues_right .challenge .result');
3373 let nb_victories = 0;
3374 let nb_defeats = 0;
3375 let nb_notPlayed = 0;
3376
3377 for(let i = 0; i < results.length; ++i) {
3378
3379 let result = results.eq(i);
3380
3381 if( ((result.text() == 'V') && (($('html')[0].lang === 'fr') || ($('html')[0].lang === 'it_IT'))) || (result.text() == 'W') || (result.text() == 'S') || (result.text() == '勝'))
3382 ++nb_victories;
3383 if( (result.text() == 'D') || (result.text() == 'L') || (result.text() == 'P') || ((result.text() == 'V') && ($('html')[0].lang === 'de_DE')) || (result.text() == '負'))
3384 ++nb_defeats;
3385 if( result.text() == '')
3386 ++nb_notPlayed;
3387 }
3388
3389 data[player] = {
3390
3391 victories: nb_victories,
3392 defeats: nb_defeats,
3393 notPlayed: nb_notPlayed
3394 };
3395
3396 localStorage.setItem('leagueResults', JSON.stringify(data));
3397
3398 calculateVictories(); //TODO move...
3399 }
3400
3401
3402 function calculateVictories() {
3403
3404 let data = JSON.parse(localStorage.getItem('leagueResults')) || {};
3405
3406 let nb_players = $('#leagues_middle .leadTable tr').length - 1;
3407 let nb_unknown = nb_players - Object.keys(data).length;
3408
3409 localStorage.setItem('leaguePlayers', nb_players);
3410 localStorage.setItem('leagueUnknown', nb_unknown);
3411
3412 let tot_victory = 0;
3413 let tot_defeat = 0;
3414 let tot_notPlayed = 0;
3415
3416 for(let key in data) {
3417 tot_victory += data[key].victories;
3418 tot_defeat += data[key].defeats;
3419 tot_notPlayed+= data[key].notPlayed;
3420 }
3421
3422 $('span.possibleChallenges span.scriptLeagueInfoTooltip.possibleChallengesTooltip span#leagueStats').empty();
3423 $('span.scriptLeagueInfoTooltip.possibleChallengesTooltip').append('<span id="leagueStats"><BR><BR><u>' + texts[lang].current_league + '</u>'
3424 + '<BR>' + texts[lang].victories + ' : ' + tot_victory + '/' + 3*nb_players
3425 + '<BR>' + texts[lang].defeats + ' : ' + tot_defeat + '/' + 3*nb_players
3426 + '<BR>' + texts[lang].notPlayed + ' : ' + tot_notPlayed + '/' + 3*nb_players
3427 + '<BR>' + texts[lang].unknown + ' : ' + nb_unknown + '/' + nb_players
3428 + '</span>');
3429
3430 $('span.possibleChallengesMobile span.scriptMobileLeagueInfoTooltip.possibleChallengesMobileTooltip span#leagueStatsMobile').empty();
3431 $('span.scriptMobileLeagueInfoTooltip.possibleChallengesMobileTooltip').append('<span id="leagueStatsMobile"><BR><BR><u>' + texts[lang].current_league + '</u>'
3432 + '<BR>' + texts[lang].victories + ' : ' + tot_victory + '/' + 3*nb_players
3433 + '<BR>' + texts[lang].defeats + ' : ' + tot_defeat + '/' + 3*nb_players
3434 + '<BR>' + texts[lang].notPlayed + ' : ' + tot_notPlayed + '/' + 3*nb_players
3435 + '<BR>' + texts[lang].unknown + ' : ' + nb_unknown + '/' + nb_players
3436 + '</span>');
3437
3438
3439 let old_data = JSON.parse(localStorage.getItem('oldLeagueResults')) || {};
3440 let old_nb_players = JSON.parse(localStorage.getItem('oldLeaguePlayers')) || 0;
3441 let old_nb_unknown = old_nb_players- Object.keys(old_data).length;
3442
3443 let old_tot_victory = 0;
3444 let old_tot_defeat = 0;
3445 let old_tot_notPlayed = 0;
3446
3447 for(let old_key in old_data) {
3448 old_tot_victory += old_data[old_key].victories;
3449 old_tot_defeat += old_data[old_key].defeats;
3450 old_tot_notPlayed+= old_data[old_key].notPlayed;
3451 }
3452
3453 const options = {year: 'numeric', month: 'short', day: 'numeric'};
3454 let old_date_end_league = new Date(localStorage.getItem('oldLeagueTime')*1000).toLocaleDateString(undefined, options);
3455
3456 if (localStorage.getItem('oldLeagueTime') != null) {
3457 $('span.possibleChallenges span.scriptLeagueInfoTooltip.possibleChallengesTooltip span#oldLeagueStats').empty();
3458 $('span.scriptLeagueInfoTooltip.possibleChallengesTooltip').append('<span id="oldLeagueStats"><BR>_______________________'
3459 + '<BR><BR>' + texts[lang].league_finished + old_date_end_league
3460 + '<BR>' + texts[lang].victories + ' : ' + old_tot_victory + '/' + 3*old_nb_players
3461 + '<BR>' + texts[lang].defeats + ' : ' + old_tot_defeat + '/' + 3*old_nb_players
3462 + '<BR>' + texts[lang].notPlayed + ' : ' + old_tot_notPlayed + '/' + 3*old_nb_players
3463 + '<BR>' + texts[lang].opponents + ' : ' + old_nb_players
3464 + '</span>');
3465
3466 $('span.possibleChallengesMobile span.scriptMobileLeagueInfoTooltip.possibleChallengesMobileTooltip span#oldLeagueStatsMobile').empty();
3467 $('span.scriptMobileLeagueInfoTooltip.possibleChallengesMobileTooltip').append('<span id="oldLeagueStatsMobile"><BR>_______________________'
3468 + '<BR><BR>' + texts[lang].league_finished + old_date_end_league
3469 + '<BR>' + texts[lang].victories + ' : ' + old_tot_victory + '/' + 3*old_nb_players
3470 + '<BR>' + texts[lang].defeats + ' : ' + old_tot_defeat + '/' + 3*old_nb_players
3471 + '<BR>' + texts[lang].notPlayed + ' : ' + old_tot_notPlayed + '/' + 3*old_nb_players
3472 + '<BR>' + texts[lang].opponents + ' : ' + old_nb_players
3473 + '</span>');
3474 }
3475 }
3476
3477 //CSS
3478 sheet.insertRule('#leagues_right .player_block .lead_player_profile .level_wrapper {'
3479 + 'top: -8px !important;}'
3480 );
3481
3482 sheet.insertRule('#leagues_right .player_block .lead_player_profile .icon {'
3483 + 'top: 5px !important;}'
3484 );
3485
3486 sheet.insertRule('.matchRating {'
3487 + 'margin-top: -25px; '
3488 + 'margin-left: 70px; '
3489 + 'text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000; '
3490 + 'line-height: 17px; '
3491 + 'font-size: 14px;}'
3492 );
3493
3494 sheet.insertRule('.matchRating1 {'
3495 + 'margin-left: 20px; '
3496 + 'text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000; '
3497 + 'line-height: 17px; '
3498 + 'font-size: 18px;}'
3499 );
3500
3501 sheet.insertRule('.plus {'
3502 + 'color: #66CD00;}'
3503 );
3504
3505 sheet.insertRule('.minus {'
3506 + 'color: #FF2F2F;}'
3507 );
3508
3509 sheet.insertRule('.close {'
3510 + 'color: #FFA500;}'
3511 );
3512
3513 sheet.insertRule('#powerLevelScouter {'
3514 + 'margin-left: -8px; '
3515 + 'margin-right: 1px; '
3516 + 'width: 25px;}'
3517 );
3518}
3519
3520/* =========================================
3521 CHAMPIONS INFORMATION (Credit: Entwine)
3522 ========================================= */
3523
3524function moduleChampions() {
3525 if (sessionStorage.getItem('championsCallBack') && $('.page-shop').length) {
3526 const championsCallBack = JSON.parse(sessionStorage.getItem('championsCallBack'));
3527 $('#breadcrumbs .back').after('<span>></span><a class="back" href="/champions-map.html" >'
3528 + $('nav [rel="content"] a[href="/champions-map.html"]').text().trim()
3529 + '<span class="mapArrowBack_flat_icn"></span></a><span>></span><a class="back" href="'
3530 + championsCallBack.location + '">'
3531 + championsCallBack.name + '<span class="mapArrowBack_flat_icn"></span></a>');
3532 sessionStorage.removeItem('championsCallBack');
3533 }
3534 else if ($('.page-champions').length) {
3535 const DEFAULT_CHAMPIONS_DATA = '{"attempts": {}, "config" : {}, "positions" : {}, "statistics" : {}}';
3536 const personalKey = Hero.infos.id + '/' + championData.champion.id;
3537 let championsData = JSON.parse(localStorage.getItem('championsData') || DEFAULT_CHAMPIONS_DATA);
3538 let positions = championsData.positions[personalKey];
3539 let positions2 = championData.champion.poses;
3540 let statistics = championsData.statistics[championData.champion.id];
3541 let attempts = championsData.attempts[personalKey];
3542 let config = championsData.config[Hero.infos.id] || {};
3543 let isSkipButtonClicked;
3544 markMatchedPositions();
3545 showAdditionalInformation();
3546 showNumberOfTicketsWhileTeamResting();
3547 $('.page-champions')
3548 .on('click', '.champions-bottom__draft-box > button', () => {setTimeout(markMatchedPositions, 500)})
3549 .on('click', '.champions-bottom__confirm-team', showNumberOfTicketsWhileTeamResting)
3550 .on('click', '.champions-bottom__skip-champion-cooldown', () => {isSkipButtonClicked = true});
3551 $(window).on('beforeunload', () => {
3552 championsData = JSON.parse(localStorage.getItem('championsData') || DEFAULT_CHAMPIONS_DATA);
3553 championsData.positions[personalKey] = positions;
3554 championsData.attempts[personalKey] = attempts;
3555 championsData.statistics[championData.champion.id] = statistics;
3556 championsData.config[Hero.infos.id] = Object.keys(config).length? config : undefined;
3557 localStorage.setItem('championsData', JSON.stringify(championsData));
3558 });
3559 $(document).ajaxComplete(function(event, xhr, options) {
3560 const response = JSON.parse(xhr.responseText);
3561 if (response.positions) {
3562 if (!positions) {
3563 if (!statistics) {
3564 statistics = Array(positionImages.length).fill(0);
3565 }
3566 response.positions.forEach((e) => statistics[e]++);
3567 attempts = 0;
3568 }
3569 if (response.final.attacker_ego > 0 || response.final.winner.type == 'hero') {
3570 positions = undefined;
3571 }
3572 else {
3573 positions = response.positions;
3574 }
3575 attempts++;
3576 }
3577 else {
3578 markMatchedPositions();
3579 }
3580 if (isSkipButtonClicked) {
3581 showAdditionalInformation();
3582 isSkipButtonClicked = false;
3583 }
3584 });
3585 const restTimer = $('.champions-bottom__rest [timer], .champions-middle__champion-resting[timer]');
3586 if (restTimer.is(':visible')) {
3587 const delayTime = Math.ceil(restTimer.attr('timer') * 1000 - Date.now());
3588 setTimeout(markMatchedPositions, delayTime + 400);
3589 }
3590
3591 function showAdditionalInformation() {
3592 if ($('.champions-middle__champion-resting').is(':visible') && positions) {
3593 positions = undefined;
3594 }
3595 if ($('#additionalInformation').is(':visible')) {
3596 return;
3597 }
3598 if (positions) {
3599 createCurrentPositionsInfo();
3600 }
3601 else if (statistics) {
3602 createStatisticsInfo();
3603 }
3604 if (positions || statistics) {
3605 configureInfoBox();
3606 }
3607 }
3608
3609 function markMatchedPositions() {
3610 $('.girl-selection__girl-box').each(function(index) {
3611 const currentGirlsPose = $(this).find('.girl-box__pose');
3612 if (currentGirlsPose.next().size() === 0) {
3613 currentGirlsPose.parent().append('<span style="margin-left: 35px; filter: hue-rotate(-45deg);" />');
3614 }
3615 if (positions2) {
3616 if (currentGirlsPose.attr('src').indexOf(preparePositionImage(positions2[index % positions2.length])) >= 0) {
3617 currentGirlsPose.next().removeClass('empty');
3618 currentGirlsPose.next().addClass('green-tick-icon');
3619 }
3620 else if (positions2.some((e) => (preparePositionImage(e) === currentGirlsPose.attr('src')))) {
3621 currentGirlsPose.next().addClass('green-tick-icon empty');
3622 }
3623 else {
3624 currentGirlsPose.next().removeClass('green-tick-icon');
3625 }
3626 }
3627 else if (statistics) {
3628 currentGirlsPose.next().css({'filter': 'invert'});
3629 if (statistics.some((elem, idx) => (elem > 0 && preparePositionImage(idx) === currentGirlsPose.attr('src')))) {
3630 currentGirlsPose.next().addClass('green-tick-icon empty');
3631 }
3632 else {
3633 currentGirlsPose.next().removeClass('green-tick-icon');
3634 }
3635 }
3636 });
3637 }
3638
3639 function showNumberOfTicketsWhileTeamResting() {
3640 if ($('.champions-bottom__ticket-amount').is(':visible') == false) {
3641 $('.champions-bottom__rest').css({'width': '280px'})
3642 .before('<div class="champions-bottom__ticket-amount"><span cur="ticket">x ' + championData.champion.currentTickets + '</span></div>');
3643 }
3644 }
3645
3646 function preparePositionImage(positionID) {
3647 return IMAGES_URL + '/pictures/design/battle_positions/' + positionImages[positionID];
3648 }
3649
3650 function createCurrentPositionsInfo() {
3651 let positionsBox = ('<div id="additionalInformation" style="position: absolute; top:' + (config.top || 165) + 'px; right:' + (config.right || -165)
3652 + 'px;"><div style="border: 2px solid #ffa23e; background-color: rgba(60,20,30,.8); border-radius: 7px; width: max-content;"> Current positions:<div>');
3653 positions.forEach((e) => {
3654 positionsBox += '<img style="height: 48px; width: 48px; cursor: pointer;" src="' + preparePositionImage(e) + '" hh_title="' + GT.figures[e]+ '">';
3655 });
3656 positionsBox += '</div> Current stage: ' + attempts + ' attempt' + (attempts == 1 ? '':'s') + ' </div></div>';
3657 $('.champions-over__champion-wrapper').append(positionsBox);
3658 }
3659
3660 function createStatisticsInfo() {
3661 let statisticsBox = ('<div id="additionalInformation" style="position: absolute; top:' + (config.top || 165) + 'px; right:' + (config.right || -165)
3662 + 'px;"><div style="border: 2px solid #ffa23e; background-color: rgba(0,0,0,.8); border-radius: 7px; width: max-content;"> Statistics:'
3663 + '<div class="scroll-area" style="font-size: 14px; max-width: 208px;"><div>');
3664 let total = statistics.reduce((a, b) => a + b);
3665 let positionList = (statistics.map((elem, idx) => ({'index': idx, 'value': elem}))
3666 .filter((e) => e.index > 0 && e.value > 0)
3667 .sort((a, b) => (a.value == b.value)? a.index - b.index : b.value - a.value));
3668 positionList.forEach((p) => {
3669 statisticsBox += '<div style="display: inline-block; width: 52px; text-align: center;">'
3670 + '<img style="height: 48px; width: 48px; margin-bottom: -6px; cursor: pointer;" src="'
3671 + preparePositionImage(p.index) + '" hh_title="' + GT.figures[p.index] + '" ><span>'
3672 + Math.round(p.value / total * 1000) / 10 + '%</span></div>';
3673 });
3674 statisticsBox += '</div></div>' + (attempts? (' Prev stage: ' + attempts + ' attempt' + (attempts == 1 ? '':'s') + ' ') : '') + '</div></div>';
3675 $('.champions-over__champion-wrapper').append(statisticsBox);
3676 $('.champions-over__champion-wrapper').find('.scroll-area > div').css({'width': positionList.length * 52 + 'px'});
3677 if (positionList.length > 4) {
3678 if (is_mobile_size()) {
3679 $('.champions-over__champion-wrapper').find('.scroll-area').css({'padding-bottom': '10px', 'margin-bottom': '-5px'});
3680 }
3681 else {
3682 $('.champions-over__champion-wrapper').find('.scroll-area').css({'padding-bottom': '', 'margin-bottom': '5px'});
3683 }
3684 $('.champions-over__champion-wrapper').find('.scroll-area').niceScroll().resize();
3685 }
3686 }
3687
3688 function configureInfoBox() {
3689 $('.girl-box__draggable').droppable('option', 'accept', (e) => e.hasClass('girl-box__draggable'));
3690 $('#additionalInformation').on('click', '.eye', (e) => {
3691 config.visible = config.visible == undefined? false : undefined;
3692 $(e.currentTarget).next().toggle('slow');
3693 $(e.currentTarget).children().toggle('fast');
3694 }).draggable({
3695 cursor: 'move',
3696 start: function () {
3697 $(this).css({'right': ''});
3698 },
3699 drag: function (event, ui) {
3700 ui.position.top /= FullSize.scale;
3701 ui.position.left /= FullSize.scale;
3702 },
3703 stop: function (event, ui) {
3704 config.right = Math.round($(this).parent().width() - ui.position.left - $(this).width());
3705 config.top = Math.round(ui.position.top);
3706 $(this).css({'left': '', 'right': config.right + 'px'});
3707 $(event.originalEvent.target).one('click', (e) => e.stopImmediatePropagation());
3708 }
3709 }).prepend('<a class="eye" style="top: 3px; right: 3px; position: absolute; cursor: pointer;">'
3710 + '<img src="https://hh2.hh-content.com/quest/ic_eyeclosed.svg" style="width: 30px; display: block;">'
3711 + '<img src="https://hh2.hh-content.com/quest/ic_eyeopen.svg" style="width: 50px; display: none;">'
3712 + '</div></a>');
3713 if (config.visible == false) {
3714 $('#additionalInformation .eye').children().toggle();
3715 $('#additionalInformation .eye').next().toggle();
3716 }
3717 }
3718 }
3719}
3720
3721
3722/* =======
3723 LINKS
3724 ======= */
3725
3726function moduleLinks() {
3727 var CurrentPage = window.location.pathname;
3728 var time_now = server_now_ts;
3729
3730 // is localstorage available?
3731 function lsTest() {
3732 try {
3733 localStorage.setItem('test', 'test');
3734 localStorage.removeItem('test');
3735 return true;
3736 } catch(e) {
3737 return false;
3738 }
3739 }
3740
3741 // verify localstorage
3742 var lsAvailable = (lsTest() === true) ? 'yes' : 'no';
3743 if (CurrentPage.indexOf('home') != -1) home(); // Current page: Homepage
3744 else if (CurrentPage.indexOf('log_in') != -1) home(); // Current page: Homepage
3745 else if (CurrentPage.indexOf('pachinko') != -1) pachinko(); // Current page: Pachinko
3746 else if (CurrentPage.indexOf('activities') != -1){ // Current page: Activities
3747 pop();
3748 setInterval(function(){contests();}, 1000);
3749 }
3750 else if (CurrentPage.indexOf('champions') != -1) // Current page: Champions
3751 setInterval(function(){champions();}, 1000);
3752 else if (CurrentPage.indexOf('shop') != -1){ // Current page: Market
3753 market();
3754 booster();
3755 }
3756 else if ((CurrentPage.indexOf('map') != -1) || (CurrentPage.indexOf('world') != -1) || (CurrentPage.indexOf('quest') != -1)) questTitle();
3757 else if (CurrentPage.indexOf('tower-of-fame') != -1) leagueInfo();
3758
3759 function calculateTime(deadline) {
3760 var currentTime = new Date();
3761 var remaining = Math.floor((deadline - currentTime.getTime())/1000);
3762 return convertToTimeFormat(remaining);
3763 }
3764
3765 function convertToTimeFormat(remainingTime) {
3766 var remM = Math.floor(remainingTime / 60);
3767 var remS = remainingTime - remM*60;
3768 if(remainingTime < 0){
3769 remM = 0;
3770 remS = 0;
3771 }
3772 if(remM > 59){
3773 var remH = Math.floor(remM / 60);
3774 var remD = Math.floor(remH / 24);
3775 remM -= remH * 60;
3776 remH -= remD * 24;
3777 if (remD > 0)
3778 return remD + texts[lang].day + " " + remH + texts[lang].hour + " " + remM + texts[lang].minute + " ";
3779 return remH + texts[lang].hour + " " + remM + texts[lang].minute + " ";
3780 }
3781 else if(remM > 0)
3782 return remM + texts[lang].minute + " " + remS + texts[lang].second;
3783 return remS + texts[lang].second;
3784 }
3785
3786 function convertToTimeFormatMinutes(remainingTime) {
3787 var remM = Math.floor(remainingTime /60);
3788 var remS = remainingTime - remM*60;
3789 if(remainingTime < 0){
3790 remM = 0;
3791 remS = 0;
3792 }
3793 if(remM > 59){
3794 var remH = Math.floor(remM / 60);
3795 remM -= remH * 60;
3796 return remH + texts[lang].hour + " " + remM + texts[lang].minute + " "
3797 }
3798 else if(remM > 0)
3799 return remM + texts[lang].minute;
3800 return remS + texts[lang].second;
3801 }
3802
3803
3804 scriptTimers();
3805 $('#contains_all > header').children('[type=quest]').append('<div class="scriptSeasonInfo" id="FightSeason">'
3806 + '<span class="season_icn">'
3807 + '<span id="seasonTool" class="infoTooltip seasonTooltip"></span></span>'
3808 + '<a href="/season-arena.html">'
3809 + '<div id="kisses_bar" class="tier_bar_season"></div>'
3810 + '<div class="white_text centered_s" style="width: 100%;">'
3811 + '<div id="kisses_data" style="width: 100%;">'
3812 + '<span id="scriptSeasonAttempts">0</span>/<span rel="max">10</span>'
3813 + '<span id="scriptSeasonTimer" rel="season_count_txt" timeforsinglepoint="3600" timeonload="24"></span>'
3814 + '</a></div></div></div>');
3815
3816 $('#contains_all > header').children('[type=quest]').append('<div class="league_counter" id="LeagueTimer">'
3817 + '<span class="league_icn">'
3818 + '<span id="leagueTool" class="infoTooltip leagueTooltip"></span></span>'
3819 + '<a href="/tower-of-fame.html">'
3820 + '<div id="league_bar" class="tier_bar_league"></div>'
3821 + '<div class="white_text centered_s" style="width: 100%;">'
3822 + '<div id="league_data" style="width: 100%;">'
3823 + '<span id="scriptLeagueAttempts">0</span>/<span rel="max">15</span>'
3824 + '<span id="scriptLeagueTimer" rel="league_count_txt" timeforsinglepoint="2100" timeonload="24"></span>'
3825 + '</a></div></div></div>');
3826
3827 $('#contains_all > header').children('[type=quest]').append('<div class="pop_timer" id="PoPTimer">'
3828 + '<a href="/activities.html?tab=pop">'
3829 + '<div id="pop_bar" class="tier_bar_pop"></div>'
3830 + '<div class="white_text centered_s" style="width: 100%;">'
3831 + '<div id="pop_data" style="width: 100%;">' + texts[lang].pop
3832 + '<span id="scriptPoPTimer" rel="pop_count_txt"></span>'
3833 + '</a></div></div></div>');
3834
3835 $('#contains_all > header').children('[type=quest]').append('<div class="booster_timer" id="BoosterTimer">'
3836 + '<a href="/shop.html">'
3837 + '<div id="booster_bar" class="tier_bar_booster"></div>'
3838 + '<div class="white_text centered_s" style="width: 100%;">'
3839 + '<div id="booster_data" style="width: 100%;">' + texts[lang].boosters_end
3840 + '<span id="scriptBoosterTimer" rel="booster_count_txt"></span>'
3841 + '</a></div></div></div>');
3842
3843
3844 function questTitle(){
3845 $('#breadcrumbs').css('z-index', '99');
3846 $('#breadcrumbs').css('top', '63px');
3847 }
3848
3849 function scriptTimers(){
3850 setInterval(function(){leagueBattles();
3851 seasonBattles();
3852 popTimer();
3853 boosterTimer();
3854 questData();
3855 trollTimer();
3856 }, 1000);
3857 }
3858
3859 function questData(){
3860 var time = Math.floor(new Date().getTime()/1000);
3861 var current_quest_energy = parseInt(Hero.energies.quest.amount);
3862 var max_quest_energy = parseInt(Hero.energies.quest.max_amount);
3863 var remaining_quest_time = parseInt(Hero.energies.quest.next_refresh_ts);
3864 var full_remaining_quest_time = remaining_quest_time + Math.max(0, (max_quest_energy - current_quest_energy - 1))*450;
3865 var full_quest_date = time_now + full_remaining_quest_time;
3866 remaining_quest_time = (full_quest_date - time)%450;
3867 //current_quest_energy = max_quest_energy - Math.ceil((full_quest_date - time)/450);
3868 var quest_link = Hero.infos.questing.current_url;
3869 if (quest_link.includes('quest') == false)
3870 quest_link = "/champions-help.html";
3871
3872 $('div.energy_counter[type="quest"] div.bar-wrapper div.over').empty().append('<a href="' + quest_link + '" style="text-decoration:none">'
3873 + '<span energy="">' + current_quest_energy + '</span>'
3874 + '<span rel="max">/' + max_quest_energy + '</span>'
3875 + '<span rel="count_txt" timeforsinglepoint="450" timeonload="48">'
3876 + '+1 dans <span rel="count">' + convertToTimeFormatMinutes(remaining_quest_time) + '</span>'
3877 + '</span>');
3878
3879 if (current_quest_energy >= max_quest_energy)
3880 $('div.energy_counter[type="quest"] div.bar-wrapper div.over span[rel="count_txt"]').css('visibility', 'hidden');
3881 }
3882
3883 function trollTimer(){
3884 var time = Math.floor(new Date().getTime()/1000);
3885 var current_troll_energy = parseInt(Hero.energies.fight.amount);
3886 var max_troll_energy = parseInt(Hero.energies.fight.max_amount);
3887 var remaining_troll_time = parseInt(Hero.energies.fight.next_refresh_ts);
3888 var full_remaining_troll_time = remaining_troll_time + Math.max(0, (max_troll_energy - current_troll_energy - 1))*1800;
3889 var full_troll_date = time_now + full_remaining_troll_time;
3890 remaining_troll_time = (full_troll_date - time)%1800;
3891
3892 $('div.energy_counter[type="fight"] div.bar-wrapper div.over span[rel="count_txt"] span[rel="count"]').remove();
3893 $('div.energy_counter[type="fight"] div.bar-wrapper div.over span[rel="count_txt"]').append('<span rel="count">' + convertToTimeFormatMinutes(remaining_troll_time) + '</span>');
3894 }
3895
3896 function pop(){
3897 var current_date_sec = Math.floor(new Date().getTime()/1000);
3898 var nb_Pop = document.getElementsByClassName("pop_thumb_expanded").length + document.getElementsByClassName("pop_thumb_in_progress").length;
3899 localStorage.setItem("nb_Pop", nb_Pop);
3900 update();
3901
3902 function update() {
3903 for (var i=0; i<nb_Pop; i++){
3904 var popDate = current_date_sec + parseInt(PlacesOfPower.instance.allPopData[i+1].remaining_time);
3905 var popTime = parseInt(PlacesOfPower.instance.allPopData[i+1].time_to_finish);
3906 localStorage.setItem("popDate" + (i+1), popDate);
3907 localStorage.setItem("popTime" + (i+1), popTime);
3908 }
3909 }
3910 }
3911
3912 function popTimer(){
3913 var current_date_sec = Math.floor(new Date().getTime()/1000);
3914 var nb_Pop = localStorage.getItem("nb_Pop");
3915 let popDate = [];
3916 let popTime = [];
3917 var time_remaining = 0;
3918 var pop_percent = 100;
3919
3920 if (nb_Pop == null) nb_Pop = 0;
3921 if (nb_Pop > 0) {
3922 for (var i=0; i<nb_Pop; i++){
3923 var popDate_i = parseInt(localStorage.getItem("popDate" + (i+1))) || 0;
3924 popDate[i] = popDate_i;
3925 var popTime_i = parseInt(localStorage.getItem("popTime" + (i+1))) || 0;
3926 popTime[i] = popTime_i;
3927 localStorage.setItem("popDate" + (i+1), popDate_i);
3928 }
3929 var popDateMin = Infinity;
3930 for (var k=0; k<nb_Pop; k++){
3931 popDateMin = Math.min(popDateMin, popDate[k]);
3932 }
3933 time_remaining = popDateMin - current_date_sec;
3934 var index = popDate.indexOf(popDateMin);
3935 pop_percent = Math.min(100, ((popTime[index]-(popDate[index]-current_date_sec))/popTime[index])*100);
3936 }
3937
3938 $('#scriptPoPTimer').html(" " + texts[lang].in + " <span rel=\"pop_count\">" + convertToTimeFormat(time_remaining) + "</span>");
3939 $('#pop_bar').css('width', pop_percent + '%');
3940
3941 if (time_remaining > 0)
3942 $('.tier_bar_pop').css('background-image', 'linear-gradient(90deg,#780049,#c80053)');
3943 else
3944 $('.tier_bar_pop').css('background-image', 'linear-gradient(to top,#008ed5 0,#05719c 100%)');
3945 }
3946
3947 function booster(){
3948 var current_date_sec = Math.floor(new Date().getTime()/1000);
3949 var boosters_date = [];
3950 var i = 0;
3951 $("#equiped .booster .slot").not(".empty").each(function(){
3952 var now = Date.now();
3953 var $booster = $(this);
3954 var time = parseInt($booster.data("d").lifetime);
3955 boosters_date[i] = time;
3956 i++;
3957 })
3958 var date_min = Infinity;
3959 if (boosters_date.length > 0) {
3960 for (var j=0; j<boosters_date.length; j++){
3961 date_min = Math.min(date_min, boosters_date[j]);
3962 }
3963 }
3964 else
3965 date_min = current_date_sec;
3966 localStorage.setItem("booster_date", date_min);
3967 }
3968
3969 function boosterTimer(){
3970 var current_date = Math.floor(new Date().getTime()/1000);
3971 var booster_date = parseInt(localStorage.getItem("booster_date"));
3972 if ((booster_date == null) || (booster_date == NaN)){
3973 booster_date = 0;
3974 localStorage.setItem("booster_date", booster_date);
3975 }
3976 var remainingTime = Math.max(0, (booster_date - current_date));
3977
3978 var booster_percent = 100-(remainingTime/(24*3600))*100;
3979
3980 $('#booster_bar').css('width', booster_percent + '%');
3981
3982 if (remainingTime > 0){
3983 $('#scriptBoosterTimer').html(" " + texts[lang].in + " <span rel=\"booster_count\">" + convertToTimeFormat(remainingTime) + "</span>");
3984 $('.tier_bar_booster').css('background-image', 'linear-gradient(90deg,#780049,#c80053)');
3985 }
3986 else {
3987 $('#scriptBoosterTimer').empty();
3988 $('.tier_bar_booster').css('background-image', 'linear-gradient(to top,#008ed5 0,#05719c 100%)');
3989 }
3990 }
3991
3992 function leagueBattles(){
3993 var time = Math.floor(new Date().getTime()/1000);
3994 var attempts = parseInt(Hero.energies.challenge.amount);
3995 var max_attempts = parseInt(Hero.energies.challenge.max_amount);
3996 var league_next_battle_in = Hero.energies.challenge.next_refresh_ts;
3997 var league_time_full = time_now + league_next_battle_in + Math.max(0, (max_attempts-attempts-1))*2100;
3998 var remaining_full_time = league_time_full-time;
3999 var remaining_next_battle = remaining_full_time%2100;
4000
4001 if (attempts < max_attempts && CurrentPage.indexOf('tower-of-fame') == -1)
4002 attempts = max_attempts - Math.max(0, Math.ceil(remaining_full_time/2100));
4003 var league_percent = (Math.min(attempts, max_attempts)/max_attempts)*100;
4004 $('#league_bar').css('width', league_percent + '%');
4005 $('#scriptLeagueAttempts').text(attempts);
4006
4007 if(attempts < 15) {
4008 $('#scriptLeagueTimer').html(" +1 " + texts[lang].in + " <span rel=\"count\">" + convertToTimeFormat(remaining_next_battle) + "</span>");
4009 $('#leagueTool').html("<span id=league_title>" + texts[lang].league + "<BR></span>" + texts[lang].full_in + " <span id=league_time_remaining>" + convertToTimeFormat(remaining_full_time) + "</span>");
4010 $('.tier_bar_league').css('background-image', 'linear-gradient(90deg,#780049,#c80053)');
4011 }
4012 else {
4013 $('#scriptLeagueTimer').empty();
4014 $('#leagueTool').html("<span id=league_title>" + texts[lang].league + "<BR></span>" + texts[lang].full);
4015 $('.tier_bar_league').css('background-image', 'linear-gradient(to top,#008ed5 0,#05719c 100%)');
4016 }
4017 }
4018
4019 function leagueInfo(){
4020 var date = time_now + season_end_at;
4021 $('div.league_end_in span span[rel="timer"]').remove();
4022 $('.league_end_in > span:nth-child(2)').append('<span rel="timer">' + calculateTime(date*1000) + '</span>');
4023 //setInterval(function(){$('.league_end_in > span:nth-child(2) > span[rel="timer"]').text(calculateTime(date*1000));}, 1000);
4024
4025 //var league_next_battle_date = time_now + Hero.energies.challenge.next_refresh_ts;
4026 var attempts = parseInt(Hero.energies.challenge.amount);
4027 var max_attempts = parseInt(Hero.energies.challenge.max_amount);
4028 var league_next_battle_in = Hero.energies.challenge.next_refresh_ts;
4029 var league_date_full = time_now + league_next_battle_in + Math.max(0, (max_attempts-attempts-1))*2100;
4030 var time = Math.floor(new Date().getTime()/1000);
4031 var remaining_full_time = league_date_full - time;
4032 var remaining_next_battle = remaining_full_time%2100;
4033 $('div.bar-wrap:nth-child(2) > div:nth-child(2) > span:nth-child(3) > span:nth-child(1)').remove();
4034 $('div.bar-wrap:nth-child(2) > div:nth-child(2) > span:nth-child(3)').append('<span rel="count">' + convertToTimeFormat(remaining_next_battle) + '</span>');
4035
4036 setInterval(function(){
4037 $('.league_end_in > span:nth-child(2) > span[rel="timer"]').text(calculateTime(date*1000));
4038 time = Math.floor(new Date().getTime()/1000);
4039 remaining_full_time = league_date_full - time;
4040 remaining_next_battle = remaining_full_time%2100;
4041 $('div.bar-wrap:nth-child(2) > div:nth-child(2) > span:nth-child(3) > span:nth-child(1)').text(convertToTimeFormat(remaining_next_battle));
4042 }, 1000);
4043 }
4044
4045 function seasonBattles(){
4046 var timestamp_last_kiss = parseInt(Hero.energies.kiss.update_ts);
4047 var current_kisses = parseInt(Hero.energies.kiss.amount);
4048 var max_kisses_number = parseInt(Hero.energies.kiss.max_amount);
4049 var time_for_new_kiss = 60*60;
4050 var new_kiss_in = parseInt(Hero.energies.kiss.next_refresh_ts);
4051 var current_date = new Date().getTime();
4052 var time_passed_sec = Math.floor(current_date/1e3)-timestamp_last_kiss;
4053 var time_remaining = convertToTimeFormat(Math.floor(time_for_new_kiss - (time_passed_sec%time_for_new_kiss)));
4054 var number_of_new_kisses = Math.floor(time_passed_sec/time_for_new_kiss);
4055 var all_kisses = 0;
4056 if (current_kisses < max_kisses_number)
4057 all_kisses = Math.min(current_kisses + number_of_new_kisses, max_kisses_number);
4058 else
4059 all_kisses = current_kisses;
4060 var season_time_remaining = convertToTimeFormat(Math.floor(time_for_new_kiss - (time_passed_sec%time_for_new_kiss)) + (Math.max(0, max_kisses_number-all_kisses-1)*time_for_new_kiss));
4061
4062 var kisses_percent = (Math.min(all_kisses, max_kisses_number)/max_kisses_number)*100;
4063 $('#kisses_bar').css('width', kisses_percent + '%');
4064
4065 $('#scriptSeasonAttempts').text(all_kisses);
4066
4067 if (all_kisses < max_kisses_number) {
4068 $('#scriptSeasonTimer').html(" +1 " + texts[lang].in + " <span rel=\"season_count\">" + time_remaining + "</span>");
4069 $('#seasonTool').html("<span id=season_title>" + texts[lang].season + "<BR></span>" + texts[lang].full_in + " <span id=season_time_remaining>" + season_time_remaining + "</span>");
4070 $('.tier_bar_season').css('background-image', 'linear-gradient(90deg,#780049,#c80053)');
4071 }
4072 else {
4073 all_kisses = Math.max(current_kisses,max_kisses_number);
4074 $('#scriptSeasonTimer').empty();
4075 $('#seasonTool').html("<span id=season_title>" + texts[lang].season + "<BR></span>" + texts[lang].full);
4076 $('.tier_bar_season').css('background-image', 'linear-gradient(to top,#008ed5 0,#05719c 100%)');
4077 }
4078 }
4079
4080 function pachinko(){
4081 var pachinkoTime = server_now_ts*1000 + pachinkoVar.next_game*1000;
4082
4083 localStorage.setItem("pachinkoTime", pachinkoTime);
4084 }
4085
4086 function market(){
4087 var marketTime = server_now_ts*1000 + $( "#shop>.shop_count> span").attr( "time" )*1000;
4088
4089 localStorage.setItem("marketTime", marketTime);
4090 }
4091
4092 function champions(){
4093 var time_min_champions = time_now + 15*60 + 1;
4094
4095 if (CurrentPage == "/champions-map.html") {
4096 for (var i = 0; i < 6; i++){
4097 var time_champion = $('a.champion-lair[href$="champions/' + (i+1) + '"] > div.champion-lair-name.map-label-link > div').attr('timer') || time_min_champions;
4098 time_min_champions = Math.min(time_min_champions, parseInt(time_champion));
4099 var timer = $('a.champion-lair[href$="champions/' + (i+1) + '"] > div.champion-lair-name.map-label-link > div').attr('timer') || 0;
4100 if (timer != 0) {
4101 $('a.champion-lair[href$="champions/' + (i+1) + '"] > div.champion-lair-name.map-label-link > div').remove()
4102 $('a.champion-lair[href$="champions/' + (i+1) + '"] > div.champion-lair-name.map-label-link').append('<div id="championTimer" timer="' + timer + '" style="margin-top: -7px; color: #999;">' + calculateTime(timer*1000) + '</div>');
4103 }
4104 }
4105 if (time_min_champions == time_now + 15*60 + 1)
4106 localStorage.setItem("championsTime", time_now*1000);
4107 else
4108 localStorage.setItem("championsTime", time_min_champions*1000);
4109 }
4110 else {
4111 var current_timer = parseInt($('.champions-bottom__rest > span:nth-child(1)').attr('timer'));
4112 var current_min = parseInt(localStorage.getItem("championsTime"));
4113 $('.champions-bottom__rest > span:nth-child(1)').empty().append(calculateTime(current_timer*1000));
4114 if (current_min < time_now*1000)
4115 current_min = time_min_champions*1000;
4116 if ((current_timer < time_min_champions) && ((current_timer*1000) < current_min)){
4117 localStorage.setItem("championsTime", current_timer*1000);
4118 }
4119 }
4120 }
4121
4122 function contests(){
4123 var next_contest_time = parseInt($('div.next_contest > div.hh_bar.contest_timer').attr('data-remaining_time'));
4124 var next_contest_date = (time_now + next_contest_time)*1000;
4125 $('div.next_contest > div.hh_bar.contest_timer > div.text > span').remove();
4126 $('div.next_contest > div.hh_bar.contest_timer > div.text').append('<span>' + calculateTime(next_contest_date) + '</span>');
4127
4128 var end_legendary_contest_time = parseInt($('div.contest.is_legendary > div.contest_header.in_progress.contest_header_active > div.personal_rewards > div.hh_bar.contest_timer').attr('data-remaining_time'));
4129 var end_legendary_contest_date = (time_now + end_legendary_contest_time)*1000;
4130 $('div.contest.is_legendary > div.contest_header.in_progress.contest_header_active > div.personal_rewards > div.hh_bar.contest_timer > div.text > span').remove();
4131 $('div.contest.is_legendary > div.contest_header.in_progress.contest_header_active > div.personal_rewards > div.hh_bar.contest_timer > div.text').append('<span>' + calculateTime(end_legendary_contest_date) + '</span>');
4132
4133 var end_regular_contest_time = parseInt($('div.contest > div.contest_header.in_progress > div.personal_rewards > div.hh_bar.contest_timer').attr('data-remaining_time'));
4134 var end_regular_contest_date = (time_now + end_regular_contest_time)*1000;
4135 $('div.contest > div.contest_header.in_progress > div.personal_rewards > div.hh_bar.contest_timer > div.text > span').remove();
4136 $('div.contest > div.contest_header.in_progress > div.personal_rewards > div.hh_bar.contest_timer > div.text').append('<span>' + calculateTime(end_regular_contest_date) + '</span>');
4137 }
4138
4139 function home() {
4140 var marketTime = localStorage.getItem("marketTime");
4141 let market = $('a[href$="shop.html"]>.position>span').css('width', '130px');
4142 market.css('height', 'auto');
4143 market.append('<BR><span id="scriptMarketTimer">' + calculateTime(marketTime) + '</span>');
4144
4145 var pachinkoTime = localStorage.getItem("pachinkoTime");
4146 let pachinko = $('a[href$="pachinko.html"]>.position>span');
4147 pachinko.css('height', 'auto');
4148 pachinko.append('<BR><span id="scriptPachinkoTimer">' + calculateTime(pachinkoTime) + '</span>');
4149
4150 var championsTime = localStorage.getItem("championsTime");
4151 if (championsTime > time_now*1000){
4152 let champions = $('a[href$="champions-map.html"]>.position>span');
4153 $('span.champion-timer').remove();
4154 champions.css('height', 'auto');
4155 champions.append('<BR><span id="scriptChampionsTimer">' + calculateTime(championsTime) + '</span>');
4156 }
4157
4158 var mission_remaining_time = missions_datas.remaining_time || missions_datas.next_missions;
4159 var mission_remaining_date = (time_now + parseInt(mission_remaining_time))*1000;
4160 $('div#home_missions_bar1 div.hh_bar.finish_in_bar div.text span').remove();
4161 $('div#home_missions_bar1 div.hh_bar.finish_in_bar div.text').append('<span id="missionsTimer1">' + calculateTime(mission_remaining_date) + '</span>');
4162 $('div#home_missions_bar2 div.hh_bar.finish_in_bar div.text span').remove();
4163 $('div#home_missions_bar2 div.hh_bar.finish_in_bar div.text').append('<span id="missionsTimer2">' + calculateTime(mission_remaining_date) + '</span>');
4164
4165 setInterval(function(){$('#scriptMarketTimer').text(calculateTime(marketTime));
4166 $('#scriptPachinkoTimer').text(calculateTime(pachinkoTime));
4167 $('#scriptChampionsTimer').text(calculateTime(championsTime));
4168 $('#missionsTimer1').text(calculateTime(mission_remaining_date));
4169 $('#missionsTimer2').text(calculateTime(mission_remaining_date));
4170 }, 1000);
4171 }
4172
4173
4174 //CSS
4175 sheet.insertRule('@media only screen and (min-width: 1026px) {'
4176 + '.scriptSeasonInfo {'
4177 + 'display: block; '
4178 + 'position: absolute; '
4179 + 'z-index: 4; '
4180 + 'width: 90%; '
4181 + 'height: 20px; '
4182 + 'margin: 10px 0 0 220px; '
4183 + 'border-radius: 8px 10px 10px 8px; '
4184 + 'background-color: rgba(0,0,0,.8); '
4185 + 'box-shadow: 0 0 0 1px rgba(255,255,255,0.73); '
4186 + 'font-size: 14px; '
4187 + 'font-weight: 400; '
4188 + 'letter-spacing: .22px; '
4189 + 'color: #fff; '
4190 + 'text-align: center;}'
4191 );
4192
4193 sheet.insertRule('@media only screen and (max-width: 1025px) {'
4194 + '.scriptSeasonInfo {'
4195 + 'display: block; '
4196 + 'position: absolute; '
4197 + 'z-index: 4; '
4198 + 'width: 90%; '
4199 + 'height: 20px; '
4200 + 'margin: 10px 0 0 190px; '
4201 + 'border-radius: 8px 10px 10px 8px; '
4202 + 'background-color: rgba(0,0,0,.8); '
4203 + 'box-shadow: 0 0 0 1px rgba(255,255,255,0.73); '
4204 + 'font-size: 14px; '
4205 + 'font-weight: 400; '
4206 + 'letter-spacing: .22px; '
4207 + 'color: #fff; '
4208 + 'text-align: center;}'
4209 );
4210
4211 sheet.insertRule('.scriptSeasonInfo a {'
4212 + 'font-family: \'Carter One\', \'Alegreya Sans\', cursive !important; '
4213 + 'color: rgb(255, 255, 255); '
4214 + 'text-decoration: none;}'
4215 );
4216
4217 sheet.insertRule('#FightSeason {'
4218 + 'width: 90%; '
4219 + 'left: 20px;}'
4220 );
4221
4222 sheet.insertRule('#FightSeason a {'
4223 + 'color: rgb(255, 255, 255); '
4224 + 'text-decoration: none;}'
4225 );
4226
4227 sheet.insertRule('#FightSeason a:hover {'
4228 //+ 'text-decoration: underline; '
4229 + 'color: rgb(255, 247, 204);} '
4230 );
4231
4232 sheet.insertRule ('#scriptSeasonTimer {'
4233 + 'font-size: 11px; '
4234 + 'color: #8ec3ff;}'
4235 );
4236
4237 sheet.insertRule('#kisses_bar {'
4238 + 'border-radius: 8px 10px 10px 8px; '
4239 + 'width: 100%; '
4240 + 'height: 100%;} '
4241 );
4242
4243 sheet.insertRule('.season_icn{'
4244 + 'display:block;'
4245 + 'width:29px;'
4246 + 'height:31px;'
4247 + 'background-image:url(https://hh2.hh-content.com/pictures/design/ic_kiss.png);'
4248 + 'background-size:25px;'
4249 + 'background-position:center;'
4250 + 'background-repeat:no-repeat;'
4251 + 'margin:0;'
4252 + 'padding:0;'
4253 + 'position:absolute;'
4254 + 'margin: -5px 0 0 -20px; '
4255 + 'z-index:36}');
4256
4257 sheet.insertRule('.seasonTooltip {'
4258 + 'width: 180px; '
4259 + 'top: 30px; '
4260 + 'margin-left: -90px;}'
4261 );
4262
4263 sheet.insertRule('.season_icn:hover .seasonTooltip {'
4264 + 'z-index:99; '
4265 + 'color: gray; '
4266 + 'font-size: 14px; '
4267 + 'visibility: visible;}'
4268 );
4269
4270 sheet.insertRule('.season_icn:hover #season_title {'
4271 + 'color: white; '
4272 + 'font-size: 16px; '
4273 + 'visibility: visible;}'
4274 );
4275
4276 sheet.insertRule('.season_icn:hover #season_time_remaining {'
4277 + 'color: orange; '
4278 + 'visibility: visible;}'
4279 );
4280
4281 sheet.insertRule('.league_counter {'
4282 + 'position: absolute; '
4283 + 'z-index: 4; '
4284 + 'width: 75%; '
4285 + 'height: 20px; '
4286 + 'margin: 10px 0 0 10px; '
4287 + 'border-radius: 8px 10px 10px 8px; '
4288 + 'background-color: rgba(0,0,0,.8); '
4289 + 'box-shadow: 0 0 0 1px rgba(255,255,255,0.73); '
4290 + 'font-size: 14px; '
4291 + 'font-weight: 400; '
4292 + 'letter-spacing: .22px; '
4293 + 'color: #fff; '
4294 + 'border: 3px; '
4295 + 'text-align: center;}'
4296 );
4297
4298 sheet.insertRule('.league_counter a {'
4299 + 'font-family: \'Carter One\', \'Alegreya Sans\', cursive !important; '
4300 + 'color: rgb(255, 255, 255); '
4301 + 'text-decoration: none;}'
4302 );
4303
4304 sheet.insertRule('#LeagueTimer {'
4305 + 'width: 85%; '
4306 + 'left: 30px;}'
4307 );
4308
4309 sheet.insertRule('#LeagueTimer a {'
4310 + 'color: rgb(255, 255, 255); '
4311 + 'text-decoration: none;}'
4312 );
4313
4314 sheet.insertRule('#LeagueTimer a:hover {'
4315 //+ 'text-decoration: underline; '
4316 + 'color: rgb(255, 247, 204);} '
4317 );
4318
4319 sheet.insertRule ('#scriptLeagueTimer {'
4320 + 'font-size: 11px; '
4321 + 'color: #8ec3ff;}'
4322 );
4323
4324 sheet.insertRule('#league_bar {'
4325 + 'border-radius: 8px 10px 10px 8px; '
4326 + 'width: 100%; '
4327 + 'height: 100%;} '
4328 );
4329
4330 sheet.insertRule('.league_icn{'
4331 + 'display:block;'
4332 + 'width:29px;'
4333 + 'height:31px;'
4334 + 'background-image:url(https://hh2.hh-content.com/league_points.png);'
4335 + 'background-size:25px;'
4336 + 'background-position:center;'
4337 + 'background-repeat:no-repeat;'
4338 + 'margin:0;'
4339 + 'padding:0;'
4340 + 'position:absolute;'
4341 + 'margin: -5px 0 0 -24px; '
4342 + 'z-index:36}');
4343
4344 sheet.insertRule('.leagueTooltip {'
4345 + 'width: 180px; '
4346 + 'top: 30px; '
4347 + 'margin-left: -90px;}'
4348 );
4349
4350 sheet.insertRule('.league_icn:hover .leagueTooltip {'
4351 + 'color: gray; '
4352 + 'font-size: 14px; '
4353 + 'visibility: visible;}'
4354 );
4355
4356 sheet.insertRule('.league_icn:hover #league_title {'
4357 + 'color: white; '
4358 + 'font-size: 16px; '
4359 + 'visibility: visible;}'
4360 );
4361
4362 sheet.insertRule('.league_icn:hover #league_time_remaining {'
4363 + 'color: orange; '
4364 + 'visibility: visible;}'
4365 );
4366
4367 sheet.insertRule ('#scriptMarketTimer, #scriptPachinkoTimer, #scriptChampionsTimer{'
4368 + 'overflow:hidden;'
4369 + 'display: block;'
4370 + 'margin-top: -5px;'
4371 + 'color: gray;}'
4372 );
4373
4374 sheet.insertRule('@media only screen and (min-width: 1026px) {'
4375 + '.pop_timer {'
4376 + 'position: absolute; '
4377 + 'z-index: 4; '
4378 + 'width: 90%; '
4379 + 'height: 20px; '
4380 + 'margin: 10px 0 0 400px; '
4381 + 'border-radius: 8px 10px 10px 8px; '
4382 + 'background-color: rgba(0,0,0,.8); '
4383 + 'box-shadow: 0 0 0 1px rgba(255,255,255,0.73); '
4384 + 'font-size: 14px; '
4385 + 'font-weight: 400; '
4386 + 'letter-spacing: .22px; '
4387 + 'color: #fff; '
4388 + 'text-align: center;}'
4389 );
4390
4391 sheet.insertRule('@media only screen and (max-width: 1025px) {'
4392 + '.pop_timer {'
4393 + 'position: absolute; '
4394 + 'z-index: 4; '
4395 + 'width: 90%; '
4396 + 'height: 20px; '
4397 + 'margin: 10px 0 0 350px; '
4398 + 'border-radius: 8px 10px 10px 8px; '
4399 + 'background-color: rgba(0,0,0,.8); '
4400 + 'box-shadow: 0 0 0 1px rgba(255,255,255,0.73); '
4401 + 'font-size: 14px; '
4402 + 'font-weight: 400; '
4403 + 'letter-spacing: .22px; '
4404 + 'color: #fff; '
4405 + 'text-align: center;}'
4406 );
4407
4408
4409 sheet.insertRule('.pop_timer a {'
4410 + 'font-family: \'Carter One\', \'Alegreya Sans\', cursive !important; '
4411 + 'color: rgb(255, 255, 255); '
4412 + 'text-decoration: none;}'
4413 );
4414
4415 sheet.insertRule('#PoPTimer {'
4416 + 'width: 80%; '
4417 + 'left: 20px;}'
4418 );
4419
4420 sheet.insertRule('#PoPTimer a {'
4421 + 'color: rgb(255, 255, 255); '
4422 + 'text-decoration: none;}'
4423 );
4424
4425 sheet.insertRule('#PoPTimer a:hover {'
4426 //+ 'text-decoration: underline; '
4427 + 'color: rgb(255, 247, 204);} '
4428 );
4429
4430 sheet.insertRule ('#scriptPoPTimer {'
4431 + 'font-size: 11px; '
4432 + 'color: #8ec3ff;}'
4433 );
4434
4435 sheet.insertRule('#pop_bar {'
4436 + 'border-radius: 8px 10px 10px 8px; '
4437 + 'width: 100%; '
4438 + 'height: 100%;} '
4439 );
4440
4441 sheet.insertRule('.infoTooltip {'
4442 + 'visibility: hidden; '
4443 + 'font-size: 12px; '
4444 + 'background-color: black; '
4445 + 'color: #fff; '
4446 + 'text-align: center; '
4447 + 'padding: 3px 5px 3px 5px; '
4448 + 'border: 2px solid #905312; '
4449 + 'border-radius: 6px; '
4450 + 'background-color: rgba(32,3,7,.9); '
4451 + 'position: absolute; '
4452 + 'margin-top: 5px; '
4453 + 'z-index: 9;}'
4454 );
4455
4456 sheet.insertRule('.infoTooltip::after {'
4457 + 'content: " "; '
4458 + 'position: absolute; '
4459 + 'bottom: 100%; '
4460 + 'left: 50%; '
4461 + 'margin-left: -10px; '
4462 + 'border-width: 10px; '
4463 + 'border-style: solid; '
4464 + 'border-color: transparent transparent #905312 transparent;}'
4465 );
4466
4467 sheet.insertRule('.booster_timer {'
4468 + 'position: absolute; '
4469 + 'z-index: 4; '
4470 + 'width: 90%; '
4471 + 'height: 20px; '
4472 + 'margin: 10px 0 0 -210px; '
4473 + 'border-radius: 8px 10px 10px 8px; '
4474 + 'background-color: rgba(0,0,0,.8); '
4475 + 'box-shadow: 0 0 0 1px rgba(255,255,255,0.73); '
4476 + 'font-size: 14px; '
4477 + 'font-weight: 400; '
4478 + 'letter-spacing: .22px; '
4479 + 'color: #fff; '
4480 + 'text-align: center;}'
4481 );
4482
4483 sheet.insertRule('.booster_timer a {'
4484 + 'font-family: \'Carter One\', \'Alegreya Sans\', cursive !important; '
4485 + 'color: rgb(255, 255, 255); '
4486 + 'text-decoration: none;}'
4487 );
4488
4489 sheet.insertRule('#BoosterTimer {'
4490 + 'width: 190px; '
4491 + 'left: 20px;}'
4492 );
4493
4494 sheet.insertRule('#BoosterTimer a {'
4495 + 'color: rgb(255, 255, 255); '
4496 + 'text-decoration: none;}'
4497 );
4498
4499 sheet.insertRule('#BoosterTimer a:hover {'
4500 //+ 'text-decoration: underline; '
4501 + 'color: rgb(255, 247, 204);} '
4502 );
4503
4504 sheet.insertRule ('#scriptBoosterTimer {'
4505 + 'font-size: 11px; '
4506 + 'color: #8ec3ff;}'
4507 );
4508
4509 sheet.insertRule('#booster_bar {'
4510 + 'border-radius: 8px 10px 10px 8px; '
4511 + 'width: 100%; '
4512 + 'height: 100%;} '
4513 );
4514}
4515
4516
4517/* ============
4518 SEASON SIM
4519 ============ */
4520
4521function moduleSeasonSim() {
4522 var playerEgo;
4523 var playerEgoCheck;
4524 var playerDefHC;
4525 var playerDefKH;
4526 var playerDefCH;
4527 var playerAtk;
4528 var playerClass;
4529 var playerAlpha;
4530 var playerBeta;
4531 var playerOmega;
4532 var playerExcitement;
4533 var playerBetaAdd;
4534 var playerOmegaAdd;
4535 var opponentEgo;
4536 var opponentDefHC;
4537 var opponentDefKH;
4538 var opponentDefCH;
4539 var opponentAtk;
4540 var opponentClass;
4541 var opponentAlpha;
4542 var opponentBeta;
4543 var opponentOmega;
4544 var opponentExcitement;
4545 var opponentBetaAdd;
4546 var opponentOmegaAdd;
4547 var opponentProcHCBase;
4548 var opponentProcHCAddOrgasm1;
4549 var opponentProcHCAddOrgasm2;
4550 var opponentProcHCAddOrgasm3;
4551 var opponentProcCH;
4552 var opponentProcKH;
4553 var opponentAlphaClass;
4554 var playerDef;
4555 var opponentDef;
4556 var playerOrgasm;
4557 var playerOrgasmCount;
4558 var opponentOrgasm;
4559 var opponentOrgasmCount;
4560 var matchRating;
4561 var turns;
4562
4563
4564 function playerTurn() {
4565 //Orgasm
4566 if (playerOrgasm >= playerExcitement) {
4567 //Orgasm damage
4568 opponentEgo -= Math.round(playerAtk * 1.5 - opponentDef);
4569 playerOrgasmCount++;
4570
4571 //Log results
4572 //console.log('Round ' + (turns + 1) + ': Player orgasm! -' + Math.round(playerAtk * 1.5 - opponentDef));
4573
4574 //Orgasm 1
4575 if (playerOrgasmCount == 1) {
4576 playerAtk += Math.round(playerBetaAdd * 1.3);
4577 opponentDef += Math.round(opponentBetaAdd * 1.75);
4578 }
4579
4580 //Orgasm 2
4581 if (playerOrgasmCount == 2) {
4582 playerAtk += Math.round(playerOmegaAdd * 1.3);
4583 opponentDef += Math.round(opponentOmegaAdd * 1.75);
4584 }
4585
4586 //Reset excitement value
4587 playerOrgasm = 0;
4588 }
4589
4590 //No orgasm
4591 else {
4592 opponentEgo -= playerAtk - opponentDef;
4593 playerOrgasm += playerAtk * 2;
4594 //console.log('Round ' + (turns + 1) + ': Player hit! -' + (playerAtk - opponentDef));
4595 }
4596
4597 //Log results
4598 //console.log('after Round ' + (turns + 1) + ': Opponent ego: ' + opponentEgo);
4599 }
4600
4601 function opponentTurn() {
4602 //Orgasm
4603 if (opponentOrgasm >= opponentExcitement) {
4604 //Orgasm damage
4605 playerEgo -= Math.round(opponentAtk * 1.5 - playerDef);
4606 opponentOrgasmCount++;
4607
4608 //Log results
4609 //console.log('Round ' + (turns + 1) + ': Opponent orgasm! -' + Math.round(opponentAtk * 1.5 - playerDef));
4610
4611 //Orgasm 1
4612 if (opponentOrgasmCount == 1) {
4613 opponentAtk += Math.round(opponentBetaAdd * 1.3);
4614 playerDef += Math.round(playerBetaAdd * 1.75);
4615 if (opponentAlphaClass == '1') {
4616 playerEgo -= opponentProcHCAddOrgasm1;
4617 //console.log('Round ' + (turns + 1) + ': HC opponent possibility of Wild Burst on first orgasm! -' + opponentProcHCAddOrgasm1);
4618 }
4619 }
4620
4621 //Orgasm 2
4622 if (opponentOrgasmCount == 2) {
4623 opponentAtk += Math.round(opponentOmegaAdd * 1.3);
4624 playerDef += Math.round(playerOmegaAdd * 1.75);
4625 if (opponentAlphaClass == '1') {
4626 playerEgo -= opponentProcHCAddOrgasm2;
4627 //console.log('Round ' + (turns + 1) + ': HC opponent possibility of Wild Burst on second orgasm! -' + opponentProcHCAddOrgasm2);
4628 }
4629 }
4630
4631 //Orgasm 3
4632 if (opponentOrgasmCount == 3) {
4633 if (opponentAlphaClass == '1') {
4634 playerEgo -= opponentProcHCAddOrgasm3;
4635 //console.log('Round ' + (turns + 1) + ': HC opponent possibility of Wild Burst on third orgasm! -' + opponentProcHCAddOrgasm3);
4636 }
4637 }
4638
4639 //Reset excitement value
4640 opponentOrgasm = 0;
4641 }
4642
4643 //No orgasm
4644 else {
4645 playerEgo -= opponentAtk - playerDef;
4646 opponentOrgasm += opponentAtk * 2;
4647 //console.log('Round ' + (turns + 1) + ': Opponent hit! -' + (opponentAtk - playerDef));
4648 }
4649
4650 //Log results
4651 //console.log('after Round ' + (turns + 1) + ': Player ego: ' + playerEgo);
4652 }
4653
4654 function simuChallenge(){
4655 //Simulate challenge
4656 for (turns = 0; turns < 99; turns++) {
4657 if (playerEgo > 0) {
4658 playerTurn()
4659 }
4660 else {
4661 break
4662 }
4663 if (opponentEgo > 0) {
4664 opponentTurn()
4665 }
4666 else {
4667 //Check if victory is only a one-turn advantage
4668 playerEgoCheck = playerEgo;
4669
4670 //Orgasm
4671 if (opponentOrgasm >= opponentExcitement) {
4672 playerEgoCheck -= Math.round(opponentAtk * 1.5 - playerDef);
4673 opponentOrgasmCount++;
4674
4675 //Log results
4676 //console.log('Round ' + (turns + 1) + ': Possibly next: Opponent orgasm! -' + Math.round(opponentAtk * 1.5 - playerDef));
4677
4678 if (opponentAlphaClass == '1') {
4679 if (opponentOrgasmCount == 1) {
4680 playerEgoCheck -= opponentProcHCAddOrgasm1;
4681 //console.log('Round ' + (turns + 1) + ': Possibly next: HC opponent possibility of Wild Burst on first orgasm! -' + opponentProcHCAddOrgasm1);
4682 }
4683 if (opponentOrgasmCount == 2) {
4684 playerEgoCheck -= opponentProcHCAddOrgasm2;
4685 //console.log('Round ' + (turns + 1) + ': Possibly next: HC opponent possibility of Wild Burst on second orgasm! -' + opponentProcHCAddOrgasm2);
4686 }
4687 if (opponentOrgasmCount == 3) {
4688 playerEgoCheck -= opponentProcHCAddOrgasm3;
4689 //console.log('Round ' + (turns + 1) + ': Possibly next: HC opponent possibility of Wild Burst on third orgasm! -' + opponentProcHCAddOrgasm3);
4690 }
4691 }
4692 }
4693 //No orgasm
4694 else {
4695 playerEgoCheck -= opponentAtk - playerDef;
4696 //console.log('Round ' + (turns + 1) + ': Possibly next: Opponent hit! -' + (opponentAtk - playerDef));
4697 }
4698
4699 if (playerEgoCheck <= 0) {
4700 //console.log('Close call! After Round ' + (turns + 1) + ': Player ego: ' + playerEgoCheck);
4701 }
4702 break
4703 }
4704 }
4705 }
4706
4707 function calculateSeasonPower(idOpponent) {
4708 // player stats
4709 playerEgo = Math.round(Hero.infos.caracs.ego);
4710 playerDefHC = Math.round(Hero.infos.caracs.def_carac1);
4711 playerDefCH = Math.round(Hero.infos.caracs.def_carac2);
4712 playerDefKH = Math.round(Hero.infos.caracs.def_carac3);
4713 playerAtk = Math.round(Hero.infos.caracs.damage);
4714 playerClass = $('div#season-arena.canvas div.season_arena_block.battle_hero .class_change_btn').attr('carac');
4715 playerAlpha = JSON.parse($('div#season-arena.canvas div.season_arena_block.battle_hero div.hero_team div.team_girl.smaller.js_hero_girl div.smaller.center_y.change_team_girls[rel=g1]').attr('girl-tooltip-data'));
4716 playerBeta = JSON.parse($('div#season-arena.canvas div.season_arena_block.battle_hero div.hero_team div.team_girl.smaller.js_hero_girl div.smaller.center_y.change_team_girls[rel=g2]').attr('girl-tooltip-data'));
4717 playerOmega = JSON.parse($('div#season-arena.canvas div.season_arena_block.battle_hero div.hero_team div.team_girl.smaller.js_hero_girl div.smaller.center_y.change_team_girls[rel=g3]').attr('girl-tooltip-data'));
4718 playerExcitement = Math.round((playerAlpha.caracs.carac1 + playerAlpha.caracs.carac2 + playerAlpha.caracs.carac3) * 28);
4719
4720 if (playerClass == 'class1') {
4721 playerBetaAdd = playerBeta.caracs.carac1;
4722 playerOmegaAdd = playerOmega.caracs.carac1;
4723 }
4724 if (playerClass == 'class2') {
4725 playerBetaAdd = playerBeta.caracs.carac2;
4726 playerOmegaAdd = playerOmega.caracs.carac2;
4727 }
4728 if (playerClass == 'class3') {
4729 playerBetaAdd = playerBeta.caracs.carac3;
4730 playerOmegaAdd = playerOmega.caracs.carac3;
4731 }
4732
4733 // opponent stats
4734 opponentEgo = parseInt($('div#season-arena.canvas div.opponents_arena div.season_arena_opponent_container:nth-child(' + (2*idOpponent+1) + ') div:nth-child(1) div:nth-child(4) div:nth-child(3) span:nth-child(2)').text().replace(/[^0-9]/gi, ''));
4735
4736 opponentDef = $('div#season-arena.canvas div.opponents_arena div.season_arena_opponent_container:nth-child(' + (2*idOpponent+1) + ') div:nth-child(1) div:nth-child(4) div:nth-child(2) span:nth-child(2)').text();
4737 opponentDef = opponentDef.substring(0, opponentDef.indexOf('-'));
4738 opponentDef = parseInt(opponentDef.replace(/[^0-9]/gi, ''));
4739
4740 opponentAtk = $('div#season-arena.canvas div.opponents_arena div.season_arena_opponent_container:nth-child(' + (2*idOpponent+1) + ') div:nth-child(1) div:nth-child(4) div:nth-child(1) span:nth-child(2)').text();
4741 opponentAtk = opponentAtk.substring(0, opponentAtk.indexOf('-'));
4742 opponentAtk = parseInt(opponentAtk.replace(/[^0-9]/gi, ''));
4743
4744 opponentClass = $('div#season-arena.canvas div.opponents_arena div.season_arena_opponent_container:nth-child(' + (2*idOpponent+1) + ') div:nth-child(1) div:nth-child(1) div:nth-child(2) div:nth-child(2) div:nth-child(2)').attr('carac');
4745 opponentAlpha = JSON.parse($('div#season-arena.canvas div.opponents_arena div.season_arena_opponent_container:nth-child(' + (2*idOpponent+1) + ') div.season_arena_block.opponent div.hero_team div.smaller.center_y.change_team_girls[rel=g1]').attr('girl-tooltip-data'));
4746 opponentBeta = JSON.parse($('div#season-arena.canvas div.opponents_arena div.season_arena_opponent_container:nth-child(' + (2*idOpponent+1) + ') div.season_arena_block.opponent div.hero_team div.smaller.center_y.change_team_girls[rel=g2]').attr('girl-tooltip-data'));
4747 opponentOmega = JSON.parse($('div#season-arena.canvas div.opponents_arena div.season_arena_opponent_container:nth-child(' + (2*idOpponent+1) + ') div.season_arena_block.opponent div.hero_team div.smaller.center_y.change_team_girls[rel=g3]').attr('girl-tooltip-data'));
4748 opponentExcitement = Math.round((opponentAlpha.caracs.carac1 + opponentAlpha.caracs.carac2 + opponentAlpha.caracs.carac3) * 28);
4749
4750 if (opponentClass == 'class1') {
4751 opponentBetaAdd = opponentBeta.caracs.carac1;
4752 opponentOmegaAdd = opponentOmega.caracs.carac1;
4753 }
4754 if (opponentClass == 'class2') {
4755 opponentBetaAdd = opponentBeta.caracs.carac2;
4756 opponentOmegaAdd = opponentOmega.caracs.carac2;
4757 }
4758 if (opponentClass == 'class3') {
4759 opponentBetaAdd = opponentBeta.caracs.carac3;
4760 opponentOmegaAdd = opponentOmega.caracs.carac3;
4761 }
4762
4763 //Determine each side's actual defense
4764 if (opponentClass == 'class1') {
4765 playerDef = playerDefHC;
4766 }
4767 if (opponentClass == 'class2') {
4768 playerDef = playerDefCH;
4769 }
4770 if (opponentClass == 'class3') {
4771 playerDef = playerDefKH;
4772 }
4773
4774 //Calculate opponent proc values, determine applicable alpha class and adjust starting ego values for proc
4775 opponentProcHCBase = Math.round(opponentAtk * 0.5);
4776 opponentProcHCAddOrgasm1 = Math.round(opponentAtk * 0.25);
4777 opponentProcHCAddOrgasm2 = Math.round(opponentBetaAdd * 1.3 * 0.75);
4778 opponentProcHCAddOrgasm3 = Math.round(opponentOmegaAdd * 1.3 * 0.75);
4779 opponentProcCH = opponentDef * 2;
4780 opponentProcKH = Math.round(opponentEgo * 0.1);
4781 opponentAlphaClass = opponentAlpha.class;
4782
4783 if (opponentAlphaClass == '1') {
4784 playerEgo -= opponentProcHCBase;
4785 }
4786 if (opponentAlphaClass == '2') {
4787 opponentEgo += opponentProcCH;
4788 }
4789 if (opponentAlphaClass == '3') {
4790 opponentEgo += opponentProcKH;
4791 }
4792
4793 //Log opponent name and starting egos for sim
4794 //console.log('Simulation log for: ' + $('div#season-arena.canvas div.opponents_arena div.season_arena_opponent_container:nth-child(' + (2*idOpponent+1) + ') > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(1)').text());
4795 //console.log('Starting Egos adjusted for worst-case proc scenario:');
4796 //console.log('Player Ego: ' + playerEgo);
4797 //console.log('Opponent Ego: ' + opponentEgo);
4798
4799 playerOrgasm = 0;
4800 playerOrgasmCount = 0;
4801 opponentOrgasm = 0;
4802 opponentOrgasmCount = 0;
4803
4804 simuChallenge();
4805
4806 //Round defeated player's ego up to 0 to not skew results
4807 if (playerEgo < 0) {
4808 playerEgo = 0;
4809 }
4810 if (opponentEgo < 0) {
4811 opponentEgo = 0;
4812 }
4813
4814 //Publish the ego difference as a match rating
4815 matchRating = playerEgo - opponentEgo;
4816 if (matchRating >= 0) {
4817 matchRating = '+' + nThousand(matchRating);
4818
4819 if (playerEgoCheck <= 0) {
4820 $('div#season-arena.canvas div.opponents_arena div.season_arena_opponent_container:nth-child(' + (2*idOpponent+1) + ') > div:nth-child(1) > div:nth-child(4) > div:nth-child(4) > span:nth-child(2)').append('<div class="matchRating close"><img id="powerLevelScouter" src="https://i.postimg.cc/3xvDTR6M/icon-sim-yellow.png">' + matchRating + '</div>');
4821 }
4822 else {
4823 $('div#season-arena.canvas div.opponents_arena div.season_arena_opponent_container:nth-child(' + (2*idOpponent+1) + ') > div:nth-child(1) > div:nth-child(4) > div:nth-child(4) > span:nth-child(2)').append('<div class="matchRating plus"><img id="powerLevelScouter" src="https://i.postimg.cc/J0YB1BM8/icon-sim-green.png">' + matchRating + '</div>');
4824 }
4825 }
4826 else {
4827 matchRating = nThousand(matchRating);
4828 $('div#season-arena.canvas div.opponents_arena div.season_arena_opponent_container:nth-child(' + (2*idOpponent+1) + ') > div:nth-child(1) > div:nth-child(4) > div:nth-child(4) > span:nth-child(2)').append('<div class="matchRating minus"><img id="powerLevelScouter" src="https://i.postimg.cc/8P3r9WZB/icon-sim-red.png">' + matchRating + '</div>');
4829 }
4830 }
4831
4832 calculateSeasonPower(1);
4833 calculateSeasonPower(2);
4834 calculateSeasonPower(3);
4835
4836 let div_button = document.querySelector('div.opponents_arena');
4837 let button = div_button.querySelector('button');
4838 button.addEventListener('click', function(){
4839 setInterval(function(){
4840 $('div#season-arena.canvas div.opponents_arena div.season_arena_opponent_container:nth-child(3) > div:nth-child(1) > div:nth-child(4) > div:nth-child(4) > span:nth-child(2) > div:nth-child(1)').remove(0);
4841 calculateSeasonPower(1);}, 5000);
4842 setInterval(function(){
4843 $('div#season-arena.canvas div.opponents_arena div.season_arena_opponent_container:nth-child(5) > div:nth-child(1) > div:nth-child(4) > div:nth-child(4) > span:nth-child(2) > div:nth-child(1)').remove(0);
4844 calculateSeasonPower(2);}, 5000);
4845 setInterval(function(){
4846 $('div#season-arena.canvas div.opponents_arena div.season_arena_opponent_container:nth-child(7) > div:nth-child(1) > div:nth-child(4) > div:nth-child(4) > span:nth-child(2) > div:nth-child(1)').remove(0);
4847 calculateSeasonPower(3);}, 5000);
4848 });
4849
4850
4851 //CSS
4852 sheet.insertRule('.matchRating {'
4853 + 'margin-left: 6px; '
4854 + 'text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000; '
4855 + 'line-height: 17px; '
4856 + 'font-size: 16px;}'
4857 );
4858
4859 sheet.insertRule('.plus {'
4860 + 'color: #66CD00;}'
4861 );
4862
4863 sheet.insertRule('.minus {'
4864 + 'color: #FF2F2F;}'
4865 );
4866
4867 sheet.insertRule('.close {'
4868 + 'color: #FFA500;}'
4869 );
4870
4871 sheet.insertRule('#powerLevelScouter {'
4872 + 'margin-left: 3px; '
4873 + 'margin-right: 1px; '
4874 + 'width: 30px;}'
4875 );
4876}
4877
4878/* ================
4879 PACHINKO NAMES
4880 ================ */
4881
4882function modulePachinkoNames() {
4883 if ($('#pachinko_whole').length){
4884 const jsonMapData = localStorage.HHPNMap;
4885 if (typeof(jsonMapData) == "undefined"){
4886 return
4887 }
4888 const localizationMap = new Map(JSON.parse(jsonMapData));
4889 const targetNode = document.getElementById('pachinko_whole');
4890 const config = { attributes: true, childList: true, subtree: true };
4891
4892 const callback = function(mutationsList, observer){
4893 var text = $('#playzone-replace-info');
4894 if (text.find('.HHMI-INFO').length != 0){
4895 return
4896 } else if ($('#playzone-replace-info').find('.girl_shards').length) {
4897 const rewards = $('#playzone-replace-info').find('.girl_shards').attr('data-rewards')
4898 const regex = /id_girl":"\d+/g;
4899 const found = rewards.match(regex);
4900
4901 var girls = "";
4902 for (var i = 0, l = found.length; i < l; i++){
4903 const raw = found[i];
4904 const id = raw.match(/\d+/g);
4905 const name = localizationMap.get(id.toString());
4906 const girlName = name.replace("’", "-");
4907 var element;
4908
4909 if (HH_UNIVERSE == 'gay') {
4910 element = '<a href="https://harem-battle.club/wiki/Gay-Harem/GH:' + name + '" target="_blank"> ' + name + ' </a>';
4911 }
4912 else if (lang == 'fr') {
4913 element = '<a href="http://hentaiheroes.wikidot.com/' + girlName + '" target="_blank"> ' + name + ' </a>';
4914 }
4915 else {
4916 element = '<a href="https://harem-battle.club/wiki/Harem-Heroes/HH:' + name + '" target="_blank"> ' + name + ' </a>';
4917 }
4918
4919 if (girls != ""){
4920 girls += ", " + element;
4921 } else {
4922 girls += element;
4923 }
4924 }
4925
4926 if (found.length > 7 && (localStorage.getItem('HHS.pachinkoNamesMulti') == '1')){
4927 text = text.find('.graduation');
4928 text.css("overflow-y", "scroll");
4929 text.css("height", "75px");
4930 text.css("fontSize", "9px");
4931 text.css("line-height", "10px");
4932 text.append('<\BR><\BR>');
4933 } else if (found.length > 7){
4934 return
4935 } else if (found.length > 3){
4936 text = text.find('.cover');
4937 text.css("fontSize", "9px");
4938 text.css("line-height", "10px");
4939 text.append('<\BR>');
4940 } else {
4941 text = text.find('.cover');
4942 text.css("fontSize", "11.5px");
4943 }
4944 text.append('<div class="HHMI-INFO">' + texts[lang].available_girls + girls + '</div>');
4945 }
4946 };
4947
4948 const observer = new MutationObserver(callback);
4949 observer.observe(targetNode, config);
4950
4951 } else if ($('#harem_whole').length){
4952 const jsonMapData = localStorage.HHPNMap;
4953 const localizationMap = typeof(jsonMapData) == "undefined"? new Map(): new Map(JSON.parse(localStorage.HHPNMap));
4954 var keys = Object.keys(girlsDataList);
4955 if (localizationMap.size >= keys.length){
4956 return;
4957 }
4958
4959 var girlNameDictionary = new Map()
4960 for (var i = 0, l = keys.length; i < l; i++){
4961 var key = keys[i];
4962 var girl = girlsDataList[key];
4963 var name = girl["Name"]
4964 if (typeof(name) != "undefined") {
4965 girlNameDictionary.set(key, name);
4966 }
4967 }
4968
4969 if (girlNameDictionary.size > 0){
4970 var json = JSON.stringify(Array.from(girlNameDictionary.entries()));
4971 localStorage.HHPNMap = json;
4972 }
4973 }
4974 sheet.insertRule('.playing-zone {'
4975 + 'height: 520px !important;}'
4976 );
4977 sheet.insertRule('.playing-zone > .border-gradient > .wrapper {'
4978 + 'height: 520px !important;}'
4979 );
4980}
4981
4982
4983sheet.insertRule('@media only screen and (max-width: 1025px) {'
4984 + 'body > div > header > div.energy_counter .bar-wrapper .over [rel="count_txt"] {'
4985 + 'left: -15px;}}'
4986 );
4987
4988sheet.insertRule('.promo_fight_discount_text {'
4989 + 'position:relative;'
4990 + 'top:0px !important;}'
4991 );
4992
4993sheet.insertRule('@media only screen and (max-width: 1025px) {'
4994 + '#tower_of_fame {'
4995 + 'background: #222;}}'
4996 );
4997
4998sheet.insertRule('body > div > header > div.currency .hudHC_mix_icn {'
4999 + 'right: 75px;}'
5000 );
5001
5002if (window.location.pathname.indexOf('season') != -1) {
5003 let i=1;
5004 while((($('div.leaderboard_row:nth-child(' + i + '').css('color') != "rgb(34, 150, 228)") && ($('div.leaderboard_row:nth-child(' + i + '').css('color') != "rgb(55, 160, 231)")) && (i < 201)){
5005 i++;
5006 }
5007 if (($('div.leaderboard_row:nth-child(' + i + '').css('color') == "rgb(34, 150, 228)") || ($('div.leaderboard_row:nth-child(' + i + '').css('color') == "rgb(55, 160, 231)")) {
5008 let player_row = $('div.leaderboard_row:nth-child(' + i + '').clone();
5009 player_row.css('position', 'fixed');
5010 player_row.css('bottom', '30px');
5011 player_row.css('width', '904px');
5012 $('#leaderboard_list').append(player_row);
5013 }
5014}
5015
5016$("#bg_all").replaceWith( $("#bg_all").clone() );
5017$("#bg_all > div > img").not($("#bg_all > div > img")[Math.floor(Math.random()*$("#bg_all > div > img").length)]).remove();
5018$("#bg_all > div > img").css("display","block");