// ==UserScript==
// @name GobZilla
// @namespace Gobland
// @description Décoche par défaut la case active dla et le vestiaire. Affiche des icônes dans la vue. Affiche le nombre d'entrainements restants. Récup des attributs avec calcul des talents au survol de la souris)
// @include http://games.gobland.fr/jeuC.html
// @include http://games.gobland.fr/act.php
// @include http://games.gobland.fr/Vue.php
// @include http://games.gobland.fr/Menu.php
// @include http://games.gobland.fr/Meute.php
// @include http://games.gobland.fr/ProfilPerso.php
// @include http://games.gobland.fr/SmallEquipement.php
// @include http://games.gobland.fr/Options.php
// @include http://games.gobland.fr/activDLA.php
// @include http://games.gobland.fr/actions.php
// @include http://games.gobland.fr/playActions.php
// @include http://games.gobland.fr/stock.php?*
// @match http://games.gobland.fr/index.php*
// @match https://games.gobland.fr/index.php*
// @match http://games.gobland.fr/playActions.php?todo=52
// @require https://cdnjs.cloudflare.com/ajax/libs/raphael/2.3.0/raphael.js
// @require https://greasemonkey.github.io/gm4-polyfill/gm4-polyfill.js
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js
// @copyright lordslair, Seishin et Death Métal (330)
// @author DeathMétal 330
// @license https://creativecommons.org/licenses/by-sa/4.0/
// @version 0.21.0
// ==/UserScript==
// Tentative de recup de l'heure de DLA pour faire un calcul sur le décalage de dla comme dans mh, mais pr l'instant j'y arrive pas
//
// var heuredla = $('div:contains("DLA")').text().match(/(\d)/);
// var divdla = $("<div id=\"DLA\"></div>");
// divdla.insertBefore($("form[action*='act.php']"));
// $("<input type=\"button\" value=\"calculer l'heure\">").insertBefore(divdla);
if ($(location).attr('href').match(/http:\/\/(.*\.)?gobland\.fr\/Meute\.php/i)) {
var lvlmeute = $('center:contains("Niveau")').text().match(/^(\D*)(\d+)/)[2];
window.localStorage.setItem('lvlmeute', lvlmeute);
} else {
var lvlmeute = window.localStorage.getItem('lvlmeute');
}
//==========================================================================================================================================================================================================================
// VUE 2D. Piqué à Stéphane Beauquis (Extention Chrome). Pour faire marcher j'ai viré l'identification ('chrome.local.storage') Merci Glak maintenant on peux cocher/décocher pour activer ou non la vue 2D.
//==========================================================================================================================================================================================================================
if ($(location).attr('href').match(/http:\/\/(.*\.)?gobland\.fr\/act\.php/i)) {
$( document ).ready(function() {
if ($("h1").text() == "Connaissance des Monstres") {
// Analyse de la CdM
var conteneur = $("#identite").find("div.deborde");
var rang = null;
var executionLinesArr = conteneur.find("center:first").text().split("\n");
$.each( executionLinesArr, function( key, value ) {
if (value.indexOf("AVEZ RÉUSSI") > 0) {
rang = value.substring(
value.indexOf("en tant que") + 12,
value.indexOf(" ("));
return false;
}
});
console.log("Rang = " + rang);
// Vérification du rang : on ne traite pas les CdM des grouillots
if (rang == "Maître" || rang == "Grand Maître") {
var resultLinesArr = conteneur.text().split("\n");
$.each( resultLinesArr, function( key, value ) {
lineArr = value.split(" : ");
// TODO : construction de la CdM
switch (lineArr[0]) {
case "Le monstre ciblé fait partie des":
console.log("Monstre = " + lineArr[1]);
break;
case "Niveau":
console.log("Niveau = " + lineArr[1]);
break;
case "Taille":
console.log("Taille = " + lineArr[1]);
break;
case "Points de Vie":
console.log("PV = " + lineArr[1]);
break;
// ......
}
});
}
}
});
}
//==========================================================================================================================================================================================================================
// Traitements spécifiques à la page MENU (left)
//==========================================================================================================================================================================================================================
if ($(location).attr('href').match(/http:\/\/(.*\.)?gobland\.fr\/Menu\.php/i)) {
// Enregistrement dans le storage local de l'identité du Gob
var gobContainer = $(".presentation").find('a:first');
window.localStorage.setItem('gobName', gobContainer.text());
window.localStorage.setItem('gobId', gobContainer.attr('href').match(/javascript:EPV\((\d+)\)/)[1]);
}
//==========================================================================================================================================================================================================================
// Traitements spécifiques à la page ACTIONS (footer)
//==========================================================================================================================================================================================================================
if ($(location).attr('href').match(/http:\/\/(.*\.)?gobland\.fr\/playActions\.php/i)) {
function showHideCdmNeededActions() {
var displayCdmNeededChecked = window.localStorage.getItem('displayCdmNeededChecked');
if(displayCdmNeededChecked == 1) {
var cdmNeeded = window.localStorage.getItem('cdmNeeded');
$.each(cdmNeeded.split(","), function(index, value) {
$('option:contains("' + value + '")').css("background-color", "#FF99FF");
});
} else {
$(".cdmNeeded").removeClass("cdmNeeded");
}
}
// Après chargement de la page, lancement des enhancements
$( document ).ready(function() {
showHideCdmNeededActions();
});
}
//==========================================================================================================================================================================================================================
// Traitements spécifiques à la page VUE
//==========================================================================================================================================================================================================================
if ($(location).attr('href').match(/^http:\/\/(.*\.)?gobland\.fr\/vue\.php$/i)) {
// Intégration de CSS pour le loader et la CDM
var myCSS = `
.cdmNeeded {
background-color: #FF99FF;
}
.cuisine {
background-color: #99FF99;
}
.cdmContainer {
background: url(http://images.gobland.fr/v1.0/grande-fenetre/gf-centre.png);
border: 2px solid #666;
font-family: sans-serif;
font-size: 12px;
padding: 10px;
display: inline-block;
background-color: #ddd;
position: fixed;
width: 400px;
left: 270px;
top: 10%;
}
.cdmContainer .title {
font-weight: bold;
font-size: 14px;
}
.cdmContainer span {
display: block;
padding: 2px;
}
.lds-roller {
display: inline-block;
position: fixed;
width: 80px;
height: 80px;
left: 415px;
top: 50%;
z-index: 1000;
}
.lds-roller div {
animation: lds-roller 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
transform-origin: 40px 40px;
}
.lds-roller div:after {
content: " ";
display: block;
position: absolute;
width: 7px;
height: 7px;
border-radius: 50%;
background: #000;
margin: -4px 0 0 -4px;
}
.lds-roller div:nth-child(1) {
animation-delay: -0.036s;
}
.lds-roller div:nth-child(1):after {
top: 63px;
left: 63px;
}
.lds-roller div:nth-child(2) {
animation-delay: -0.072s;
}
.lds-roller div:nth-child(2):after {
top: 68px;
left: 56px;
}
.lds-roller div:nth-child(3) {
animation-delay: -0.108s;
}
.lds-roller div:nth-child(3):after {
top: 71px;
left: 48px;
}
.lds-roller div:nth-child(4) {
animation-delay: -0.144s;
}
.lds-roller div:nth-child(4):after {
top: 72px;
left: 40px;
}
.lds-roller div:nth-child(5) {
animation-delay: -0.18s;
}
.lds-roller div:nth-child(5):after {
top: 71px;
left: 32px;
}
.lds-roller div:nth-child(6) {
animation-delay: -0.216s;
}
.lds-roller div:nth-child(6):after {
top: 68px;
left: 24px;
}
.lds-roller div:nth-child(7) {
animation-delay: -0.252s;
}
.lds-roller div:nth-child(7):after {
top: 63px;
left: 17px;
}
.lds-roller div:nth-child(8) {
animation-delay: -0.288s;
}
.lds-roller div:nth-child(8):after {
top: 56px;
left: 12px;
}
@keyframes lds-roller {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}`;
var myStyle = document.createElement("style");
myStyle.setAttribute("type", "text/css");
myStyle.appendChild(document.createTextNode(myCSS));
document.body.appendChild(myStyle);
// HTML pour le loader
var loader = $("<div id=\"loader\" class=\"lds-roller\"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>");
$("#content").append(loader);
$("#loader").hide();
// HTML pour les CdM
var cdm = $("<div id=\"cdm\" class=\"cdmContainer\"></div>");
$("#content").append(cdm);
cdm.click(function(evt) {
evt.preventDefault();
$("#cdm").hide();
});
$("#cdm").hide();
const raceGobs = ["Musculeux", "Mentalo", "Nodef", "Trad Scions", "Vis Yonnair", "Zozo Giste"];
/*const cdmNeeded = [
"Cube gélatineux", "Reine Fourmi" , "Fourmi Guerrière" , "Hydre" , "Fourmi Ouvrière" , "Phoenix" , "Balrog" , "Gargouille" , "Colosse de pierre" ,
"Professeur Fou" , "Golem d'Argile" , "Ours hibou" , "Tertre errant" , "Feu follet"];*/
/// Coloration des gros mobs et indication px
$("#TCREATURES > center > table > tbody > tr").each( function(){
var race = $(this).find('td').eq(4).text();
if (jQuery.inArray(race, raceGobs) < 0) {
var tdlevel = $(this).find('td');
var lvl = parseInt(tdlevel.eq(3).text(), 10);
if (isNaN(lvl)) return;
if (lvl > 39) {
$(this).css("background-color","#f55442")
} else if (lvl > 29) {
$(this).css("background-color","#f59c42")
} else if (lvl > 25) {
$(this).css("background-color","#f5b342")
}
// Ajout de l'affichage d'une CDM au clic sur la race
$(this).find('td').eq(4).css("cursor", "pointer");
$(this).find('td').eq(4).click(function(evt) {
evt.preventDefault();
$("#loader").show();
var url = "https://gobzilla.incaworld.fr/cdm/"+race+"/"+lvl;
$.getJSON( url, function( data ) {
if (data["race"] != undefined) {
$("#loader").hide();
$("#cdm").html("<div class=\"title\">" + data["nom"] + "</div>"
+ "<p>Le monstre fait partie des : " + data["race"] + "</p>"
+ "<span>Niveau moyen : " + data["niveau"] + "</span>"
+ "<span>Points de Vie : entre " + data["pvMin"] + " à " + data["pvMax"] + "</span>"
+ "<span>Dés d'Attaque : entre " + data["attMin"] + " et " + data["attMax"] + "</span>"
+ "<span>Dés d'Esquive : entre " + data["esqMin"] + " et " + data["esqMax"] + "</span>"
+ "<span>Dés de Dégât : entre " + data["degMin"] + " et " + data["degMax"] + "</span>"
+ "<span>Dés de Régénération : entre " + data["regMin"] + " et " + data["regMax"] + "</span>"
+ "<span>Perception : entre " + data["perMin"] + " et " + data["perMax"] + "</span>"
+ "<span>Armure Physique : entre " + data["armurePhyMin"] + " et " + data["armurePhyMax"] + "</span>"
+ "<span>Armure Magique : entre " + data["armureMagMin"] + " et " + data["armureMagMax"] + "</span>"
+ "<span>Tour : entre " + data["tourMin"] + "h et " + data["tourMax"] + "h</span>"
+ "<span>Pouvoir : " + data["pouvoir"] + "</span>"
+ "<span>Créature volante : " + (data["vol"]?"Oui":"Non") + "</span>"
+ "<span>Attaque à distance : " + (data["distance"]?"Oui":"Non") + "</span>"
+ "<span>Nombre d'attaques : " + data["nbAttaques"] + "</span>"
+ "<span>Comportement : " + data["comportement"] + "</span>"
+ "<span>Intelligence : " + data["intelligence"] + "</span>"
+ "<span>Vitesse : " + data["vitesse"] + "</span>"
+ "<span>VLC : " + data["vlc"] + "</span>"
+ "<span>" + data["magie"] + "</span></br>"
+ "<b>Cette moyenne de " + data["nbCdm"] + " CdM n'est qu'une estimation !</b>");
} else {
$("#loader").hide();
$("#cdm").html("Pas de CDM en stock !");
}
$("#cdm").show();
});
});
if (lvlmeute != undefined) {
var px = Math.max(0, 20+2*(lvl-lvlmeute)+lvl);
tdlevel.prop('title', px + "px");
} else {
tdlevel.prop('title', "Merci de visiter la page meute pour charger le niveau");
}
}
});
// Coloration des gobs
$.each(raceGobs, function(index, value) {
$('td:contains("' + value + '")').parent().css("background-color","#ccccff");
});
var show2DChecked = window.localStorage.getItem('show2DChecked');
var displayLieuxChecked = window.localStorage.getItem('displayLieuxChecked');
var displayCdmNeeded = window.localStorage.getItem('displayCdmNeededChecked');
var displayCuisine = window.localStorage.getItem('displayCuisineChecked');
var vue2DBuilt = false;
var extendedLieuxBuilt = false;
var R;
function showHideVue2d() {
if($('#ckbDisplay2D').is(":checked")) {
window.localStorage.setItem('show2DChecked', 1);
if (!vue2DBuilt) build2DView();
$("#vue2D").show();
$("#filterDiv").show();
} else {
window.localStorage.setItem('show2DChecked', 0);
$("#vue2D").hide();
$("#filterDiv").hide();
}
}
function showHideExtendedLieux() {
if($('#ckbDisplayLieux').is(":checked")) {
window.localStorage.setItem('displayLieuxChecked', 1);
if (!extendedLieuxBuilt) buildExtendedLieux();
$(".extendedLieu").show();
} else {
window.localStorage.setItem('displayLieuxChecked', 0);
$(".extendedLieu").hide();
}
}
function showHideCdmNeeded() {
if($('#ckbDisplayCdmNeeded').is(":checked")) {
window.localStorage.setItem('displayCdmNeededChecked', 1);
var cdmNeededUpdate = new Date(window.localStorage.getItem('cdmNeededUpdate'));
var delta = (new Date() - cdmNeededUpdate)/1000/60/60/24;
if (delta > 5) {
var urlCdMNeeded = "https://gobzilla.incaworld.fr/mobs/cdm/5";
$.getJSON( urlCdMNeeded, function( data ) {
if (data != undefined) {
window.localStorage.setItem('cdmNeeded', data.monstres);
window.localStorage.setItem('cdmNeededUpdate', new Date());
}
});
}
var cdmNeeded = window.localStorage.getItem('cdmNeeded');
$.each(cdmNeeded.split(","), function(index, value) {
$('td:contains("' + value + '")').parent().addClass("cdmNeeded");
$('option:contains("' + value + '")').addClass("cmNeeded");
});
} else {
window.localStorage.setItem('displayCdmNeededChecked', 0);
$(".cdmNeeded").removeClass("cdmNeeded");
}
}
function showHideCuisine() {
if($('#ckbDisplayCuisine').is(":checked")) {
window.localStorage.setItem('displayCuisineChecked', 1);
var cuisineUpdate = new Date(window.localStorage.getItem('cuisineUpdate'));
var delta = (new Date() - cuisineUpdate)/1000/60/60/24;
if (delta > 30) {
var urlCuisine = "https://gobzilla.incaworld.fr/mobs/insecte";
$.getJSON( urlCuisine, function( data ) {
if (data != undefined) {
window.localStorage.setItem('cuisine', data.monstres);
window.localStorage.setItem('cuisineUpdate', new Date());
}
});
}
var cuisine = window.localStorage.getItem('cuisine');
$.each(cuisine.split(","), function(index, value) {
$('td:contains("' + value + '")').parent().addClass("cuisine");
});
} else {
window.localStorage.setItem('displayCuisineChecked', 0);
$(".cuisine").removeClass("cuisine");
}
}
// Après chargement de la page, lancement des enhancements
$( document ).ready(function() {
// Vue 2D
if (show2DChecked == 1) {
$('#ckbDisplay2D').prop( "checked", show2DChecked );
}
showHideVue2d();
// Liste des lieux étendue
if (displayLieuxChecked == 1) {
$('#ckbDisplayLieux').prop( "checked", displayLieuxChecked );
}
showHideExtendedLieux();
// CdM manquantes
if (displayCdmNeeded == 1) {
$('#ckbDisplayCdmNeeded').prop( "checked", displayCdmNeeded );
}
showHideCdmNeeded();
// A cuisiner
if (displayCuisine == 1) {
$('#ckbDisplayCuisine').prop( "checked", displayCuisine );
}
showHideCuisine();
});
var cells = {};
var niveau = 0;
var _X=0, _Y=0, _N=0;
var div = $("<div id=\"vue2D\"></div>");
div.insertBefore($("form[action*='newMail.php']"));
//=======================================================================
// Filters
//=======================================================================
var prediv = $("<div id=\"preFilter\"></div>");
prediv.insertBefore(div);
prediv.append($('<label />', { 'for': 'ckbDisplay2D', text: 'Vue 2D' }));
prediv.append($("<input type=\"checkbox\" id=\"ckbDisplay2D\" name=\"ckbDisplay2D\" class=\"ckbFilter\" >"));
prediv.append($('<label />', { 'for': 'ckbDisplayLieux', text: 'Lieux étendus' }));
prediv.append($("<input type=\"checkbox\" id=\"ckbDisplayLieux\" name=\"ckbDisplayLieux\" class=\"ckbFilter\" >"));
prediv.append($('<label />', { 'for': 'ckbDisplayCdmNeeded', text: 'CdM manquantes' }));
prediv.append($("<input type=\"checkbox\" id=\"ckbDisplayCdmNeeded\" name=\"ckbDisplayCdmNeeded\" class=\"ckbFilter\" >"));
prediv.append($('<label />', { 'for': 'ckbDisplayCuisine', text: 'Mobs à cuisiner' }));
prediv.append($("<input type=\"checkbox\" id=\"ckbDisplayCuisine\" name=\"ckbDisplayCuisine\" class=\"ckbFilter\" >"));
var filterDiv = $("<div id=\"filterDiv\"></div>");
filterDiv.insertBefore(div);
filterDiv.append($('<label />', { 'for': 'ckbNiveau', text: 'Même niveau' }));
filterDiv.append($("<input type=\"checkbox\" id=\"ckbNiveau\" name=\"ckbNiveau\" class=\"ckbFilter\" >"));
filterDiv.append($('<label />', { 'for': 'ckbObject', text: 'Trésor' }));
filterDiv.append($("<input type=\"checkbox\" id=\"ckbObject\" name=\"ckbObject\" class=\"ckbFilter\" checked=\"checked\" >"));
filterDiv.append($('<label />', { 'for': 'ckbMonster', text: 'Monstre' }));
filterDiv.append($("<input type=\"checkbox\" id=\"ckbMonster\" name=\"ckbMonster\" class=\"ckbFilter\" checked=\"checked\" >"));
filterDiv.append($('<label />', { 'for': 'ckbPlace', text: 'Lieu' }));
filterDiv.append($("<input type=\"checkbox\" id=\"ckbPlace\" name=\"ckbPlace\" class=\"ckbFilter\" checked=\"checked\" >"));
//=======================================================================
// Construction de la liste étendue des lieux sur la base d'une API externe
//=======================================================================
function buildExtendedLieux() {
var reflieux = new Array();
$("#TLIEUX > table > tbody > tr").each( function(){
reflieux.push($(this).find('td').eq(1).text());
});
var url = "https://gobzilla.incaworld.fr/lieux/"+_X+"/"+_Y+"/"+_N;
$.getJSON( url, function( data ) {
// alert(JSON.stringify(data));
$.each( data, function( key, val ) {
if (( reflieux.indexOf(val["id"]) == -1 ) && (val["id"] !== -1))
{
var row = "<tr bgcolor=\"#E0E0E0\" class=\"extendedLieu\"><td>" + val["distance"] ;
row += "</td><td>" + val["id"] ;
row += "</td><td>" + val["nom"] ;
row += "</td><td>" + val["type"] ;
row += "</td><td>" + val["x"] ;
row += "</td><td>" + val["y"] ;
row += "</td><td>" + val["z"] ;
row += "</td></tr>";
$(row).insertAfter("#TLIEUX table tr:last");
}
});
});
extendedLieuxBuilt = true;
}
//=======================================================================
// Grab the data for Vue2D
//=======================================================================
var _terre="", _PX=0, _PY=0;
// Get the name and num of the actual goblin
var nom = $('#identite').attr("nom");
var num = $('#identite').attr("num");
// Get the actual position and view size
$('li').each(function(){
// cache jquery var
var current = $(this);
var matches = current.text().match(/Ma position actuelle est : X = ([\-0-9]+), Y = ([\-0-9]+), N = ([\-0-9]+)([^\-]+)/);
if (matches) {
_X = parseInt(matches[1]);
_Y = parseInt(matches[2]);
_N = parseInt(matches[3]);
niveau = _N;
_terre = matches[4];
}
matches = current.text().match(/L'affichage est limité à (\d+) cases horizontalement et (\d+) verticalement/);
if (matches) {
_PX = (parseInt(matches[1])>14)?14:parseInt(matches[1]);
_PY = (parseInt(matches[2])>7)?7:parseInt(matches[2]);
}
});
var width = 630,
height = 650,
leftgutter = 30,
bottomgutter = 20,
offset = 25,
nbCase = _PX * 2 + 1,
carre = Math.floor((width-offset-5) / nbCase),
txt = {"font": '10px Fontin-Sans, Arial', stroke: "none", fill: "#000"};
var alllieux = {};
// Compute grid limits
var xmin = _X - _PX,
ymin = _Y - _PX,
ymax = _Y + _PX,
Dx = xmin * -1,
Dy = ymin * -1;
//=============================================================
// Gestion des changements de filtre
//=============================================================
$("input.ckbFilter").change(function () {
showHideVue2d();
showHideExtendedLieux();
showHideCdmNeeded();
showHideCuisine();
for( var key in cells ) {
x = cells[key].x;
y = cells[key].y;
mapping = "i" + getMapping(key) + ".src";
alllieux[key].remove();
if (mapping != "i0000.src")
{
alllieux[key] = R.image(eval(mapping), x, y, carre-1, carre-1);
}
}
for (var key in alllieux) {
(function (st, key) {
if (st[0])
{
st[0].style.cursor = "pointer";
st[0].onmouseover = function () {
//st[0].onclick = function () {
x = cells[key].x; //X Co-Ords
y = cells[key].y; //Y Co-Ords
// Compute tic position
tic = "";
tic += ( y >= (Math.floor(nbCase/2))*carre )?"bottom":"top";
tic += ( x > (Math.floor(nbCase/2))*carre )?"left":"right";
var s = compute_text(key);
if ( s != "" )
{
// Draw the tooltip
draw_tooltip(this, 1, s, x, y, carre, tic);
}
};
st[0].onmouseout = function () {
draw_tooltip(this, 0);
};
}
})(alllieux[key], key);
}
});
// Images
$("<img src=\"http://images.gobland.fr/addons/GGVue2D/0001.jpg\" id=\"i0001\" style=\"display:none;\" />").insertBefore(div);
$("<img src=\"http://images.gobland.fr/addons/GGVue2D/0010.jpg\" id=\"i0010\" style=\"display:none;\" />").insertBefore(div);
$("<img src=\"http://images.gobland.fr/addons/GGVue2D/0011.jpg\" id=\"i0011\" style=\"display:none;\" />").insertBefore(div);
$("<img src=\"http://images.gobland.fr/addons/GGVue2D/0100.jpg\" id=\"i0100\" style=\"display:none;\" />").insertBefore(div);
$("<img src=\"http://images.gobland.fr/addons/GGVue2D/0101.jpg\" id=\"i0101\" style=\"display:none;\" />").insertBefore(div);
$("<img src=\"http://images.gobland.fr/addons/GGVue2D/0110.jpg\" id=\"i0110\" style=\"display:none;\" />").insertBefore(div);
$("<img src=\"http://images.gobland.fr/addons/GGVue2D/0111.jpg\" id=\"i0111\" style=\"display:none;\" />").insertBefore(div);
$("<img src=\"http://images.gobland.fr/addons/GGVue2D/1000.jpg\" id=\"i1000\" style=\"display:none;\" />").insertBefore(div);
$("<img src=\"http://images.gobland.fr/addons/GGVue2D/1001.jpg\" id=\"i1001\" style=\"display:none;\" />").insertBefore(div);
$("<img src=\"http://images.gobland.fr/addons/GGVue2D/1010.jpg\" id=\"i1010\" style=\"display:none;\" />").insertBefore(div);
$("<img src=\"http://images.gobland.fr/addons/GGVue2D/1011.jpg\" id=\"i1011\" style=\"display:none;\" />").insertBefore(div);
$("<img src=\"http://images.gobland.fr/addons/GGVue2D/1100.jpg\" id=\"i1100\" style=\"display:none;\" />").insertBefore(div);
$("<img src=\"http://images.gobland.fr/addons/GGVue2D/1101.jpg\" id=\"i1101\" style=\"display:none;\" />").insertBefore(div);
$("<img src=\"http://images.gobland.fr/addons/GGVue2D/1110.jpg\" id=\"i1110\" style=\"display:none;\" />").insertBefore(div);
$("<img src=\"http://images.gobland.fr/addons/GGVue2D/1111.jpg\" id=\"i1111\" style=\"display:none;\" />").insertBefore(div);
//initialisation de la vue2d
//=============================================================
// D r a w
//=============================================================
function build2DView() {
Raphael.fn.drawGrid = function (x, y, w, h, wv, hv, color) {
color = color || "#000";
var path = ["M", Math.round(x) + .5, Math.round(y) + .5, "L", Math.round(x + w) + .5, Math.round(y) + .5, Math.round(x + w) + .5, Math.round(y + h) + .5, Math.round(x) + .5, Math.round(y + h) + .5, Math.round(x) + .5, Math.round(y) + .5],
rowHeight = h / hv,
columnWidth = w / wv;
for (var i = 1; i < hv; i++) {
path = path.concat(["M", Math.round(x) + .5, Math.round(y + i * rowHeight) + .5, "H", Math.round(x + w) + .5]);
}
for (i = 1; i < wv; i++) {
path = path.concat(["M", Math.round(x + i * columnWidth) + .5, Math.round(y) + .5, "V", Math.round(y + h) + .5]);
}
return this.path(path.join(",")).attr({stroke: color});
};
var i0001 = document.getElementById("i0001");
var i0010 = document.getElementById("i0010");
var i0011 = document.getElementById("i0011");
var i0100 = document.getElementById("i0100");
var i0101 = document.getElementById("i0101");
var i0110 = document.getElementById("i0110");
var i0111 = document.getElementById("i0111");
var i1000 = document.getElementById("i1000");
var i1001 = document.getElementById("i1001");
var i1010 = document.getElementById("i1010");
var i1011 = document.getElementById("i1011");
var i1100 = document.getElementById("i1100");
var i1101 = document.getElementById("i1101");
var i1111 = document.getElementById("i1111");
R = Raphael("vue2D", width, height);
// Draw the grid
R.drawGrid(offset, offset, nbCase*carre, nbCase*carre, nbCase, nbCase, "#000");
// Draw legend for X-axis and Y-axis
for( var i = 0 ; i < nbCase ; i++ ) {
// X coordinates top/bottom
R.text( Math.round(offset+(i+.5)*carre), 10, (xmin+i).toString() ).attr(txt);
R.text( Math.round(offset+(i+.5)*carre), 630, (xmin+i).toString() ).attr(txt);
// Y coordinates
R.text( 10, Math.round(offset+(i+.5)*carre), (ymax-i).toString() ).attr(txt);
}
// Add to the list the current Goblin
x = _PX*carre + offset + 1;
y = _PX*carre + offset + 1;
var key = ( x + Dx ) + Math.abs( y + Dy ) * nbCase + 1;
cells[key] = { "x":x, "y":y, "realx":_X, "realy":_Y };
cells[key][_N] = { "gob":[nom+" ("+num+")\n"], "monster":[], "place":[], "object":[] };
var creatures = $('#TCREATURES').find("table");
$("tbody tr", creatures).each(function (index, tr) {
var lines = $('td', tr).map(function(index, td) {
return $(td).text();
});
if ( typeof lines[0] != "undefined" )
{
x = (_PX + parseInt(lines[6]) - _X)*carre + offset + 1;
y = (_PX - parseInt(lines[7]) + _Y)*carre + offset + 1;
var key = ( x + Dx ) + Math.abs( y + Dy ) * nbCase + 1;
// Get level
var lvl = lines[8];
if (!(key in cells))
{
// Add the new cell
cells[key] = { "x":x, "y":y, "realx":lines[6], "realy":lines[7] };
cells[key][lvl] = { "gob":[], "monster":[], "place":[], "object":[] };
}
if (!(lvl in cells[key]))
{
// Add a new level for this cell
cells[key][lvl] = { "gob":[], "monster":[], "place":[], "object":[] };
}
if (( lines[4] == "Mentalo" ) ||
( lines[4] == "Nodef" ) ||
( lines[4] == "Musculeux" ) ||
( lines[4] == "Vis Yonnair" ) ||
( lines[4] == "Trad Scion" ) ||
( lines[4] == "Zozo Giste" ))
{
cells[key][lvl]["gob"].push(lines[2]);
}
else
{
cells[key][lvl]["monster"].push(lines[2]);
}
}
});
// Get all 'lieux' to display
var lieux = $('#TLIEUX').find("table");
$("tbody tr", lieux).each(function (index, tr) {
var lines = $('td', tr).map(function(index, td) {
return $(td).text();
});
if ( typeof lines[0] != "undefined" )
{
x = (_PX + parseInt(lines[4]) - _X)*carre + offset + 1;
y = (_PX - parseInt(lines[5]) + _Y)*carre + offset + 1;
var key = ( x + Dx ) + Math.abs( y + Dy ) * nbCase + 1;
// Get level
var lvl = lines[6];
if (!(key in cells))
{
cells[key] = { "x":x, "y":y, "realx":lines[4], "realy":lines[5] };
cells[key][lvl] = { "gob":[], "monster":[], "place":[], "object":[] };
}
if (!(lvl in cells[key]))
{
cells[key][lvl] = { "gob":[], "monster":[], "place":[], "object":[] };
}
cells[key][lvl]["place"].push(lines[2]);
}
});
// Get all 'tresor' to display
var tresors = $('#TOBJETS').find("table");
$("tbody tr", tresors).each(function (index, tr) {
var lines = $('td', tr).map(function(index, td) {
return $(td).text();
});
if ( typeof lines[0] != "undefined" )
{
x = (_PX + parseInt(lines[3]) - _X)*carre + offset + 1;
y = (_PX - parseInt(lines[4]) + _Y)*carre + offset + 1;
var key = ( x + Dx ) + Math.abs( y + Dy ) * nbCase + 1;
// Get level
var lvl = lines[5];
if (!(key in cells))
{
cells[key] = { "x":x, "y":y, "realx":lines[3], "realy":lines[4] };
cells[key][lvl] = { "gob":[], "monster":[], "place":[], "object":[] };
}
if (!(lvl in cells[key]))
{
cells[key][lvl] = { "gob":[], "monster":[], "place":[], "object":[] };
}
cells[key][lvl]["object"].push(lines[2]);
}
});
alllieux = {};
for( var key in cells ) {
x = cells[key].x;
y = cells[key].y;
mapping = "i" + getMapping(key) + ".src";
alllieux[key] = R.image(eval(mapping), x, y, carre-1, carre-1);
}
for (var key in alllieux) {
(function (st, key) {
st[0].style.cursor = "pointer";
st[0].onmouseover = function () {
x = cells[key].x; //X Co-Ords
y = cells[key].y; //Y Co-Ords
// Compute tic position
tic = "";
tic += ( y >= (Math.floor(nbCase/2))*carre )?"bottom":"top";
tic += ( x > (Math.floor(nbCase/2))*carre )?"left":"right";
var s = compute_text(key);
if ( s != "" ) {
draw_tooltip(this, 1, s, x, y, carre, tic);
}
};
st[0].onmouseout = function () {
draw_tooltip(this, 0);
};
})(alllieux[key], key);
};
vue2DBuilt = true;
}
function getMapping(k) {
var result = "";
var cptGob = 0, cptMob = 0, cptPlace = 0, cptObj = 0;
if ($('input[name=ckbNiveau]').is(':checked')) {
if (niveau in cells[k]) {
cptGob += cells[k][niveau]["gob"].length;
cptMob += cells[k][niveau]["monster"].length;
cptPlace += cells[k][niveau]["place"].length;
cptObj += cells[k][niveau]["object"].length;
}
} else {
for( var lvl in cells[k] )
{
if (( lvl != "x" ) && ( lvl != "y" ) &&
( lvl != "realx" ) && ( lvl != "realy" ))
{
cptGob += cells[k][lvl]["gob"].length;
cptMob += cells[k][lvl]["monster"].length;
cptPlace += cells[k][lvl]["place"].length;
cptObj += cells[k][lvl]["object"].length;
}
}
}
result += (cptGob > 0)? "1" : "0";
result += ((cptMob > 0) && ($('input[name=ckbMonster]').is(':checked')))? "1" : "0";
result += ((cptObj > 0) && ($('input[name=ckbObject]').is(':checked')))? "1" : "0";
result += ((cptPlace > 0) && ($('input[name=ckbPlace]').is(':checked')))? "1" : "0";
return result;
}
//=======================================================================================
// Compute the global text that must be display in the popup.
//=======================================================================================
function compute_text(k) {
var result = "X=" + cells[k].realx + ", Y=" + cells[k].realy + "\n";
var n = [];
if ($('input[name=ckbNiveau]').is(':checked'))
{
if (niveau in cells[k])
{
n.push(niveau);
}
} else {
for( var lvl in cells[k] )
{
if (( lvl != "x" ) && ( lvl != "y" ) &&
( lvl != "realx" ) && ( lvl != "realy" ))
{
n.push(lvl);
}
}
}
var data = ""
for( i = 0; i<n.length; i++ ) {
k2 = n[i];
data += getString(cells[k][k2]["gob"]);
data += getString(cells[k][k2]["monster"],true);
data += getString(cells[k][k2]["place"]);
if ($('input[name=ckbObject]').is(':checked'))
{
data += getString(cells[k][k2]["object"],true);
}
if (data != "")
{
result += " \nNiveau: " + k2 + "\n" + data;
data = "";
}
}
return result;
}
//=======================================================================================
// Process the data array and generate the string to display in the popup
// If compressed = true, the number of items are counted to be displayed as N x items
//=======================================================================================
function getString(data,compressed) {
if(typeof(compressed)==='undefined') compressed = false;
var result = "";
if (compressed)
{
var tmp = {};
for( var i=0; i < data.length; i++ )
{
n = data[i];
if (!(n in tmp))
{
tmp[n] = 0;
}
tmp[n] = tmp[n] + 1;
}
for( var k in tmp )
{
result += "\t" + tmp[k] + " x " + k + "\n";
}
}
else
{
for( var i=0; i < data.length; i++ )
{
result += "\t" + data[i] + "\n";
}
}
return result;
}
function draw_tooltip(object, show, text, x, y, carre, from) {
if(show == 0) {
popup.remove();
popup_txt.remove();
transparent_txt.remove();
return;
}
// Center X on middle of the cell.
x += Math.floor(carre/2);
//draw text somewhere to get its dimensions and make it transparent
transparent_txt = R.text(10,10, text).attr({fill: "transparent",font: "10px sans-serif"});
//get text dimensions to obtain tooltip dimensions
var txt_box = transparent_txt.getBBox();
if (from=="topright") {
// Move to bottom of the cell
y += carre;
// Compute position
Xtext = x+5;
Ytext = y+Math.floor(txt_box.height/2)+5;
//draw text
popup_txt = R.text(Xtext, Ytext, text).attr({fill: "black",font: "10px sans-serif",'text-anchor': 'start'});
var bb = popup_txt.getBBox();
// Compute path for tooltip box
pathText = // 'M'ove to the 'dent' in the bubble
"M" + (x) + " " + (y) +
// 'v'ertically draw a line 5 pixels more than the height of the text
"v" + (bb.height+5) +
// 'h'orizontally draw a line 10 more than the text's width
"h" + (bb.width+10) +
// 'v'ertically draw a line to the bottom of the text
"v" + -bb.height +
// 'h'orizontally draw a line so we're 5 pixels from the left side
"h" + -(bb.width+5) +
// 'Z' closes the figure
"Z";
} else if (from=="topleft") {
// Move to bottom of the cell
y += carre;
// Compute position
Xtext = x-(txt_box.width+5);
Ytext = y+Math.floor(txt_box.height/2)+5;
//draw text
popup_txt = R.text(Xtext, Ytext, text).attr({fill: "black",font: "10px sans-serif",'text-anchor': 'start'});
var bb = popup_txt.getBBox();
// Compute path for tooltip box
pathText = // 'M'ove to the 'dent' in the bubble
"M" + (x) + " " + (y) +
// 'v'ertically draw a line 5 pixels more than the height of the text
"v" + (bb.height+5) +
// 'h'orizontally draw a line 10 more than the text's width
"h" + -(bb.width+10) +
// 'v'ertically draw a line to the bottom of the text
"v" + -bb.height +
// 'h'orizontally draw a line so we're 5 pixels from the left side
"h" + (bb.width+5) +
// 'Z' closes the figure
"Z";
} else if (from=="bottomleft") {
// Compute position
Xtext = x-(txt_box.width+5);
Ytext = y-Math.floor(txt_box.height/2)-6;
//draw text
popup_txt = R.text(Xtext, Ytext, text).attr({fill: "black",font: "10px sans-serif",'text-anchor': 'start'});
var bb = popup_txt.getBBox();
// Compute path for tooltip box
pathText = // 'M'ove to the 'dent' in the bubble
"M" + (x) + " " + (y) +
// 'v'ertically draw a line 5 pixels more than the height of the text
"v" + -(bb.height+5) +
// 'h'orizontally draw a line 10 more than the text's width
"h" + -(bb.width+10) +
// 'v'ertically draw a line to the bottom of the text
"v" + bb.height +
// 'h'orizontally draw a line so we're 5 pixels from the left side
"h" + (bb.width+5) +
// 'Z' closes the figure
"Z";
} else // bottom right
{
// Compute position
Xtext = x+5;
Ytext = y-Math.floor(txt_box.height/2)-6;
//draw text
popup_txt = R.text(Xtext, Ytext, text).attr({fill: "black",font: "10px sans-serif",'text-anchor': 'start'});
var bb = popup_txt.getBBox();
// Compute path for tooltip box
pathText = // 'M'ove to the 'dent' in the bubble
"M" + (x) + " " + (y) +
// 'v'ertically draw a line 5 pixels more than the height of the text
"v" + -(bb.height+5) +
// 'h'orizontally draw a line 10 more than the text's width
"h" + (bb.width+10) +
// 'v'ertically draw a line to the bottom of the text
"v" + bb.height +
// 'h'orizontally draw a line so we're 5 pixels from the left side
"h" + -(bb.width+5) +
// 'Z' closes the figure
"Z";
}
//draw path for tooltip box
popup = R.path( pathText ).attr( {fill: "yellow"} );
//finally put the text in front
popup_txt.toFront();
} // End draw_tooltip
};
//==========================================================================================================================================================================================================================
// Traitements spécifiques à la page PROFIL
//==========================================================================================================================================================================================================================
if ($(location).attr('href').match(/^http:\/\/(.*\.)?gobland\.fr\/ProfilPerso\.php$/i)) {
var skills = {};
//================================================================================================================
// Présentation de Gobzilla au survol de la souris dans Mon profil, table de améliorations)
//=================================================================================================================
$( document ).ready(function() {
$('a:contains("Table des Améliorations")').prop('title',
" Bienvenue sur GobZilla, roulé à la main sous les Aisselles par DeathMétal 330." + "\n" +
" Fonctions principales : " + "\n" +
" - Affiche une vue 2d activable ou non (version test) "+ "\n" +
" - Décoche le vestiaire, décoche l'activation de DLA "+ "\n" +
" - Calcul auto de nombre d'entrainements" + "\n" +
" - Récupération des carac et calcul des skills au survol de la souris. " + "\n" +
' - Modifie la Css et met en couleur les Gobelins et les gros monstres dans la vue et les monstres sur lequels on a besoin de cdm en rose' + "\n" +
" - Ajout d'icônes dans le profil et dans la vue " + "\n" +
" 🥰 amis"+ "\n" +
" 👨🍳 monstre à cuisiner " + "\n" +
'👁️👁️👁️ VLC Totale'+ "\n" +
'👁️👁️ VLC Importante'+ "\n" +
'👁️ VLC partielle'+ "\n" +
'🙈 Aucune VLC'+ "\n" +
" - Bientôt des cdm au survol du monstre dans la vue" + "\n" +
" - Bipez moi si vous voyez des erreurs, il doit y en avoir.......");
// Encapsuler la faim dans un conteneur pour coloration et récupérer la faim du gob
var tdSante = $('th:contains("Santé")').parent().find("td:first");
tdSante.html(tdSante.html().replace(/Faim................: (\d+)/, '<span id="faimContainer">Faim................: $1</span>'));
var faim = tdSante.text().match(/Faim................: (\d+)/);
skills.FAIM = faim[1];
if (skills.FAIM < 11) {
$('#faimContainer').css({"color": "green"});
} else if (skills.FAIM < 20) {
$('#faimContainer').css({"color": "blue"});
} else {
$('#faimContainer').css({"color": "red", "font-weight": "bold"});
}
});
//fait apparaitre table des amélioration et gobzilla en jaune dans monprofil
$('a:contains("Table des Améliorations")').css("background-color","#FFFF33");
//fait apparaitre comp et tech et dons en couleurs dans MonProfil
$('td:contains("Connaissance des Monstres")').parent().css("background-color","cefeda");
$('td:contains("Identification des Trésors")').parent().css("background-color","fec8f1");
$('td:contains("Limier")').parent().css("background-color","f9ffbc");
$('td:contains("Dur")').parent().css("background-color","f9ffbc");
//fait apparaitre "Grand Maître" en Gras dans Mon Profil
$('td:contains("(Grand Maître)")').css("font-weight", "bold");
$( document ).ready(function() {
displayNextLevel();
buildSkillsStats();
buildSkillsMagie();
addToolTipsTalents();
// Met en rouge le malus de concentration
if (skills.CON < 0) {
$('td:contains("Bonus de concentration")').css("color","red");
} else {
$('td:contains("Bonus de concentration")').css("color","green" , "font-weight", "bold");
}
});
function addToolTipsTalents() {
//================================================================================================================
/// INFO BULLES TALENTS (au survol de la souris sur une comp ou tech, fait le calcul si c'est possible)
//=================================================================================================================
$('a:contains("Symphonie Intestinale")').prop('title',
'Apprenti...........ATT/ESQ/PER -' + Math.floor((skills.PV/30)) + "\n" +
'Compagnon...ATT/ESQ/PER -' + Math.floor((skills.PV/25)) + "\n" +
'Maître...............ATT/ESQ/PER -' + Math.floor((skills.PV/20)) + "\n" +
'Grand Maître..ATT/ESQ/PER -' + Math.floor((skills.PV/15))) ;
$('a:contains("Afflux Sanguin")').prop('title',
'Apprenti ' + Math.floor((skills.PV/30) ) + 'D3' + ' (' + Math.floor((skills.PV/30) )*2 + ')' + "\n" +
'Compagnon ' + Math.floor((skills.PV/25) ) + 'D3' + ' (' + Math.floor((skills.PV/25) )*2 + ')' + "\n" +
'Maître ' + Math.floor((skills.PV/20) ) + 'D3' + ' (' + Math.floor((skills.PV/20) )*2 + ')' + "\n" +
'Grand Maître ' + Math.floor((skills.PV/15) )+ 'D3' + ' (' + Math.floor((skills.PV/15) )*2 + ')') ;
$('a:contains("Appel des Ombres")').prop('title',
'Apprenti......' + ' MT +' + (skills.MTP/2)+ ' | ' + ' RT +0 ' + ' | ' + ' MP +0 ' + ' | ' + ' RT -' + (skills.RPP/2) + "\n" +
'Compagnon......' + ' MT +' + (skills.MTP)+ ' | ' + ' RT +0 '+ ' | ' + ' MP +0 '+ ' | ' + ' RP -' + (skills.RPP) + "\n" +
'Maître......' + ' MT +' + (skills.MTP)+ ' | ' + ' RT +' + (skills.RTP/2) + ' | ' + ' MP -' +(skills.MPP/2) + ' | ' + ' RP -' + (skills.RPP) + "\n" +
'Grand Maître......' + ' MT +' + (skills.MTP)+ ' | ' + ' RT +' + (skills.RTP)+ ' | ' + ' MP -' +(skills.MPP)+ ' | ' + ' RP -' + (skills.RPP));
$('a:contains("Appel de la Nature")').prop('title',
'Apprenti......' + ' MS +' + (skills.MSP/2)+ ' | ' + ' RS +0 ' + ' | ' + ' MC +0 ' + ' | ' + ' RC -' + (skills.RCP/2) + "\n" +
'Compagnon......' + ' MS +' + (skills.MSP)+ ' | ' + ' RS +0 '+ ' | ' + ' MC +0 '+ ' | ' + ' RC -' + (skills.RCP) + "\n" +
'Maître......' + ' MS +' + (skills.MSP)+ ' | ' + ' RS +' + (skills.RSP/2) + ' | ' + ' MC -' +(skills.MCP/2) + ' | ' + ' RC -' + (skills.RCP) + "\n" +
'Grand Maître......' + ' MS +' + (skills.MSP)+ ' | ' + ' RS +' + (skills.RSP)+ ' | ' + ' MC -' +(skills.MCP)+ ' | ' + ' RC -' + (skills.RCP));
$('a:contains("Alchimie")').prop('title',
'ATT ' + Math.floor(skills.ATT ) + 'D6' + skills.ATTP + ' (' + Math.floor(((+skills.ATT) )*3.5 + +skills.ATTP) + ')' + "\n" +
'......DEG......' + "\n" +
'Apprenti...... ' + Math.floor(skills.ATT ) + 'D6' + skills.ATTP + ' (' + Math.floor(((+skills.ATT) )*3.5 + +skills.ATTP) + ')' + "\n" +
'Compagnon...... ' + Math.floor((skills.PV/25) ) + 'D3' + ' (' + Math.floor((skills.PV/25) )*3.5 + ')' + "\n" +
'Maître...... ' + Math.floor((skills.PV/20) ) + 'D3' + ' (' + Math.floor((skills.PV/20) )*3.5 + ')' + "\n" +
'Grand Maître...... ' + Math.floor((skills.PV/15) )+ 'D3' + ' (' + Math.floor((skills.PV/15) )*3.5 + ')') ;
$('a:contains("Renforcement magique")').prop('title',
'Apprenti......' + ' MM +' + (skills.MMP/2)+ ' | ' + ' RM +0 ' + ' | ' + ' MR +0 ' + ' | ' + ' RR -' + (skills.RCP/2) + "\n" +
'Compagnon......' + ' MM +' + (skills.MMP)+ ' | ' + ' RM +0 '+ ' | ' + ' MR +0 '+ ' | ' + ' RR -' + (skills.RCP) + "\n" +
'Maître......' + ' MM +' + (skills.MMP)+ ' | ' + ' RM +' + (skills.RMP/2) + ' | ' + ' MR -' +(skills.MRP/2) + ' | ' + ' RR -' + (skills.RRP) + "\n" +
'Grand Maître......' + ' MM +' + (skills.MMP)+ ' | ' + ' RM +' + (skills.RMP)+ ' | ' + ' MR -' +(skills.MRP)+ ' | ' + ' RR -' + (skills.RRP));
$('a:contains("Connaissance des Monstres")').prop('title', 'portée : ' + (Math.floor((+skills.PER)+(+skills.PERM)+(+skills.PERP))));
$('a:contains("Projectile")').prop('title',
'ATT ' + Math.floor(((skills.PER/2 + skills.ATT/2)) - Math.max(0,(2/4-0))) + 'D6 +' + Math.floor(skills.PERM/2 + skills.ATTM/2 ) + '---> ' +
(Math.floor((((skills.PER/2 + skills.ATT/2)) - Math.max(0,2/4-0)))*3.5 + Math.floor(skills.PERM/2 + skills.ATTM/2 )) + "\n" +
'DEG ' + Math.floor((skills.PER/2 + skills.ATT/2)) + 'D3 +' + (skills.ATTM/2 + skills.PERM/2 ) + '---> ' +
((Math.floor((skills.PER/2 + skills.ATT/2)))*2 + Math.floor(skills.PERM/2 + skills.ATTM/2 )) + ' (' +
((((Math.floor((skills.PER/2 + skills.ATT/2)))*2 + Math.floor(skills.PERM/2 + skills.ATTM/2 ))) + ((((Math.floor((skills.PER/2 + skills.ATT/2)))*2 + Math.floor(skills.PERM/2 + skills.ATTM/2 )))/2)) + ')' + "\n" +
'Divisé par 2 si résisté');
$('a:contains("Baratin")').prop('title',
'Apprenti......' + Math.floor((1)+((skills.PER)/5 + (skills.REG)/5))+'D6' + ' (' + Math.floor(1+((skills.PER)/5 + (skills.REG)/5)*3.5) + ')' + "\n" +
'Compagnon......' + Math.floor((1)+((skills.PER)/4 + (skills.REG)/4)) +'D6' + ' (' + Math.floor(1+((skills.PER)/4 + (skills.REG)/4)*3.5) + ')' + "\n" +
'Maître ......' + Math.floor((1)+((skills.PER)/3 + (skills.REG)/3))+'D6' + ' (' + Math.floor(1+((skills.PER)/3 + (skills.REG)/3)*3.5) + ')' + "\n" +
'Grand Maître ......' + Math.floor((1)+((skills.PER)/2 + (skills.REG)/2))+'D6' + ' (' + Math.floor(1+((skills.PER)/2 + (skills.REG)/2)*3.5) + ')');
$('a:contains("Chirurgie")').prop('title',
'Apprenti...... ' + Math.floor((3/2)*skills.REG) + 'D3'+ ' (' + Math.floor((3/2)*skills.REG) *2 + ')' + "\n" +
'Compagnon...... ' + Math.floor((4/2)*skills.REG) + 'D3' + ' (' + Math.floor((4/2)*skills.REG) *2 + ')' + "\n" +
'Maître...... ' + Math.floor((5/2)*skills.REG) + 'D3' + ' (' + Math.floor((5/2)*skills.REG) *2 + ')' + "\n" +
'Grand Maître...... ' + Math.floor((6/2)*skills.REG) + 'D3' + ' (' + Math.floor((6/2)*skills.REG) *2 + ')');
$('a:contains("Soins")').prop('title',
'Apprenti...... ' + '+' + Math.floor(+skills.REG*1 + +skills.REGM) + ' PV' + "\n" +
'Compagnon...... ' + '+' + Math.floor(+skills.REG*2 + +skills.REGM) + ' PV' +"\n" +
'Maître...... ' + '+' + Math.floor(+skills.REG*3 + +skills.REGM) + ' PV' + "\n" +
'Grand Maître...... ' + '+' + Math.floor(+skills.REG*4 + +skills.REGM) + ' PV');
$('a:contains("Téléportation")').prop('title',
'Apprenti...... ' + 'Portée horizontale : ' + ((Math.floor(Math.sqrt(19+8*skills.MM*1/5+3))-7)/2 + 20 + + skills.PER + +skills.PERM ) + ' Portée verticale : ' +((Math.floor(((Math.sqrt(19+8*skills.MM*1/5+3))-7)/2/3+3))) + "\n" +
'Compagnon...... ' + 'Portée horizontale : ' + ((Math.floor(Math.sqrt(19+8*skills.MM*1.1/5+3))-7)/2 + 20 + + skills.PER + +skills.PERM ) + ' Portée verticale : ' +((Math.floor(((Math.sqrt(19+8*skills.MM*1.1/5+3))-7)/2/3+3))) + "\n" +
'Maître...... ' + 'Portée horizontale : ' + ((Math.floor(Math.sqrt(19+8*skills.MM*1.2/5+3))-7)/2 + 20 + + skills.PER + +skills.PERM ) + ' Portée verticale : ' +((Math.floor(((Math.sqrt(19+8*skills.MM*1.2/5+3))-7)/2/3+3))) + "\n" +
'Grand Maître...... ' + 'Portée horizontale : ' + ((Math.floor(Math.sqrt(19+8*skills.MM*1.3/5+3))-7)/2 + 20 + + skills.PER + +skills.PERM ) + ' Portée verticale : ' +((Math.floor(((Math.sqrt(19+8*skills.MM*1.3/5+3))-7)/2/3+3))));
$('a:contains("Double Dague")').prop('title',
'Grand Maître : 1ere attaque : ' + skills.ATT+ 'D6'+ '+' + skills.ATTP*1+ '+' + +skills.ATTM +
'2eme attaque : ' + Math.floor(skills.ATT-+skills.ATT*0.25) + 'D6'+ '+' + Math.floor(skills.ATTP*1*0.25)+ '+' + Math.floor(skills.ATTM*0.25) +
'3eme attaque : ' + Math.floor(skills.ATT-+skills.ATT*0.5) + 'D6'+ '+' + Math.floor(skills.ATTP*1*0.5)+ '+' + Math.floor(skills.ATTM*0.5) +
'4eme attaque : ' + Math.floor(skills.ATT-+skills.ATT*0.75) + 'D6'+ '+' + Math.floor(skills.ATTP*1*0.75)+ '+' + Math.floor(skills.ATTM*0.75) +
'Dégâts : ' + skills.DEG + 'D3'+ '+' + Math.floor(skills.DEGP*1.5)+ '+' + Math.floor(skills.DEGM)) ;
$('a:contains("Flairer le gibier")').prop('title',
'Apprenti...... ' + 'Portée : ' + 1.5*(+skills.PER+(+skills.PERP)) + "\n" +
'Compagnon......' + 'Portée : '+ 2*(+skills.PER+(+skills.PERP)) + "\n" +
'Maître...... ' + 'Portée : ' + 2.5*(+skills.PER+(+skills.PERP)) + "\n" +
'Grand Maître...... ' + 'Portée : ' + 3*(+skills.PER+(+skills.PERP)) + "\n" );
$('a:contains("Jet de Pierres")').prop('title',
'Apprenti...... ' + 'Portée : 1' + "\n" +
'Compagnon......' + 'Portée : 2' + "\n" +
'Maître...... ' + 'Portée : 3' + "\n" +
'Grand Maître...... ' + 'Portée : 4' );
$('a:contains("Attaque Défensive")').prop('title',
'Apprenti.............. ' + 'ESQ +' + Math.floor(Math.max(skills.ESQ/3,1)) + " | ATT -1\n" +
'Compagnon....... ' + 'ESQ +' + Math.floor(Math.max(skills.ESQ/2.5,2)) + " | ATT -1\n" +
'Maître................... ' + 'ESQ +' + Math.floor(Math.max(skills.ESQ/2,3)) + " | ATT -1\n" +
'Grand Maître..... ' + 'ESQ +' + Math.floor(Math.max(skills.ESQ/1.5,4)) + " | ATT -1");
$('a:contains("Forme spectrale")').prop('title',
'Apprenti...... ' + 'ESQ +3 ARMM +1' + '.... total ARMM après conversion : ' + (Math.floor(skills.ARMP*0.15)+(+skills.ARMM)+1) + "\n" +
'Compagnon......' + 'ESQ +4 ARMM +2' + '.... total ARMM après conversion : ' + (Math.floor(skills.ARMP*0.20)+(+skills.ARMM)+2) + "\n" +
'Maître...... ' + 'ESQ +5 ARMM +3' + '.... total ARMM après conversion : ' + (Math.floor(skills.ARMP*0.25)+(+skills.ARMM)+3) + "\n" +
'Grand Maître...... ' + 'ESQ +6 ARMM +4' + '.... total ARMM après conversion : ' + (Math.floor(skills.ARMP*0.30)+(+skills.ARMM)+4));
$('a:contains("Herboriser")').prop('title',
'Apprenti...... ' + 'Portée : ' + 1.5*(+skills.PER+(+skills.PERP)) + " (Fleur,Baie) " + "\n" +
'Compagnon......' + 'Portée : '+ 2*(+skills.PER+(+skills.PERP)) + ' (Fleur,Baie, Plante grasse, Champignon)' + "\n" +
'Maître...... ' + 'Portée : ' + 2.5*(+skills.PER+(+skills.PERP)) + ' (Fleur,Baie, Plante grasse, Champignon, Mousse)' + "\n" +
'Grand Maître...... ' + 'Portée : ' + 3*(+skills.PER+(+skills.PERP)) + ' (tout)');
$('a:contains("Rafale")').prop('title',
'FULL' + "\n" +
'Apprenti...... ' + 'DEG ' + skills.DEG + 'D3' + skills.DEGM + ' (pas de malus de REG)' + "\n" +
'Compagnon......' + 'DEG ' + skills.DEG + 'D3' + skills.DEGM + ' (Malus REG : ' + (Math.floor(skills.DEG/2)) + 'D3' + ')' + "\n" +
'Maître...... ' + 'DEG ' + skills.DEG + 'D3' + skills.DEGM + ' (Malus REG : ' + (Math.floor(skills.DEG)) + 'D3' + ')' + "\n" +
'Grand Maître...... ' + 'DEG ' + skills.DEG + 'D3' + skills.DEGM + ' (Malus REG : ' + (Math.floor(skills.DEG*2)) + 'D3' + ')' + "\n" +
'RES' + "\n" +
'Apprenti...... ' + 'DEG ' + (Math.floor(skills.DEG*0.3)) + 'D3' + skills.DEGM + ' (pas de malus de REG)' + "\n" +
'Compagnon......' + 'DEG ' + (Math.floor(skills.DEG*0.4)) + 'D3' + skills.DEGM + ' (pas de malus de REG)' + "\n" +
'Maître...... ' + 'DEG ' + (Math.floor(skills.DEG*0.5)) + 'D3' + skills.DEGM + ' (Malus REG : ' + (Math.floor(skills.DEG/2)) + 'D3' + ')' + "\n" +
'Grand Maître...... ' + 'DEG ' + (Math.floor(skills.DEG*0.6)) + 'D3' + skills.DEGM + ' (Malus REG : ' + (Math.floor(skills.DEG) + 'D3' + ')')) ;
// DONS
$('a:contains("Dans")').prop('title', 'ATTM + ' + skills.danslmil);
$('a:contains("Limier")').prop('title', 'PERM + ' + skills.limier);
$('a:contains("Chef")').prop('title', 'Bonus Cuisine : + ' + 5*skills.grandchef);
$('a:contains("Dur à cuir")').prop('title', '+ ' + skills.duracuir*5 + ' PV');
};
function displayNextLevel() {
// calcul du nombre d'entrainements pour passer au lvl sup
var gobExperience = $('th:contains("Expérience")').parent().closest('tr');
var tdExp = $('td:first', gobExperience);
var sExp = tdExp.html();
res = sExp.match(/: (\d+) \((\d+) PI \| Niveau (\d+) : (\d+)/);
var nbTrain = Math.ceil((res[4].valueOf() - res[2].valueOf())/( 2 * res[1].valueOf()));
var pExp = sExp.indexOf(")");
var sTrain = (nbTrain > 1) ? " entraînements" : " entraînement";
tdExp.html(sExp.substr(0, pExp + 1 ) + " ---> Il te reste " + nbTrain + sTrain + sExp.substr(pExp + 1));
};
function buildSkillsStats() {
// Recup position et PER
var gobPosition = $('th:contains("Position")').parent().closest('tr').text();
var pos = gobPosition.match(/X = ([-]*\d+) \| Y = ([-]*\d+) \| N = ([-]*\d+)/);
skills.X = pos[1];
skills.Y = pos[2];
skills.N = pos[3];
var per = gobPosition.match(/Perception......: (\d+)/);
skills.PER = per[1];
var perp = gobPosition.match(/Cases (\W(\d+))/);
skills.PERP = perp[1];
var perm = gobPosition.match(/Cases (\W(\d+))(\W(\d+))/);
skills.PERM = perm[3];
// Recup de la concentration (pour la modif css plus haut)
var concentration = $('th:contains("Affinités")').parent().closest('tr').text();
var conc = concentration.match(/Bonus de concentration : (\d+)/);
skills.CON = conc[1];
// Recup de la dla
var gobdla = $('th:contains("Echéance du Tour")').parent().closest('tr').text();
var dla = gobdla.match(/(\d+)/);
skills.DLA = dla[1];
// Recup PV, PVMax et REG
var gobSante = $('th:contains("Santé")').parent().closest('tr');
var tdSante = $('td:first', gobSante);
res = tdSante.html().split(/<BR>/i); //gobSante.match(/: (\d+)([^:]+): (\d+)([^:]+): (\d+)/);
skills.PV = res[0].match(/: (\d+)/)[1];
skills.PVMax = res[1].match(/: (\d+)/)[1];
var regensgob = $('td:contains("Régénération")').parent().closest('tr').text();
var reg = regensgob.match(/Régénération..: (\d+)/);
skills.REG = reg[1];
var regp = regensgob.match(/D3(\W(\d+))/);
skills.REGP = regp[1];
var regm = regensgob.match(/D3(\W(\d+))(\W(\d+))/);
skills.REGM = regm[3];
/// recup DEG
var degatsgob = $('div:contains("Dégâts")').parent().closest('tr').text();
var deg = degatsgob.match(/: (\d+)/);
skills.DEG = deg[1];
var degp = degatsgob.match(/D3(\W(\d+))/);
skills.DEGP = degp[1];
var degm = degatsgob.match(/D3(\W(\d+))(\W(\d+))/);
skills.DEGM = degm[3];
/// recup ARM
var armuresgob = $('div:contains("Armure")').parent().closest('tr').text();
var armp = armuresgob.match(/Armure.....: (\d+)/);
skills.ARMP = armp[1];
var armm = armuresgob.match(/Armure.....: (\d+)(\W)(\d+)/);
skills.ARMM = armm[3];
/// recup ATT
var attaquesgob = $('td:contains("Attaque")').parent().closest('tr').text();
var att = attaquesgob.match(/Attaque.....: (\d+)/);
skills.ATT = att[1];
var attp = attaquesgob.match(/Attaque.....: (\d+)D6(\W(\d+))/);
skills.ATTP = attp[2];
var attm = attaquesgob.match(/Attaque.....: (\d+)D6(\W(\d+))(\W(\d+))/);
skills.ATTM = attm[4];
/// recup ESQ
var esquivesgob = $('td:contains("Esquive")').parent().closest('tr').text();
var esq = esquivesgob.match(/Esquive....: (\d+)/);
skills.ESQ = esq[1];
var esqp = esquivesgob.match(/Esquive....: (\d+)D6(\W(\d+))(\W)(\d+)/);
skills.ESQP = esqp[2];
var esqm = esquivesgob.match(/Esquive....: (\d+)D6(\W)(\d+)(\W(\d+))/);
skills.ESQM = esqm[4];
};
function getDon(don) {
try {
return $('td:contains("' + don + '")').next('td').text().match(/(\d) (\W) (\d)/)[1];
} catch (err) {
return null;
}
};
function buildSkillsMagie() {
//recup dons
skills.danslmil = getDon("Dans");
skills.limier = getDon("Limier");
skills.grandchef = getDon("Grand Chef");
skills.duracuir = getDon("Dur à cuir");
///recup Magies (a finir)
skills.RM = $('td.invisible:contains("(RM)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.RMP = $('td.invisible:contains("(RM)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.RMM = $('td.invisible:contains("(RM)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.MM = $('td.invisible:contains("(MM)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.MMP = $('td.invisible:contains("(MM)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.MMM = $('td.invisible:contains("(MM)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.RS = $('td.invisible:contains("(RS)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.RSP = $('td.invisible:contains("(RS)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.RSM = $('td.invisible:contains("(RS)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.MS = $('td.invisible:contains("(MS)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.MSP = $('td.invisible:contains("(MS)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.MSM = $('td.invisible:contains("(MS)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.RT = $('td.invisible:contains("(RT)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.RTP = $('td.invisible:contains("(RT)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.RTM = $('td.invisible:contains("(RT)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.MT = $('td.invisible:contains("(MT)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.MTP = $('td.invisible:contains("(MT)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.MTM = $('td.invisible:contains("(MT)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.RC = $('td.invisible:contains("(RC)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.RCP = $('td.invisible:contains("(RC)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.RCM = $('td.invisible:contains("(RC)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.MC = $('td.invisible:contains("(RT)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.MCP = $('td.invisible:contains("(RT)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.MCM = $('td.invisible:contains("(RT)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.RP = $('td.invisible:contains("(RP)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.RPP = $('td.invisible:contains("(RP)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.RPM = $('td.invisible:contains("(RP)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.MP = $('td.invisible:contains("(MP)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.MPP = $('td.invisible:contains("(MP)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.MPM = $('td.invisible:contains("(MP)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.RR = $('td.invisible:contains("(RR)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.RRP = $('td.invisible:contains("(RR)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.RRM = $('td.invisible:contains("(RR)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
//manque MR
};
}
//================================================================================================================
/// Affichage des carats
//================================================================================================================
const regMinerai = /^(\D*)(\d+)(\D*)$/
const qualites = {
'Médiocre': 2,
'Moyenne': 2.75,
'Normale': 3.5,
'Bonne': 4.25,
'Exceptionnelle': 5
};
$( document ).ready(function() {
$('a:contains("taille")').each(function() {
arr = this.text.match(regMinerai);
carats = arr[2] * qualites[arr[3].split(' ')[3]];
this.text = arr[0] + ' [Carats = ' + carats + ']'
})
});
//====================================================================================
/// Décocher par défaut la case activer sa DLA sur la page de Log-In piqué a Seishin
//====================================================================================
(function() {
'use strict';
$('input[type=checkbox][name=aDLA]').prop( "checked", false);
})();
//===================================================
// Décocher par défaut le vestaire piqué a Seishin
//===================================================
(function() {
'use strict';
$('input[type=checkbox][name=VESTIAIRE]').prop( "checked", false );
})();
//=================================================================================================================================
///Info Bulle CdM ( a faire une fois la base de données cdm solide, prochainement. Par contre ça risque d'alourdir le bouzin ^^)
//=================================================================================================================================
$( document ).ready(function() {
$('a:contains("Abishaii Bleu")').prop('title', 'XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX');
});
//========================================================================================================
///fonction RemplaceText () pour remplacer le texte et ajouter des icones dans Gobland (inspiré par Lordslair))
//========================================================================================================
if ($(location).attr('href').match(/http:\/\/(.*\.)?gobland\.fr\/Vue\.php|http:\/\/(.*\.)?gobland\.fr\/ProfilPerso\.php/i)) {
const words = {
// Clan et CM
'((286|388|386|387|164|385|405|393|46237|95720|130171|46237|47717|95720|130171|53|101759|101|50127|95982|108284|100794|94082|108|121|129|141|180|48520|66516|69423|119472|32954|))' : '🥰',
// pour forcer une présentation de Gobzilla dans la vue
'Table des Améliorations' : 'Table des Améliorations ---- GobZilla',
// Monstres à cuisiner (insectes)
'Ankheg ' : 'Ankheg 👨🍳 ',
'Araignée Géante ' : 'Araignée Géante 👨🍳 ',
'Brontoscorpion ' : 'Brontoscorpion 👨🍳 ',
'Fourmi Guerrière ' : 'Fourmi Guerrière 👨🍳 ',
'Fourmi Ouvrière ' : 'Fourmi Ouvrière 👨🍳 ',
'Guêpe géante ' : 'Guêpe géante 👨🍳 ',
'Limace Géante ' : ' Limace Géante 👨🍳 ',
'Mante religieuse géante ' : 'Mante religieuse géante 👨🍳 ',
'Meganeura ' : 'Meganeura 👨🍳 ',
'Mille-pattes géant ' : 'Mille-pattes géant 👨🍳 ',
'Nuage dinsectes ' : 'Nuage dinsectes 👨🍳 ',
'Nuée de Vermines ' : 'Nuée de Vermines 👨🍳 ',
'Reine Fourmi ' : 'Reine Fourmi 👨🍳 ',
'Scarabée Géant ' : 'Scarabée Géant 👨🍳 ',
'Strige ': 'Strige 👨🍳 ',
'Thri-kreen ': 'Thri-kreen 👨🍳 ',
// VLC des monstres
'Cerbère ' : 'Cerbère 👁️👁️👁️ ',
'Colosse de pierre ' : 'Colosse de pierre 👁️👁️👁️ ',
'Dryade ' : 'Dryade 👁️👁️👁️ ',
'Illithid ' : 'Illithid 👁️👁️👁️ ',
'Dryade ' : 'Dryade 👁️👁️👁️ ',
'Abishaii Multicolore ' : 'Abishaii Multicolore 👁️👁️ ',
'Automate ' : 'Automate 👁️👁️ ',
'Barghest ' : 'Barghest 👁️👁️ ',
'Behemoth ' : 'Behemoth 👁️👁️ ',
'Cattis ' : 'Cattis 👁️👁️ ' ,
'Chimère ' : 'Chimère 👁️👁️ ' ,
'Dao' : 'Dao 👁️👁️',
'Djinn ' : 'Djinn 👁️👁️ ',
'Ent ' : 'Ent 👁️👁️ ',
'Hellrot ' : 'Hellrot 👁️👁️ ',
'Horreur chasseresse ' : 'Horreur chasseresse 👁️👁️ ',
'Légion-en-peine ' : 'Légion-en-peine 👁️👁️ ',
'Marid ' : 'Marid 👁️👁️ ',
'Oni ' : 'Oni 👁️👁️ ',
'Rakshah ' : 'Rakshah 👁️👁️ ',
'Shai ' : 'Shai 👁️👁️ ',
'Sphinx ' : 'Sphinx 👁️👁️ ',
'Taureau démoniaque ' : 'Taureau démoniaque 👁️👁️ ',
'Vampire ' : 'Vampire 👁️👁️ ',
'Vampire Archaïque ' : 'Vampire Archaïque 👁️👁️ ',
'Abishaii Blanc ' : 'Abishaii Blanc 👁️ ',
'Abishaii Bleu ' : 'Abishaii Bleu 👁️ ',
'Abishaii Noir ' : 'Abishaii Noir 👁️ ',
'Abishaii Rouge ' : 'Abishaii Rouge 👁️ ',
'Abishaii Vert ' : 'Abishaii Vert 👁️ ',
'Ame-en-peine ' : 'Ame-en-peine 👁️ ',
'Béhir ' : 'Béhir 👁️ ',
'Bulette ' : 'Bulette 👁️ ',
'Crapaud démoniaque ' : 'Crapaud démoniaque 👁️ ',
'Danseur de Mort ' : 'Danseur de Mort 👁️ ',
'Diablotin ' : 'Diablotin 👁️',
'Elémentaire de Terre ' : 'Elémentaire de Terre 👁️ ',
"Elémentaire d'eau " : "Elémentaire d'eau 👁️ ",
'Elémentaire de Feu ' : 'Elémentaire de Feu 👁️ ',
'Fungus Géant ' : 'Fungus Géant 👁️ ',
'Géant des Nuages ' : 'Géant des Nuages 👁️ ',
'Géant des Tempêtes ' : 'Géant des Tempêtes 👁️ ',
'Géant du Froid ' : 'Géant du Froid 👁️ ',
'Gnome de pierre ' : 'Gnome de pierre 👁️ ',
'Gorgone ' : 'Gorgone 👁️ ',
'Goule ' : 'Goule 👁️ ',
'Griffon ' : 'Griffon 👁️ ',
'Guêpe géante ' : 'Guêpe géante 👁️ ',
'Hippogriffe ' : 'Hippogriffe 👁️ ',
'Homothérium ' : 'Homothérium 👁️ ',
'Incube ' : 'Incube 👁️ ',
'Lémure ' : 'Lémure 👁️ ',
'Molosse Satanique ' : 'Molosse Satanique 👁️ ',
'Ombre ' : 'Ombre 👁️ ',
'Larbin démoniaque ' : 'Larbin démoniaque 👁️ ',
'Plante Carnivore ' : 'Plante Carnivore 👁️ ',
'Ombre ' : 'Ombre 👁️ ',
'Salamandre ' : 'Salamandre 👁️ ',
'Ombre ' : 'Ombre 👁️ ',
'Squelette ' : 'Squelette 👁️ ',
'Spectre ' : 'Spectre 👁️ ',
'Sylphide ' : 'Sylphide 👁️ ',
'Tertre errant ' : 'Tertre errant 👁️ ',
'Sylphide ' : 'Sylphide 👁️ ',
'Troglodyte ' : 'Troglodyte 👁️ ',
'Troll ' : 'Troll 👁️ ',
'Sylphide ' : 'Sylphide 👁️ ',
'Zombi ' : 'Zombi 👁️ ',
'Amibe Géante ' : 'Amibe Géante 🙈 ',
'Anaconda des Catacombes ' : 'Anaconda des Catacombes 🙈 ',
'Araignée Géante ' : 'Araignée Géante 🙈 ' ,
'Arbre à gobelins ' : 'Arbre à gobelins 🙈 ',
'Babélien ' : 'Babélien 🙈 ',
'Basilic ' : 'Basilic 🙈 ',
'Boggart ' : 'Boggart 🙈 ',
'Bondin ' : 'Bondin 🙈 ',
'Brontoscorpion ' : 'Brontoscorpion 🙈 ',
'Caillouteux ' : 'Caillouteux 🙈 ',
'Centaure ' : 'Centaure 🙈 ' ,
'Chauve-souris Géante ' : 'Chauve-souris Géante 🙈 ',
'Cockatrice ' : 'Cockatrice 🙈 ',
'Crapaud Géant ' : 'Crapaud Géant 🙈 ',
'Croquemitaine ' : 'Croquemitaine 🙈 ',
'Cyclope ' : 'Cyclope 🙈 ',
'Dumb ' : 'Dumb 🙈 ',
'Elfe ' : 'Elfe 🙈 ',
'Escargot ' : 'Escargot 🙈 ',
'Ettercap ' : 'Ettercap 🙈 ',
'Ettin ' : 'Ettin 🙈 ',
'Eusmilus ' : 'Eusmilus 🙈 ',
'Fantôme ' : 'Fantôme 🙈 ',
'Feu follet ' : 'Feu follet 🙈 ',
'Fongoïde ' : 'Fongoïde 🙈 ',
'Furgolin ' : 'Furgolin 🙈 ',
'Géant des Collines ' : 'Géant des Collines 🙈 ',
'Géant du Feu ' : 'Géant du Feu 🙈 ' ,
'Gelée ocre ' : 'Gelée ocre 🙈 ',
'Glouton ' : 'Glouton 🙈 ',
'Glouton Sanguinaire ' : 'Glouton Sanguinaire 🙈 ',
'Gnome Artificier ' : 'Gnome Artificier 🙈 ',
'Goblours ' : 'Goblours 🙈 ',
'Golem de Fer ' : 'Golem de Fer 🙈 ',
'Golem de Pierre ' : 'Golem de Pierre 🙈',
'Gremlins ' : 'Gremlins 🙈 ',
'Harpie ' : 'Harpie 🙈 ',
'Hippopotame furieux ' : 'Hippopotame furieux 🙈 ',
'Hurleur ' : 'Hurleur 🙈 ',
'Kappa ' : 'Kappa 🙈 ',
'Kobold ' : 'Kobold 🙈 ',
'Lapin Sanguinaire ' : 'Lapin Sanguinaire 🙈 ',
'Lézard Géant ' : 'Lézard Géant 🙈 ',
'Licorne ' : 'Licorne 🙈 ',
'Limace Géante ' : ' Limace Géante 🙈 ',
'Loup-garou ' : 'Loup-garou 🙈 ',
'Lutin ' : 'Lutin 🙈 ',
'Macrauchenia ' : 'Macrauchenia 🙈 ' ,
'Mante religieuse géante ' : 'Mante religieuse géante 🙈 ',
'Manticore ' : 'Manticore 🙈 ',
'Marmotte ' : 'Marmotte 🙈 ' ,
'Méduse ' : 'Méduse 🙈 ',
'Meganeura ' : 'Meganeura 🙈 ',
'Megantereon ' : 'Megantereon 🙈 ',
'Méphite Aérien ' : 'Méphite Aérien 🙈 ',
'Méphite Aqueux ' : 'Méphite Aqueux 🙈 ' ,
'Méphite de Glace ' : 'Méphite de Glace 🙈 ',
'Méphite de Verre ' : 'Méphite de Verre 🙈 ',
'Méphite Magmatique ' : 'Méphite Magmatique 🙈 ',
'Méphite Sulfureux ' : 'Méphite Sulfureux 🙈 ',
'Mimique ' : 'Mimique 🙈 ',
'Minotaure ' : 'Minotaure 🙈 ',
"Nuage d'insectes " : "Nuage d'insectes 🙈 ",
'Nuée de Vermines ' : 'Nuée de Vermines 👨🙈 ',
'Oiseau-Tonnerre ' : 'Oiseau-Tonnerre 🙈 ',
'Onyx ' : 'Onyx 🙈 ' ,
'Orque Noir ' : 'Orque Noir 🙈 ',
'Otyugh ' : 'Otyugh 🙈 ',
'Ours des Montagnes ' : 'Ours des Montagnes 🙈 ',
'Pégase ' : 'Pégase 🙈 ',
'Rat-garou ' : 'Rat-garou 🙈 ',
'Rat Géant ' : 'Rat Géant 🙈 ',
'Rocketeux ' : 'Rocketeux 🙈 ',
'Sagouin ' : 'Sagouin 🙈 ',
'Scarabée Géant ' : 'Scarabée Géant 🙈 ',
'Scorpion Géant ' : 'Scorpion Géant 🙈 ',
'Slaad ' : 'Slaad 🙈 ',
'Strige ': 'Strige 👨🙈 ',
'Sprigan ' : 'Sprigan 🙈 ',
'Thri-kreen ' : 'Thri-kreen 🙈 ',
'Tigre-garou ' : 'Tigre-garou 🙈 ',
'Titan ' : 'Titan 🙈 ',
'Tortue Carnivore ' : 'Tortue Carnivore 🙈 ',
'Tutoki ': 'Tutoki 🙈 ',
'Viverne ' : 'Viverne 🙈 ',
'Worg ' : 'Worg 🙈 ',
'Yéti ' : 'Yéti 🙈 ',
// Icônes équipement
'Potion' : 'Potion 🧪',
'Parchemin' : 'Parchemin 📜📜📜📜📜📜📜alerte📜📜📜📜📜📜📜📜📜📜',
'CT| Canines de Trõll' : ' CT 💰',
'Anneau' : 'Anneau 💍 ',
'Bouclier' : 'Bouclier 🛡️',
'Corps' : 'Corps ☠️',
'Arme 1 Main' : 'Arme 1 main 🗡️',
'Outil' : "Outil 🔧",
'Nourriture' : 'Nouriture 🍔',
'Rondin' : 'Rondin 🪵',
// Dans Mon Profil
'Santé' : 'Santé ❤️',
'Echéance du Tour' : 'Echéance du Tour⏱️',
'Combat' : 'Combat ⚔️',
'Affinités' : 'Affinités ✨',
'Position' : 'Position 🧭',
'Description' : 'Description 📜',
'Expérience' : 'Expérience 🇽🇵',
'Actions programmées': 'Actions programmées ⏰',
'Suivants' : 'Suivants 🦙',
'Empathie' : 'Empathie 🫂',
'Sociale' : 'Sociale 🫂',
'Flux Obscur' : 'Flux Obscur ⚫',
'Voile Obscur' : 'Voile Obscur ⚫',
'Magie' : 'Magie 🪄',
'Psychique' : 'Psychique 🧠',
'Physique' : 'Physique 💪',
'Corporelle' : 'Corporelle💪',
'Technologie' : 'Technologie ⚙️',
// Diverses icônes
'Baguette' : 'Baguette 🪄 ',
'Escalier' : 'Escalier 🪜 ',
'Baie' : 'Baie 🫐',
//'Arbre' : 'Arbre 🌳',
'Fleur' : 'Fleur 🌷',
'Zone de ténèbres' : 'Zone de ténèbres 🌫️',
'Porte' : 'Porte 🚪',
'':''
};
const tagsWhitelist = ['PRE', 'BLOCKQUOTE', 'CODE', 'INPUT', 'BUTTON', 'TEXTAREA'];
function prepareRegex(string) {
return string.replace(/(\({2}|([\[\]\^\&\$\.\?\/\\\+\{\}])|\)$)/g, '\\$1');
}
function isTagOk(tag) {
return tagsWhitelist.indexOf(tag) === -1;
}
function enhanceText() {
'use strict';
// enclenchement des remplacements et ajouts d'icones
var regexs = [],
replacements = [],
rIsRegexp = /^\/(.+)\/([gim]+)?$/,
word, text, texts, i, userRegexp;
for (word in words) {
if ( typeof word === 'string' && words.hasOwnProperty(word) ) {
userRegexp = word.match(rIsRegexp);
// add the search/needle/query
if (userRegexp) {
regexs.push(new RegExp(userRegexp[1], 'g'));
} else {
regexs.push(
new RegExp(prepareRegex(word).replace(/\\?\*/g, function (fullMatch) {
return fullMatch === '\\*' ? '*' : '[^ ]*';
}), 'g')
);
}
replacements.push(words[word]);
}
}
texts = document.evaluate('//body//text()[ normalize-space(.) != "" ]', document, null, 6, null);
for (i = 0; text = texts.snapshotItem(i); i += 1) {
if ( tagsWhitelist.indexOf(text.parentNode.tagName) ) {
regexs.forEach(function (value, index) {
text.data = text.data.replace( value, replacements[index] );
});
}
}
};
$( document ).ready(function() {
enhanceText();
});
};
//========================================================================================================================================================================================================
/// Fonction principale pour remplacer le texte et ajouter des icones dans Gobland (inspiré par Lordslair) FIN
//========================================================================================================================================================================================================