helper.tin 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. #nop vim: set filetype=tt:;
  2. /*
  3. 本文件属于 PaoTin++ 的一部分
  4. ===========
  5. PaoTin++ © 2020~2023 的所有版权均由担子炮(dzp <danzipao@gmail.com>) 享有并保留一切法律权利
  6. 你可以在遵照 GPLv3 协议的基础之上使用、修改及重新分发本程序。
  7. ===========
  8. */
  9. load-lib event;
  10. event.Define {map/walk/boat/in} {无参} {$MODULE} {已上船};
  11. event.Define {map/walk/boat/out} {无参} {$MODULE} {即将下船};
  12. VAR {地图脚本同步信息} map.sync.room-id {};
  13. #alias {map.Sync} {
  14. #local prev {%1};
  15. #local current {%2};
  16. #local next {%3};
  17. #local message {};
  18. #if { "$prev$current$next" == "" } {
  19. #local message {WALK-SYNC-MESSAGE};
  20. };
  21. #else {
  22. #local message {F${prev}-V${current}-T$next};
  23. #var map.sync.room-id {
  24. {prev}{$prev}
  25. {current}{$current}
  26. {next}{$next}
  27. };
  28. };
  29. sync.Wait {
  30. #line gag;
  31. okLog 服务器已同步。;
  32. event.DelayEmit map/walk/continue;
  33. } {$message};
  34. };
  35. #alias {map.GuoJiang} {map.shaogong 过江};
  36. #alias {map.GuoHe} {map.shaogong 过河};
  37. #alias {map.YellBoat} {map.shaogong 自助};
  38. #alias {map.shaogong} {
  39. #local words {%1};
  40. #class map.shaogong open;
  41. #alias {map.waitBoat} { #var map-Boat-state {waitBoat} };
  42. #action {^只听得江面上隐隐传来:“别急嘛,这儿正忙着呐……”$} {
  43. #nop 不依赖触发了,用定时器靠谱一些;
  44. };
  45. #action {^岸边一只渡船上的艄公说道:正等着你呢,上来吧。$} {
  46. #if { "${map-Boat-state}" == "waitBoat" } {
  47. #var map-Boat-state {enterBoat};
  48. #untick map.yellboat;
  49. enter;
  50. event.Emit map/walk/boat/in;
  51. };
  52. };
  53. #action {^一叶扁舟缓缓地驶了过来,艄公将一块踏脚板搭上堤岸,以便乘客{上下。|}$} {
  54. #if { "${map-Boat-state}" == "waitBoat" } {
  55. #var map-Boat-state {enterBoat};
  56. #untick map.yellboat;
  57. enter;
  58. event.Emit map/walk/boat/in;
  59. };
  60. };
  61. #action {^%*接过你递给的船资%S。$} {map.waitBoat};
  62. #action {^你的车船通账上还剩%S,这一趟的船资是%S。$} {map.waitBoat};
  63. #action {^%S道:原来是%S的人,快请上船。$} {map.waitBoat};
  64. #action {^你吸了口气,一声“船家”,声音中正平和地远远传了出去。$} {map.waitBoat};
  65. #action {^你使出吃奶的力气喊了一声:“船家”$} {map.waitBoat};
  66. #action {^艄公把踏脚板收起来,说了一声“坐稳喽”,竹篙一点,扁舟向{|江心驶去。}$} {
  67. #if { "${map-Boat-state}" == "enterBoat" } {
  68. #var map-Boat-state {inBoat};
  69. #untick map.yellboat;
  70. };
  71. };
  72. #action {^艄公说{ |}“到啦,上岸吧”{ |},随即把一块踏脚板搭上堤岸。$} {
  73. #if { "${map-Boat-state}" == "inBoat" } {
  74. #nop 北侠 BUG 导致这条信息和下面赶下船的信息同时出现,这样会导致 out 失效。;
  75. #nop 所以做一些防御处理;
  76. #delay map-Boat-out {
  77. #var map.stepaccu 1;
  78. #unvar map-Boat-state;
  79. #undelay map-Boat-out;
  80. event.Emit map/walk/boat/out;
  81. busy.Halt {out; map.BotReturn map.shaogong};
  82. } {0.05};
  83. };
  84. };
  85. #action {^艄公要继续做生意了,所有人被赶下了渡船。$} {
  86. #if { "${map-Boat-state}" == "inBoat" } {
  87. #delay map-Boat-out {
  88. #var map.stepaccu 1;
  89. #unvar map-Boat-state;
  90. #undelay map-Boat-out;
  91. event.Emit map/walk/boat/out;
  92. busy.Halt {map.BotReturn map.shaogong};
  93. } {0};
  94. };
  95. };
  96. #tick map.yellboat {yell boat} 1;
  97. #class map.shaogong close;
  98. #if { "$words" == "自助" } {
  99. yell boat;
  100. };
  101. #else {
  102. ask shao gong about $words;
  103. };
  104. };
  105. #alias {map.SpecialBoat} {
  106. #class map.SpecialBoat open;
  107. #action {^你跃上木船,船夫把木船划向海中。$} {event.Emit map/walk/boat/in}; #nop 神龙岛;
  108. #action {^你朝船夫挥了挥手便跨上岸去。$} {map.SpecialBoat.return}; #nop 神龙岛;
  109. #action {^你从踏板上走上了船。$} {event.Emit map/walk/boat/in}; #nop 桃花岛;
  110. #action {^你沿着踏板走了上去。$} {map.SpecialBoat.return}; #nop 桃花岛;
  111. #action {map.SpecialBoat.return} {event.Emit map/walk/boat/out; busy.Halt {map.BotReturn map.SpecialBoat}};
  112. #class map.SpecialBoat close;
  113. enter boat;
  114. };
  115. #alias {map.Ride} {
  116. #local target {%1};
  117. #class map.Ride open;
  118. #action {^你跳上了小船,操舟向%*划去。$} {event.Emit map/walk/boat/in};
  119. #action {^你跳上了羊皮筏子,操舟向%*划去。$} {event.Emit map/walk/boat/in};
  120. #action {^你从小船上跳了下来,到了%*。$} {event.Emit map/walk/boat/out; busy.Halt {map.BotReturn map.Ride}};
  121. #class map.Ride close;
  122. ride $target;
  123. };
  124. #alias {map.BotReturn} {
  125. #local bot {%1};
  126. #class $bot kill;
  127. event.DelayEmit {map/walk/continue} {$bot};
  128. };