@maka/maka-cli 5.3.17 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/bundle/typescript/package.json +1 -1
  2. package/bundle/typescript/src/commands/game/sideQuest/archetypes.d.ts +62 -0
  3. package/bundle/typescript/src/commands/game/sideQuest/archetypes.js +196 -0
  4. package/bundle/typescript/src/commands/game/sideQuest/archetypes.js.map +1 -0
  5. package/bundle/typescript/src/commands/game/sideQuest/commands/advance.d.ts +16 -0
  6. package/bundle/typescript/src/commands/game/sideQuest/commands/advance.js +65 -0
  7. package/bundle/typescript/src/commands/game/sideQuest/commands/advance.js.map +1 -0
  8. package/bundle/typescript/src/commands/game/sideQuest/commands/assense.d.ts +16 -0
  9. package/bundle/typescript/src/commands/game/sideQuest/commands/assense.js +122 -0
  10. package/bundle/typescript/src/commands/game/sideQuest/commands/assense.js.map +1 -0
  11. package/bundle/typescript/src/commands/game/sideQuest/commands/attack.d.ts +42 -0
  12. package/bundle/typescript/src/commands/game/sideQuest/commands/attack.js +243 -0
  13. package/bundle/typescript/src/commands/game/sideQuest/commands/attack.js.map +1 -0
  14. package/bundle/typescript/src/commands/game/sideQuest/commands/bluff.d.ts +16 -0
  15. package/bundle/typescript/src/commands/game/sideQuest/commands/bluff.js +39 -0
  16. package/bundle/typescript/src/commands/game/sideQuest/commands/bluff.js.map +1 -0
  17. package/bundle/typescript/src/commands/game/sideQuest/commands/brandish.d.ts +21 -0
  18. package/bundle/typescript/src/commands/game/sideQuest/commands/brandish.js +82 -0
  19. package/bundle/typescript/src/commands/game/sideQuest/commands/brandish.js.map +1 -0
  20. package/bundle/typescript/src/commands/game/sideQuest/commands/bypass-command.d.ts +28 -0
  21. package/bundle/typescript/src/commands/game/sideQuest/commands/bypass-command.js +101 -0
  22. package/bundle/typescript/src/commands/game/sideQuest/commands/bypass-command.js.map +1 -0
  23. package/bundle/typescript/src/commands/game/sideQuest/commands/call.d.ts +19 -0
  24. package/bundle/typescript/src/commands/game/sideQuest/commands/call.js +219 -0
  25. package/bundle/typescript/src/commands/game/sideQuest/commands/call.js.map +1 -0
  26. package/bundle/typescript/src/commands/game/sideQuest/commands/cast.d.ts +58 -0
  27. package/bundle/typescript/src/commands/game/sideQuest/commands/cast.js +397 -0
  28. package/bundle/typescript/src/commands/game/sideQuest/commands/cast.js.map +1 -0
  29. package/bundle/typescript/src/commands/game/sideQuest/commands/command-registry.d.ts +11 -1
  30. package/bundle/typescript/src/commands/game/sideQuest/commands/command-registry.js +8 -3
  31. package/bundle/typescript/src/commands/game/sideQuest/commands/command-registry.js.map +1 -1
  32. package/bundle/typescript/src/commands/game/sideQuest/commands/command.d.ts +6 -0
  33. package/bundle/typescript/src/commands/game/sideQuest/commands/command.js +4 -0
  34. package/bundle/typescript/src/commands/game/sideQuest/commands/command.js.map +1 -1
  35. package/bundle/typescript/src/commands/game/sideQuest/commands/drone.d.ts +15 -0
  36. package/bundle/typescript/src/commands/game/sideQuest/commands/drone.js +72 -0
  37. package/bundle/typescript/src/commands/game/sideQuest/commands/drone.js.map +1 -0
  38. package/bundle/typescript/src/commands/game/sideQuest/commands/drop.js +3 -0
  39. package/bundle/typescript/src/commands/game/sideQuest/commands/drop.js.map +1 -1
  40. package/bundle/typescript/src/commands/game/sideQuest/commands/edge.d.ts +13 -0
  41. package/bundle/typescript/src/commands/game/sideQuest/commands/edge.js +31 -0
  42. package/bundle/typescript/src/commands/game/sideQuest/commands/edge.js.map +1 -0
  43. package/bundle/typescript/src/commands/game/sideQuest/commands/end-call.d.ts +6 -0
  44. package/bundle/typescript/src/commands/game/sideQuest/commands/end-call.js +27 -0
  45. package/bundle/typescript/src/commands/game/sideQuest/commands/end-call.js.map +1 -0
  46. package/bundle/typescript/src/commands/game/sideQuest/commands/equip.d.ts +4 -0
  47. package/bundle/typescript/src/commands/game/sideQuest/commands/equip.js +59 -2
  48. package/bundle/typescript/src/commands/game/sideQuest/commands/equip.js.map +1 -1
  49. package/bundle/typescript/src/commands/game/sideQuest/commands/equipment.d.ts +13 -0
  50. package/bundle/typescript/src/commands/game/sideQuest/commands/equipment.js +50 -0
  51. package/bundle/typescript/src/commands/game/sideQuest/commands/equipment.js.map +1 -0
  52. package/bundle/typescript/src/commands/game/sideQuest/commands/give.js +7 -1
  53. package/bundle/typescript/src/commands/game/sideQuest/commands/give.js.map +1 -1
  54. package/bundle/typescript/src/commands/game/sideQuest/commands/go.d.ts +13 -0
  55. package/bundle/typescript/src/commands/game/sideQuest/commands/go.js +147 -4
  56. package/bundle/typescript/src/commands/game/sideQuest/commands/go.js.map +1 -1
  57. package/bundle/typescript/src/commands/game/sideQuest/commands/hack.d.ts +25 -0
  58. package/bundle/typescript/src/commands/game/sideQuest/commands/hack.js +199 -0
  59. package/bundle/typescript/src/commands/game/sideQuest/commands/hack.js.map +1 -0
  60. package/bundle/typescript/src/commands/game/sideQuest/commands/haggle.d.ts +15 -0
  61. package/bundle/typescript/src/commands/game/sideQuest/commands/haggle.js +75 -0
  62. package/bundle/typescript/src/commands/game/sideQuest/commands/haggle.js.map +1 -0
  63. package/bundle/typescript/src/commands/game/sideQuest/commands/inv.d.ts +12 -0
  64. package/bundle/typescript/src/commands/game/sideQuest/commands/inv.js +43 -0
  65. package/bundle/typescript/src/commands/game/sideQuest/commands/inv.js.map +1 -0
  66. package/bundle/typescript/src/commands/game/sideQuest/commands/jack.d.ts +17 -0
  67. package/bundle/typescript/src/commands/game/sideQuest/commands/jack.js +64 -0
  68. package/bundle/typescript/src/commands/game/sideQuest/commands/jack.js.map +1 -0
  69. package/bundle/typescript/src/commands/game/sideQuest/commands/kill.d.ts +10 -3
  70. package/bundle/typescript/src/commands/game/sideQuest/commands/kill.js +11 -33
  71. package/bundle/typescript/src/commands/game/sideQuest/commands/kill.js.map +1 -1
  72. package/bundle/typescript/src/commands/game/sideQuest/commands/look.js +47 -4
  73. package/bundle/typescript/src/commands/game/sideQuest/commands/look.js.map +1 -1
  74. package/bundle/typescript/src/commands/game/sideQuest/commands/map.d.ts +12 -0
  75. package/bundle/typescript/src/commands/game/sideQuest/commands/map.js +46 -0
  76. package/bundle/typescript/src/commands/game/sideQuest/commands/map.js.map +1 -0
  77. package/bundle/typescript/src/commands/game/sideQuest/commands/pan.d.ts +12 -0
  78. package/bundle/typescript/src/commands/game/sideQuest/commands/pan.js +55 -0
  79. package/bundle/typescript/src/commands/game/sideQuest/commands/pan.js.map +1 -0
  80. package/bundle/typescript/src/commands/game/sideQuest/commands/persuade.d.ts +18 -0
  81. package/bundle/typescript/src/commands/game/sideQuest/commands/persuade.js +100 -0
  82. package/bundle/typescript/src/commands/game/sideQuest/commands/persuade.js.map +1 -0
  83. package/bundle/typescript/src/commands/game/sideQuest/commands/pick.d.ts +10 -0
  84. package/bundle/typescript/src/commands/game/sideQuest/commands/pick.js +33 -0
  85. package/bundle/typescript/src/commands/game/sideQuest/commands/pick.js.map +1 -0
  86. package/bundle/typescript/src/commands/game/sideQuest/commands/project.d.ts +19 -0
  87. package/bundle/typescript/src/commands/game/sideQuest/commands/project.js +54 -0
  88. package/bundle/typescript/src/commands/game/sideQuest/commands/project.js.map +1 -0
  89. package/bundle/typescript/src/commands/game/sideQuest/commands/read.js +6 -5
  90. package/bundle/typescript/src/commands/game/sideQuest/commands/read.js.map +1 -1
  91. package/bundle/typescript/src/commands/game/sideQuest/commands/reboot.d.ts +12 -0
  92. package/bundle/typescript/src/commands/game/sideQuest/commands/reboot.js +52 -0
  93. package/bundle/typescript/src/commands/game/sideQuest/commands/reboot.js.map +1 -0
  94. package/bundle/typescript/src/commands/game/sideQuest/commands/reload.d.ts +14 -0
  95. package/bundle/typescript/src/commands/game/sideQuest/commands/reload.js +40 -0
  96. package/bundle/typescript/src/commands/game/sideQuest/commands/reload.js.map +1 -0
  97. package/bundle/typescript/src/commands/game/sideQuest/commands/rest.d.ts +15 -0
  98. package/bundle/typescript/src/commands/game/sideQuest/commands/rest.js +59 -0
  99. package/bundle/typescript/src/commands/game/sideQuest/commands/rest.js.map +1 -0
  100. package/bundle/typescript/src/commands/game/sideQuest/commands/say.js +31 -2
  101. package/bundle/typescript/src/commands/game/sideQuest/commands/say.js.map +1 -1
  102. package/bundle/typescript/src/commands/game/sideQuest/commands/search.js +71 -7
  103. package/bundle/typescript/src/commands/game/sideQuest/commands/search.js.map +1 -1
  104. package/bundle/typescript/src/commands/game/sideQuest/commands/sheet.d.ts +12 -0
  105. package/bundle/typescript/src/commands/game/sideQuest/commands/sheet.js +58 -0
  106. package/bundle/typescript/src/commands/game/sideQuest/commands/sheet.js.map +1 -0
  107. package/bundle/typescript/src/commands/game/sideQuest/commands/silent.d.ts +13 -0
  108. package/bundle/typescript/src/commands/game/sideQuest/commands/silent.js +50 -0
  109. package/bundle/typescript/src/commands/game/sideQuest/commands/silent.js.map +1 -0
  110. package/bundle/typescript/src/commands/game/sideQuest/commands/sneak.d.ts +15 -0
  111. package/bundle/typescript/src/commands/game/sideQuest/commands/sneak.js +35 -0
  112. package/bundle/typescript/src/commands/game/sideQuest/commands/sneak.js.map +1 -0
  113. package/bundle/typescript/src/commands/game/sideQuest/commands/solve.js +32 -11
  114. package/bundle/typescript/src/commands/game/sideQuest/commands/solve.js.map +1 -1
  115. package/bundle/typescript/src/commands/game/sideQuest/commands/spells.d.ts +14 -0
  116. package/bundle/typescript/src/commands/game/sideQuest/commands/spells.js +86 -0
  117. package/bundle/typescript/src/commands/game/sideQuest/commands/spells.js.map +1 -0
  118. package/bundle/typescript/src/commands/game/sideQuest/commands/stance.d.ts +12 -0
  119. package/bundle/typescript/src/commands/game/sideQuest/commands/stance.js +41 -0
  120. package/bundle/typescript/src/commands/game/sideQuest/commands/stance.js.map +1 -0
  121. package/bundle/typescript/src/commands/game/sideQuest/commands/subdue.d.ts +21 -0
  122. package/bundle/typescript/src/commands/game/sideQuest/commands/subdue.js +43 -0
  123. package/bundle/typescript/src/commands/game/sideQuest/commands/subdue.js.map +1 -0
  124. package/bundle/typescript/src/commands/game/sideQuest/commands/surrender.d.ts +20 -0
  125. package/bundle/typescript/src/commands/game/sideQuest/commands/surrender.js +45 -0
  126. package/bundle/typescript/src/commands/game/sideQuest/commands/surrender.js.map +1 -0
  127. package/bundle/typescript/src/commands/game/sideQuest/commands/take.d.ts +8 -0
  128. package/bundle/typescript/src/commands/game/sideQuest/commands/take.js +138 -2
  129. package/bundle/typescript/src/commands/game/sideQuest/commands/take.js.map +1 -1
  130. package/bundle/typescript/src/commands/game/sideQuest/commands/talk.js +8 -0
  131. package/bundle/typescript/src/commands/game/sideQuest/commands/talk.js.map +1 -1
  132. package/bundle/typescript/src/commands/game/sideQuest/commands/unequip.js +6 -3
  133. package/bundle/typescript/src/commands/game/sideQuest/commands/unequip.js.map +1 -1
  134. package/bundle/typescript/src/commands/game/sideQuest/commands/unlock.js +1 -0
  135. package/bundle/typescript/src/commands/game/sideQuest/commands/unlock.js.map +1 -1
  136. package/bundle/typescript/src/commands/game/sideQuest/commands/use.d.ts +24 -0
  137. package/bundle/typescript/src/commands/game/sideQuest/commands/use.js +102 -1
  138. package/bundle/typescript/src/commands/game/sideQuest/commands/use.js.map +1 -1
  139. package/bundle/typescript/src/commands/game/sideQuest/factories/item-factory.js +2 -1
  140. package/bundle/typescript/src/commands/game/sideQuest/factories/item-factory.js.map +1 -1
  141. package/bundle/typescript/src/commands/game/sideQuest/factories/npc-factory.js +7 -2
  142. package/bundle/typescript/src/commands/game/sideQuest/factories/npc-factory.js.map +1 -1
  143. package/bundle/typescript/src/commands/game/sideQuest/factories/puzzle-factory.js +2 -1
  144. package/bundle/typescript/src/commands/game/sideQuest/factories/puzzle-factory.js.map +1 -1
  145. package/bundle/typescript/src/commands/game/sideQuest/factories/room-factory.js +3 -0
  146. package/bundle/typescript/src/commands/game/sideQuest/factories/room-factory.js.map +1 -1
  147. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.d.ts +175 -0
  148. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.js +673 -0
  149. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-chunks.js.map +1 -0
  150. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-factory.d.ts +8 -1
  151. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-factory.js +139 -21
  152. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-factory.js.map +1 -1
  153. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-seed-generator.d.ts +174 -0
  154. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-seed-generator.js +647 -0
  155. package/bundle/typescript/src/commands/game/sideQuest/factories/scene-seed-generator.js.map +1 -0
  156. package/bundle/typescript/src/commands/game/sideQuest/game.d.ts +138 -9
  157. package/bundle/typescript/src/commands/game/sideQuest/game.js +757 -197
  158. package/bundle/typescript/src/commands/game/sideQuest/game.js.map +1 -1
  159. package/bundle/typescript/src/commands/game/sideQuest/minigames/hack-minigame.d.ts +16 -0
  160. package/bundle/typescript/src/commands/game/sideQuest/minigames/hack-minigame.js +101 -0
  161. package/bundle/typescript/src/commands/game/sideQuest/minigames/hack-minigame.js.map +1 -0
  162. package/bundle/typescript/src/commands/game/sideQuest/minigames/lockpick-minigame.d.ts +15 -0
  163. package/bundle/typescript/src/commands/game/sideQuest/minigames/lockpick-minigame.js +95 -0
  164. package/bundle/typescript/src/commands/game/sideQuest/minigames/lockpick-minigame.js.map +1 -0
  165. package/bundle/typescript/src/commands/game/sideQuest/models/door.d.ts +10 -0
  166. package/bundle/typescript/src/commands/game/sideQuest/models/door.js +15 -2
  167. package/bundle/typescript/src/commands/game/sideQuest/models/door.js.map +1 -1
  168. package/bundle/typescript/src/commands/game/sideQuest/models/inventory.d.ts +10 -0
  169. package/bundle/typescript/src/commands/game/sideQuest/models/inventory.js +54 -4
  170. package/bundle/typescript/src/commands/game/sideQuest/models/inventory.js.map +1 -1
  171. package/bundle/typescript/src/commands/game/sideQuest/models/item.d.ts +41 -0
  172. package/bundle/typescript/src/commands/game/sideQuest/models/item.js +106 -3
  173. package/bundle/typescript/src/commands/game/sideQuest/models/item.js.map +1 -1
  174. package/bundle/typescript/src/commands/game/sideQuest/models/npc.d.ts +27 -0
  175. package/bundle/typescript/src/commands/game/sideQuest/models/npc.js +312 -50
  176. package/bundle/typescript/src/commands/game/sideQuest/models/npc.js.map +1 -1
  177. package/bundle/typescript/src/commands/game/sideQuest/models/player.d.ts +278 -0
  178. package/bundle/typescript/src/commands/game/sideQuest/models/player.js +661 -9
  179. package/bundle/typescript/src/commands/game/sideQuest/models/player.js.map +1 -1
  180. package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.d.ts +75 -1
  181. package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.js +199 -6
  182. package/bundle/typescript/src/commands/game/sideQuest/models/puzzle.js.map +1 -1
  183. package/bundle/typescript/src/commands/game/sideQuest/models/room.d.ts +24 -0
  184. package/bundle/typescript/src/commands/game/sideQuest/models/room.js +53 -18
  185. package/bundle/typescript/src/commands/game/sideQuest/models/room.js.map +1 -1
  186. package/bundle/typescript/src/commands/game/sideQuest/models/scene.d.ts +73 -0
  187. package/bundle/typescript/src/commands/game/sideQuest/models/scene.js +208 -3
  188. package/bundle/typescript/src/commands/game/sideQuest/models/scene.js.map +1 -1
  189. package/bundle/typescript/src/commands/game/sideQuest/scenes/scene1.json +319 -70
  190. package/bundle/typescript/src/commands/game/sideQuest/scenes/scene2.json +661 -227
  191. package/bundle/typescript/src/commands/game/sideQuest/types/player-equipment.d.ts +1 -0
  192. package/bundle/typescript/src/commands/game/sideQuest/types/seed/exit-seed.d.ts +1 -0
  193. package/bundle/typescript/src/commands/game/sideQuest/types/seed/item-seed.d.ts +1 -0
  194. package/bundle/typescript/src/commands/game/sideQuest/types/seed/npc-seed.d.ts +1 -0
  195. package/bundle/typescript/src/commands/game/sideQuest/types/seed/player-seed.d.ts +42 -0
  196. package/bundle/typescript/src/commands/game/sideQuest/types/seed/puzzle-seed.d.ts +15 -1
  197. package/bundle/typescript/src/commands/game/sideQuest/types/seed/room-seed.d.ts +4 -0
  198. package/bundle/typescript/src/commands/game/sideQuest/types/seed/scene-seed.d.ts +8 -0
  199. package/bundle/typescript/src/commands/game/sideQuest/types/seed/win-condition-seed.d.ts +15 -0
  200. package/bundle/typescript/src/commands/game/sideQuest/types/seed/win-condition-seed.js +2 -0
  201. package/bundle/typescript/src/commands/game/sideQuest/types/seed/win-condition-seed.js.map +1 -0
  202. package/bundle/typescript/src/commands/game/sideQuest/types/shared/abstracts.d.ts +1 -0
  203. package/bundle/typescript/src/commands/game/sideQuest/types/shared/abstracts.js +5 -0
  204. package/bundle/typescript/src/commands/game/sideQuest/types/shared/abstracts.js.map +1 -1
  205. package/bundle/typescript/src/commands/game/sideQuest/types/shared/item-enum.d.ts +1 -0
  206. package/bundle/typescript/src/commands/game/sideQuest/types/shared/item-enum.js +1 -0
  207. package/bundle/typescript/src/commands/game/sideQuest/types/shared/item-enum.js.map +1 -1
  208. package/bundle/typescript/src/commands/game/sideQuest/ui.d.ts +3 -0
  209. package/bundle/typescript/src/commands/game/sideQuest/ui.js +95 -6
  210. package/bundle/typescript/src/commands/game/sideQuest/ui.js.map +1 -1
  211. package/bundle/typescript/src/commands/game/sideQuest/utilities/auto-fight.d.ts +60 -0
  212. package/bundle/typescript/src/commands/game/sideQuest/utilities/auto-fight.js +138 -0
  213. package/bundle/typescript/src/commands/game/sideQuest/utilities/auto-fight.js.map +1 -0
  214. package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.d.ts +145 -0
  215. package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.js +354 -0
  216. package/bundle/typescript/src/commands/game/sideQuest/utilities/combat-exchange.js.map +1 -0
  217. package/bundle/typescript/src/commands/game/sideQuest/utilities/comm-style.d.ts +2 -0
  218. package/bundle/typescript/src/commands/game/sideQuest/utilities/comm-style.js +12 -0
  219. package/bundle/typescript/src/commands/game/sideQuest/utilities/comm-style.js.map +1 -0
  220. package/bundle/typescript/src/commands/game/sideQuest/utilities/dice.d.ts +22 -0
  221. package/bundle/typescript/src/commands/game/sideQuest/utilities/dice.js +34 -0
  222. package/bundle/typescript/src/commands/game/sideQuest/utilities/dice.js.map +1 -0
  223. package/bundle/typescript/src/commands/game/sideQuest/utilities/fuzzy-match.d.ts +36 -0
  224. package/bundle/typescript/src/commands/game/sideQuest/utilities/fuzzy-match.js +92 -0
  225. package/bundle/typescript/src/commands/game/sideQuest/utilities/fuzzy-match.js.map +1 -0
  226. package/bundle/typescript/src/commands/game/sideQuest/utilities/planes.d.ts +77 -0
  227. package/bundle/typescript/src/commands/game/sideQuest/utilities/planes.js +265 -0
  228. package/bundle/typescript/src/commands/game/sideQuest/utilities/planes.js.map +1 -0
  229. package/bundle/typescript/src/commands/game/sideQuest/utilities/pursuit.d.ts +16 -0
  230. package/bundle/typescript/src/commands/game/sideQuest/utilities/pursuit.js +36 -0
  231. package/bundle/typescript/src/commands/game/sideQuest/utilities/pursuit.js.map +1 -0
  232. package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js +78 -7
  233. package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js.map +1 -1
  234. package/bundle/typescript/src/commands/set/global.sub.cmd.js +59 -5
  235. package/bundle/typescript/src/commands/set/global.sub.cmd.js.map +1 -1
  236. package/bundle/typescript/src/tools/ai/ai.class.d.ts +42 -0
  237. package/bundle/typescript/src/tools/ai/ai.class.js +117 -0
  238. package/bundle/typescript/src/tools/ai/ai.class.js.map +1 -0
  239. package/bundle/typescript/src/tools/fsi/fsi.interfaces.d.ts +1 -0
  240. package/bundle/typescript/src/tools/fsi/fsi.interfaces.js.map +1 -1
  241. package/bundle/typescript/src/tools/https/https.class.d.ts +3 -2
  242. package/bundle/typescript/src/tools/https/https.class.js +51 -2
  243. package/bundle/typescript/src/tools/https/https.class.js.map +1 -1
  244. package/bundle/typescript/src/tools/https/https.interface.d.ts +10 -0
  245. package/package.json +1 -1
