blob: 3a20d21f30ff371c23266bb3857837605d639417 (
plain)
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
|
class Area {
slug = '';
monsterProgress = 0;
trainerProgress = 0;
constructor (slug) {
this.slug = slug;
}
get name () {
return translate(this.alternateSlug);
}
get isCompleted () {
return this.monsterProgress >= this.requiredEncounters && this.trainerProgress >= this.trainers.length;
}
get alternateSlug () {
return DB.areas[this.slug]['modules/tuxemon.slug'];
}
/**
* @returns {Object[]}
*/
get encounters () {
return DB.areas[this.slug].encounters;
}
get encounterPercentTotal () {
return DB.areas[this.slug].encounter_percent_total;
}
get requiredEncountersBase () {
return DB.areas[this.slug].requiredEncounters;
}
get requiredEncounters () {
return this.requiredEncountersBase * (this.trainerProgress + 1);
}
get trainers () {
return DB.areas[this.slug].trainers;
}
/**
* @typedef {Object} AreaItem
* @property {ItemSlug} slug
* @property {number} dropRatio
* @inner
*
* @returns {AreaItem[]}
*/
get items () {
return DB.areas[this.slug].items;
}
get environment () {
return DB.areas[this.slug].environment;
}
get map () {
return DB.areas[this.slug].map;
}
/**
* @returns {Object[]}
*/
get locations () {
return DB.areas[this.slug].locations;
}
get events () {
return DB.areas[this.slug].events;
}
get connections () {
return DB.areas[this.slug].connections;
}
}
|