9070.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. // Manglemire
  2. //
  3. // made by michengs / HSDN / ambushing
  4. module.exports = (dispatch, handlers, guide, lang) => {
  5. guide.type = SP;
  6. let bossBuffs = [];
  7. let count = -1;
  8. let shining = true;
  9. const debuffs_hand = {
  10. 470046: 3,
  11. 470047: 6,
  12. 470048: 9
  13. };
  14. function start_boss_event() {
  15. bossBuffs = [];
  16. count = -1;
  17. shining = true;
  18. }
  19. function is_telling_truth() {
  20. const ones = count % 10;
  21. const tens = Math.floor((count % 100) / 10);
  22. if (bossBuffs.includes(ones) || bossBuffs.includes(tens)) {
  23. return false;
  24. }
  25. return true;
  26. }
  27. const abnormality_change = (added, event) => {
  28. if (debuffs_hand[event.id]) {
  29. if (added) {
  30. if (!bossBuffs.includes(debuffs_hand[event.id])) {
  31. bossBuffs.push(debuffs_hand[event.id]);
  32. }
  33. } else {
  34. const index = bossBuffs.indexOf(debuffs_hand[event.id]);
  35. if (index > -1) {
  36. bossBuffs.splice(index, 1);
  37. }
  38. }
  39. }
  40. };
  41. dispatch._mod.dispatch.addOpcode("S_DUNGEON_EVENT_GAGE", 60350);
  42. dispatch.hook("S_ABNORMALITY_BEGIN", 4, abnormality_change.bind(null, true));
  43. dispatch.hook("S_ABNORMALITY_END", 1, abnormality_change.bind(null, false));
  44. dispatch.hook("S_DUNGEON_EVENT_GAGE", 1, () => {
  45. if (shining) {
  46. if (count === 100) {
  47. count = -1;
  48. }
  49. count++;
  50. shining = false;
  51. dispatch.setTimeout(() => shining = true, 500);
  52. }
  53. });
  54. return {
  55. "ns-470-1000": [{ type: "func", func: start_boss_event }],
  56. "s-470-1000-1105-0": [{ type: "text", sub_type: "message", message: "Jump", message_RU: "Прыжок" }],
  57. "s-470-1000-1106-0": [{ type: "text", sub_type: "message", message: "Smash", message_RU: "Удар" }],
  58. "s-470-1000-1120-0": [{ type: "text", sub_type: "message", message: "Pull", message_RU: "Притяжка" }],
  59. "s-470-1000-1114-0": [{ type: "text", sub_type: "message", message: "Spray", message_RU: "Спрей" }],
  60. "s-470-1000-1201-0": [
  61. { type: "text", sub_type: "message", message: "Stun", message_RU: "Стан" },
  62. { type: "spawn", func: "circle", args: [true, 553, 0, 0, 12, 250, 0, 2500] }
  63. ],
  64. "s-470-1000-1307-0": [{ type: "text", sub_type: "message", message: "With a Bomb - Go away. No Bomb - Enter the circle", message_RU: "С бомбой - отойти. Без бомбы - войти в круг" }],
  65. "s-470-1000-2105-0": [{ type: "text", sub_type: "message", message: "Jump", message_RU: "Прыжок" }],
  66. "s-470-1000-2106-0": [{ type: "text", sub_type: "message", message: "Smash", message_RU: "Удар" }],
  67. "s-470-1000-2107-0": [
  68. { type: "text", sub_type: "message", message: "Stun", message_RU: "Стан" },
  69. { type: "spawn", func: "circle", args: [true, 553, 0, 100, 12, 250, 0, 2500] }
  70. ],
  71. "s-470-1000-2114-0": [{ type: "text", sub_type: "message", message: "Line", message_RU: "Полоса" }],
  72. "s-470-1000-3106-0": [{ type: "text", sub_type: "message", message: "100" }],
  73. "s-470-1000-3213-0": [ // "My shield will save me!" (shield)
  74. { type: "text", sub_type: "message", message: "Break shield", message_RU: "Сломать щит", check_func: () => is_telling_truth() },
  75. { type: "text", sub_type: "message", message: "Puddles (run away)", message_RU: "Лужи (убегать)", check_func: () => !is_telling_truth() }
  76. ],
  77. "s-470-1000-3212-0": [ // "I will kill you all!" (aoe around boss)
  78. { type: "text", sub_type: "message", message: "Out", message_RU: "Наружу", check_func: () => is_telling_truth() },
  79. { type: "text", sub_type: "message", message: "In", message_RU: "Внутрь", check_func: () => !is_telling_truth() }
  80. ],
  81. "s-470-1000-3218-0": [ // "One of you must die!" (aoe around player)
  82. { type: "text", sub_type: "message", message: "Out", message_RU: "Наружу", check_func: () => is_telling_truth() },
  83. { type: "text", sub_type: "message", message: "In", message_RU: "Внутрь", check_func: () => !is_telling_truth() }
  84. ],
  85. "qb-470-1000-470019": [
  86. { type: "text", sub_type: "alert", message: "Truth", message_RU: "Правда", check_func: () => is_telling_truth() },
  87. { type: "text", sub_type: "alert", message: "Lie", message_RU: "Ложь", check_func: () => !is_telling_truth() }
  88. ],
  89. "qb-470-1000-470011": [{ type: "text", sub_type: "message", message: "Stand on stars", message_RU: "Встать на звезду" }]
  90. };
  91. };