@fnndsc/brasa 0.42.0 → 0.43.1

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 (184) hide show
  1. package/dist/buildinfo.json +1 -1
  2. package/dist/builtins/fs/mkdir.js +28 -1
  3. package/dist/builtins/fs/mkdir.js.map +1 -1
  4. package/dist/builtins/games/trek.d.ts +8 -0
  5. package/dist/builtins/games/trek.js +50 -0
  6. package/dist/builtins/games/trek.js.map +1 -0
  7. package/dist/builtins/help.js +57 -0
  8. package/dist/builtins/help.js.map +1 -1
  9. package/dist/builtins/helpSections.js +7 -1
  10. package/dist/builtins/helpSections.js.map +1 -1
  11. package/dist/builtins/sys/textFilters.d.ts +107 -0
  12. package/dist/builtins/sys/textFilters.js +465 -0
  13. package/dist/builtins/sys/textFilters.js.map +1 -0
  14. package/dist/core/commandOrder.js +3 -3
  15. package/dist/core/commandOrder.js.map +1 -1
  16. package/dist/core/coreCommands.js +14 -1
  17. package/dist/core/coreCommands.js.map +1 -1
  18. package/dist/lib/completer/index.js +1 -1
  19. package/dist/lib/completer/index.js.map +1 -1
  20. package/dist/notes.json +1 -1
  21. package/package.json +4 -4
  22. package/NOTICE +0 -48
  23. package/dist/builtins/games/trek/abandon.d.ts +0 -3
  24. package/dist/builtins/games/trek/abandon.js +0 -159
  25. package/dist/builtins/games/trek/abandon.js.map +0 -1
  26. package/dist/builtins/games/trek/attack.d.ts +0 -3
  27. package/dist/builtins/games/trek/attack.js +0 -185
  28. package/dist/builtins/games/trek/attack.js.map +0 -1
  29. package/dist/builtins/games/trek/autover.d.ts +0 -3
  30. package/dist/builtins/games/trek/autover.js +0 -79
  31. package/dist/builtins/games/trek/autover.js.map +0 -1
  32. package/dist/builtins/games/trek/capture.d.ts +0 -3
  33. package/dist/builtins/games/trek/capture.js +0 -117
  34. package/dist/builtins/games/trek/capture.js.map +0 -1
  35. package/dist/builtins/games/trek/check_out.d.ts +0 -3
  36. package/dist/builtins/games/trek/check_out.js +0 -67
  37. package/dist/builtins/games/trek/check_out.js.map +0 -1
  38. package/dist/builtins/games/trek/checkcond.d.ts +0 -3
  39. package/dist/builtins/games/trek/checkcond.js +0 -101
  40. package/dist/builtins/games/trek/checkcond.js.map +0 -1
  41. package/dist/builtins/games/trek/compkl.d.ts +0 -8
  42. package/dist/builtins/games/trek/compkl.js +0 -66
  43. package/dist/builtins/games/trek/compkl.js.map +0 -1
  44. package/dist/builtins/games/trek/computer.d.ts +0 -3
  45. package/dist/builtins/games/trek/computer.js +0 -310
  46. package/dist/builtins/games/trek/computer.js.map +0 -1
  47. package/dist/builtins/games/trek/consts.d.ts +0 -109
  48. package/dist/builtins/games/trek/consts.js +0 -159
  49. package/dist/builtins/games/trek/consts.js.map +0 -1
  50. package/dist/builtins/games/trek/context.d.ts +0 -27
  51. package/dist/builtins/games/trek/context.js +0 -2
  52. package/dist/builtins/games/trek/context.js.map +0 -1
  53. package/dist/builtins/games/trek/damage.d.ts +0 -3
  54. package/dist/builtins/games/trek/damage.js +0 -87
  55. package/dist/builtins/games/trek/damage.js.map +0 -1
  56. package/dist/builtins/games/trek/damaged.d.ts +0 -3
  57. package/dist/builtins/games/trek/damaged.js +0 -58
  58. package/dist/builtins/games/trek/damaged.js.map +0 -1
  59. package/dist/builtins/games/trek/dcrept.d.ts +0 -3
  60. package/dist/builtins/games/trek/dcrept.js +0 -86
  61. package/dist/builtins/games/trek/dcrept.js.map +0 -1
  62. package/dist/builtins/games/trek/destruct.d.ts +0 -3
  63. package/dist/builtins/games/trek/destruct.js +0 -114
  64. package/dist/builtins/games/trek/destruct.js.map +0 -1
  65. package/dist/builtins/games/trek/dock.d.ts +0 -5
  66. package/dist/builtins/games/trek/dock.js +0 -133
  67. package/dist/builtins/games/trek/dock.js.map +0 -1
  68. package/dist/builtins/games/trek/dumpgame.d.ts +0 -15
  69. package/dist/builtins/games/trek/dumpgame.js +0 -29
  70. package/dist/builtins/games/trek/dumpgame.js.map +0 -1
  71. package/dist/builtins/games/trek/dumpme.d.ts +0 -3
  72. package/dist/builtins/games/trek/dumpme.js +0 -81
  73. package/dist/builtins/games/trek/dumpme.js.map +0 -1
  74. package/dist/builtins/games/trek/dumpssradio.d.ts +0 -6
  75. package/dist/builtins/games/trek/dumpssradio.js +0 -72
  76. package/dist/builtins/games/trek/dumpssradio.js.map +0 -1
  77. package/dist/builtins/games/trek/events.d.ts +0 -3
  78. package/dist/builtins/games/trek/events.js +0 -407
  79. package/dist/builtins/games/trek/events.js.map +0 -1
  80. package/dist/builtins/games/trek/getcodi.d.ts +0 -14
  81. package/dist/builtins/games/trek/getcodi.js +0 -24
  82. package/dist/builtins/games/trek/getcodi.js.map +0 -1
  83. package/dist/builtins/games/trek/getpar.d.ts +0 -40
  84. package/dist/builtins/games/trek/getpar.js +0 -174
  85. package/dist/builtins/games/trek/getpar.js.map +0 -1
  86. package/dist/builtins/games/trek/help.d.ts +0 -3
  87. package/dist/builtins/games/trek/help.js +0 -155
  88. package/dist/builtins/games/trek/help.js.map +0 -1
  89. package/dist/builtins/games/trek/impulse.d.ts +0 -6
  90. package/dist/builtins/games/trek/impulse.js +0 -85
  91. package/dist/builtins/games/trek/impulse.js.map +0 -1
  92. package/dist/builtins/games/trek/initquad.d.ts +0 -17
  93. package/dist/builtins/games/trek/initquad.js +0 -79
  94. package/dist/builtins/games/trek/initquad.js.map +0 -1
  95. package/dist/builtins/games/trek/io.d.ts +0 -102
  96. package/dist/builtins/games/trek/io.js +0 -216
  97. package/dist/builtins/games/trek/io.js.map +0 -1
  98. package/dist/builtins/games/trek/kill.d.ts +0 -21
  99. package/dist/builtins/games/trek/kill.js +0 -194
  100. package/dist/builtins/games/trek/kill.js.map +0 -1
  101. package/dist/builtins/games/trek/klmove.d.ts +0 -3
  102. package/dist/builtins/games/trek/klmove.js +0 -181
  103. package/dist/builtins/games/trek/klmove.js.map +0 -1
  104. package/dist/builtins/games/trek/lose.d.ts +0 -9
  105. package/dist/builtins/games/trek/lose.js +0 -36
  106. package/dist/builtins/games/trek/lose.js.map +0 -1
  107. package/dist/builtins/games/trek/lrscan.d.ts +0 -3
  108. package/dist/builtins/games/trek/lrscan.js +0 -96
  109. package/dist/builtins/games/trek/lrscan.js.map +0 -1
  110. package/dist/builtins/games/trek/main.d.ts +0 -24
  111. package/dist/builtins/games/trek/main.js +0 -37
  112. package/dist/builtins/games/trek/main.js.map +0 -1
  113. package/dist/builtins/games/trek/move.d.ts +0 -3
  114. package/dist/builtins/games/trek/move.js +0 -229
  115. package/dist/builtins/games/trek/move.js.map +0 -1
  116. package/dist/builtins/games/trek/nova.d.ts +0 -3
  117. package/dist/builtins/games/trek/nova.js +0 -135
  118. package/dist/builtins/games/trek/nova.js.map +0 -1
  119. package/dist/builtins/games/trek/out.d.ts +0 -3
  120. package/dist/builtins/games/trek/out.js +0 -52
  121. package/dist/builtins/games/trek/out.js.map +0 -1
  122. package/dist/builtins/games/trek/phaser.d.ts +0 -3
  123. package/dist/builtins/games/trek/phaser.js +0 -341
  124. package/dist/builtins/games/trek/phaser.js.map +0 -1
  125. package/dist/builtins/games/trek/play.d.ts +0 -3
  126. package/dist/builtins/games/trek/play.js +0 -112
  127. package/dist/builtins/games/trek/play.js.map +0 -1
  128. package/dist/builtins/games/trek/printf.d.ts +0 -31
  129. package/dist/builtins/games/trek/printf.js +0 -157
  130. package/dist/builtins/games/trek/printf.js.map +0 -1
  131. package/dist/builtins/games/trek/ram.d.ts +0 -3
  132. package/dist/builtins/games/trek/ram.js +0 -97
  133. package/dist/builtins/games/trek/ram.js.map +0 -1
  134. package/dist/builtins/games/trek/rand.d.ts +0 -29
  135. package/dist/builtins/games/trek/rand.js +0 -109
  136. package/dist/builtins/games/trek/rand.js.map +0 -1
  137. package/dist/builtins/games/trek/rest.d.ts +0 -3
  138. package/dist/builtins/games/trek/rest.js +0 -76
  139. package/dist/builtins/games/trek/rest.js.map +0 -1
  140. package/dist/builtins/games/trek/schedule.d.ts +0 -23
  141. package/dist/builtins/games/trek/schedule.js +0 -55
  142. package/dist/builtins/games/trek/schedule.js.map +0 -1
  143. package/dist/builtins/games/trek/score.d.ts +0 -8
  144. package/dist/builtins/games/trek/score.js +0 -61
  145. package/dist/builtins/games/trek/score.js.map +0 -1
  146. package/dist/builtins/games/trek/setup.d.ts +0 -18
  147. package/dist/builtins/games/trek/setup.js +0 -251
  148. package/dist/builtins/games/trek/setup.js.map +0 -1
  149. package/dist/builtins/games/trek/setwarp.d.ts +0 -8
  150. package/dist/builtins/games/trek/setwarp.js +0 -28
  151. package/dist/builtins/games/trek/setwarp.js.map +0 -1
  152. package/dist/builtins/games/trek/shield.d.ts +0 -3
  153. package/dist/builtins/games/trek/shield.js +0 -139
  154. package/dist/builtins/games/trek/shield.js.map +0 -1
  155. package/dist/builtins/games/trek/snova.d.ts +0 -3
  156. package/dist/builtins/games/trek/snova.js +0 -156
  157. package/dist/builtins/games/trek/snova.js.map +0 -1
  158. package/dist/builtins/games/trek/srscan.d.ts +0 -3
  159. package/dist/builtins/games/trek/srscan.js +0 -176
  160. package/dist/builtins/games/trek/srscan.js.map +0 -1
  161. package/dist/builtins/games/trek/state.d.ts +0 -190
  162. package/dist/builtins/games/trek/state.js +0 -84
  163. package/dist/builtins/games/trek/state.js.map +0 -1
  164. package/dist/builtins/games/trek/style.d.ts +0 -7
  165. package/dist/builtins/games/trek/style.js +0 -93
  166. package/dist/builtins/games/trek/style.js.map +0 -1
  167. package/dist/builtins/games/trek/systemname.d.ts +0 -10
  168. package/dist/builtins/games/trek/systemname.js +0 -12
  169. package/dist/builtins/games/trek/systemname.js.map +0 -1
  170. package/dist/builtins/games/trek/torped.d.ts +0 -3
  171. package/dist/builtins/games/trek/torped.js +0 -232
  172. package/dist/builtins/games/trek/torped.js.map +0 -1
  173. package/dist/builtins/games/trek/trek.d.ts +0 -27
  174. package/dist/builtins/games/trek/trek.js +0 -96
  175. package/dist/builtins/games/trek/trek.js.map +0 -1
  176. package/dist/builtins/games/trek/visual.d.ts +0 -3
  177. package/dist/builtins/games/trek/visual.js +0 -87
  178. package/dist/builtins/games/trek/visual.js.map +0 -1
  179. package/dist/builtins/games/trek/warp.d.ts +0 -5
  180. package/dist/builtins/games/trek/warp.js +0 -173
  181. package/dist/builtins/games/trek/warp.js.map +0 -1
  182. package/dist/builtins/games/trek/win.d.ts +0 -12
  183. package/dist/builtins/games/trek/win.js +0 -34
  184. package/dist/builtins/games/trek/win.js.map +0 -1
