GobZilla

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)

Versión del día 08/11/2022. Echa un vistazo a la versión más reciente.

// ==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/Vue.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/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
// @require        http://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.js
// @copyright      lordslair, Seishin et Death Métal (330)
// @author         DeathMétal 330
// @license        https://creativecommons.org/licenses/by-sa/4.0/
// @version        0.11.0
// ==/UserScript==






//==========================================================================================================================================================================================================================
// 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.
//==========================================================================================================================================================================================================================

var cells = {};
var niveau = 0;
var _X=0, _Y=0, _N=0;

			// ajoute les checkbox filtre en 1er (death métal)

			var div = $("<div id=\"vue2D\"></div>");
			div.insertBefore($("form[action*='newMail.php']"));

			//=======================================================================
			// Filters
			//=======================================================================
			$('<label />', { 'for': 'ckbNiveau', text: 'Même niveau' }).insertBefore(div);
			$("<input type=\"checkbox\" id=\"ckbNiveau\" name=\"ckbNiveau\" class=\"ckbFilter\" >").insertBefore(div);
			$('<label />', { 'for': 'ckbObject', text: 'Trésor' }).insertBefore(div);
			$("<input type=\"checkbox\" id=\"ckbObject\" name=\"ckbObject\" class=\"ckbFilter\" checked=\"checked\" >").insertBefore(div);
			$('<label />', { 'for': 'ckbMonster', text: 'Monstre' }).insertBefore(div);
			$("<input type=\"checkbox\" id=\"ckbMonster\" name=\"ckbMonster\" class=\"ckbFilter\" checked=\"checked\" >").insertBefore(div);
			$('<label />', { 'for': 'ckbPlace', text: 'Lieu' }).insertBefore(div);
			$("<input type=\"checkbox\" id=\"ckbPlace\" name=\"ckbPlace\" class=\"ckbFilter\" checked=\"checked\" >").insertBefore(div);
      $('<label />', { 'for': 'display2D', text: 'Vue 2D' }).insertBefore(div);
      $("<input type=\"checkbox\" id=\"ckbDisplay2D\" name=\"ckbDisplay2D\" class=\"ckbFilter\"checked=\"checked\">").insertBefore(div);


if ($(location).attr('href').match(/^http:\/\/(.*\.)?gobland\.fr\/vue\.php$/i))
{
	// Grab the Data
	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 reflieux = new Array();
	$("#TLIEUX > table > tbody > tr").each( function(){
		reflieux.push($(this).find('td').eq(1).text());
	});

	var url = "http://www.beauquis.fr/gobland/mindist.php?x="+_X+"&y="+_Y+"&n="+_N;
	$.getJSON( url, function( data ) {
		//alert(JSON.stringify(data));
		$.each( data, function( key, val ) {
			if (( reflieux.indexOf(val["idlieu"]) == -1 ) && (val["idlieu"] !== -1))
			{
				var row = "<tr bgcolor=\"#E0E0E0\"><td>" + val["distance"] ;
				row += "</td><td>" + val["idlieu"] ;
				row += "</td><td>" + val["nom"] ;
				row += "</td><td>" + val["type"] ;
				row += "</td><td>" + val["X"] ;
				row += "</td><td>" + val["Y"] ;
				row += "</td><td>" + val["N"] ;
				row += "</td></tr>";
				$(row).insertAfter("#TLIEUX table tr:last");
			}
  		});
	});

  var alllieux = {};

// ici j'ai viré (deathmétal)
//	chrome.storage.local.get(['display2D'], function(result) {
//		var displayView2D = result.display2D;
//          if (displayView2D) {

			// Compute grid limits
			var xmin = _X - _PX,
			    ymin = _Y - _PX,
			    ymax = _Y + _PX,
		        Dx = xmin * -1,
				Dy = ymin * -1;




			$("input.ckbFilter").change(function () {

        //affiche ou non la vue 2d (merci Glak)
        if($('#ckbDisplay2D').is(":checked"))
            $("#vue2D").show();
          else
            $("#vue2D").hide();


			    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
			//=============================================================
			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");

		    var width = 630,
		        height = 650,
		        leftgutter = 30,
		        bottomgutter = 20,
		        offset = 25,
		        nbCase = _PX * 2 + 1,
		        carre = Math.floor((width-offset-5) / nbCase),
		        R = Raphael("vue2D", width, height),
		        txt = {"font": '10px Fontin-Sans, Arial', stroke: "none", fill: "#000"};

		    // 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);
			}
//		}
//	});

	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();

	}

    for (var key in alllieux) {
        (function (st, key) {
            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);
    };
      };

  //j'ai viré (deathmétal)
  //	chrome.storage.local.get(['clanID', 'clanPWD'], function(result) {
	//	var clanID = result.clanID;
	//	var clanPWD = result.clanPWD;
  // et la suite du script original (ligne 836 à 961 car ça faisait foirer à pas forcement super utile)



//===============================================================================================================================================================================================
//                                                F I N   D E   L A   V U E   2 D
//===============================================================================================================================================================================================







//================================================================================================================
// 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.......")
  });


