-
Notifications
You must be signed in to change notification settings - Fork 6
/
browser.js
54 lines (50 loc) · 1012 Bytes
/
browser.js
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
const Controller = require('./libs/Controller');
class Jx3Simulator {
constructor(options) {
this.options = {
school: 'huajian',
duration: 300,
iterator: 5,
target: 98,
self: {
basicAttack: 0,
spunk: 0,
crit: 0,
critEff: 0,
hit: 0,
haste: 0,
strain: 0,
overcome: 0,
delay: 100,
},
talent: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
recipes: {},
effects: {
cw: 0,
water: 0,
thunder: 0,
setEffect: [],
},
};
if (options && typeof options === 'object') {
this.init(options);
}
return this;
}
init(options) {
for (const key of Object.keys(options)) {
if (typeof options[key] === 'object' && !Array.isArray(options[key])) {
const subOption = options[key];
for (const subKey of Object.keys(subOption)) {
this.options[key][subKey] = subOption[subKey];
}
} else {
this.options[key] = options[key];
}
}
}
run() {
return new Controller(this.options);
}
}
module.exports = Jx3Simulator;