@@ -0,0 +1,219 @@
1
+ import { Command } from './command.js';
2
+ import { Category } from '../types/shared/item-enum.js';
3
+ import { parseArgsWithQuotes } from './talk.js';
4
+ import { CALL_ICON, CALL_COLOR } from '../utilities/comm-style.js';
5
+ import { FIXER_NAME } from '../factories/scene-seed-generator.js';
6
+ import { fuzzyPickName } from '../utilities/fuzzy-match.js';
7
+ export class CallCommand extends Command {
8
+ static verb = 'call';
9
+ static description = 'Call someone remotely over a commlink (no need to be in the same room; commlink must be equipped).';
10
+ async execute(args) {
11
+ if (!args || args.length === 0) {
12
+ return 'Usage: call <name> [message]';
13
+ }
14
+ const rawWords = parseArgsWithQuotes(args.join(' '));
15
+ if (!this.hasEquippedCommlink(this.actor)) {
16
+ return `You need to equip a commlink before you can call anyone.`;
17
+ }
18
+ // Running silent kills the broadcast both ways (see silent.ts).
19
+ if (this.actor.runningSilent) {
20
+ return `You're running silent -- your link isn't broadcasting. Go loud ("silent") before calling anyone.`;
21
+ }
22
+ // Hacked dark is a different kind of quiet (see hack.ts PAN attacks).
23
+ if (this.actor.arOffline) {
24
+ return `Your AR is CUT -- someone cracked your PAN and your link is dead air. "reboot" first.`;
25
+ }
26
+ // Talking on comms is not a quiet activity (see sneak.ts).
27
+ this.actor.sneaking = false;
28
+ // "call taxi" / "call cab": transport is a phone call away, like
29
+ // everything else in this world -- no system travel verbs. With a job
30
+ // pending, the cab comes to WHEREVER you are and takes you to the
31
+ // run; with a WRAPPED job it takes you home to the hub. Checked
32
+ // before NPC resolution ("taxi" is a service, not a person).
33
+ const spoken = rawWords.map(w => w.toLowerCase()).filter(w => w !== 'a' && w !== 'the');
34
+ if (this.game?.hasHub && (spoken[0] === 'taxi' || spoken[0] === 'cab')) {
35
+ if (this.actor.plane !== 'meat') {
36
+ return this.actor.plane === 'matrix'
37
+ ? `Cabs take bodies, not personas -- "jack out" first.`
38
+ : `Cabs take bodies, not ghosts -- "return" first.`;
39
+ }
40
+ if (this.actor.inExchange) {
41
+ return `Mid-fight is no time to hail a cab.`;
42
+ }
43
+ if (this.scene.isHub && this.game.pendingRun) {
44
+ this.actor.performAction('calls a taxi', 'and steps to the curb');
45
+ const ride = this.game.pendingRide;
46
+ const trip = await this.game.launchPendingRun();
47
+ return `${ride?.arrive ?? 'A cab pulls up.'}\n${ride?.board ?? 'You climb in.'}\n${trip}`;
48
+ }
49
+ if (!this.scene.isHub && this.scene.isCompleted()) {
50
+ this.actor.performAction('calls a taxi', 'for the ride home');
51
+ const home = await this.game.continueToNextScene();
52
+ return `A cab noses out of the dark and finds you like it always knew where you'd be.\n${home}`;
53
+ }
54
+ if (this.scene.isHub) {
55
+ return `The dispatcher's bored voice: "No fare on the books for you, chummer." (No job arranged -- "call ${FIXER_NAME}" first.)`;
56
+ }
57
+ return `No cab rolls into the middle of a live job. Finish it -- or walk.`;
58
+ }
59
+ const { target, remainingWords } = this.resolveTargetAndMessage(rawWords);
60
+ if (!target) {
61
+ return `You don't know anyone by the name "${rawWords[0]}" to call.`;
62
+ }
63
+ if (target === this.actor) {
64
+ return "You can't call yourself.";
65
+ }
66
+ if (!this.hasCommlink(target)) {
67
+ return `You don't get through -- ${target.name} doesn't seem to have a commlink.`;
68
+ }
69
+ if (target.runningSilent) {
70
+ return `You can't raise ${target.name} -- their link isn't broadcasting. They're running silent.`;
71
+ }
72
+ // HUB flow: calling the fixer from home isn't a conversation -- it's
73
+ // the COMMISSION. He answers, tells you to stay by your link, and
74
+ // hangs up; the job arrives as HIS callback the moment drafting lands
75
+ // (see Game.draftNextScene's incoming-call handoff). No lingering
76
+ // chat: a real session found it confusing to still be talking to the
77
+ // man who just said "I'll call you back."
78
+ if (this.game && this.game.hasHub && this.scene.isHub && target.name === FIXER_NAME) {
79
+ this.actor.performAction('calls', target.name);
80
+ // A job is WAITING: this call is the offer. The line connects for
81
+ // real -- his AI pitches it in his own voice, the rate can be
82
+ // haggled right here (haggle.ts reads the pending seed), and
83
+ // "travel" is what actually takes it. Calling again re-delivers.
84
+ const pending = this.game.pendingRun;
85
+ if (pending) {
86
+ this.actor.activeCallPartner = target;
87
+ target.activeCallPartner = this.actor;
88
+ void Promise.resolve(target.hear(this.actor, `[System note: you sent ${this.actor.name} a message about a job and they are calling back. Pitch it in your own voice: "${pending.name}" -- ${pending.story} The payout is EXACTLY ${pending.winCondition?.payout ?? 'unset'} nuyen (they may haggle). The fare's on the client's account -- taking the job means calling a taxi ("call taxi"), which picks them up wherever they are.]`)).catch(err => {
89
+ this.logger.error(`${target.name} failed to pitch the pending job: ${err}`);
90
+ });
91
+ return `${CALL_ICON} ${FIXER_NAME} picks up.\n=== JOB OFFER #${this.game.pendingRunTier}: ${pending.name} ===\n${pending.story}\n("haggle" to talk rate, "end-call" to think. Fare's on the client -- "call taxi" when you're in.)`;
92
+ }
93
+ const gate = this.game.canDraftNextScene();
94
+ // Plain text (icon only, no color tags): a real session saw the
95
+ // closing tag render literally on this line.
96
+ if (gate.allowed) {
97
+ this.game.draftNextSceneInBackground();
98
+ return `${CALL_ICON} One ring. "${FIXER_NAME}. I'll have work for you shortly -- I'll ping you." Click.`;
99
+ }
100
+ return `${CALL_ICON} One ring. "${gate.message ?? 'Working on it.'}" Click.`;
101
+ }
102
+ const message = remainingWords.join(' ');
103
+ const greeting = message || `(calling) You there, ${target.name}?`;
104
+ this.actor.performAction('calls', target.name);
105
+ this.logger.write(`${this.actor.name} calls ${target.name}: "${greeting}"`);
106
+ // Cleanly disconnect any stale prior call on either side before linking
107
+ // the new one -- otherwise a former partner would be left thinking
108
+ // they're still connected (their own "say" would keep routing to
109
+ // someone who's since moved on). See end-call.ts for the explicit
110
+ // version of this same disconnect.
111
+ if (this.actor.activeCallPartner && this.actor.activeCallPartner !== target) {
112
+ this.actor.activeCallPartner.activeCallPartner = undefined;
113
+ }
114
+ if (target.activeCallPartner && target.activeCallPartner !== this.actor) {
115
+ target.activeCallPartner.activeCallPartner = undefined;
116
+ }
117
+ // Symmetric: either side can now reach the other with an ordinary
118
+ // "say", not just this initial hail -- see say.ts. Stays connected
119
+ // until "end-call" (or a new call replaces it, per above).
120
+ this.actor.activeCallPartner = target;
121
+ target.activeCallPartner = this.actor;
122
+ // If the caller is holding this run's win-condition macguffin and
123
+ // calls its intended recipient, treat the call itself as the hand-off.
124
+ // Fixers work deals over comms, not face to face -- there's no in-world
125
+ // reason a physical "give" should ever be required for a job-giver
126
+ // who's meant to be unreachable in person. Resolved synchronously
127
+ // (doesn't depend on the NPC's reply), so it's reflected in this
128
+ // command's own return text right away.
129
+ let deliveryNote = '';
130
+ let deliveredItemName = '';
131
+ const wc = this.scene.getWinCondition();
132
+ if (wc?.type === 'give' && wc.toNpc?.toLowerCase() === target.name.toLowerCase()) {
133
+ const item = this.actor.inventory.getItem(wc.item);
134
+ if (item) {
135
+ const delivered = this.actor.inventory.transferItemTo(item.name, target.inventory);
136
+ if (delivered) {
137
+ this.scene.updateInventory(this.scene.getPlayer().inventory);
138
+ this.scene.checkWinCondition(item.name, target.name);
139
+ deliveryNote = ` You relay that you have the ${item.name} -- consider it delivered.`;
140
+ deliveredItemName = item.name;
141
+ }
142
+ }
143
+ }
144
+ // Fold the delivery into what the NPC actually hears (not just the
145
+ // player-facing confirmation above) -- otherwise an NPC whose reply is
146
+ // AI-generated has no way to know the job's already done, and keeps
147
+ // asking about it on a callback.
148
+ const heardMessage = deliveredItemName
149
+ ? `${greeting} [System note: ${this.actor.name} just delivered "${deliveredItemName}" to you over this call.]`
150
+ : greeting;
151
+ // Deliberately does NOT require sharing a room with the target -- the
152
+ // whole point of a commlink call is reaching someone you can't walk up
153
+ // to (a fixer working from a hideout you'll never set foot in, say).
154
+ // Deliberately NOT awaited: the target's reply (if any) comes from an
155
+ // AI round-trip and announces itself to the screen on its own once it
156
+ // arrives. Awaiting it here would block this confirmation behind that
157
+ // delay, so the reply could render before "You call X" does -- making
158
+ // it look like the call was never actually made.
159
+ void Promise.resolve(target.hear(this.actor, heardMessage)).catch(err => {
160
+ this.logger.error(`${target.name} failed to handle a call from ${this.actor.name}: ${err}`);
161
+ });
162
+ // Calling ${FIXER_NAME} once the job's done is what actually gets you
163
+ // the next one -- the in-fiction equivalent of typing "continue", which
164
+ // still works too as an explicit fallback. Deliberately checks the
165
+ // fixer's identity directly, NOT the win condition's toNpc: a job's
166
+ // "give" target is often a one-off contact ${FIXER_NAME} pointed the
167
+ // runner toward, not ${FIXER_NAME} himself (see the "broker, not always
168
+ // the destination" convention), so it's ${FIXER_NAME} specifically who
169
+ // lines up the next gig, regardless of who this job's delivery went to.
170
+ // Not gated on this call being the one that JUST completed the job:
171
+ // checking in on an already-finished job (e.g. delivered via "give"
172
+ // instead) triggers it just as well. Runs in the background (see
173
+ // Game.draftNextSceneInBackground()) -- job generation can take 20-40+
174
+ // seconds, and this confirmation shouldn't wait behind it.
175
+ //
176
+ // CLASSIC sessions only (hub calls short-circuit above): calling the
177
+ // fixer after a completed job chain-drafts the next one. In hub
178
+ // sessions a finished run's Johnson call is just a call -- "continue"
179
+ // home first, then commission the next job from there.
180
+ if (this.game && target.name === FIXER_NAME
181
+ && !this.game.hasHub
182
+ && this.game.canDraftNextScene().allowed) {
183
+ this.game.draftNextSceneInBackground();
184
+ }
185
+ return `{${CALL_COLOR}-fg}${CALL_ICON} You call ${target.name}: "${greeting}"${deliveryNote}{/${CALL_COLOR}-fg}`;
186
+ }
187
+ hasEquippedCommlink(actor) {
188
+ return actor.equipment.head?.commlink != null;
189
+ }
190
+ hasCommlink(actor) {
191
+ const inInventory = actor.inventory.getAllItems().some(item => item.category === Category.Commlink);
192
+ return inInventory || this.hasEquippedCommlink(actor);
193
+ }
194
+ /**
195
+ * Multi-word names ("Mr. Johnson") shouldn't require the player to quote
196
+ * them just to call someone, and partial names shouldn't fail -- found
197
+ * via real sessions where "call Mr. Johnson" (period parsing), then
198
+ * "call mr" and "call Mr. J" (partials) all bounced. Tries progressively
199
+ * shorter word-prefixes of the input (longest first), resolving each
200
+ * through the same fuzzy matcher "take"/"attack"/"cast" use (punctuation
201
+ * and typo tolerant; an ambiguous fragment deliberately misses).
202
+ * Whatever's left over after the matched name becomes the message.
203
+ */
204
+ resolveTargetAndMessage(words) {
205
+ // Includes the caller too, so "call <own name>" resolves into the
206
+ // actual "can't call yourself" check below rather than a confusing
207
+ // "don't know anyone" -- self is never a real target.
208
+ const candidates = [this.actor, ...this.scene.allActors];
209
+ const names = candidates.map(a => a.name);
210
+ for (let i = words.length; i >= 1; i--) {
211
+ const picked = fuzzyPickName(words.slice(0, i).join(' '), names);
212
+ if (picked) {
213
+ return { target: candidates.find(a => a.name === picked), remainingWords: words.slice(i) };
214
+ }
215
+ }
216
+ return { target: undefined, remainingWords: [] };
217
+ }
218
+ }
219
+ //# sourceMappingURL=call.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"call.js","sourceRoot":"","sources":["../../../../../../../src/commands/game/sideQuest/commands/call.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,MAAM,OAAO,WAAY,SAAQ,OAAO;IAC5B,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC;IACrB,MAAM,CAAC,WAAW,GAAG,oGAAoG,CAAC;IAEpI,KAAK,CAAC,OAAO,CAAC,IAAc;QAC1B,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/B,OAAO,8BAA8B,CAAC;QACxC,CAAC;QAED,MAAM,QAAQ,GAAG,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAErD,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1C,OAAO,0DAA0D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K,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACpG,OAAO,WAAW,IAAI,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC;IAED;;;;;;;;;OASG;IACK,uBAAuB,CAAC,KAAe;QAC7C,kEAAkE;QAClE,mEAAmE;QACnE,sDAAsD;QACtD,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACzD,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAE1C,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;YACjE,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,EAAE,cAAc,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7F,CAAC;QACH,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC;IACnD,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { BypassCommand } from './bypass-command.js';
2
+ import { PuzzleBypassType } from '../types/seed/puzzle-seed.js';
3
+ /**
4
+ * Gear-driven spellcasting (see Player's magic section): you know a spell
5
+ * if you carry its SpellFormula (or any Grimoire), and the best Focus on
6
+ * you scales the casting pool. "cast <spell> [at <target>]" casts; a bare
7
+ * "cast" (or "cast <direction/barrier>") is still the ward-bypass route
8
+ * inherited from BypassCommand -- now gated on actually having magic gear,
9
+ * instead of being a free-floating coin flip anyone could attempt.
10
+ */
11
+ export declare class CastCommand extends BypassCommand {
12
+ protected static verb: string;
13
+ protected static description: string;
14
+ protected bypassType: PuzzleBypassType;
15
+ protected noPuzzleMessage: string;
16
+ execute(args?: string[]): Promise<string>;
17
+ /**
18
+ * Lenient spell-name matching: the exact key, or a unique fragment of at
19
+ * least 3 characters ("bolt"/"mana" -> manabolt). Anything that doesn't
20
+ * resolve falls through to the ward-bypass path, which is what a
21
+ * direction or barrier name ("cast north", "cast maglock") needs.
22
+ */
23
+ private resolveSpellName;
24
+ private castSpell;
25
+ /**
26
+ * Support spells (heal/armor) default to SELF but can target an ally:
27
+ * "cast heal on jinx". Touch range -- the target must share the room --
28
+ * and the same fuzzy name matching as everything else. Returns an error
29
+ * string instead of a target when the name can't be resolved here.
30
+ */
31
+ private resolveAllyTarget;
32
+ /** How the caster's pool reads in narration: focus-assisted, raw talent, or book-learned. */
33
+ private castingLabel;
34
+ /**
35
+ * Drain, resolved AFTER the spell: resist with Body, take whatever gets
36
+ * through as STUN damage -- casting doesn't cut you, it wrings you out.
37
+ * A full stun track is a knockout, and overflow past it spills into the
38
+ * physical track (enough drain doesn't just put you down, it starts
39
+ * killing you). Callers check drainCollapse() afterward.
40
+ */
41
+ private applyDrain;
42
+ /**
43
+ * What the drain just did to the caster, if anything: overflow filling
44
+ * the physical track is a burnout DEATH; a full stun track alone is a
45
+ * knockout -- out of the run, but honestly narrated as unconsciousness.
46
+ */
47
+ private drainCollapse;
48
+ private castManabolt;
49
+ private castHeal;
50
+ private castArmor;
51
+ /**
52
+ * Non-combat casts are a single block, no exchange pacing needed: the
53
+ * player's own casts return the text for ui.ts to print, while an NPC's
54
+ * cast self-announces to a witnessing player (its return value only ever
55
+ * feeds its AI history) -- same rationale as CombatExchange.
56
+ */
57
+ private finishSpell;
58
+ }