//================================================================================================================
/// 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 + ']'
  })
});


//================================================================================================================
/// CSS modofocator : modification du CSS (je sais pas pourquoi faut le mettre tout en haut)
//================================================================================================================

const raceGobs = ["Musculeux", "Mentalo", "Nodef", "Trad Scions", "Vis Yonnair", "Zozo Giste"];
const cdmNeeded = [
  "Diablotin", "Dryade", "Squelette", "Méphite de Feu", "Monstre Rouilleur",
  "Fourmi Ouvrière", "Homme-Lézard", "Ver Géant Carnivore", "Naga",
  "Nécrophage", "Guerrier Nain", "Ankheg", "Incube", "Gargouille",
  "Golem de Chair", "Lacodon", "Scorpion Géant", "Limace Géante", "Ogre",
  "Basilic", "Golem de Pierre", "Mille-pattes géant", "Gelée ocre",
  "Géant de Pierre", "Glouton Sanguinaire", "Effrit", "Reine Fourmi",
  "Larbin démoniaque", "Escargot", "Lémure", "Feu follet", "Tertre errant",
  "Ours hibou", "Marilith", "Babélien"];

/// Coloration des gros mobs
$("#TCREATURES > center > table > tbody > tr").each( function(){
  var race = $(this).find('td').eq(4).text();
  if (jQuery.inArray(race, raceGobs) < 0) {
    var lvl = $(this).find('td').eq(3).text();
    if (lvl > 40) {
      $(this).css("background-color","#f55442")
    } else if (lvl > 30) {
      $(this).css("background-color","#f59c42")
    }
  }
});

// Coloration des gobs
$.each(raceGobs, function(index, value) {
  $('td:contains("' + value + '")').parent().css("background-color","#ccccff");
});

// Coloration des besoins de CdM
$.each(cdmNeeded, function(index, value) {
  $('td:contains("' + value + '")').parent().css("background-color","#FF99FF");
  $('option:contains("' + value + '")').css("background-color","#FF99FF");
});

//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");

//================================================================================================================
/// INFO BULLES TALENTS (au survol de la sourie sur une comp ou tech, fait le calcul si c'est possible)
//=================================================================================================================

