dungeon.tin 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. #nop 房间信息解析模块之副本管理;
  2. VAR {当前副本} {gCurrentDungeon} {主站};
  3. VAR {上一个副本} {gPrevDungeon} {主站};
  4. event.Define {map/EnterDungeon} {无参} {$MODULE} {进入副本,副本的名称在变量 gCurrentDungeon 中。};
  5. event.Define {map/LeaveDungeon} {无参} {$MODULE} {离开副本,副本的名称在变量 gPrevDungeon 中。};
  6. event.Define {map/EnterDungeonIdle} {无参} {$MODULE} {进入副本,且不再 busy,副本的名称在变量 gCurrentDungeon 中。};
  7. event.Define {map/LeaveDungeonIdle} {无参} {$MODULE} {离开副本,且不再 busy,副本的名称在变量 gPrevDungeon 中。};
  8. event.HandleOnce {map/init} {map/dungeon} {map} {map.Dungeon.Init};
  9. #alias {map.Dungeon.Init} {
  10. event.Handle {map/GotRoomInfo} {map/dungeon} {map} {map.Dungeon.locate};
  11. event.Handle {map/EnterDungeon} {map/dungeon} {map} {map.EnterDungeon.notice};
  12. event.Handle {map/LeaveDungeon} {map/dungeon} {map} {map.LeaveDungeon.notice};
  13. event.Handle {map/EnterDungeonIdle} {map/dungeon} {map} {map.EnterDungeon.notice idle};
  14. event.Handle {map/LeaveDungeonIdle} {map/dungeon} {map} {map.LeaveDungeon.notice idle};
  15. };
  16. #alias {map.EnterDungeon.notice} {
  17. #if { "%1" == "idle" } {
  18. warnLog 你来到了「$gCurrentDungeon」,你不忙。;
  19. #nop 万安塔进入的时候会丢失 GMCP 战斗标志。;
  20. #if { "$gCurrentDungeon" == "万安塔" } {char.MarkFight};
  21. };
  22. #else {
  23. warnLog 你来到了「$gCurrentDungeon」。;
  24. #tick dungeon.checkbusy {checkbusy} 1;
  25. busy.Wait {
  26. #untick dungeon.checkbusy;
  27. event.Emit map/EnterDungeonIdle;
  28. };
  29. };
  30. };
  31. #alias {map.LeaveDungeon.notice} {
  32. char.UnmarkFight;
  33. #if { "%1" == "idle" } {
  34. okLog 你离开了「$gPrevDungeon」,你不忙。;
  35. };
  36. #else {
  37. okLog 你离开了「$gPrevDungeon」。;
  38. #tick dungeon.checkbusy {checkbusy} 1;
  39. busy.Wait {
  40. #untick dungeon.checkbusy;
  41. event.Emit map/LeaveDungeonIdle;
  42. };
  43. };
  44. };
  45. #alias {map.Dungeon.locate} {
  46. #if { "$gMapRoom[name]" == "" } {
  47. errLog 房间信息解析不正确。;
  48. #return;
  49. };
  50. #local dungeon {主站};
  51. #if { "$gMapRoom[name]" == "%+1..S[%+1..S]" } {
  52. #local dungeon {$gMapRoom[name]};
  53. #replace dungeon {%+1..S[%+1..S]} {&2};
  54. #replace dungeon {副本$} {};
  55. #replace gMapRoom[name] {[{[^\[]*}]} {};
  56. #replace gMapRoom[colorName] {[{[^\[]*}]} {};
  57. };
  58. #elseif { "$gMapRoom[dungeon]" != "" } {
  59. #local dungeon {$gMapRoom[dungeon]};
  60. };
  61. #if { "$dungeon" == "$gCurrentDungeon" } {
  62. #return;
  63. };
  64. #var gPrevDungeon {$gCurrentDungeon};
  65. #var gCurrentDungeon {$dungeon};
  66. #if { "$dungeon" == "主站" } {
  67. event.Emit map/LeaveDungeon;
  68. };
  69. #else {
  70. event.Emit map/EnterDungeon;
  71. };
  72. };
  73. #action {^准备进入%S⏳$E} {
  74. map.dungeon.change {%1};
  75. };
  76. #action {^准备退出%S...$E} {
  77. map.dungeon.change {%1};
  78. };
  79. #alias {map.dungeon.change} {
  80. #local dungeon {%1};
  81. #if { "$dungeon" != "{剑心居|破阵任务|韩世忠任务|保卫襄阳|鄱阳湖|万安塔|藏经阁|剿匪|蛊神塔}" } {
  82. #return;
  83. };
  84. #class map.dungeon.change open;
  85. #action {^你进入了%1副本。{|ID=map/dungeon}$} {map.dungeon.change.done};
  86. #action {^你退出了%1{|副本}。{|ID=map/dungeon}$} {map.dungeon.change.done};
  87. #alias {map.dungeon.change.sync} {
  88. #class map.dungeon.change kill;
  89. #untick map.dungeon.change.sync;
  90. sync.Ignore map.dungeon.change.sync;
  91. look;
  92. };
  93. #alias {map.dungeon.change.done} {
  94. xtt.Tick {map.dungeon.change.sync} {
  95. sync.Ignore map.dungeon.change.sync;
  96. sync.Wait {map.dungeon.change.sync} {map.dungeon.change.sync};
  97. } 1;
  98. };
  99. #delay {map.dungeon.change.wait} {map.dungeon.change.done} 5;
  100. #class dungeon.enter.wait close;
  101. };
  102. #action {^请使用 leave 自己的id 来退出副本。$E} {leave $user[id]; #line gag};
  103. #alias {enter jxj} {enter jianxinju} {5.5};
  104. /*
  105. 2024/06/29 巡检结果:
  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. 准备进入XXX⏳
  148. 你进入了XXX副本。
  149. 房间名[XXX副本] -
  150. 准备退出XXX...
  151. 你退出了XXX。
  152. 特例:
  153. 你退出了剑心居副本。—— 这里多了「副本」两个字。
  154. 万安塔一层[万安塔副本] - [大元国] [副本] —— 末尾多了「副本」。
  155. */