-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDefs.ts
More file actions
54 lines (46 loc) · 969 Bytes
/
Defs.ts
File metadata and controls
54 lines (46 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { clientEvent as id1ClientEvent } from '../id1/Defs.ts';
export {
attn,
channel,
content,
effect,
flags,
hull,
modelFlags,
moveType,
solid,
} from '../../shared/Defs.ts';
export {
clientEventName,
colors,
contentShift,
damage,
dead,
deathType,
items,
range,
spawnflags,
tentType,
worldType,
} from '../id1/Defs.ts';
/**
* Client event opcodes emitted by Hellwave game code.
*/
export const clientEvent = Object.freeze({
...id1ClientEvent,
/** change to the money, args: current balance (number) */
MONEY_UPDATE: 200,
/** update on round time, args: seconds of time remaining (number) */
ROUND_TIME: 201,
/** update on round phase */
ROUND_PHASE: 202,
/** navigation hint */
NAV_HINT: 203,
});
/**
* Format a balance using the Hellwave currency prefix.
* @returns Money formatted for HUD rendering.
*/
export function formatMoney(amount: number): string {
return `Q${amount.toFixed(0)}`;
}