NormalEventProc.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?php
  2. namespace loyalsoft;
  3. /**
  4. * 事件类型定义
  5. * author: gwang, 2020年11月30日17:56:01
  6. */
  7. class EEventType {
  8. /**
  9. * hello world
  10. */
  11. const HelloWorld = "HelloWorld";
  12. /**
  13. * 给予道具
  14. */
  15. const AddItem = "AddItem";
  16. /**
  17. * 移除道具
  18. */
  19. const RemoveItem = "RemoveItem";
  20. /**
  21. * 给予任务
  22. */
  23. const AddTaskItem = "AddTaskItem";
  24. /**
  25. * 移除任务
  26. */
  27. const RemoveTaskItem = "RemoveTaskItem";
  28. /**
  29. * 完成任务步骤
  30. */
  31. const MissionStepComplete = "MissionStepComplete";
  32. /**
  33. * 任务卡完成
  34. */
  35. const TaskCardFinished = "TaskCardFinished";
  36. /**
  37. * 开启一段剧情对话
  38. */
  39. const StartPlot = "StartPlot";
  40. /**
  41. * 开启npc对话
  42. */
  43. const NpcDialog = "NpcDialog";
  44. }
  45. /**
  46. * 系统事件处理模块
  47. * @author gwang
  48. */
  49. class NormalEventProc {
  50. //put your code here
  51. public static function OnHelloWorld($arg1, $arg2) {
  52. Resp::AddEvent(EEventType::HelloWorld, $arg1, $arg2);
  53. }
  54. /**
  55. * 包裹--获得新的道具
  56. * @param type $arg1
  57. * @param type $arg2
  58. */
  59. public static function OnBag_new_Item($arg1, $arg2) {
  60. Resp::AddEvent(EEventType::AddItem, $arg1, $arg2);
  61. }
  62. /**
  63. * 包裹--移除道具
  64. * @param type $arg1
  65. * @param type $arg2
  66. */
  67. public static function OnBag_Remove_Item($arg1, $arg2) {
  68. Resp::AddEvent(EEventType::RemoveItem, $arg1, $arg2);
  69. }
  70. /**
  71. * 任务卡包裹--获得新的任务卡
  72. * @param type $arg1
  73. * @param type $arg2
  74. */
  75. public static function OnTaskBag_new_Card($arg1, $arg2) {
  76. Resp::AddEvent(EEventType::AddTaskItem, $arg1, $arg2);
  77. }
  78. //
  79. /**
  80. * 任务卡包裹--移除任务卡
  81. * @param type $arg1
  82. * @param type $arg2
  83. */
  84. public static function OnTaskBag_remove_Card($arg1, $arg2) {
  85. Resp::AddEvent(EEventType::AddYanling, $arg1, $arg2);
  86. }
  87. /**
  88. * 任务卡-任务步骤完成
  89. * @param type $arg1
  90. * @param type $arg2
  91. */
  92. public static function OnTaskCardStep_Complete($arg1, $arg2) {
  93. Resp::AddEvent(EEventType::MissionStepComplete, $arg1, $arg2);
  94. }
  95. /**
  96. * 任务卡-完成
  97. * @param type $arg1
  98. * @param type $arg2
  99. */
  100. public static function OnTaskCard_Finish($arg1, $arg2) {
  101. Resp::AddEvent(EEventType::TaskCardFinished, $arg1, $arg2);
  102. }
  103. /**
  104. * 剧情-开启一段新对话
  105. * @param type $arg1
  106. * @param type $arg2
  107. */
  108. public static function OnPlot_startNew($arg1, $arg2) {
  109. Resp::AddEvent(EEventType::StartPlot, $arg1, $arg2);
  110. }
  111. /**
  112. * 剧情-开启一段NPC对话
  113. * @param type $arg1
  114. * @param type $arg2
  115. */
  116. public static function OnNpcDialog_startNew($arg1, $arg2) {
  117. Resp::AddEvent(EEventType::NpcDialog, $arg1, $arg2);
  118. }
  119. }