forked from quisquous/cactbot
-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathraidboss_options.ts
138 lines (121 loc) · 4.5 KB
/
raidboss_options.ts
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
import { Lang } from '../../resources/languages';
import UserConfig, { ConfigValue } from '../../resources/user_config';
import { BaseOptions, RaidbossData } from '../../types/data';
import { Matches } from '../../types/net_matches';
import { PartyMemberParamObjectKeys, PartyTrackerOptions } from '../../types/party';
import {
LooseTriggerSet,
TriggerAutoConfig,
TriggerField,
TriggerOutput,
TriggerSetAutoConfig,
} from '../../types/trigger';
// This file defines the base options that raidboss expects to see.
// Backwards compat for this old style of overriding triggers.
// TODO: we should probably deprecate and remove this.
export type PerTriggerOption = Partial<{
TextAlert: boolean;
SoundAlert: boolean;
SpeechAlert: boolean;
GroupSpeechAlert: boolean; // TODO: we should remove this
SoundOverride: string;
VolumeOverride: number;
Condition: TriggerField<RaidbossData, Matches, boolean>;
InfoText: TriggerOutput<RaidbossData, Matches>;
AlertText: TriggerOutput<RaidbossData, Matches>;
AlarmText: TriggerOutput<RaidbossData, Matches>;
TTSText: TriggerOutput<RaidbossData, Matches>;
}>;
export type TimelineConfig = Partial<{
Ignore: string[];
Rename: { [text: string]: string };
Add: { time: number; text: string; duration?: number }[];
}>;
export type PerTriggerAutoConfig = { [triggerId: string]: TriggerAutoConfig };
export type PerTriggerSetAutoConfig = { [triggerSetId: string]: TriggerSetAutoConfig };
export type PerTriggerOptions = { [triggerId: string]: PerTriggerOption };
export type DisabledTriggers = { [triggerId: string]: boolean };
export type PerZoneTimelineConfig = { [zoneId: number]: TimelineConfig };
export type TriggerSetConfig = { [triggerSetId: string]: { [key: string]: ConfigValue } };
type RaidbossNonConfigOptions = {
PlayerNicks: { [gameName: string]: string };
InfoSound: string;
AlertSound: string;
AlarmSound: string;
LongSound: string;
PullSound: string;
AudioAllowed: boolean;
DisabledTriggers: DisabledTriggers;
PerTriggerAutoConfig: PerTriggerAutoConfig;
PerTriggerSetAutoConfig: PerTriggerSetAutoConfig;
PerTriggerOptions: PerTriggerOptions;
PerZoneTimelineConfig: PerZoneTimelineConfig;
TriggerSetConfig: TriggerSetConfig;
Triggers: LooseTriggerSet[];
PlayerNameOverride?: string;
IsRemoteRaidboss: boolean;
// Transforms text before passing it to TTS.
TransformTts: (text: string) => string;
};
// These options are ones that are not auto-defined by raidboss_config.js.
const defaultRaidbossNonConfigOptions: RaidbossNonConfigOptions = {
PlayerNicks: {},
InfoSound: '../../resources/sounds/freesound/percussion_hit.webm',
AlertSound: '../../resources/sounds/BigWigs/Alert.webm',
AlarmSound: '../../resources/sounds/BigWigs/Alarm.webm',
LongSound: '../../resources/sounds/BigWigs/Long.webm',
PullSound: '../../resources/sounds/freesound/sonar.webm',
AudioAllowed: true,
DisabledTriggers: {},
PerTriggerAutoConfig: {},
PerTriggerSetAutoConfig: {},
PerTriggerOptions: {},
PerZoneTimelineConfig: {},
TriggerSetConfig: {},
Triggers: [],
IsRemoteRaidboss: false,
TransformTts: (t) => t,
};
// TODO: figure out how to get this type from raidboss_config??
// These values are overwritten and are just here for typing.
const defaultRaidbossConfigOptions = {
DefaultAlertOutput: 'textAndSound',
AlertsLanguage: undefined as (Lang | undefined),
TimelineLanguage: undefined as (Lang | undefined),
TimelineEnabled: true,
AlertsEnabled: true,
DefaultPlayerLabel: 'nick' as PartyMemberParamObjectKeys,
ShowTimerBarsAtSeconds: 30,
KeepExpiredTimerBarsForSeconds: 0.7,
BarExpiresSoonSeconds: 6,
MaxNumberOfTimerBars: 6,
ReverseTimeline: false,
DisplayAlarmTextForSeconds: 3,
DisplayAlertTextForSeconds: 3,
DisplayInfoTextForSeconds: 3,
AlarmSoundVolume: 1,
AlertSoundVolume: 1,
InfoSoundVolume: 1,
LongSoundVolume: 1,
PullSoundVolume: 1,
RumbleEnabled: false,
InfoRumbleDuration: 400,
InfoRumbleWeak: 0.5,
InfoRumbleStrong: 0,
AlertRumbleDuration: 500,
AlertRumbleWeak: 0,
AlertRumbleStrong: 0.5,
AlarmRumbleDuration: 750,
AlarmRumbleWeak: 0.75,
AlarmRumbleStrong: 0.75,
};
type RaidbossConfigOptions = typeof defaultRaidbossConfigOptions;
export interface RaidbossOptions
extends BaseOptions, RaidbossNonConfigOptions, RaidbossConfigOptions, PartyTrackerOptions {}
// See user/raidboss-example.js for documentation.
const Options: RaidbossOptions = {
...UserConfig.getDefaultBaseOptions(),
...defaultRaidbossNonConfigOptions,
...defaultRaidbossConfigOptions,
};
export default Options;