-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSetupBossList.cs
584 lines (565 loc) · 21.7 KB
/
SetupBossList.cs
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
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
using System;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace BossAssist
{
public class SetupBossList
{
internal List<BossInfo> SortedBosses;
public SetupBossList()
{
InitList();
}
private void InitList()
{
SortedBosses = new List<BossInfo>
{
new BossInfo(1f, NPCID.KingSlime, "Vanilla", "King Slime", (() => NPC.downedSlimeKing), new List<int>() { ItemID.SlimeCrown }, SetupCollect(50), SetupLoot(50), "BossAssist/Resources/BossTextures/Boss50"),
new BossInfo(2f, NPCID.EyeofCthulhu, "Vanilla", "Eye of Cthulhu", (() => NPC.downedBoss1), new List<int>() { ItemID.SuspiciousLookingEye }, SetupCollect(4), SetupLoot(4), "BossAssist/Resources/BossTextures/Boss4"),
new BossInfo(3f, NPCID.EaterofWorldsHead, "Vanilla", "Eater of Worlds", (() => NPC.downedBoss2), new List<int>() { ItemID.WormFood }, SetupCollect(13), SetupLoot(13), "BossAssist/Resources/BossTextures/Boss13"),
new BossInfo(3f, NPCID.BrainofCthulhu, "Vanilla", "Brain of Cthulhu", (() => NPC.downedBoss2), new List<int>() { ItemID.BloodySpine }, SetupCollect(266), SetupLoot(266), "BossAssist/Resources/BossTextures/Boss266"),
new BossInfo(4f, NPCID.QueenBee, "Vanilla", "Queen Bee", (() => NPC.downedQueenBee), new List<int>() { ItemID.Abeemination }, SetupCollect(222), SetupLoot(222), "BossAssist/Resources/BossTextures/Boss222"),
new BossInfo(5f, NPCID.SkeletronHead, "Vanilla", "Skeletron", (() => NPC.downedBoss3), new List<int>() { ItemID.ClothierVoodooDoll }, SetupCollect(35), SetupLoot(35), "BossAssist/Resources/BossTextures/Boss35"),
new BossInfo(6f, NPCID.WallofFlesh, "Vanilla", "Wall of Flesh", (() => Main.hardMode), new List<int>() { ItemID.GuideVoodooDoll }, SetupCollect(113), SetupLoot(113), "BossAssist/Resources/BossTextures/Boss113"),
new BossInfo(7f, NPCID.Retinazer, "Vanilla", "The Twins", (() => NPC.downedMechBoss2), new List<int>() { ItemID.MechanicalEye }, SetupCollect(125), SetupLoot(125), "BossAssist/Resources/BossTextures/Boss125"),
new BossInfo(8f, NPCID.TheDestroyer, "Vanilla", "The Destroyer", (() => NPC.downedMechBoss1), new List<int>() { ItemID.MechanicalWorm }, SetupCollect(134), SetupLoot(134), "BossAssist/Resources/BossTextures/Boss134"),
new BossInfo(9f, NPCID.SkeletronPrime, "Vanilla", "Skeletron Prime", (() => NPC.downedMechBoss3), new List<int>() { ItemID.MechanicalSkull }, SetupCollect(127), SetupLoot(127), "BossAssist/Resources/BossTextures/Boss127"),
new BossInfo(10f, NPCID.Plantera, "Vanilla", "Plantera", (() => NPC.downedPlantBoss), new List<int>() { }, SetupCollect(262), SetupLoot(262), "BossAssist/Resources/BossTextures/Boss262"),
new BossInfo(11f, NPCID.Golem, "Vanilla", "Golem", (() => NPC.downedGolemBoss), new List<int>() { ItemID.LihzahrdPowerCell }, SetupCollect(245), SetupLoot(245), "BossAssist/Resources/BossTextures/Boss245"),
new BossInfo(11.5f, NPCID.DD2Betsy, "Vanilla", "Betsy", (() => WorldAssist.downedBetsy), new List<int>() { ItemID.DD2ElderCrystal }, SetupCollect(551), SetupLoot(551), "BossAssist/Resources/BossTextures/Boss551"),
new BossInfo(12f, NPCID.DukeFishron, "Vanilla", "Duke Fishron", (() => NPC.downedFishron), new List<int>() { ItemID.TruffleWorm }, SetupCollect(370), SetupLoot(370), "BossAssist/Resources/BossTextures/Boss370"),
new BossInfo(13f, NPCID.CultistBoss, "Vanilla", "Lunatic Cultist", (() => NPC.downedAncientCultist), new List<int>() { }, SetupCollect(439), SetupLoot(439), "BossAssist/Resources/BossTextures/Boss439"),
new BossInfo(14f, NPCID.MoonLordHead, "Vanilla", "Moon Lord", (() => NPC.downedMoonlord), new List<int>() { ItemID.CelestialSigil }, SetupCollect(396), SetupLoot(396), "BossAssist/Resources/BossTextures/Boss396")
};
}
// New system is better
internal void AddBoss(float val, int id, string source, string name, Func<bool> down, List<int> spawn, List<int> collect, List<int> loot, string texture)
{
if (!ModContent.TextureExists(texture)) texture = "BossAssist/Resources/BossTextures/Boss0";
SortedBosses.Add(new BossInfo(val, id, source, name, down, spawn, SortCollectibles(collect), loot, texture));
SortedBosses.Sort((x, y) => x.progression.CompareTo(y.progression));
Console.ForegroundColor = ConsoleColor.DarkYellow;
Console.Write("<<Boss Assist>> ");
Console.ForegroundColor = ConsoleColor.DarkGray;
Console.Write(source + " has added a boss!");
Console.WriteLine();
Console.ResetColor();
if (BossAssist.ServerCollectedRecords != null)
{
for (int i = 0; i < 255; i++)
{
BossAssist.ServerCollectedRecords[i].Add(new BossStats());
}
// Adding a boss to each player
}
}
/*
Didnt work out as I had hoped, not completely sure why, but probably not even necessary
internal List<int> BagFirst(List<int> loot)
{
int reserve = 0;
foreach (int item in loot)
{
Item i = new Item();
i.SetDefaults(item);
if (i.expert || i.Name.Contains("Treasure Bag") || (i.type > ItemID.Count && i.modItem.Name.Contains("Treasure Bag")))
{
reserve = item;
break;
}
}
if (reserve != 0)
{
loot.Remove(reserve);
loot.Insert(reserve, 0);
}
return loot;
}
*/
internal List<int> SortCollectibles(List<int> collection)
{
// Sorts the Main 3 Collectibles
List<int> SortedCollectibles = new List<int>();
foreach (int item in collection)
{
Item i = new Item();
i.SetDefaults(item);
if (i.createTile > 0 && (i.Name.Contains("Trophy")) || (i.type > ItemID.Count && i.modItem.Name.Contains("Trophy")))
{
SortedCollectibles.Add(item);
break;
}
}
if (SortedCollectibles.Count == 0) SortedCollectibles.Add(-1); // No Trophy
foreach (int item in collection)
{
Item i = new Item();
i.SetDefaults(item);
if (i.vanity && (i.Name.Contains("Mask")) || (i.type > ItemID.Count && i.modItem.Name.Contains("Mask")))
{
SortedCollectibles.Add(item);
break;
}
}
if (SortedCollectibles.Count == 1) SortedCollectibles.Add(-1); // No Mask
foreach (int item in collection)
{
Item i = new Item();
i.SetDefaults(item);
if (i.createTile > 0 && (i.Name.Contains("Music Box")) || (i.type > ItemID.Count && i.modItem.Name.Contains("Music Box")))
{
SortedCollectibles.Add(item);
break;
}
}
if (SortedCollectibles.Count == 2) SortedCollectibles.Add(-1); // No Music Box
foreach (int item in collection)
{
if (!SortedCollectibles.Contains(item)) SortedCollectibles.Add(item);
}
return SortedCollectibles;
}
internal void AddSpawnItem(int bType, string bSource, List<int> bLoot)
{
int index = SortedBosses.FindIndex(x => x.id == bType && x.source == bSource);
if (index != -1)
{
foreach (int item in bLoot)
{
SortedBosses[index].loot.Add(item);
}
}
}
internal void AddToLootTable(int bType, string bSource, List<int> bLoot)
{
int index = SortedBosses.FindIndex(x => x.id == bType && x.source == bSource);
if (index != -1)
{
foreach (int item in bLoot)
{
SortedBosses[index].loot.Add(item);
}
}
}
internal void AddToCollection(int bType, string bSource, List<int> bCollect)
{
int index = SortedBosses.FindIndex(x => x.id == bType && x.source == bSource);
if (index != -1)
{
foreach (int item in bCollect)
{
SortedBosses[index].collection.Add(item);
}
}
}
internal protected List<int> SetupLoot(int bossNum)
{
if (bossNum == NPCID.KingSlime)
{
return new List<int>()
{
ItemID.KingSlimeBossBag,
ItemID.RoyalGel,
ItemID.Solidifier,
ItemID.SlimySaddle,
ItemID.NinjaHood,
ItemID.NinjaShirt,
ItemID.NinjaPants,
ItemID.SlimeHook,
ItemID.SlimeGun,
ItemID.LesserHealingPotion
};
}
if (bossNum == NPCID.EyeofCthulhu)
{
return new List<int>()
{
ItemID.EyeOfCthulhuBossBag,
ItemID.EoCShield,
ItemID.DemoniteOre,
ItemID.UnholyArrow,
ItemID.CorruptSeeds,
ItemID.Binoculars,
ItemID.LesserHealingPotion
};
}
if (bossNum == NPCID.EaterofWorldsHead)
{
return new List<int>()
{
ItemID.EaterOfWorldsBossBag,
ItemID.WormScarf,
ItemID.ShadowScale,
ItemID.DemoniteOre,
ItemID.EatersBone,
ItemID.LesserHealingPotion
};
}
if (bossNum == NPCID.BrainofCthulhu)
{
return new List<int>()
{
ItemID.BrainOfCthulhuBossBag,
ItemID.BrainOfConfusion,
ItemID.CrimtaneOre,
ItemID.TissueSample,
ItemID.BoneRattle,
ItemID.LesserHealingPotion
};
}
if (bossNum == NPCID.QueenBee)
{
return new List<int>()
{
ItemID.QueenBeeBossBag,
ItemID.HiveBackpack,
ItemID.BeeGun,
ItemID.BeeKeeper,
ItemID.BeesKnees,
ItemID.HiveWand,
ItemID.BeeHat,
ItemID.BeeShirt,
ItemID.BeePants,
ItemID.HoneyComb,
ItemID.Nectar,
ItemID.HoneyedGoggles,
ItemID.Beenade,
ItemID.BottledHoney
};
}
if (bossNum == NPCID.SkeletronHead)
{
return new List<int>()
{
ItemID.SkeletronBossBag,
ItemID.BoneGlove,
ItemID.SkeletronHand,
ItemID.BookofSkulls,
ItemID.LesserHealingPotion
};
}
if (bossNum == NPCID.WallofFlesh)
{
return new List<int>()
{
ItemID.WallOfFleshBossBag,
ItemID.DemonHeart,
ItemID.Pwnhammer,
ItemID.BreakerBlade,
ItemID.ClockworkAssaultRifle,
ItemID.LaserRifle,
ItemID.WarriorEmblem,
ItemID.SorcererEmblem,
ItemID.RangerEmblem,
ItemID.SummonerEmblem,
ItemID.HealingPotion
};
}
if (bossNum == NPCID.Retinazer)
{
return new List<int>()
{
ItemID.TwinsBossBag,
ItemID.MechanicalWheelPiece,
ItemID.SoulofSight,
ItemID.HallowedBar,
ItemID.GreaterHealingPotion
};
}
if (bossNum == NPCID.TheDestroyer)
{
return new List<int>()
{
ItemID.DestroyerBossBag,
ItemID.MechanicalWagonPiece,
ItemID.SoulofMight,
ItemID.HallowedBar,
ItemID.GreaterHealingPotion
};
}
if (bossNum == NPCID.SkeletronPrime)
{
return new List<int>()
{
ItemID.SkeletronPrimeBossBag,
ItemID.MechanicalBatteryPiece,
ItemID.SoulofFright,
ItemID.HallowedBar,
ItemID.GreaterHealingPotion
};
}
if (bossNum == NPCID.Plantera)
{
return new List<int>()
{
ItemID.PlanteraBossBag,
ItemID.SporeSac,
ItemID.TempleKey,
ItemID.Seedling,
ItemID.TheAxe,
ItemID.PygmyStaff,
ItemID.GrenadeLauncher,
ItemID.VenusMagnum,
ItemID.NettleBurst,
ItemID.LeafBlower,
ItemID.FlowerPow,
ItemID.WaspGun,
ItemID.Seedler,
ItemID.ThornHook,
ItemID.GreaterHealingPotion
};
}
if (bossNum == NPCID.Golem)
{
return new List<int>()
{
ItemID.GolemBossBag,
ItemID.ShinyStone,
ItemID.Stynger,
ItemID.PossessedHatchet,
ItemID.SunStone,
ItemID.EyeoftheGolem,
ItemID.Picksaw,
ItemID.HeatRay,
ItemID.StaffofEarth,
ItemID.GolemFist,
ItemID.BeetleHusk,
ItemID.GreaterHealingPotion
};
}
if (bossNum == NPCID.DD2Betsy)
{
return new List<int>()
{
ItemID.BossBagBetsy,
ItemID.BetsyWings,
ItemID.DD2BetsyBow, // Aerial Bane
ItemID.MonkStaffT3, // Sky Dragon's Fury
ItemID.ApprenticeStaffT3, // Betsy's Wrath
ItemID.DD2SquireBetsySword // Flying Dragon
};
}
if (bossNum == NPCID.DukeFishron)
{
return new List<int>()
{
ItemID.FishronBossBag,
ItemID.ShrimpyTruffle,
ItemID.FishronWings,
ItemID.BubbleGun,
ItemID.Flairon,
ItemID.RazorbladeTyphoon,
ItemID.TempestStaff,
ItemID.Tsunami,
ItemID.GreaterHealingPotion
};
}
if (bossNum == NPCID.CultistBoss)
{
return new List<int>()
{
ItemID.CultistBossBag,
ItemID.LunarCraftingStation,
ItemID.GreaterHealingPotion
};
}
if (bossNum == NPCID.MoonLordHead)
{
return new List<int>()
{
ItemID.MoonLordBossBag,
ItemID.GravityGlobe,
ItemID.PortalGun,
ItemID.LunarOre,
ItemID.Meowmere,
ItemID.Terrarian,
ItemID.StarWrath,
ItemID.SDMG,
ItemID.FireworksLauncher, // The Celebration
ItemID.LastPrism,
ItemID.LunarFlareBook,
ItemID.RainbowCrystalStaff,
ItemID.MoonlordTurretStaff, // Lunar Portal Staff
ItemID.SuspiciousLookingTentacle,
ItemID.GreaterHealingPotion
};
}
return new List<int>();
}
internal protected List<int> SetupCollect(int bossNum)
{
if (bossNum == NPCID.KingSlime)
{
return new List<int>()
{
ItemID.KingSlimeTrophy,
ItemID.KingSlimeMask,
ItemID.MusicBoxBoss1
};
}
if (bossNum == NPCID.EyeofCthulhu)
{
return new List<int>()
{
ItemID.EyeofCthulhuTrophy,
ItemID.EyeMask,
ItemID.MusicBoxBoss1
};
}
if (bossNum == NPCID.EaterofWorldsHead)
{
return new List<int>()
{
ItemID.EaterofWorldsTrophy,
ItemID.EaterMask,
ItemID.MusicBoxBoss1
};
}
if (bossNum == NPCID.BrainofCthulhu)
{
return new List<int>()
{
ItemID.BrainofCthulhuTrophy,
ItemID.BrainMask,
ItemID.MusicBoxBoss3
};
}
if (bossNum == NPCID.QueenBee)
{
return new List<int>()
{
ItemID.QueenBeeTrophy,
ItemID.BeeMask,
ItemID.MusicBoxBoss4
};
}
if (bossNum == NPCID.SkeletronHead)
{
return new List<int>()
{
ItemID.SkeletronTrophy,
ItemID.SkeletronMask,
ItemID.MusicBoxBoss1
};
}
if (bossNum == NPCID.WallofFlesh)
{
return new List<int>()
{
ItemID.WallofFleshTrophy,
ItemID.FleshMask,
ItemID.MusicBoxBoss2
};
}
if (bossNum == NPCID.Retinazer)
{
return new List<int>()
{
ItemID.RetinazerTrophy,
ItemID.SpazmatismTrophy,
ItemID.TwinMask,
ItemID.MusicBoxBoss2
};
}
if (bossNum == NPCID.TheDestroyer)
{
return new List<int>()
{
ItemID.DestroyerTrophy,
ItemID.DestroyerMask,
ItemID.MusicBoxBoss3
};
}
if (bossNum == NPCID.SkeletronPrime)
{
return new List<int>()
{
ItemID.SkeletronPrimeTrophy,
ItemID.SkeletronPrimeMask,
ItemID.MusicBoxBoss1
};
}
if (bossNum == NPCID.Plantera)
{
return new List<int>()
{
ItemID.PlanteraTrophy,
ItemID.PlanteraMask,
ItemID.MusicBoxPlantera
};
}
if (bossNum == NPCID.Golem)
{
return new List<int>()
{
ItemID.GolemTrophy,
ItemID.GolemMask,
ItemID.MusicBoxBoss5
};
}
if (bossNum == NPCID.DD2Betsy)
{
return new List<int>()
{
ItemID.BossTrophyBetsy,
ItemID.BossMaskBetsy,
ItemID.MusicBoxDD2
};
}
if (bossNum == NPCID.DukeFishron)
{
return new List<int>()
{
ItemID.DukeFishronTrophy,
ItemID.DukeFishronMask,
ItemID.MusicBoxBoss1
};
}
if (bossNum == NPCID.CultistBoss)
{
return new List<int>()
{
ItemID.AncientCultistTrophy,
ItemID.BossMaskCultist,
ItemID.MusicBoxBoss5
};
}
if (bossNum == NPCID.MoonLordHead)
{
return new List<int>()
{
ItemID.MoonLordTrophy,
ItemID.BossMaskMoonlord,
ItemID.MusicBoxLunarBoss
};
}
return new List<int>();
}
}
public class BossInfo
{
internal float progression;
internal int id;
internal string source;
internal string name;
internal Func<bool> downed;
internal List<int> spawnItem;
internal List<int> loot;
internal List<int> collection;
internal string pageTexture;
internal BossInfo(float progression, int id, string source, string name, Func<bool> downed, List<int> spawnItem, List<int> collection, List<int> loot, string pageTexture = null)
{
this.progression = progression;
this.id = id;
this.source = source;
this.name = name;
this.downed = downed;
this.spawnItem = spawnItem;
this.collection = collection;
this.loot = loot;
this.pageTexture = pageTexture;
}
}
}