-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
30 lines (28 loc) · 925 Bytes
/
script.js
File metadata and controls
30 lines (28 loc) · 925 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
let mobName = "Regenerative Blood";
let deathMap = new Map();
let healMap = new Map();
let showPadIfTrue = true; //true = only show pad, false = remove pad
initializePinForFight = (fight) => {
fight.events.forEach(event => {
if (event.type === "death" && event.target?.name === mobName) {
deathMap.set(event.targetInstanceId, event.timestamp);
}
if (event.type === "heal" && event.target?.name === mobName) {
healMap.set(event.targetInstanceId, event.timestamp);
}
});
};
pinMatchesFightEvent = (event, fight) => {
if (
event.type === "damage" &&
event.target &&
event.target.name === mobName &&
(
event.timestamp <= healMap.get(event.targetInstanceId) ||
event.timestamp >= deathMap.get(event.targetInstanceId)
)
) {
return showPadIfTrue;
}
return !showPadIfTrue;
};