forked from Zorn192/AutoTrimps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfight-info.js
187 lines (158 loc) · 5.57 KB
/
fight-info.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
;(function(M)
{
M["fightinfo"] = {};
M["fightinfo"].$worldGrid = document.getElementById('grid');
M["fightinfo"].$mapGrid = document.getElementById('mapGrid');
// Powerful imps
M["fightinfo"].powerful =
[
"Improbability",
"Omnipotrimp",
"Mutimp",
"Hulking_Mutimp"
];
// Exotic imps
M["fightinfo"].exotics =
[
"Feyimp",
"Tauntimp",
"Venimp",
"Whipimp",
"Magnimp",
"Goblimp",
"Flutimp",
"Jestimp",
"Titimp",
"Chronoimp"
];
// Fast imps
M["fightinfo"].fast =
[
"Snimp",
"Kittimp",
"Gorillimp",
"Squimp",
"Shrimp",
"Chickimp",
"Frimp",
"Slagimp",
"Lavimp",
"Kangarimp",
"Entimp",
"Carbimp",
];
//Colors for special imps (This has been disabled)
M["fightinfo"].colors =
{
bone: '#ffffff',
exotic: '#000000',
powerful: '#000000',
fast : '#000000'
}
M["fightinfo"].lastProcessedWorld = null;
M["fightinfo"].lastProcessedMap = null;
function Update()
{
// Check if we should update world or map info
if(game.global.mapsActive)
{
// Check if current map already infoed
// Can't do this because of map repeating
/*if(M["fightinfo"].lastProcessedMap === null || M["fightinfo"].lastProcessedMap !== game.global.lookingAtMap)
M["fightinfo"].lastProcessedMap = game.global.lookingAtMap;
else
return;*/
// Cell data
var cells = game.global.mapGridArray;
// DOM rows
var $rows = Array.prototype.slice.call(M["fightinfo"].$mapGrid.children);
}
else
{
// Check if current world already infoed
if(M["fightinfo"].lastProcessedWorld === null || M["fightinfo"].lastProcessedWorld !== game.global.world)
M["fightinfo"].lastProcessedWorld = game.global.world;
else
return;
// Cell data
var cells = game.global.gridArray;
// DOM rows
var $rows = Array.prototype.slice.call(M["fightinfo"].$worldGrid.children);
}
// Rows are in inverse order somewhy
$rows = $rows.reverse();
// DOM cells
var $cells = [];
// Loop through DOM rows and concat each row's cell-element into $cells
$rows.forEach(function(x)
{
$cells = $cells.concat(Array.prototype.slice.call(x.children));
});
// Process all cells
for(var i = 0; i < $cells.length; i++)
{
// DOM cell
var $cell = $cells[i];
// Cell data
var cell = cells[i];
if(cell.name.toLowerCase().indexOf('skele') > -1) // Skeletimp cell
{
if(cell.special.length === 0)
$cell.innerHTML = "<span class=\"glyphicon glyphicon-italic\"></span> ";
$cell.title = cell.name;
//$cell.style.color = M["fightinfo"].colors.bone; //(This changes the colour of the glyph - bad bc it overrides trimps and looks bad against corruption etc)
$cell.style.textShadow = '0px 0px 10px #ffffff';
}
else if(M["fightinfo"].exotics.indexOf(cell.name) > -1) // Exotic cell
{
if(cell.special.length === 0)
$cell.innerHTML = "<span class=\"glyphicon glyphicon-sunglasses\"></span> ";
$cell.title = cell.name;
//$cell.style.color = M["fightinfo"].colors.exotic; //(This changes the colour of the glyph - bad bc it overrides trimps and looks bad against corruption etc)
$cell.style.textShadow = '0px 0px 10px #fb753f';
}
else if(M["fightinfo"].powerful.indexOf(cell.name) > -1) // Powerful imp
{
if(cell.special.length === 0)
$cell.innerHTML = "<span class=\"glyphicon glyphicon-hazard\"></span> ";
$cell.title = cell.name;
//$cell.style.color = M["fightinfo"].colors.powerful; //(This changes the colour of the glyph - bad bc it overrides trimps and looks bad against corruption etc)
$cell.style.textShadow = '0px 0px 10px #8c0000';
}
else if(M["fightinfo"].fast.indexOf(cell.name) > -1) // Fast imp
{
//if(cell.special.length === 0)
$cell.innerHTML = "<span class=\"glyphicon glyphicon-forward\"></span> ";
$cell.title = cell.name;
//$cell.style.color = M["fightinfo"].colors.fast; //(This changes the colour of the glyph - bad bc it overrides trimps and looks bad against corruption etc)
$cell.style.textShadow = '0px 0px 10px #ffffff';
}
//This shit doesn't work and I don't know why (What is the celltitle??? is it the name of the nature? Imps are labelled Toxic/Gusty/Frozen but that didin't work either)
if(cell.name.toLowerCase().indexOf('poison') > -1) // Poison Token cell
{
if(cell.special.length === 0)
$cell.innerHTML = "<span class=\"glyphicon glyphicon-flask\"></span> ";
$cell.title = cell.name;
//$cell.style.color = M["fightinfo"].colors.exotic; //(This changes the colour of the glyph - bad bc it overrides trimps and looks bad against corruption etc)
$cell.style.textShadow = '0px 0px 10px #ffffff';
}
if(cell.name.toLowerCase().indexOf('wind') > -1) // Wind Token cell
{
if(cell.special.length === 0)
$cell.innerHTML = "<span class=\"icomoon icon-air\"></span> ";
$cell.title = cell.name;
//$cell.style.color = M["fightinfo"].colors.exotic; //(This changes the colour of the glyph - bad bc it overrides trimps and looks bad against corruption etc)
$cell.style.textShadow = '0px 0px 10px #ffffff';
}
if(cell.name.toLowerCase().indexOf('ice') > -1) // Ice Token cell
{
if(cell.special.length === 0)
$cell.innerHTML = "<span class=\"glyphicon glyphicon-certificate\"></span> ";
$cell.title = cell.name;
//$cell.style.color = M["fightinfo"].colors.exotic; //(This changes the colour of the glyph - bad bc it overrides trimps and looks bad against corruption etc)
$cell.style.textShadow = '0px 0px 10px #ffffff';
}
}
}
M["fightinfo"].Update = Update;
})(MODULES);