Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. internal class BossInfo
  2. {
  3. internal string key = "";
  4. internal float progression = 0f;
  5. internal string displayName = "";
  6. internal List<int> npcIDs = new List<int>();
  7. internal Func<bool> downed = () => false;
  8.  
  9. internal bool isBoss = false;
  10. internal bool isMiniboss = false;
  11. internal bool isEvent = false;
  12.  
  13. internal List<int> spawnItem = new List<int>();
  14. internal List<int> loot = new List<int>();
  15. internal List<int> collection = new List<int>();
  16.  
  17. internal BossInfo()
  18. {
  19.  
  20. }
  21. }
  22.  
  23. List<BossInfo> bossInfos = new List<BossInfo>();
  24.  
  25. public override void PostAddRecipes()
  26. {
  27. Mod bc = ModLoader.GetMod("BossChecklist");
  28. if (bc != null)
  29. {
  30. object data = bc.Call("GetCurrentBossInfo");
  31.  
  32. if (data is List<Dictionary<string, object>> list)
  33. {
  34. foreach (var boss in list)
  35. {
  36. var tinyBossInfo = new BossInfo()
  37. {
  38. key = boss.ContainsKey("key") ? boss["key"] as string : "",
  39. progression = boss.ContainsKey("progression") ? Convert.ToSingle(boss["progression"]) : 0f,
  40. displayName = boss.ContainsKey("displayName") ? boss["displayName"] as string : "",
  41. npcIDs = boss.ContainsKey("npcIDs") ? boss["npcIDs"] as List<int> : new List<int>(),
  42. downed = boss.ContainsKey("downed") ? boss["downed"] as Func<bool> : () => false,
  43.  
  44. isBoss = boss.ContainsKey("isBoss") ? Convert.ToBoolean(boss["isBoss"]) : false,
  45. isMiniboss = boss.ContainsKey("isMiniboss") ? Convert.ToBoolean(boss["isMiniboss"]) : false,
  46. isEvent = boss.ContainsKey("isEvent") ? Convert.ToBoolean(boss["isEvent"]) : false,
  47.  
  48. spawnItem = boss.ContainsKey("spawnItem") ? boss["spawnItem"] as List<int> : new List<int>(),
  49. loot = boss.ContainsKey("loot") ? boss["loot"] as List<int> : new List<int>(),
  50. collection = boss.ContainsKey("collection") ? boss["collection"] as List<int> : new List<int>(),
  51. };
  52. bossInfos.Add(tinyBossInfo);
  53. }
  54. }
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement