-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdata.js
475 lines (416 loc) · 19.2 KB
/
data.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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
var item_lookup = {
"Mace": {
"image": "images/Mace.jpg",
"title": "Mace",
"text": "This weapon is often affectionately refered to as 'The Smasher', 'The Destroyer', 'The Crusher', 'The Evil Neopet Mincer'... well, there are too many names to list here, but you get the idea!",
"bonuses": {
"All": 1,
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+1</td></tr><tr><td>Defence Bonus:</td><td>+0</td></tr></table>"
},
"Magic_Staff_of_Thunder": {
"image": "images/Magic_Staff_of_Thunder_large.jpg",
"title": "Magic Staff of Thunder",
"text": "The thunderous sounds from this staff will have your enemies trembling! <br><br> Grundos know how to work these staffs the best. (As they do with all 'Magic' items!)",
"bonuses": {
"All": 1,
"Grundo": 3
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+0</td></tr><tr><td>Defence Bonus:</td><td>+1</td></tr><tr><td>In the hands of a Grundo:</td><td>+3</td></tr></table>"
},
"Broadsword": {
"image": "images/Broadsword.jpg",
"title": "Broad Sword",
"text": "This handy weapon was once a plough for tilling fields, but when dark times beset Meridell, it was forged into a Broadsword. <br><br>Techos like these weapons very much indeed!",
"bonuses": {
"All": 1,
"Techo": 3
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+1</td></tr><tr><td>Defence Bonus:</td><td>+0</td></tr><tr><td>In the hands of a Techo:</td><td>+3</td></tr></table>"
},
"Hammer": {
"image": "images/Hammer.jpg",
"title": "Hammer",
"text": "Ideal for pets that like to smash things. You not only get to bash the invaders with it, you get to feel good doing it, too!",
"bonuses": {
"All": 2,
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+2</td></tr><tr><td>Defence Bonus:</td><td>+0</td></tr></table>"
},
"Berserker_Battleaxe": {
"image": "images/Berserker_Battleaxe_large.jpg",
"title": "Berserker Battleaxe",
"text": "Heavy weaponry only the strong dare brandish! <br><br>When a Skeith has this Battleaxe along with teleportation power... whoa!!! <br><br>(Note: Skeiths get extra move after teleporting with this equipped)",
"bonuses": {
"All": 5,
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+5</td></tr><tr><td>Defence Bonus:</td><td>+0</td></tr></table>"
},
"Bow": {
"image": "images/Bow_large.jpg",
"title": "Bow",
"text": "Once a Scorchio gains the experience of a Soldier, he can shoot his bow from 2 spaces away!",
"bonuses": {
"All": 2,
"Scorchio": 4
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+2</td></tr><tr><td>Defence Bonus:</td><td>+0</td></tr><tr><td>In the hands of a Scorchio:</td><td>+4</td></tr></table>"
},
"Magic_Force_Spell": {
"image": "images/Magic_Force_Spell_large.jpg",
"title": "Magic Force Spell",
"text": "Zap adjacent enemies with the power of the Magic Force Spell to inflict massive damage! <br><br>In the hands of a Grundo, you can not only zap your enemies, but you can zap a fellow trooper from anywhere to heal them. (Requires both pieces to have an available move).",
"bonuses": {
"All": 3,
"Grundo": 5
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+3</td></tr><tr><td>Defence Bonus:</td><td>+0</td></tr><tr><td>In the hands of a Grundo:</td><td>+5</td></tr></table>"
},
"Double_Sword": {
"image": "images/Double_Sword.jpg",
"title": "Double Sword",
"text": "This weapon has a very nice special ability: whenever it hits it is guaranteed to do at least six points of damage. (Unfortunately it is not guaranteed to hit...)",
"bonuses": {
"All": 4,
"Techo": 6
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+4</td></tr><tr><td>Defence Bonus:</td><td>+0</td></tr><tr><td>In the hands of a Techo:</td><td>+6</td></tr></table>"
},
"Halberd": {
"image": "images/Halberd.jpg",
"title": "Halberd",
"text": "Touched with the Magic of Meridell, this item grants its owner unlimited moves (Max 5)!",
"bonuses": {
"All": 4,
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+4</td></tr><tr><td>Defence Bonus:</td><td>+0</td></tr></table>"
},
"Double_Axe": {
"image": "images/Double_Axe.jpg",
"title": "Double Axe",
"text": "Guaranteed to do at least 5 points of damage when it hits (is not guaranteed to hit).",
"bonuses": {
"All": 5,
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+5</td></tr><tr><td>Defence Bonus:</td><td>+0</td></tr></table>"
},
"Magic_Lightning_Spell": {
"image": "images/Magic_Lightning_Spell.jpg",
"title": "Magic Lightning Spell",
"text": "Zap Invaders with a lightning bolt! <br><br>When used by Grundos, this powerful spell can attack Invaders from 2 spaces away! It can also heal multiple fellow fighters in the same column! To use the healing power, click a fellow fighter in the column you wish to target. (Costs 1 move per healing).",
"bonuses": {
"All": 2,
"Grundo": 4
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+2</td></tr><tr><td>Defence Bonus:</td><td>+0</td></tr><tr><td>In the hands of a Grundo:</td><td>+4</td></tr></table>"
},
"Amulet_of_Teleportation": {
"image": "images/Amulet_of_Teleportation_large.jpg",
"title": "Amulet of Teleportation",
"text": "When a Skeith wears this Amulet, he can teleport to any unoccupied space in rows 3 through 10!<br><br>It also provides +2 defence points when worn by Skeiths and non-Skeiths alike!",
"bonuses": {
"All": 2,
"Skeith": 4
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+0</td></tr><tr><td>Defence Bonus:</td><td>+2</td></tr><tr><td>In the hands of a Skeith:</td><td>+4</td></tr></table>"
},
"Helmet": {
"image": "images/Helmet_large.jpg",
"title": "Helmet",
"text": "When a Moehog wears this helmet, it provides some extra protection to that skull he loves to fight with!",
"bonuses": {
"All": 3,
"Moehog": 5
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+0</td></tr><tr><td>Defence Bonus:</td><td>+3</td></tr><tr><td>In the hands of a Moehog:</td><td>+5</td></tr></table>"
},
"Magic_Cloak_of_Invisibility": {
"image": "images/Magic_Cloak_of_Invisibility.jpg",
"title": "Cloak of Invisibility",
"text": "When a Grundo wears this cloak, he becomes invisible, making it nearly impossible to hit him!<br><br>Many battles are won and lost depending on whether the Grundo has this item and the Magic Force Spell!",
"bonuses": {
"All": 3,
"Grundo": 5
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+0</td></tr><tr><td>Defence Bonus:</td><td>+3</td></tr><tr><td>In the hands of a Grundo:</td><td>+5</td></tr></table>"
},
"Shield": {
"image": "images/Shield.jpg",
"title": "Shield",
"text": "Techos know how to put these shields to good use!",
"bonuses": {
"All": 4,
"Techo": 6
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+0</td></tr><tr><td>Defence Bonus:</td><td>+4</td></tr><tr><td>In the hands of a Techo:</td><td>+6</td></tr></table>"
},
"Leather_Armor": {
"image": "images/Leather_Armor.jpg",
"title": "Leather Armor",
"text": "The lightest armor, but still offering good protection! All Meridellians can wear it.",
"bonuses": {
"All": 3,
"Scorchio": 5
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+0</td></tr><tr><td>Defence Bonus:</td><td>+3</td></tr><tr><td>In the hands of a Scorchio:</td><td>+5</td></tr></table>"
},
"Chainmail": {
"image": "images/Chainmail.jpg",
"title": "Chainmail",
"text": "Affords the best movement with the best protection! All Meridellians can wear it.",
"bonuses": {
"All": 4,
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+0</td></tr><tr><td>Defence Bonus:</td><td>+4</td></tr></table>"
},
"Plate_Armor": {
"image": "images/Plate_Armor.jpg",
"title": "Plate Armor",
"text": "The strongest armor, but a bit cumbersome. All Meridellians can wear it.",
"bonuses": {
"All": 5,
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+0</td></tr><tr><td>Defence Bonus:</td><td>+5</td></tr></table>"
},
"Sword_of_Deflection": {
"image": "images/Sword_of_Deflection_large.jpg",
"title": "Sword of Deflection",
"text": "Techos use this sword to deflect the enchantments cast upon Skeiths by the evil Invaders! <br><br>Click on the Techo that carries this sword then click on the enchanted Skeith to free him!",
"bonuses": {
"All": 4,
"Techo": 6
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+4</td></tr><tr><td>Defence Bonus:</td><td>+0</td></tr><tr><td>In the hands of a Techo:</td><td>+6</td></tr></table>"
},
"Counter_Enchantment_Helmet": {
"image": "images/Counter_Enchantment_Helmet_large.jpg",
"title": "Counter Enchantment Helmet",
"text": "Moehogs can use the magical power of this helmet to deflect the enchantments cast upon Grundos by the evil Invaders! <br><br>If a Grundo is enchanted, click on the Moehog that wears this helmet and then click on the enchanted Grundo to free him!",
"bonuses": {
"All": 3,
"Moehog": 5
},
"stats": "<table><tr><td>Attack Bonus:</td><td>+0</td></tr><tr><td>Defence Bonus:</td><td>+3</td></tr><tr><td>In the hands of a Moehog:</td><td>+5</td></tr></table>"
},
//////////////////////////////
//Lost Items
//////////////////////////////
"Goblet": {
"image": "images/Goblet.jpg",
"title": "Goblet",
"text": "This is the lost item for Mission 1!<br><br>It grants a permanent stat bonus to your troops. This stat bonus will only be saved if you go on to complete the mission. Lost items will re-appear in all three battles in a given mission until you collect it. It will disappear in a battle once less than two invaders are left.",
"stats": "<table><tr><td>Permanent Attack Bonus:</td><td>+1</td></tr><tr><td>Permanent Defence Bonus:</td><td>+1</td></tr></table>"
},
"Gold_Ixi": {
"image": "images/Gold_Ixi.jpg",
"title": "Gold Ixi",
"text": "This is the lost item for Mission 2!<br><br>It grants a permanent stat bonus to your troops. This stat bonus will only be saved if you go on to complete the mission. Lost items will re-appears in all three battles in a given mission until you collect it. It will disappear in a battle once less than two invaders are left.",
"stats": "<table><tr><td>Permanent Attack Bonus:</td><td>+1</td></tr><tr><td>Permanent Defence Bonus:</td><td>+1</td></tr></table>"
},
"Urn_of_Abundance": {
"image": "images/Urn_of_Abundance.jpg",
"title": "Urn of Abundance",
"text": "This is the lost item for Mission 3!<br><br>It grants a permanent stat bonus to your troops. This stat bonus will only be saved if you go on to complete the mission. Lost items will re-appears in all three battles in a given mission until you collect it. It will disappear in a battle once less than two invaders are left.",
"stats": "<table><tr><td>Permanent Attack Bonus:</td><td>+1</td></tr><tr><td>Permanent Defence Bonus:</td><td>+1</td></tr></table>"
},
"Ancient_Book": {
"image": "images/Ancient_Book.jpg",
"title": "Ancient Book",
"text": "This is the lost item for Mission 4!<br><br>It grants a permanent stat bonus to your troops. This stat bonus will only be saved if you go on to complete the mission. Lost items will re-appears in all three battles in a given mission until you collect it. It will disappear in a battle once less than two invaders are left.",
"stats": "<table><tr><td>Permanent Attack Bonus:</td><td>+1</td></tr><tr><td>Permanent Defence Bonus:</td><td>+1</td></tr></table>"
},
"Crown": {
"image": "images/Crown.jpg",
"title": "Crown",
"text": "This is the lost item for Mission 5!<br><br>It grants a permanent stat bonus to your troops. This stat bonus will only be saved if you go on to complete the mission. Lost items will re-appears in all three battles in a given mission until you collect it. It will disappear in a battle once less than two invaders are left.",
"stats": "<table><tr><td>Permanent Attack Bonus:</td><td>+1</td></tr><tr><td>Permanent Defence Bonus:</td><td>+1</td></tr></table>"
},
"Royal_Plate": {
"image": "images/Royal_Plate.jpg",
"title": "Royal Plate",
"text": "This is the lost item for Mission 6!<br><br>It grants a permanent stat bonus to your troops. This stat bonus will only be saved if you go on to complete the mission. Lost items will re-appears in all three battles in a given mission until you collect it. It will disappear in a battle once less than two invaders are left.",
"stats": "<table><tr><td>Permanent Attack Bonus:</td><td>+1</td></tr><tr><td>Permanent Defence Bonus:</td><td>+1</td></tr></table>"
},
"Royal_Tapestry": {
"image": "images/Royal_Tapestry.jpg",
"title": "Royal Tapestry",
"text": "This is the lost item for Mission 7!<br><br>It grants a permanent stat bonus to your troops. This stat bonus will only be saved if you go on to complete the mission. Lost items will re-appears in all three battles in a given mission until you collect it. It will disappear in a battle once less than two invaders are left.",
"stats": "<table><tr><td>Permanent Attack Bonus:</td><td>+1</td></tr><tr><td>Permanent Defence Bonus:</td><td>+1</td></tr></table>"
},
"Treasure_Chest": {
"image": "images/Treasure_Chest.jpg",
"title": "Treasure Chest",
"text": "This is the lost item for Mission 8!<br><br>It grants a permanent stat bonus to your troops. This stat bonus will only be saved if you go on to complete the mission. Lost items will re-appears in all three battles in a given mission until you collect it. It will disappear in a battle once less than two invaders are left.",
"stats": "<table><tr><td>Permanent Attack Bonus:</td><td>+1</td></tr><tr><td>Permanent Defence Bonus:</td><td>+1</td></tr></table>"
},
"Vase_of_Plenty": {
"image": "images/Vase_of_Plenty.jpg",
"title": "Vase of Plenty",
"text": "This is the lost item for Mission 9!<br><br>It grants a permanent stat bonus to your troops. This stat bonus will only be saved if you go on to complete the mission. Lost items will re-appears in all three battles in a given mission until you collect it. It will disappear in a battle once less than two invaders are left.",
"stats": "<table><tr><td>Permanent Attack Bonus:</td><td>+1</td></tr><tr><td>Permanent Defence Bonus:</td><td>+1</td></tr></table>"
},
"Orb": {
"image": "images/Orb.jpg",
"title": "Orb",
"text": "This is the lost item for Mission 10!<br><br>It grants a permanent stat bonus to your troops. This stat bonus will only be saved if you go on to complete the mission. Lost items will re-appears in all three battles in a given mission until you collect it. It will disappear in a battle once less than two invaders are left.",
"stats": "<table><tr><td>Permanent Attack Bonus:</td><td>+1</td></tr><tr><td>Permanent Defence Bonus:</td><td>+1</td></tr></table>"
},
//////////////////////////////
//Potions
//////////////////////////////
"Health_Potion": {
"image": "images/Health_Potion.jpg",
"title": "Health Potion",
"text": "When consumed by a pet, this healing potion will boost your pet to full health.",
"stats": "<table><tr><td>Heals Pet</td><td>100%</td></tr></table>"
},
"Potion_of_Fortitude": {
"image": "images/Potion_of_Fortitude.jpg",
"title": "Potion of Fortitude",
"text": "When consumed by a pet, this healing potion will boost your pet to full health.",
"stats": "<table><tr><td>Heals Pet</td><td>100%</td></tr></table>"
},
"Mega_Potion": {
"image": "images/Mega_Potion.jpg",
"title": "Mega Potion",
"text": "When consumed by a pet, this healing potion will boost your pet to full health.",
"stats": "<table><tr><td>Heals Pet</td><td>100%</td></tr></table>"
},
"Potion_of_Well-Being": {
"image": "images/Potion_of_Well-Being.jpg",
"title": "Potion of Well-Being",
"text": "When consumed by a pet, this healing potion will boost your pet to full health.",
"stats": "<table><tr><td>Heals Pet</td><td>100%</td></tr></table>"
},
};
function attack_strength_bonus_calc(base_attack_strength) {
bonus_attack_strength = 0
if (base_attack_strength >= 9 && base_attack_strength <= 11) {
bonus_attack_strength = 1;
}
if (base_attack_strength >= 12 && base_attack_strength <= 14) {
bonus_attack_strength = 2;
}
if (base_attack_strength >= 15 && base_attack_strength <= 17) {
bonus_attack_strength = 3;
}
if (base_attack_strength == 18) {
bonus_attack_strength = 4;
}
if (base_attack_strength == 19) {
bonus_attack_strength = 5;
}
if (base_attack_strength > 19) {
//Unknown... enemy bosses hit this, but we have no record of how it changes things.
//This is how the Java clone handles it, and makes sense to me.
//It does mean the comment in the youtube video about the Graarls in Mission 8 having high attack doesn't really make sense or matter.
bonus_attack_strength = 5;
}
return bonus_attack_strength;
}
function get_team_member_by_name(name) {
for (var i=0; i<window.my_team.length; i++) {
if (window.my_team[i].name == name) {
return window.my_team[i];
}
}
}
function get_enemy_by_name(name) {
for (var i=0; i<window.enemies.length; i++) {
if (window.enemies[i].name == name) {
return window.enemies[i];
}
}
}
function get_item_bonus(item_name, pet_breed) {
if (!item_name) {
return 0;
}
if (item_lookup[item_name]['bonuses'][pet_breed]) {
return item_lookup[item_name]['bonuses'][pet_breed];
}
if (item_lookup[item_name]['bonuses']['All']) {
return item_lookup[item_name]['bonuses']['All'];
}
return 0;
}
function random_1_or_n1() {
var num = Math.floor(Math.random() * 2 + 1);
if (num == 2) {
return -1;
}
else {
return 1;
}
}
function get_next_available_team_name(start){
for(var i=0; i<20; i++) {
var test_name = "Soldier "+(start+i).toString();
var is_available = true;
for(var j=0; j<window.my_team.length; j++) {
if(window.my_team[j].name == test_name) {
is_available = false;
}
}
if (is_available) {
return test_name;
}
}
return "Soldier "+(start+100).toString();
}
function get_next_available_enemy_name(breed){
for(var i=0; i<20; i++) {
var num_str = i;
if(num_str < 10) {
num_str = "0" + num_str.toString();
}
var test_name = "Invader "+breed+" "+num_str;
var is_available = true;
for(var j=0; j<window.enemies.length; j++) {
if(window.enemies[j].name == test_name) {
is_available = false;
}
}
if (is_available) {
return test_name;
}
}
return "Soldier "+(100).toString();
}
var rank_to_color = {
"Corporal": "#000000",
"Lieutenant": "#339900",
"Captain": "#0066ff",
"Soldier": "#000099",
"Defender": "#ff9900",
"Villager": "#800080",
}
function saves_to_pet_rank(saves) {
if(saves >= 96) {
return "Corporal";
}
else if(saves >= 64) {
return "Lieutenant";
}
else if(saves >= 32) {
return "Captain";
}
else if(saves >= 9) {
return "Soldier";
}
else if(saves >= 3) {
return "Defender";
}
else {
return "Villager";
}
}
var shields = ["Stablehand","Serf","Peon","Page","Squire","Guard","High Guard","Knight","Baron","Earl","Duke","Lord"];
function get_current_shield(){
if(mission == 1) {
return shields[battle-1];
}
else {
return shields[mission - 1 + 2];
}
}