@@ -1,114 +0,0 @@
1
- /*
2
- * destruct.ts: a TypeScript port of BSD trek(6), from destruct.c.
3
- * Ported from NetBSD src/games/trek (trunk 7a9ca154a8f6144307865f23390a3c63b400b801): destruct.c 1.10 2009/05/24.
4
- *
5
- * Copyright (c) 1980, 1993
6
- * The Regents of the University of California. All rights reserved.
7
- *
8
- * Redistribution and use in source and binary forms, with or without
9
- * modification, are permitted provided that the following conditions
10
- * are met:
11
- * 1. Redistributions of source code must retain the above copyright
12
- * notice, this list of conditions and the following disclaimer.
13
- * 2. Redistributions in binary form must reproduce the above copyright
14
- * notice, this list of conditions and the following disclaimer in the
15
- * documentation and/or other materials provided with the distribution.
16
- * 3. Neither the name of the University nor the names of its contributors
17
- * may be used to endorse or promote products derived from this software
18
- * without specific prior written permission.
19
- *
20
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30
- * SUCH DAMAGE.
31
- *
32
- */
33
- /**
34
- * @file The self destruct sequence: a countdown, the game's password, and
35
- * whatever is near enough to go up with the ship.
36
- *
37
- * @module
38
- */
39
- import { COMPUTER, L_DSTRCT } from './consts.js';
40
- import { damaged } from './damaged.js';
41
- import { getstrpar, skiptonl } from './getpar.js';
42
- import { killk } from './kill.js';
43
- import { lose } from './lose.js';
44
- import { out } from './out.js';
45
- /*
46
- ** Self Destruct Sequence
47
- **
48
- ** The computer starts up the self destruct sequence. Obviously,
49
- ** if the computer is out nothing can happen. You get a countdown
50
- ** and a request for password. This must match the password that
51
- ** you entered at the start of the game.
52
- **
53
- ** You get to destroy things when you blow up; hence, it is
54
- ** possible to win the game by destructing if you take the last
55
- ** Klingon with you.
56
- **
57
- ** By the way, the \032 in the message is a ^Z, which is because
58
- ** the terminal in my office is an ADM-3, which uses that char-
59
- ** acter to clear the screen. I also stick in a \014 (form feed)
60
- ** because that clears some other screens.
61
- **
62
- ** Uses trace flag 41
63
- */
64
- /** Self Destruct Sequence */
65
- export async function destruct(t, _v) {
66
- let i;
67
- if (damaged(t, COMPUTER)) {
68
- await out(t, COMPUTER);
69
- return;
70
- }
71
- t.io.printf('\n\x07 --- WORKING ---\x07\n');
72
- await t.io.sleep(3);
73
- /* output the count 10 9 8 7 6 */
74
- for (i = 10; i > 5; i--) {
75
- for (let j = 10; j > i; j--)
76
- t.io.printf(' ');
77
- t.io.printf('%d\n', i);
78
- await t.io.sleep(1);
79
- }
80
- /* check for password on new line only */
81
- await skiptonl(t, 0);
82
- const checkpass = await getstrpar(t, 'Enter password verification', 14, null);
83
- await t.io.sleep(2);
84
- if (checkpass !== t.s.Game.passwd) {
85
- t.io.printf('Self destruct sequence aborted\n');
86
- return;
87
- }
88
- t.io.printf('Password verified; self destruct sequence continues:\n');
89
- await t.io.sleep(2);
90
- /* output count 5 4 3 2 1 0 */
91
- for (i = 5; i >= 0; i--) {
92
- await t.io.sleep(1);
93
- for (let j = 5; j > i; j--)
94
- t.io.printf(' ');
95
- t.io.printf('%d\n', i);
96
- }
97
- await t.io.sleep(2);
98
- t.io.printf('\x1a\x0c***** %s destroyed *****\n', t.s.Ship.shipname);
99
- t.s.Game.killed = 1;
100
- /* let's see what we can blow up!!!! */
101
- const zap = 20.0 * t.s.Ship.energy;
102
- t.s.Game.deaths += t.s.Ship.crew;
103
- for (i = 0; i < t.s.Etc.nkling;) {
104
- const k = t.s.Etc.klingon[i];
105
- if (k.power * k.dist <= zap)
106
- await killk(t, k.x, k.y);
107
- else
108
- i++;
109
- }
110
- /* if we didn't kill the last Klingon (detected by killk), */
111
- /* then we lose.... */
112
- await lose(t, L_DSTRCT);
113
- }
114
- //# sourceMappingURL=destruct.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"destruct.js","sourceRoot":"","sources":["../../../../src/builtins/games/trek/destruct.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAG/B;;;;;;;;;;;;;;;;;;EAkBE;AAEF,6BAA6B;AAC7B,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,CAAO,EAAE,EAAU;IAChD,IAAI,CAAS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C,EAAE,QAAQ,CAAC,CAAC;AAC1B,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { Trek } from './context.js';
2
- /** The dock command. */
3
- export declare function dock(t: Trek, _v: number): Promise<void>;
4
- /** The undock command. */
5
- export declare function undock(t: Trek, _v: number): Promise<void>;
@@ -1,133 +0,0 @@
1
- /*
2
- * dock.ts: a TypeScript port of BSD trek(6), from dock.c.
3
- * Ported from NetBSD src/games/trek (trunk 7a9ca154a8f6144307865f23390a3c63b400b801): dock.c 1.10 2009/05/24.
4
- *
5
- * Copyright (c) 1980, 1993
6
- * The Regents of the University of California. All rights reserved.
7
- *
8
- * Redistribution and use in source and binary forms, with or without
9
- * modification, are permitted provided that the following conditions
10
- * are met:
11
- * 1. Redistributions of source code must retain the above copyright
12
- * notice, this list of conditions and the following disclaimer.
13
- * 2. Redistributions in binary form must reproduce the above copyright
14
- * notice, this list of conditions and the following disclaimer in the
15
- * documentation and/or other materials provided with the distribution.
16
- * 3. Neither the name of the University nor the names of its contributors
17
- * may be used to endorse or promote products derived from this software
18
- * without specific prior written permission.
19
- *
20
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30
- * SUCH DAMAGE.
31
- *
32
- */
33
- /**
34
- * @file Docking to a starbase and leaving it.
35
- *
36
- * @module
37
- */
38
- import { BASE, DOCKED, E_FIXDV, GREEN, MAXEVENTS, NSECTS } from './consts.js';
39
- import { dumpssradio } from './dumpssradio.js';
40
- import { reschedule } from './schedule.js';
41
- /*
42
- ** DOCK TO STARBASE
43
- **
44
- ** The starship is docked to a starbase. For this to work you
45
- ** must be adjacent to a starbase.
46
- **
47
- ** You get your supplies replenished and your captives are
48
- ** disembarked. Note that your score is updated now, not when
49
- ** you actually take the captives.
50
- **
51
- ** Any repairs that need to be done are rescheduled to take
52
- ** place sooner. This provides for the faster repairs when you
53
- ** are docked.
54
- */
55
- /** The dock command. */
56
- export async function dock(t, _v) {
57
- const { Ship, Param, Game } = t.s;
58
- let i;
59
- let j;
60
- let ok;
61
- let e;
62
- if (Ship.cond === DOCKED) {
63
- t.io.printf('Chekov: But captain, we are already docked\n');
64
- return;
65
- }
66
- /* check for ok to dock, i.e., adjacent to a starbase */
67
- ok = 0;
68
- for (i = Ship.sectx - 1; i <= Ship.sectx + 1 && !ok; i++) {
69
- if (i < 0 || i >= NSECTS)
70
- continue;
71
- for (j = Ship.secty - 1; j <= Ship.secty + 1; j++) {
72
- if (j < 0 || j >= NSECTS)
73
- continue;
74
- if (t.s.Sect[i][j] === BASE) {
75
- ok++;
76
- break;
77
- }
78
- }
79
- }
80
- if (!ok) {
81
- t.io.printf('Chekov: But captain, we are not adjacent to a ' +
82
- 'starbase.\n');
83
- return;
84
- }
85
- /* restore resources */
86
- Ship.energy = Param.energy;
87
- Ship.torped = Param.torped;
88
- Ship.shield = Param.shield;
89
- Ship.crew = Param.crew;
90
- Game.captives += Param.brigfree - Ship.brigfree;
91
- Ship.brigfree = Param.brigfree;
92
- /* reset ship's defenses */
93
- Ship.shldup = 0;
94
- Ship.cloaked = 0;
95
- Ship.cond = DOCKED;
96
- Ship.reserves = Param.reserves;
97
- /* recalibrate space inertial navigation system */
98
- Ship.sinsbad = 0;
99
- /* output any saved radio messages */
100
- dumpssradio(t);
101
- /* reschedule any device repairs */
102
- for (i = 0; i < MAXEVENTS; i++) {
103
- e = t.s.Event[i];
104
- if (e.evcode !== E_FIXDV)
105
- continue;
106
- reschedule(t, i, (e.date - t.s.Now.date) * Param.dockfac);
107
- }
108
- }
109
- /*
110
- ** LEAVE A STARBASE
111
- **
112
- ** This is the inverse of dock(). The main function it performs
113
- ** is to reschedule any damages so that they will take longer.
114
- */
115
- /** The undock command. */
116
- export async function undock(t, _v) {
117
- const { Ship, Param, Move } = t.s;
118
- let e;
119
- if (Ship.cond !== DOCKED) {
120
- t.io.printf('Sulu: Pardon me captain, but we are not docked.\n');
121
- return;
122
- }
123
- Ship.cond = GREEN;
124
- Move.free = 0;
125
- /* reschedule device repair times (again) */
126
- for (let i = 0; i < MAXEVENTS; i++) {
127
- e = t.s.Event[i];
128
- if (e.evcode !== E_FIXDV)
129
- continue;
130
- reschedule(t, i, (e.date - t.s.Now.date) / Param.dockfac);
131
- }
132
- }
133
- //# sourceMappingURL=dock.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dock.js","sourceRoot":"","sources":["../../../../src/builtins/games/trek/dock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH;;;;GAIG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE9E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C;;;;;;;;;;;;;EAaE;AAEF,wBAAwB;AACxB,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,CAAO,EAAE,EAAU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,CAAC,mDAAmD,CAAC,CAAC;QACjE,OAAO;IACT,CAAC;IACD,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IAClB,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;IAEd,4CAA4C;IAC5C,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACjB,IAAI,CAAC,CAAC,MAAM,KAAK,OAAO;YAAE,SAAS;QACnC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC"}
@@ -1,15 +0,0 @@
1
- /**
2
- * @file Dumping the game for a later restart, and restarting it.
3
- *
4
- * Deviation: the C writes the data areas to the file "trek.dump" in the
5
- * current directory; here they are kept in the session's dump slot
6
- * (`t.dump`), so `dump` then a `restart` length restores the game within
7
- * the session. The version check stays.
8
- *
9
- * @module
10
- */
11
- import type { Trek } from './context.js';
12
- /** DUMP GAME */
13
- export declare function dumpgame(t: Trek, _v: number): Promise<void>;
14
- /** RESTORE GAME: zero for success, one for failure. */
15
- export declare function restartgame(t: Trek): Promise<number>;
@@ -1,29 +0,0 @@
1
- /** THIS CONSTANT MUST CHANGE AS THE DATA SPACES CHANGE */
2
- const VERSION = 2;
3
- /** DUMP GAME */
4
- export async function dumpgame(t, _v) {
5
- const { Ship, Now, Param, Etc, Game, Sect, Quad, Move, Event } = t.s;
6
- const dump = { version: VERSION, Ship, Now, Param, Etc, Game, Sect, Quad, Move, Event };
7
- t.dump.saved = structuredClone(dump);
8
- }
9
- /** RESTORE GAME: zero for success, one for failure. */
10
- export async function restartgame(t) {
11
- const dump = t.dump.saved === null ? null : structuredClone(t.dump.saved);
12
- if (dump === null || dump.version !== VERSION) {
13
- t.io.printf('cannot restart\n');
14
- return 1;
15
- }
16
- const s = t.s;
17
- // In place, as the C's read() into each area.
18
- Object.assign(s.Ship, dump.Ship);
19
- Object.assign(s.Now, dump.Now);
20
- Object.assign(s.Param, dump.Param);
21
- Object.assign(s.Etc, dump.Etc);
22
- Object.assign(s.Game, dump.Game);
23
- dump.Sect.forEach((row, x) => { s.Sect[x] = row; });
24
- dump.Quad.forEach((row, x) => row.forEach((one, y) => { Object.assign(s.Quad[x][y], one); }));
25
- Object.assign(s.Move, dump.Move);
26
- dump.Event.forEach((one, n) => { Object.assign(s.Event[n], one); });
27
- return 0;
28
- }
29
- //# sourceMappingURL=dumpgame.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dumpgame.js","sourceRoot":"","sources":["../../../../src/builtins/games/trek/dumpgame.ts"],"names":[],"mappings":"AA6CA,0DAA0D;AAC1D,MAAM,OAAO,GAAW,CAAC,CAAC;AAgB1B,gBAAgB;AAChB,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,CAAO,EAAE,EAAU;IAChD,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IACrE,MAAM,IAAI,GAAS,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IAC9F,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;AACvC,CAAC;AAED,uDAAuD;AACvD,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,CAAO;IACvC,MAAM,IAAI,GAAgB,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,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C,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAc,EAAE,CAAS,EAAQ,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAc,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1G,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { Trek } from './context.js';
2
- /** Dump the starship somewhere in the galaxy */
3
- export declare function dumpme(t: Trek, flag: number): Promise<void>;
@@ -1,81 +0,0 @@
1
- /*
2
- * dumpme.ts: a TypeScript port of BSD trek(6), from dumpme.c.
3
- * Ported from NetBSD src/games/trek (trunk 7a9ca154a8f6144307865f23390a3c63b400b801): dumpme.c 1.8 2009/05/24.
4
- *
5
- * Copyright (c) 1980, 1993
6
- * The Regents of the University of California. All rights reserved.
7
- *
8
- * Redistribution and use in source and binary forms, with or without
9
- * modification, are permitted provided that the following conditions
10
- * are met:
11
- * 1. Redistributions of source code must retain the above copyright
12
- * notice, this list of conditions and the following disclaimer.
13
- * 2. Redistributions in binary form must reproduce the above copyright
14
- * notice, this list of conditions and the following disclaimer in the
15
- * documentation and/or other materials provided with the distribution.
16
- * 3. Neither the name of the University nor the names of its contributors
17
- * may be used to endorse or promote products derived from this software
18
- * without specific prior written permission.
19
- *
20
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30
- * SUCH DAMAGE.
31
- *
32
- */
33
- /**
34
- * @file The ship thrown somewhere in the galaxy: off the negative energy
35
- * barrier, or through a black hole.
36
- *
37
- * @module
38
- */
39
- import { E_FIXDV, MAXEVENTS, NQUADS, NSECTS } from './consts.js';
40
- import { events } from './events.js';
41
- import { franf, ranf } from './rand.js';
42
- import { reschedule } from './schedule.js';
43
- /*
44
- ** Dump the starship somewhere in the galaxy
45
- **
46
- ** Parameter is zero if bounce off of negative energy barrier,
47
- ** one if through a black hole
48
- **
49
- ** Note that the quadrant is NOT initialized here. This must
50
- ** be done from the calling routine.
51
- **
52
- ** Repair of devices must be deferred.
53
- */
54
- /** Dump the starship somewhere in the galaxy */
55
- export async function dumpme(t, flag) {
56
- const f = flag;
57
- t.s.Ship.quadx = ranf(t.rnd, NQUADS);
58
- t.s.Ship.quady = ranf(t.rnd, NQUADS);
59
- t.s.Ship.sectx = ranf(t.rnd, NSECTS);
60
- t.s.Ship.secty = ranf(t.rnd, NSECTS);
61
- const x = 1.5 * franf(t.rnd);
62
- t.s.Move.time += x;
63
- if (f) {
64
- t.io.printf('%s falls into a black hole.\n', t.s.Ship.shipname);
65
- }
66
- else {
67
- t.io.printf('Computer applies full reverse power to avoid hitting the\n');
68
- t.io.printf(' negative energy barrier. A space warp was entered.\n');
69
- }
70
- /* bump repair dates forward */
71
- for (let i = 0; i < MAXEVENTS; i++) {
72
- const e = t.s.Event[i];
73
- if (e.evcode !== E_FIXDV)
74
- continue;
75
- reschedule(t, i, e.date - t.s.Now.date + x);
76
- }
77
- await events(t, 1);
78
- t.io.printf('You are now in quadrant %d,%d. It is stardate %.2f\n', t.s.Ship.quadx, t.s.Ship.quady, t.s.Now.date);
79
- t.s.Move.time = 0;
80
- }
81
- //# sourceMappingURL=dumpme.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dumpme.js","sourceRoot":"","sources":["../../../../src/builtins/games/trek/dumpme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C;;;;;;;;;;EAUE;AAEF,gDAAgD;AAChD,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,CAAO,EAAE,IAAY;IAChD,MAAM,CAAC,GAAW,IAAI,CAAC;IACvB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACrC,MAAM,CAAC,GAAW,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;IACnB,IAAI,CAAC,EAAE,CAAC;QACN,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,+BAA+B,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClE,CAAC;SAAM,CAAC;QACN,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,4DAA4D,CAAC,CAAC;QAC1E,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,0DAA0D,CAAC,CAAC;IAC1E,CAAC;IACD,+BAA+B;IAC/B,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,MAAM,CAAC,GAAc,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAc,CAAC;QAC/C,IAAI,CAAC,CAAC,MAAM,KAAK,OAAO;YAAE,SAAS;QACnC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;IAC9C,CAAC;IACD,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACnB,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,uDAAuD,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnH,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;AACpB,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { Trek } from './context.js';
2
- /**
3
- ** output hidden distress calls
4
- **/
5
- /** output hidden distress calls */
6
- export declare function dumpssradio(t: Trek): number;
@@ -1,72 +0,0 @@
1
- /*
2
- * dumpssradio.ts: a TypeScript port of BSD trek(6), from dumpssradio.c.
3
- * Ported from NetBSD src/games/trek (trunk 7a9ca154a8f6144307865f23390a3c63b400b801): dumpssradio.c 1.8 2009/05/24.
4
- *
5
- * Copyright (c) 1980, 1993
6
- * The Regents of the University of California. All rights reserved.
7
- *
8
- * Redistribution and use in source and binary forms, with or without
9
- * modification, are permitted provided that the following conditions
10
- * are met:
11
- * 1. Redistributions of source code must retain the above copyright
12
- * notice, this list of conditions and the following disclaimer.
13
- * 2. Redistributions in binary form must reproduce the above copyright
14
- * notice, this list of conditions and the following disclaimer in the
15
- * documentation and/or other materials provided with the distribution.
16
- * 3. Neither the name of the University nor the names of its contributors
17
- * may be used to endorse or promote products derived from this software
18
- * without specific prior written permission.
19
- *
20
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30
- * SUCH DAMAGE.
31
- *
32
- */
33
- /**
34
- * @file The hidden distress calls, printed when the subspace radio is
35
- * back: each one still standing, and those that went quiet meanwhile.
36
- *
37
- * @module
38
- */
39
- import { E_ENSLV, E_GHOST, E_HIDDEN, E_KDESB, E_REPRO, MAXEVENTS } from './consts.js';
40
- import { unschedule } from './schedule.js';
41
- import { systemname } from './systemname.js';
42
- /**
43
- ** output hidden distress calls
44
- **/
45
- /** output hidden distress calls */
46
- export function dumpssradio(t) {
47
- let chkrest = 0;
48
- for (let j = 0; j < MAXEVENTS; j++) {
49
- const e = t.s.Event[j];
50
- /* if it is not hidden, then just ignore it */
51
- if ((e.evcode & E_HIDDEN) === 0)
52
- continue;
53
- if (e.evcode & E_GHOST) {
54
- unschedule(t, j);
55
- t.io.printf('Starsystem %s in quadrant %d,%d is no longer distressed\n', systemname(t, t.s.Quad[e.x][e.y]) ?? '(null)', e.x, e.y);
56
- continue;
57
- }
58
- switch (e.evcode) {
59
- case E_KDESB:
60
- t.io.printf('Starbase in quadrant %d,%d is under attack\n', e.x, e.y);
61
- chkrest++;
62
- break;
63
- case E_ENSLV:
64
- case E_REPRO:
65
- t.io.printf('Starsystem %s in quadrant %d,%d is distressed\n', systemname(t, t.s.Quad[e.x][e.y]) ?? '(null)', e.x, e.y);
66
- chkrest++;
67
- break;
68
- }
69
- }
70
- return chkrest;
71
- }
72
- //# sourceMappingURL=dumpssradio.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dumpssradio.js","sourceRoot":"","sources":["../../../../src/builtins/games/trek/dumpssradio.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEtF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;IAEI;AAEJ,mCAAmC;AACnC,MAAM,UAAU,WAAW,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AAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { Trek } from './context.js';
2
- /** CAUSE TIME TO ELAPSE: 'timewarp' is set if called in a time warp. */
3
- export declare function events(t: Trek, timewarp: number): Promise<number>;