@bgforge/mls-server 3.0.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.
@@ -0,0 +1,32 @@
1
+ {
2
+ "critter_mod_skill": {
3
+ "label": "critter_mod_skill(who, skill, amount)",
4
+ "documentation": {
5
+ "kind": "markdown",
6
+ "value": "---\nModifies a given skill in a given critter object by a given amount.\n\nNote that for tagged skills, the amount will be rounded down to the closest even number."
7
+ },
8
+ "parameters": [
9
+ {
10
+ "label": "who",
11
+ "documentation": {
12
+ "kind": "markdown",
13
+ "value": "```fallout-ssl-tooltip\nObjectPtr who\n```\nMust be `dude_obj`. Will not work on other critters."
14
+ }
15
+ },
16
+ {
17
+ "label": "skill",
18
+ "documentation": {
19
+ "kind": "markdown",
20
+ "value": "```fallout-ssl-tooltip\nint skill\n```\n`SKILL_*` from `define.h`"
21
+ }
22
+ },
23
+ {
24
+ "label": "amount",
25
+ "documentation": {
26
+ "kind": "markdown",
27
+ "value": "```fallout-ssl-tooltip\nint amount\n```\nCan be negative."
28
+ }
29
+ }
30
+ ]
31
+ }
32
+ }
@@ -0,0 +1 @@
1
+ "use strict";var O=Object.create;var A=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var L=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of x(t))!h.call(r,o)&&o!==e&&A(r,o,{get:()=>t[o],enumerable:!(n=v(t,o))||n.enumerable});return r};var F=(r,t,e)=>(e=r!=null?O(E(r)):{},L(t||!r||!r.__esModule?A(e,"default",{value:r,enumerable:!0}):e,r));var g=F(require("path")),m=F(require("fs")),U=".td",B=new Set(["keyword","property","method","getter","setter","constructor","call","index","construct","local var","local function","local class","parameter","label","string"]),M=new Set(["Array","ArrayBuffer","ArrayBufferConstructor","ArrayBufferLike","ArrayBufferTypes","ArrayBufferView","ArrayConstructor","ArrayIterator","ArrayLike","AsyncGenerator","AsyncGeneratorFunction","AsyncGeneratorFunctionConstructor","AsyncIterable","AsyncIterableIterator","AsyncIterator","AsyncIteratorObject","Atomics","Awaited","BigInt","BigInt64Array","BigInt64ArrayConstructor","BigIntConstructor","BigIntToLocaleStringOptions","BigUint64Array","BigUint64ArrayConstructor","Boolean","BooleanConstructor","BuiltinIteratorReturn","CallableFunction","Capitalize","ClassAccessorDecoratorContext","ClassAccessorDecoratorResult","ClassAccessorDecoratorTarget","ClassDecorator","ClassDecoratorContext","ClassFieldDecoratorContext","ClassGetterDecoratorContext","ClassMemberDecoratorContext","ClassMethodDecoratorContext","ClassSetterDecoratorContext","Collator","CollatorConstructor","CollatorOptions","ConcatArray","ConstructorParameters","DataView","DataViewConstructor","Date","DateConstructor","DateTimeFormat","DateTimeFormatConstructor","DateTimeFormatOptions","DateTimeFormatPart","DateTimeFormatPartTypes","DateTimeFormatPartTypesRegistry","DecoratorContext","DecoratorMetadata","DecoratorMetadataObject","DisplayNames","DisplayNamesFallback","DisplayNamesLanguageDisplay","DisplayNamesOptions","DisplayNamesType","Error","ErrorConstructor","EvalError","EvalErrorConstructor","Exclude","Extract","FlatArray","Float32Array","Float32ArrayConstructor","Float64Array","Float64ArrayConstructor","Function","FunctionConstructor","Generator","GeneratorFunction","GeneratorFunctionConstructor","IArguments","ImportAssertions","ImportAttributes","ImportCallOptions","ImportMeta","Infinity","InstanceType","Int16Array","Int16ArrayConstructor","Int32Array","Int32ArrayConstructor","Int8Array","Int8ArrayConstructor","Iterable","IterableIterator","Iterator","IteratorObject","IteratorResult","IteratorReturnResult","IteratorYieldResult","JSON","LDMLPluralRule","Locale","LocaleCollationCaseFirst","LocaleHourCycleKey","LocaleOptions","LocalesArgument","Lowercase","Map","MapConstructor","MapIterator","Math","MethodDecorator","NaN","NewableFunction","NoInfer","NonNullable","Number","NumberConstructor","NumberFormat","NumberFormatConstructor","NumberFormatOptions","NumberFormatOptionsCurrencyDisplay","NumberFormatOptionsCurrencyDisplayRegistry","NumberFormatOptionsSignDisplay","NumberFormatOptionsSignDisplayRegistry","NumberFormatOptionsStyle","NumberFormatOptionsStyleRegistry","NumberFormatOptionsUseGrouping","NumberFormatOptionsUseGroupingRegistry","NumberFormatPart","NumberFormatPartTypeRegistry","NumberFormatPartTypes","Object","ObjectConstructor","Omit","OmitThisParameter","ParameterDecorator","Parameters","Partial","Pick","PluralRuleType","PluralRules","PluralRulesConstructor","PluralRulesOptions","Promise","PromiseConstructor","PromiseConstructorLike","PromiseFulfilledResult","PromiseLike","PromiseRejectedResult","PromiseSettledResult","PropertyDecorator","PropertyDescriptor","PropertyDescriptorMap","PropertyKey","Proxy","ProxyConstructor","ProxyHandler","RangeError","RangeErrorConstructor","Readonly","ReadonlyArray","ReadonlyMap","ReadonlySet","Record","ReferenceError","ReferenceErrorConstructor","RegExp","RegExpConstructor","RegExpExecArray","RegExpMatchArray","RegExpStringIterator","RelativeTimeFormat","RelativeTimeFormatLocaleMatcher","RelativeTimeFormatNumeric","RelativeTimeFormatOptions","RelativeTimeFormatPart","RelativeTimeFormatStyle","RelativeTimeFormatUnit","RelativeTimeFormatUnitSingular","Required","ResolvedCollatorOptions","ResolvedDateTimeFormatOptions","ResolvedDisplayNamesOptions","ResolvedNumberFormatOptions","ResolvedNumberFormatOptionsUseGrouping","ResolvedPluralRulesOptions","ResolvedRelativeTimeFormatOptions","ReturnType","Set","SetConstructor","SetIterator","SharedArrayBuffer","SharedArrayBufferConstructor","String","StringConstructor","StringIterator","Symbol","SymbolConstructor","SyntaxError","SyntaxErrorConstructor","TemplateStringsArray","ThisParameterType","ThisType","TypeError","TypeErrorConstructor","TypedPropertyDescriptor","URIError","URIErrorConstructor","Uint16Array","Uint16ArrayConstructor","Uint32Array","Uint32ArrayConstructor","Uint8Array","Uint8ArrayConstructor","Uint8ClampedArray","Uint8ClampedArrayConstructor","Uncapitalize","UnicodeBCP47LocaleIdentifier","Uppercase","WeakKey","WeakKeyTypes","WeakMap","WeakMapConstructor","WeakSet","WeakSetConstructor","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","unescape","apply","construct","defineProperty","deleteProperty","get","getCanonicalLocales","getOwnPropertyDescriptor","getPrototypeOf","has","isExtensible","ownKeys","preventExtensions","set","setPrototypeOf"]);function C(r){return r.endsWith(U)}function w(r){let t=new Set,e=/^[ \t]*(?:declare\s+)?(?:function|interface|type|var|const|let|class|enum)\s+(\w+)/gm,n;for(;(n=e.exec(r))!==null;){let o=n[1];o!==void 0&&t.add(o)}return t}function k(r){let t,e=!1,n;function o(){if(t===void 0){let s=g.resolve(__dirname,"../../server/out/td-runtime.d.ts"),c=g.resolve(__dirname,"../../@bgforge/mls-server/out/td-runtime.d.ts");m.existsSync(s)?(t=s,e=!0):m.existsSync(c)?(t=c,e=!0):(t=s,e=!1)}return t}function S(){if(n===void 0)try{let s=m.readFileSync(o(),"utf-8");n=w(s)}catch{n=new Set}return n}function I(s){let c=o();if(!e)return s.languageService;let i=s.languageServiceHost,P=i.getScriptFileNames.bind(i);i.getScriptFileNames=()=>{let a=P();return!a.some(u=>C(u))||a.includes(c)?a:[...a,c]};let D=i.getCompilationSettings.bind(i);return i.getCompilationSettings=()=>{let a=D();return i.getScriptFileNames().some(p=>C(p))?{...a,target:r.typescript.ScriptTarget.ES2020,lib:["lib.es2020.d.ts"]}:a},new Proxy(s.languageService,{get(a,u,p){return u==="getCompletionsAtPosition"?(d,b,N)=>{let l=a.getCompletionsAtPosition(d,b,N);if(l===void 0)return l;if(C(d)){let y=l.entries.filter(R=>B.has(R.kind)||!M.has(R.name));return{...l,entries:y}}let f=S();if(f.size===0)return l;let T=l.entries.filter(y=>!f.has(y.name));return{...l,entries:T}}:Reflect.get(a,u,p)}})}return{create:I}}module.exports=k;
@@ -0,0 +1,314 @@
1
+ /**
2
+ * Core TD (TypeScript to D) runtime API declarations.
3
+ * This is the transpiler API — functions that map to WeiDU D constructs.
4
+ * Engine-specific functions (triggers, actions, constants) are separate
5
+ * and generated per-project from server/data/*.yml.
6
+ *
7
+ * JSDoc sourced from weidu-d-base.yml (WeiDU documentation).
8
+ * Copied to server/out/ during build (build-base-server.sh).
9
+ * Injected into tsserver by the TD TypeScript plugin (plugins/td-plugin/src/index.ts).
10
+ */
11
+
12
+ // --- IElib sync surface start ---
13
+ // These types must be structurally compatible with BGforge IElib.
14
+ // Both projects define them independently; keep shapes and brand strings identical.
15
+
16
+ /**
17
+ * String reference (TLK index).
18
+ *
19
+ * Branded to prevent accidentally passing a plain number where a text
20
+ * reference is expected.
21
+ */
22
+ type StrRef = number & { __brand: "StrRef" }
23
+
24
+ /** Branded type for engine actions. Engine action functions must return this type. */
25
+ interface Action { readonly __brand: "Action" }
26
+
27
+ // --- IElib sync surface end ---
28
+
29
+ // ---------------------------------------------------------------------------
30
+ // State-level functions (called inside state functions)
31
+ // ---------------------------------------------------------------------------
32
+
33
+ /**
34
+ * Say text in current state.
35
+ * Variadic: `say(t1, t2, t3)` emits multisay (`SAY text = text = text`).
36
+ * Two-arg form: `say(dialog, text)` for cross-dialog say (chain speaker switch).
37
+ */
38
+ declare function say(...text: StrRef[]): void
39
+ declare function say(dialog: string, text: StrRef): void
40
+
41
+ /**
42
+ * Copy all transitions from the given state in the given dialog file.
43
+ * This copying takes place before all other D Actions.
44
+ * If `safe` is true, COPY_TRANS will not warn about potentially unsafe uses.
45
+ * @see copyTransLate for late-binding variant
46
+ */
47
+ declare function copyTrans(dialog: string, stateRef: string | number, options?: { safe?: boolean }): void
48
+
49
+ /**
50
+ * Set state weight for priority ordering.
51
+ * Lower weights are evaluated first. Should only be used to patch existing dialogues.
52
+ */
53
+ declare function weight(n: number): void
54
+
55
+ // ---------------------------------------------------------------------------
56
+ // Transition builder - reply(text).action(...).goTo(target)
57
+ // ---------------------------------------------------------------------------
58
+
59
+ /** Shared terminal and modifier methods for transition builders. */
60
+ interface TransitionBuilder<Self> {
61
+ /** Add text to the PC's journal if this transition is taken. */
62
+ journal(text: StrRef): Self
63
+ /** Add text to the "solved" section of the PC's journal. */
64
+ solvedJournal(text: StrRef): Self
65
+ /** Add text to the "unsolved" section of the PC's journal. */
66
+ unsolvedJournal(text: StrRef): Self
67
+ /** Set transition feature flags directly using the binary DLG format. */
68
+ flags(n: number): Self
69
+ /** Continue dialogue at the given state label in the same DLG file. */
70
+ goTo(target: string | number | Function): void
71
+ /** End the conversation. */
72
+ exit(): void
73
+ /** Continue dialogue at the given state in another DLG file. */
74
+ extern(dialog: string, state: string | number, options?: { ifFileExists?: boolean }): void
75
+ /** Copy transitions from the given state, resolved after all other D Actions. */
76
+ copyTransLate(dialog: string, state: string | number, options?: { safe?: boolean }): void
77
+ }
78
+
79
+ /** After reply(): can chain .action(), .journal(), or terminate. */
80
+ interface AfterReply extends TransitionBuilder<AfterReply> {
81
+ /** Execute engine actions if this transition is taken. */
82
+ action(...actions: Action[]): AfterAction
83
+ }
84
+
85
+ /** After action(): can chain .journal() or terminate. */
86
+ interface AfterAction extends TransitionBuilder<AfterAction> {}
87
+
88
+ /**
89
+ * If this transition is taken, the PC says the reply text.
90
+ * Returns a builder for chaining `.action()`, `.journal()`, and terminal (`.goTo()`, `.exit()`, `.extern()`).
91
+ */
92
+ declare function reply(text: StrRef): AfterReply
93
+
94
+ /**
95
+ * Execute engine actions if this transition is taken.
96
+ * Returns a builder for chaining `.journal()` and terminal (`.goTo()`, `.exit()`, `.extern()`).
97
+ */
98
+ declare function action(...actions: Action[]): AfterAction
99
+
100
+ /** Continue dialogue at the given state label in the same DLG file. Synonym for GOTO. */
101
+ declare function goTo(target: string | number | Function): void
102
+
103
+ /** End the conversation. */
104
+ declare function exit(): void
105
+
106
+ /**
107
+ * Continue dialogue at the given state in another DLG file.
108
+ * If `ifFileExists` is true, the transition is skipped if the file doesn't exist.
109
+ */
110
+ declare function extern(dialog: string, state: string | number, options?: { ifFileExists?: boolean }): void
111
+
112
+ /**
113
+ * Copy transitions from the given state, resolved after all other D Actions.
114
+ * Same as COPY_TRANS but late-binding.
115
+ * If `safe` is true, will not warn about potentially unsafe uses.
116
+ */
117
+ declare function copyTransLate(dialog: string, state: string | number, options?: { safe?: boolean }): void
118
+
119
+ /** Set transition feature flags directly using the binary DLG format. */
120
+ declare function flags(value: number): void
121
+
122
+ /** Add text to the PC's journal if this transition is taken. */
123
+ declare function journal(text: StrRef): void
124
+
125
+ /** Add text to the "solved" section of the PC's journal. */
126
+ declare function solvedJournal(text: StrRef): void
127
+
128
+ /** Add text to the "unsolved" section of the PC's journal. */
129
+ declare function unsolvedJournal(text: StrRef): void
130
+
131
+ // ---------------------------------------------------------------------------
132
+ // Dialog operations - BEGIN, APPEND, EXTEND
133
+ // ---------------------------------------------------------------------------
134
+
135
+ /**
136
+ * Create an inline state with the given label and body.
137
+ * Use inside begin(), append(), appendEarly() argument lists.
138
+ * @example begin("DLG", [state("greeting", () => { say(tra(1)); exit(); })]);
139
+ */
140
+ declare function state(label: string, body: () => void): Function
141
+
142
+ /**
143
+ * Create a new DLG file from scratch. Any existing DLG file with the same name
144
+ * will be overwritten. The new DLG file contains exactly the states in the list.
145
+ */
146
+ declare function begin(dialog: string, states: (Function | string)[]): void
147
+ declare function begin(dialog: string, ...states: Function[]): void
148
+
149
+ /**
150
+ * Add states to the end of an already-existing dialogue file.
151
+ */
152
+ declare function append(dialog: string, states: Function[]): void
153
+ declare function append(dialog: string, ...states: Function[]): void
154
+
155
+ /**
156
+ * Like `append`, but the states are added early in the compilation timeline
157
+ * (just after BEGIN is processed). They can be targets for INTERJECT_COPY_TRANS.
158
+ */
159
+ declare function appendEarly(dialog: string, ...states: Function[]): void
160
+
161
+ /**
162
+ * Load the given dialog and replace the state at the given numeric index
163
+ * with the new state described by the body function.
164
+ */
165
+ declare function replaceState(dialog: string, state: number, body: () => void): void
166
+
167
+ /**
168
+ * Add transitions to the top of the transition list for the specified state.
169
+ */
170
+ declare function extendTop(dialog: string, state: string | number | Function, callback: () => void): void
171
+
172
+ /**
173
+ * Add transitions to the bottom of the transition list for the specified state.
174
+ */
175
+ declare function extendBottom(dialog: string, state: string | number | Function, callback: () => void): void
176
+ declare function extendBottom(dialog: string, state: string | number | Function, options: { position?: number }, callback: () => void): void
177
+
178
+ // ---------------------------------------------------------------------------
179
+ // Chain - linear multi-speaker conversations
180
+ // ---------------------------------------------------------------------------
181
+
182
+ /**
183
+ * Create a long conversation in which the PC can say nothing.
184
+ * Useful when NPCs talk among themselves. CHAIN only appends to existing
185
+ * dialogues; it cannot create a new DLG.
186
+ */
187
+ declare function chain(callback: Function): void
188
+ declare function chain(entryTrigger: boolean, callback: Function): void
189
+ declare function chain(dialog: string, label: string, body: () => void): void
190
+ declare function chain(entryTrigger: boolean, dialog: string, label: string, body: () => void): void
191
+
192
+ /** Switch speaker in a chain body. Subsequent `say()` calls use this speaker. */
193
+ declare function from(speaker: string): void
194
+
195
+ /** Conditional speaker switch. The speaker's lines are only included if the condition is true. */
196
+ declare function fromWhen(speaker: string, condition: boolean): void
197
+
198
+ // ---------------------------------------------------------------------------
199
+ // Interject operations
200
+ // ---------------------------------------------------------------------------
201
+
202
+ /**
203
+ * Like CHAIN, but all chain text is guarded by `Global(globalVar, "GLOBAL", 0)`
204
+ * and accompanied by `SetGlobal(globalVar, "GLOBAL", 1)`, ensuring
205
+ * the interjection is only seen once per game.
206
+ */
207
+ declare function interject(entryDialog: string, entryState: string, globalVar: string, callback: Function, exitDialog?: string, exitState?: string): void
208
+
209
+ /**
210
+ * Like `interject`, but at the end of the chain text, copies all transitions
211
+ * from the entry state instead of using an explicit exit.
212
+ * Convenient for quick interjections that don't change the conversation flow.
213
+ */
214
+ declare function interjectCopyTrans(entryDialog: string, entryState: string, globalVar: string, callback: Function, exitDialog?: string, exitState?: string): void
215
+
216
+ /**
217
+ * Like `interjectCopyTrans`, but actions in the entry state's transitions
218
+ * are preserved with the original speaker (not transferred to the new speaker).
219
+ */
220
+ declare function interjectCopyTrans2(entryDialog: string, entryState: string, globalVar: string, callback: Function): void
221
+
222
+ /**
223
+ * Like `interjectCopyTrans`, but all states in the chain text get a link
224
+ * in the entry state, rather than only the first one.
225
+ */
226
+ declare function interjectCopyTrans3(entryDialog: string, entryState: string, globalVar: string, callback: Function): void
227
+
228
+ /**
229
+ * Combination of `interjectCopyTrans2` (action handling) and
230
+ * `interjectCopyTrans3` (extended state creation rules).
231
+ */
232
+ declare function interjectCopyTrans4(entryDialog: string, entryState: string, globalVar: string, callback: Function): void
233
+
234
+ // ---------------------------------------------------------------------------
235
+ // Patch operations
236
+ // ---------------------------------------------------------------------------
237
+
238
+ /**
239
+ * Fine-grained altering of transitions in existing dialogue states.
240
+ */
241
+ declare function alterTrans(dialog: string, states: (string | number)[], trans: number[], options: { trigger?: boolean; action?: Action; reply?: StrRef }): void
242
+
243
+ /**
244
+ * Add a trigger string to all specified states.
245
+ * Useful for adding extra conditions to existing dialogue states.
246
+ */
247
+ declare function addStateTrigger(dialog: string, state: string | number | (string | number)[], trigger: boolean): void
248
+
249
+ /**
250
+ * Add a trigger string to transitions in specified states.
251
+ * Often used with `extendBottom` to create new branches: add the negation
252
+ * of a predicate to existing transitions, then add a transition with that predicate.
253
+ */
254
+ declare function addTransTrigger(dialog: string, states: (string | number)[], trigger: boolean, options?: { trans?: number[] }): void
255
+
256
+ /**
257
+ * Add an action string to transitions in specified states.
258
+ * The action is prepended to any existing action text.
259
+ */
260
+ declare function addTransAction(dialog: string, states: (string | number)[], trans: number[], action: Action): void
261
+
262
+ /**
263
+ * Replace all instances of `from` text with `to` text in the trigger strings
264
+ * of transitions in specified states.
265
+ */
266
+ declare function replaceTransTrigger(dialog: string, states: (string | number | Function)[], trans: number[], from: string, to: string): void
267
+
268
+ /**
269
+ * Replace all instances of `from` text with `to` text in the action strings
270
+ * of transitions in specified states.
271
+ */
272
+ declare function replaceTransAction(dialog: string, states: (string | number | Function)[], trans: number[], from: string, to: string): void
273
+
274
+ /**
275
+ * Destructively replace every occurrence of `from` (may be a regexp) in all
276
+ * trigger strings of the given dialog file(s).
277
+ * Should only be used to patch or workaround existing dialogues.
278
+ */
279
+ declare function replaceTriggerText(dialog: string | string[], from: string, to: string): void
280
+
281
+ /**
282
+ * Destructively replace every occurrence of `from` (may be a regexp) in all
283
+ * action strings of the given dialog files.
284
+ * Should only be used to patch or workaround existing dialogues.
285
+ */
286
+ declare function replaceActionText(dialogs: string[], from: string, to: string): void
287
+
288
+ /**
289
+ * Destructively change the WEIGHT of the given state.
290
+ * Should only be used to patch or workaround existing dialogues.
291
+ */
292
+ declare function setWeight(dialog: string, state: string | number, weight: number): void
293
+
294
+ /**
295
+ * Destructively change the SAY text of the given state.
296
+ * Should only be used to patch or workaround existing dialogues.
297
+ */
298
+ declare function replaceSay(dialog: string, state: string | number, text: StrRef): void
299
+
300
+ /**
301
+ * Destructively set the trigger string of the specified states.
302
+ * Should only be used to patch or workaround existing dialogues.
303
+ */
304
+ declare function replaceStateTrigger(dialog: string, states: (string | number)[], trigger: boolean): void
305
+
306
+ /**
307
+ * Load the given dialog and replace states by numeric index.
308
+ * A new state with key X replaces old state number X.
309
+ */
310
+ declare function replace(dialog: string, states: Record<number, () => void>): void
311
+
312
+ // ---------------------------------------------------------------------------
313
+ // Text helpers: tra(), tlk(), obj() are declared in ielib.
314
+ // ---------------------------------------------------------------------------
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,11 @@
1
+ "use strict";var _={barter_init_p_proc:"Called when the barter screen is initialized.",barter_p_proc:"Called when the player initiates bartering with the critter.",combat_is_over_p_proc:"Called every time before combat ends.",combat_is_starting_p_proc:"Called every time before the start of combat.",combat_p_proc:"Called in combat (every turn?). The specific combat event number is passed via `fixed_param`.",create_p_proc:"Called when the object is first created on the map.",critter_p_proc:`This procedure is called every "heartbeat", which means it's run ten times each second, except during combat.
2
+ Note: if this procedure is not present in the script, errors can occur, and the first encountered procedure may be treated as this handler.`,damage_p_proc:"Called when the critter takes damage. The amount of damage received is passed via `fixed_param`.\nNote: not called if the damage is fully absorbed by armor.",description_p_proc:"Called when the player inspects the object (binoculars). By default, the description from the prototype object is shown.\nNote: must use `script_overrides` to prevent simultaneous execution with the default description.",destroy_p_proc:"Called on death of the critter or destruction of the object (except when using `destroy_object(self_obj)`).",drop_p_proc:"Called when the self-object is dropped to the ground.",is_dropping_p_proc:"Called when trying to drop an object.",look_at_p_proc:"Called when the player passes the cursor over any object. By default, the prototype name of the object is displayed.\nNote: must use `script_overrides` to prevent simultaneous execution with the default name display.",map_enter_p_proc:"Called once by the engine each time the map is entered from another map. It is not run when the elevation is changed.",map_exit_p_proc:"Called when the player leaves the map.",map_update_p_proc:"Called every 250 game ticks (1 tick = 1/10 second, so roughly every 25 seconds). It is also called each time you exit a dialogue, each time you exit the pipboy screen and each time you use an item. In addition to that, it is run once when you enter the map, and, seemingly, twice when you change elevation.",pickup_p_proc:`In object scripts, called when a critter tries to pick up this item.
3
+ For container objects, called when a critter tries to open them or steal something.
4
+ In critter scripts, called when someone tries to steal from this critter.`,push_p_proc:"Called when trying to push the object.",spatial_p_proc:"Called when an object passes over the self-object's spatial trigger area.",start:"Called by the engine when the script is first run or the game object is first created, then never again, unless specifically called from somewhere else.",talk_p_proc:"Called when the player tries to initiate dialogue with the critter.",timed_event_p_proc:"This procedure is called by the function `add_timer_event(ObjPtr obj, int time, int fixed_param)`.\n`ObjPtr` points to the object whose script's `timed_event_p_proc` procedure you want to access.\nTime is the number of game ticks (1 game tick = 1/10 seconds) you want to pass before the `timed_event_p_proc` is called.\n`fixed_param` is a variable you can set to differentiate between various timed events.\nIn `timed_event_p_proc`, you can check the value of `fixed_param` against whatever number you used when calling `add_timer_event`.\nThis allows for multiple uses of `timed_event_p_proc` in the same script.",use_ad_on_p_proc:"Called when an advantage is used on the object.",use_disad_on_p_proc:"Called when a disadvantage is used on the object.",use_obj_on_p_proc:`Called when:
5
+ - A critter uses an object on another critter. (Or themselves).
6
+ - A critter uses an object from inventory screen AND this object does not have "Use" action flag set and it's not active flare or explosive.
7
+ - Player or AI uses any drug.
8
+ The parameter \`obj_being_used_with\` receives a pointer to the object that was used.`,use_p_proc:`Called when:
9
+ - A critter uses an object from inventory which have "Use" action flag set or it's an active flare or dynamite.
10
+ - Player uses an object from main interface.
11
+ Use \`source_obj\` to get the object being used. Note: not called for some item types when working with inventory.`,use_skill_on_p_proc:"Called when a skill is used on the object. The skill number is passed via `action_being_used` (see DEFINE.H, Skill Equates)."};var g=_;function l(e,t){if(e===void 0||t===void 0)return e;let r=t.find(o=>o.kind==="functionName"||o.kind==="localName");if(r===void 0)return e;let s=g[r.text];if(s===void 0)return e;let a={text:s,kind:"text"};return{...e,documentation:[...e.documentation??[],a]}}var u=["barter_init_p_proc","barter_p_proc","combat_is_over_p_proc","combat_is_starting_p_proc","combat_p_proc","create_p_proc","critter_p_proc","damage_p_proc","description_p_proc","destroy_p_proc","drop_p_proc","is_dropping_p_proc","look_at_p_proc","map_enter_p_proc","map_exit_p_proc","map_update_p_proc","pickup_p_proc","push_p_proc","spatial_p_proc","start","talk_p_proc","timed_event_p_proc","use_ad_on_p_proc","use_disad_on_p_proc","use_obj_on_p_proc","use_p_proc","use_skill_on_p_proc"];var y=new Set(u),b=6133,v=/^['"](\w+)['"]\s+is declared but/;function w(e){let t=typeof e=="string"?e:e.messageText;return v.exec(t)?.[1]}function p(e){return e.filter(t=>{if(t.code!==b)return!0;let r=w(t.messageText);return r===void 0||!y.has(r)})}var x=".tssl";function d(e){return e.endsWith(x)}function j(e){function t(r){return new Proxy(r.languageService,{get(a,o,h){return o==="getSemanticDiagnostics"?n=>{let i=a.getSemanticDiagnostics(n);return d(n)?p(i):i}:o==="getSuggestionDiagnostics"?n=>{let i=a.getSuggestionDiagnostics(n);return d(n)?p(i):i}:o==="getQuickInfoAtPosition"?(n,i)=>{let c=a.getQuickInfoAtPosition(n,i);return d(n)?l(c,c?.displayParts):c}:Reflect.get(a,o,h)}})}return{create:t}}module.exports=j;
Binary file
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@bgforge/mls-server",
3
+ "description": "LSP server for Fallout SSL, WeiDU (BAF/D/TP2), and related modding languages",
4
+ "version": "3.0.1",
5
+ "author": "BGforge",
6
+ "license": "SEE LICENSE IN LICENSE.txt",
7
+ "main": "out/server.js",
8
+ "bin": {
9
+ "bgforge-mls-server": "out/server.js"
10
+ },
11
+ "files": [
12
+ "out/",
13
+ "!out/*.map",
14
+ "LICENSE.txt"
15
+ ],
16
+ "engines": {
17
+ "node": ">=18"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/BGforgeNet/VScode-BGforge-MLS"
22
+ },
23
+ "homepage": "https://github.com/BGforgeNet/VScode-BGforge-MLS",
24
+ "bugs": {
25
+ "url": "https://github.com/BGforgeNet/VScode-BGforge-MLS/issues"
26
+ },
27
+ "keywords": [
28
+ "lsp",
29
+ "language-server",
30
+ "fallout",
31
+ "weidu",
32
+ "infinity-engine",
33
+ "modding"
34
+ ],
35
+ "dependencies": {
36
+ "@supercharge/promise-pool": "^2.4.0",
37
+ "esbuild-wasm": "^0.24.2",
38
+ "fast-glob": "^3.3.3",
39
+ "ini": "^6.0.0",
40
+ "ts-morph": "^24.0.0",
41
+ "typescript": "^5.9.3",
42
+ "vscode-languageserver": "8.1.0",
43
+ "vscode-languageserver-textdocument": "^1.0.12",
44
+ "web-tree-sitter": "^0.26.6",
45
+ "yaml": "^2.8.2"
46
+ },
47
+ "optionalDependencies": {
48
+ "sslc-emscripten-noderawfs": "https://github.com/sfall-team/sslc/releases/download/2026-02-07-11-20-26/wasm-emscripten-node-noderawfs.tar.gz"
49
+ },
50
+ "devDependencies": {
51
+ "@types/ini": "^4.1.1",
52
+ "@types/node": "^20.19.35",
53
+ "vitest": "^4.0.18"
54
+ },
55
+ "scripts": {
56
+ "test": "./scripts/test.sh",
57
+ "test:unit": "vitest run"
58
+ }
59
+ }