forked from quisquous/cactbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conditions.ts
26 lines (24 loc) · 1.01 KB
/
conditions.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
// For consistency with Responses, Conditions
// are also functions.
import { RaidbossData as Data } from '../types/data';
import { TargetedMatches } from '../types/trigger';
export default {
targetIsYou(): (data: Data, matches: TargetedMatches) => boolean {
return (data: Data, matches: TargetedMatches) => data.me === matches?.target;
},
targetIsNotYou(): (data: Data, matches: TargetedMatches) => boolean {
return (data: Data, matches: TargetedMatches) => data.me !== matches?.target;
},
caresAboutAOE(): (data: Data) => boolean {
return (data: Data) =>
data.role === 'tank' || data.role === 'healer' || data.CanAddle() || data.job === 'BLU';
},
caresAboutMagical(): (data: Data) => boolean {
return (data: Data) =>
data.role === 'tank' || data.role === 'healer' || data.CanAddle() || data.job === 'BLU';
},
caresAboutPhysical(): (data: Data) => boolean {
return (data: Data) =>
data.role === 'tank' || data.role === 'healer' || data.CanFeint() || data.job === 'BLU';
},
};