@korial29/tiny-fps 0.174.0 → 0.175.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.
@@ -16,9 +16,9 @@ export interface Audio {
16
16
  /**
17
17
  * Plays the sound `id` (an index into the layers). With `at`, panned left or right by its direction from the listener and
18
18
  * fainter with distance; without, centred (the own player's sounds). `gain` scales the volume,
19
- * `rate` the speed and so the pitch.
19
+ * `rate` the speed and so the pitch; over the `radio` as speak() says a line.
20
20
  */
21
- play(id: number, at?: Vec3, gain?: number, rate?: number): void;
21
+ play(id: number, at?: Vec3, gain?: number, rate?: number, radio?: boolean): void;
22
22
  /**
23
23
  * Says the announcer's line `id` (LINE), centred, the music lowered under it. Lines wait their
24
24
  * turn, two at most and each once; none before the voice is decoded, a moment after unlock.
@@ -140,6 +140,8 @@ export declare const SOUND: {
140
140
  * noise is quiet (lp 0.06 keeps about a tenth of the swing): the loops have a high volume.
141
141
  */
142
142
  export declare const LAYERS: Voice[][];
143
+ /** The seconds sound `id` lasts: its longest voice, from its start late to the end of its decay. */
144
+ export declare const secondsOf: (id: number, layers?: Voice[][]) => number;
143
145
  /** The sounds played in a loop: their buffers go through seam. */
144
146
  export declare const LOOPED: number[];
145
147
  /**
@@ -6,8 +6,8 @@ export declare const TAUNT_DELAY = 0.6;
6
6
  export declare const TAUNT_LATE = 1.3;
7
7
  /** Seconds a player keeps quiet after a taunt: a quick run of frags gets one. */
8
8
  export declare const TAUNT_GAP = 4;
9
- /** The voice of player `id` in a build (BODY): one of the man's or one of the woman's. */
10
- export declare const speakerOf: (id: number, body?: number) => number;
9
+ /** The voice of player `id` in a build (BODY): one of the man's or one of the woman's, a ninja's own. */
10
+ export declare const speakerOf: (id: number, body?: number, ninja?: boolean) => number;
11
11
  /** A player's speed of speech, a little off the next's by his id, so that two in a voice differ. */
12
12
  export declare const paceOf: (id: number) => number;
13
13
  /**
@@ -17,7 +17,7 @@ export declare const paceOf: (id: number) => number;
17
17
  export declare const tauntOf: (speaker: number, how: number, n: number) => number;
18
18
  /** The clip (CAST) of `speaker`'s `k`th cry as he goes down. */
19
19
  export declare const deathOf: (speaker: number, k: number) => number;
20
- /** An ally's line that began: who says it, and its seconds. */
20
+ /** A line over the radio that began: who says it, and its seconds. */
21
21
  export interface Said {
22
22
  by: number;
23
23
  s: number;
@@ -34,16 +34,17 @@ export interface Taunts {
34
34
  n: number;
35
35
  }, me: number, now: number, wait?: number): void;
36
36
  /**
37
- * Says the taunts due at `now` (s): the own and the one aimed at the own player centred, an
38
- * ally's over the radio wherever he is, an enemy's from where `where` draws him (feet), unheard
39
- * when it does not draw him. Returns the allies' lines that began.
37
+ * Says the taunts due at `now` (s): the own centred, an ally's and the one aimed at the own
38
+ * player over the radio wherever their author is, any other enemy's from where `where` draws him
39
+ * (feet), unheard when it does not draw him; a xenomorph roars in their place. Returns the
40
+ * radio's lines that began.
40
41
  */
41
42
  frame(now: number, where: (id: number) => Vec3 | undefined): Said[];
42
43
  }
43
44
  export declare const createTaunts: (audio: Pick<Audio, "speak"> & Partial<Pick<Audio, "play">>,
44
- /** A player's build (BODY) from the roster. */
45
- body: (id: number) => number | undefined,
45
+ /** A player's voice from the roster (speakerOf()). */
46
+ speaker: (id: number) => number,
46
47
  /** A player's team from the roster. */
47
48
  team?: (id: number) => number | undefined,
48
- /** Whether a player is a xenomorph: it roars (ROAR), with no words and no radio. */
49
+ /** Whether a player is a xenomorph: it roars (ROAR), with no words, over the radio all the same. */
49
50
  beast?: (id: number) => boolean) => Taunts;