$( document ).ready(function() {
    $('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))) ;
});

$( document ).ready(function() {
    $('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 + ')') ;
});

$( document ).ready(function() {
    $('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));
});

$( document ).ready(function() {
    $('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 FINIR//
$( document ).ready(function() {
    $('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 + ')') ;
});

$( document ).ready(function() {
    $('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));
});

$( document ).ready(function() {
    $('a:contains("Connaissance des Monstres")').prop('title', 'portée : ' + (Math.floor((+skills.PER)+(+skills.PERM)+(+skills.PERP))));
});

$( document ).ready(function() {
    $('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é');
});

$( document ).ready(function() {
    $('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)  + ')');
});

$( document ).ready(function() {
    $('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 + ')');
});

$( document ).ready(function() {
    $('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');
});

$( document ).ready(function() {
    $('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))));
});

$( document ).ready(function() {
    $('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)) ;
});

$( document ).ready(function() {
    $('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"  );
});

$( document ).ready(function() {
    $('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'   );
});

$( document ).ready(function() {
    $('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");
});


$( document ).ready(function() {
    $('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));
});


$( document ).ready(function() {
    $('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)')   ;
});

$( document ).ready(function() {
    $('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
$( document ).ready(function() {
    $('a:contains("Dans")').prop('title', 'ATTM + ' + skills.danslmil);
});

$( document ).ready(function() {
    $('a:contains("Limier")').prop('title', 'PERM + ' + skills.limier);
});

$( document ).ready(function() {
    $('a:contains("Chef")').prop('title', 'Bonus Cuisine :  + ' + 5*skills.grandchef);
});

$( document ).ready(function() {
    $('a:contains("Dur à cuir")').prop('title', '+ ' + skills.duràcuir*5 + ' PV');
});



//====================================================================================
/// 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))
{

(function () {
    'use strict';

    var 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',

// monstre a 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 👨‍🍳 ',
'Scorpion Géant ' : 'Scorpion Géant 👨‍🍳 ',
'Strige ': 'Strige 👨‍🍳 ',
'Thri-kreen ': 'Thri-kreen 👨‍🍳 ',


// voir le caché des monstres
'Cerbère ' :  'Cerbère 👁️👁️👁️ ',
'Colosse de pierre ' :  'Colosse de pierre 👁️👁️👁️ ',
//'Dragon ' :  "Dragon 👁️👁️👁️",
'Dryade ' :  'Dryade 👁️👁️👁️ ',
'Illithid ' :  'Illithid 👁️👁️👁️ ',
'Dryade ' :  'Dryade 👁️👁️👁️ ',
'Abishaii Multicolore ' : 'Abishaii Multicolore 👁️👁️ ',
'Automate ' : 'Automate 👁️👁️ ',
'Barghest ' : 'Barghest 👁️👁️ ',
'Behemoth ' : 'Behemoth 👁️👁️ ',
'Cattis ' : 'Cattis 👁️👁️ ' ,
'Chimère ' : 'Chimère 👁️👁️ ' ,
'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 👁️ ',
'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 👁️ ',
'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 👁️ ',
'Spectre ' :  'Spectre 👁️ ',
'Sylphide ' :  'Sylphide 👁️ ',
'Tertre errant ' :  'Tertre errant 👁️ ',
'Sylphide ' :  'Sylphide 👁️ ',
'Troglodyte ' :  'Troglodyte 👁️ ',
'Troll ' :  'Troll 👁️ ',
'Sylphide ' :  'Sylphide 👁️ ',
'Zombi ' :  'Zombi 👁️ ',
//'Pseudo-Dragon '  : 'Pseudo-Dragon 🙈',
'Amibe Géante ' : 'Amibe Géante 🙈 ',
'Anaconda des Catacombes ' : 'Anaconda des Catacombes 🙈 ',
'Araignée Géante ' : 'Araignée Géante 🙈 ' ,
'Arbre à gobelins ' : 'Arbre à gobelins 🙈 ',
'Boggart ' : 'Boggart 🙈 ',
'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 Sanguinaire ' : 'Glouton Sanguinaire 🙈 ',
'Gnome Artificier ' : 'Gnome Artificier 🙈 ',
'Goblours ' : 'Goblours 🙈 ',
'Golem de Fer ' : 'Golem de Fer 🙈 ',
'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 🙈 ',
'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 🙈 ',
'Mimique ' : 'Mimique 🙈 ',
'Minotaure ' : 'Minotaure 🙈 ',
"Nuage d'insectes " : "Nuage d'insectes 🙈 ",
'Oiseau-Tonnerre ' : 'Oiseau-Tonnerre 🙈 ',
'Onyx ' : 'Onyx 🙈 ' ,
'Orque Noir ' : 'Orque Noir 🙈 ',
'Otyugh ' : 'Otyugh 🙈 ',
'Ours des Montagnes ' : 'Ours des Montagnes 🙈 ',
'Pégase ' : 'Pégase 🙈 ',
'Rat Géant ' : 'Rat Géant 🙈 ',
'Rocketeux ' : 'Rocketeux 🙈 ',
'Sagouin ' : 'Sagouin 🙈 ',
'Scarabée Géant ' : 'Scarabée Géant 🙈 ',
'Slaad ' : 'Slaad 🙈 ',
'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 🙈 ',


//icones é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 ⚙️',

//divers icones
'Baguette' : 'Baguette 🪄 ',
'Escalier' : 'Escalier 🪜 ',
'Baie' : 'Baie 🫐',
//'Arbre' :     'Arbre 🌳',
'Fleur' : 'Fleur 🌷',
'Zone de ténèbres' : 'Zone de ténèbres 🌫️',
'Porte' : 'Porte 🚪',



'':''};



///enclenchement des remplacements et ajouts d'icones
var regexs = [], replacements = [],
        tagsWhitelist = ['PRE', 'BLOCKQUOTE', 'CODE', 'INPUT', 'BUTTON', 'TEXTAREA'],
        rIsRegexp = /^\/(.+)\/([gim]+)?$/,
        word, text, texts, i, userRegexp;


    function prepareRegex(string) {
        return string.replace(/(\({2}|([\[\]\^\&\$\.\?\/\\\+\{\}])|\)$)/g, '\\$1');
    }

    function isTagOk(tag) {
        return tagsWhitelist.indexOf(tag) === -1;
    }

    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] );
            });
        }
    }

}());

};
//========================================================================================================================================================================================================
///                                      Fonction principale pour remplacer le texte et ajouter des icones dans Gobland (inspiré par Lordslair) FIN
//========================================================================================================================================================================================================





//=========================================================================
//   RECUPINFO : R E C U P   D E S   I N F O S   P A G E   P R O F I L
//=========================================================================
var skills = {};

// calcul du nombre d'entrainement 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));

/// RECUP DES CARACS



// 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 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];

//recup dons
  skills.danslmil = $('td:contains("Dans")').next('td').text().match(/(\d) (\W) (\d)/)[1];
  skills.limier = $('td:contains("Limier")').next('td').text().match(/(\d) (\W) (\d)/)[1];
  skills.grandchef = $('td:contains("Grand Chef")').next('td').text().match(/(\d) (\W) (\d)/)[1];
  skills.duràcuir = $('td:contains("Dur à cuir")').next('td').text().match(/(\d) (\W) (\d)/)[1];

///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













//================================================================================================

// Met en rouge le malus de concentration (je sais pas pourquoi si je place en haut ça marche pas)
if (skills.CON < 0) {
  $('td:contains("Bonus de concentration")').css("color","red");
} else {
  $('td:contains("Bonus de concentration")').css("color","green" , "font-weight", "bold");
}