@robsonbittencourt/calc 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +2 -0
- package/.eslintrc +12 -0
- package/bundle +107 -0
- package/dist/adaptable.d.ts +6 -0
- package/dist/adaptable.js +28 -0
- package/dist/adaptable.js.map +1 -0
- package/dist/calc.d.ts +6 -0
- package/dist/calc.js +26 -0
- package/dist/calc.js.map +1 -0
- package/dist/data/abilities.d.ts +15 -0
- package/dist/data/abilities.js +448 -0
- package/dist/data/abilities.js.map +1 -0
- package/dist/data/index.d.ts +2 -0
- package/dist/data/index.js +30 -0
- package/dist/data/index.js.map +1 -0
- package/dist/data/interface.d.ts +150 -0
- package/dist/data/interface.js +3 -0
- package/dist/data/interface.js.map +1 -0
- package/dist/data/items.d.ts +24 -0
- package/dist/data/items.js +708 -0
- package/dist/data/items.js.map +1 -0
- package/dist/data/moves.d.ts +86 -0
- package/dist/data/moves.js +5014 -0
- package/dist/data/moves.js.map +1 -0
- package/dist/data/natures.d.ts +17 -0
- package/dist/data/natures.js +127 -0
- package/dist/data/natures.js.map +1 -0
- package/dist/data/production.min.js +1 -0
- package/dist/data/species.d.ts +48 -0
- package/dist/data/species.js +10126 -0
- package/dist/data/species.js.map +1 -0
- package/dist/data/types.d.ts +23 -0
- package/dist/data/types.js +538 -0
- package/dist/data/types.js.map +1 -0
- package/dist/desc.d.ts +65 -0
- package/dist/desc.js +866 -0
- package/dist/desc.js.map +1 -0
- package/dist/field.d.ts +49 -0
- package/dist/field.js +111 -0
- package/dist/field.js.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +99 -0
- package/dist/index.js.map +1 -0
- package/dist/items.d.ts +13 -0
- package/dist/items.js +434 -0
- package/dist/items.js.map +1 -0
- package/dist/mechanics/gen12.d.ts +6 -0
- package/dist/mechanics/gen12.js +271 -0
- package/dist/mechanics/gen12.js.map +1 -0
- package/dist/mechanics/gen3.d.ts +11 -0
- package/dist/mechanics/gen3.js +371 -0
- package/dist/mechanics/gen3.js.map +1 -0
- package/dist/mechanics/gen4.d.ts +11 -0
- package/dist/mechanics/gen4.js +596 -0
- package/dist/mechanics/gen4.js.map +1 -0
- package/dist/mechanics/gen56.d.ts +13 -0
- package/dist/mechanics/gen56.js +836 -0
- package/dist/mechanics/gen56.js.map +1 -0
- package/dist/mechanics/gen789.d.ts +14 -0
- package/dist/mechanics/gen789.js +1325 -0
- package/dist/mechanics/gen789.js.map +1 -0
- package/dist/mechanics/util.d.ts +39 -0
- package/dist/mechanics/util.js +675 -0
- package/dist/mechanics/util.js.map +1 -0
- package/dist/move.d.ts +50 -0
- package/dist/move.js +324 -0
- package/dist/move.js.map +1 -0
- package/dist/pokemon.d.ts +55 -0
- package/dist/pokemon.js +240 -0
- package/dist/pokemon.js.map +1 -0
- package/dist/production.min.js +1 -0
- package/dist/result.d.ts +34 -0
- package/dist/result.js +94 -0
- package/dist/result.js.map +1 -0
- package/dist/state.d.ts +77 -0
- package/dist/state.js +3 -0
- package/dist/state.js.map +1 -0
- package/dist/stats.d.ts +26 -0
- package/dist/stats.js +183 -0
- package/dist/stats.js.map +1 -0
- package/dist/test/calc.test.d.ts +1 -0
- package/dist/test/calc.test.js +1297 -0
- package/dist/test/calc.test.js.map +1 -0
- package/dist/test/data.test.d.ts +1 -0
- package/dist/test/data.test.js +368 -0
- package/dist/test/data.test.js.map +1 -0
- package/dist/test/gen.d.ts +135 -0
- package/dist/test/gen.js +636 -0
- package/dist/test/gen.js.map +1 -0
- package/dist/test/helper.d.ts +55 -0
- package/dist/test/helper.js +174 -0
- package/dist/test/helper.js.map +1 -0
- package/dist/test/move.test.d.ts +1 -0
- package/dist/test/move.test.js +14 -0
- package/dist/test/move.test.js.map +1 -0
- package/dist/test/pokemon.test.d.ts +1 -0
- package/dist/test/pokemon.test.js +102 -0
- package/dist/test/pokemon.test.js.map +1 -0
- package/dist/test/stats.test.d.ts +1 -0
- package/dist/test/stats.test.js +64 -0
- package/dist/test/stats.test.js.map +1 -0
- package/dist/test/utils.test.d.ts +1 -0
- package/dist/test/utils.test.js +19 -0
- package/dist/test/utils.test.js.map +1 -0
- package/dist/util.d.ts +17 -0
- package/dist/util.js +115 -0
- package/dist/util.js.map +1 -0
- package/jest.config.js +11 -0
- package/package.json +40 -0
- package/src/adaptable.ts +12 -0
- package/src/calc.ts +40 -0
- package/src/data/abilities.ts +383 -0
- package/src/data/index.ts +36 -0
- package/src/data/interface.ts +176 -0
- package/src/data/items.ts +632 -0
- package/src/data/moves.ts +5028 -0
- package/src/data/natures.ts +65 -0
- package/src/data/species.ts +10098 -0
- package/src/data/types.ts +478 -0
- package/src/desc.ts +1063 -0
- package/src/field.ts +124 -0
- package/src/index.ts +156 -0
- package/src/items.ts +423 -0
- package/src/mechanics/gen12.ts +297 -0
- package/src/mechanics/gen3.ts +444 -0
- package/src/mechanics/gen4.ts +702 -0
- package/src/mechanics/gen56.ts +1134 -0
- package/src/mechanics/gen789.ts +1788 -0
- package/src/mechanics/util.ts +676 -0
- package/src/move.ts +337 -0
- package/src/pokemon.ts +244 -0
- package/src/result.ts +106 -0
- package/src/state.ts +81 -0
- package/src/stats.ts +213 -0
- package/src/test/calc.test.ts +1588 -0
- package/src/test/data.test.ts +129 -0
- package/src/test/gen.ts +514 -0
- package/src/test/helper.ts +185 -0
- package/src/test/move.test.ts +13 -0
- package/src/test/pokemon.test.ts +121 -0
- package/src/test/stats.test.ts +84 -0
- package/src/test/utils.test.ts +18 -0
- package/src/util.ts +153 -0
- package/tsconfig.json +10 -0
|
@@ -0,0 +1,675 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __values = (this && this.__values) || function(o) {
|
|
3
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
4
|
+
if (m) return m.call(o);
|
|
5
|
+
if (o && typeof o.length === "number") return {
|
|
6
|
+
next: function () {
|
|
7
|
+
if (o && i >= o.length) o = void 0;
|
|
8
|
+
return { value: o && o[i++], done: !o };
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
12
|
+
};
|
|
13
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
14
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
+
if (!m) return o;
|
|
16
|
+
var i = m.call(o), r, ar = [], e;
|
|
17
|
+
try {
|
|
18
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
19
|
+
}
|
|
20
|
+
catch (error) { e = { error: error }; }
|
|
21
|
+
finally {
|
|
22
|
+
try {
|
|
23
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
24
|
+
}
|
|
25
|
+
finally { if (e) throw e.error; }
|
|
26
|
+
}
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
30
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
31
|
+
if (ar || !(i in from)) {
|
|
32
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
33
|
+
ar[i] = from[i];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
37
|
+
};
|
|
38
|
+
exports.__esModule = true;
|
|
39
|
+
exports.OF32 = exports.OF16 = exports.pokeRound = exports.handleFixedDamageMoves = exports.getStatDescriptionText = exports.countBoosts = exports.getStellarStabMod = exports.getStabMod = exports.getWeight = exports.getShellSideArmCategory = exports.getFinalDamage = exports.isQPActive = exports.getQPBoostedStat = exports.getBaseDamage = exports.chainMods = exports.checkMultihitBoost = exports.checkSeedBoost = exports.checkInfiltrator = exports.checkEmbody = exports.checkWindRider = exports.checkDauntlessShield = exports.checkIntrepidSword = exports.checkDownload = exports.checkIntimidate = exports.checkWonderRoom = exports.checkItem = exports.checkForecast = exports.checkTeraformZero = exports.checkAirLock = exports.getMoveEffectiveness = exports.getFinalSpeed = exports.computeFinalStats = exports.getModifiedStat = exports.isGrounded = void 0;
|
|
40
|
+
var util_1 = require("../util");
|
|
41
|
+
var stats_1 = require("../stats");
|
|
42
|
+
var EV_ITEMS = [
|
|
43
|
+
'Macho Brace',
|
|
44
|
+
'Power Anklet',
|
|
45
|
+
'Power Band',
|
|
46
|
+
'Power Belt',
|
|
47
|
+
'Power Bracer',
|
|
48
|
+
'Power Lens',
|
|
49
|
+
'Power Weight',
|
|
50
|
+
];
|
|
51
|
+
function isGrounded(pokemon, field) {
|
|
52
|
+
return (field.isGravity || pokemon.hasItem('Iron Ball') ||
|
|
53
|
+
(!pokemon.hasType('Flying') &&
|
|
54
|
+
!pokemon.hasAbility('Levitate') &&
|
|
55
|
+
!pokemon.hasItem('Air Balloon')));
|
|
56
|
+
}
|
|
57
|
+
exports.isGrounded = isGrounded;
|
|
58
|
+
function getModifiedStat(stat, mod, gen) {
|
|
59
|
+
if (gen && gen.num < 3) {
|
|
60
|
+
if (mod >= 0) {
|
|
61
|
+
var pastGenBoostTable = [1, 1.5, 2, 2.5, 3, 3.5, 4];
|
|
62
|
+
stat = Math.floor(stat * pastGenBoostTable[mod]);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
var numerators = [100, 66, 50, 40, 33, 28, 25];
|
|
66
|
+
stat = Math.floor((stat * numerators[-mod]) / 100);
|
|
67
|
+
}
|
|
68
|
+
return Math.min(999, Math.max(1, stat));
|
|
69
|
+
}
|
|
70
|
+
var numerator = 0;
|
|
71
|
+
var denominator = 1;
|
|
72
|
+
var modernGenBoostTable = [
|
|
73
|
+
[2, 8],
|
|
74
|
+
[2, 7],
|
|
75
|
+
[2, 6],
|
|
76
|
+
[2, 5],
|
|
77
|
+
[2, 4],
|
|
78
|
+
[2, 3],
|
|
79
|
+
[2, 2],
|
|
80
|
+
[3, 2],
|
|
81
|
+
[4, 2],
|
|
82
|
+
[5, 2],
|
|
83
|
+
[6, 2],
|
|
84
|
+
[7, 2],
|
|
85
|
+
[8, 2],
|
|
86
|
+
];
|
|
87
|
+
stat = OF16(stat * modernGenBoostTable[6 + mod][numerator]);
|
|
88
|
+
stat = Math.floor(stat / modernGenBoostTable[6 + mod][denominator]);
|
|
89
|
+
return stat;
|
|
90
|
+
}
|
|
91
|
+
exports.getModifiedStat = getModifiedStat;
|
|
92
|
+
function computeFinalStats(gen, attacker, defender, field) {
|
|
93
|
+
var e_1, _a, e_2, _b;
|
|
94
|
+
var stats = [];
|
|
95
|
+
for (var _i = 4; _i < arguments.length; _i++) {
|
|
96
|
+
stats[_i - 4] = arguments[_i];
|
|
97
|
+
}
|
|
98
|
+
var sides = [[attacker, field.attackerSide], [defender, field.defenderSide]];
|
|
99
|
+
try {
|
|
100
|
+
for (var sides_1 = __values(sides), sides_1_1 = sides_1.next(); !sides_1_1.done; sides_1_1 = sides_1.next()) {
|
|
101
|
+
var _c = __read(sides_1_1.value, 2), pokemon = _c[0], side = _c[1];
|
|
102
|
+
try {
|
|
103
|
+
for (var stats_2 = (e_2 = void 0, __values(stats)), stats_2_1 = stats_2.next(); !stats_2_1.done; stats_2_1 = stats_2.next()) {
|
|
104
|
+
var stat = stats_2_1.value;
|
|
105
|
+
if (stat === 'spe') {
|
|
106
|
+
pokemon.stats.spe = getFinalSpeed(gen, pokemon, field, side);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
pokemon.stats[stat] = getModifiedStat(pokemon.rawStats[stat], pokemon.boosts[stat], gen);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
114
|
+
finally {
|
|
115
|
+
try {
|
|
116
|
+
if (stats_2_1 && !stats_2_1.done && (_b = stats_2["return"])) _b.call(stats_2);
|
|
117
|
+
}
|
|
118
|
+
finally { if (e_2) throw e_2.error; }
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
123
|
+
finally {
|
|
124
|
+
try {
|
|
125
|
+
if (sides_1_1 && !sides_1_1.done && (_a = sides_1["return"])) _a.call(sides_1);
|
|
126
|
+
}
|
|
127
|
+
finally { if (e_1) throw e_1.error; }
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
exports.computeFinalStats = computeFinalStats;
|
|
131
|
+
function getFinalSpeed(gen, pokemon, field, side) {
|
|
132
|
+
var weather = field.weather || '';
|
|
133
|
+
var terrain = field.terrain;
|
|
134
|
+
var speed = getModifiedStat(pokemon.rawStats.spe, pokemon.boosts.spe, gen);
|
|
135
|
+
var speedMods = [];
|
|
136
|
+
if (side.isTailwind)
|
|
137
|
+
speedMods.push(8192);
|
|
138
|
+
if ((pokemon.hasAbility('Unburden') && pokemon.abilityOn) ||
|
|
139
|
+
(pokemon.hasAbility('Chlorophyll') && weather.includes('Sun')) ||
|
|
140
|
+
(pokemon.hasAbility('Sand Rush') && weather === 'Sand') ||
|
|
141
|
+
(pokemon.hasAbility('Swift Swim') && weather.includes('Rain')) ||
|
|
142
|
+
(pokemon.hasAbility('Slush Rush') && ['Hail', 'Snow'].includes(weather)) ||
|
|
143
|
+
(pokemon.hasAbility('Surge Surfer') && terrain === 'Electric')) {
|
|
144
|
+
speedMods.push(8192);
|
|
145
|
+
}
|
|
146
|
+
else if (pokemon.hasAbility('Quick Feet') && pokemon.status) {
|
|
147
|
+
speedMods.push(6144);
|
|
148
|
+
}
|
|
149
|
+
else if (pokemon.hasAbility('Slow Start') && pokemon.abilityOn) {
|
|
150
|
+
speedMods.push(2048);
|
|
151
|
+
}
|
|
152
|
+
else if (isQPActive(pokemon, field) && getQPBoostedStat(pokemon, gen) === 'spe') {
|
|
153
|
+
speedMods.push(6144);
|
|
154
|
+
}
|
|
155
|
+
if (pokemon.hasItem('Choice Scarf')) {
|
|
156
|
+
speedMods.push(6144);
|
|
157
|
+
}
|
|
158
|
+
else if (pokemon.hasItem.apply(pokemon, __spreadArray(['Iron Ball'], __read(EV_ITEMS), false))) {
|
|
159
|
+
speedMods.push(2048);
|
|
160
|
+
}
|
|
161
|
+
else if (pokemon.hasItem('Quick Powder') && pokemon.named('Ditto')) {
|
|
162
|
+
speedMods.push(8192);
|
|
163
|
+
}
|
|
164
|
+
speed = OF32(pokeRound((speed * chainMods(speedMods, 410, 131172)) / 4096));
|
|
165
|
+
if (pokemon.hasStatus('par') && !pokemon.hasAbility('Quick Feet')) {
|
|
166
|
+
speed = Math.floor(OF32(speed * (gen.num < 7 ? 25 : 50)) / 100);
|
|
167
|
+
}
|
|
168
|
+
speed = Math.min(gen.num <= 2 ? 999 : 10000, speed);
|
|
169
|
+
return Math.max(0, speed);
|
|
170
|
+
}
|
|
171
|
+
exports.getFinalSpeed = getFinalSpeed;
|
|
172
|
+
function getMoveEffectiveness(gen, move, type, isGhostRevealed, isGravity, isRingTarget) {
|
|
173
|
+
if (isGhostRevealed && type === 'Ghost' && move.hasType('Normal', 'Fighting')) {
|
|
174
|
+
return 1;
|
|
175
|
+
}
|
|
176
|
+
else if (isGravity && type === 'Flying' && move.hasType('Ground')) {
|
|
177
|
+
return 1;
|
|
178
|
+
}
|
|
179
|
+
else if (move.named('Freeze-Dry') && type === 'Water') {
|
|
180
|
+
return 2;
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
var effectiveness = gen.types.get((0, util_1.toID)(move.type)).effectiveness[type];
|
|
184
|
+
if (effectiveness === 0 && isRingTarget) {
|
|
185
|
+
effectiveness = 1;
|
|
186
|
+
}
|
|
187
|
+
if (move.named('Flying Press')) {
|
|
188
|
+
effectiveness *= gen.types.get('flying').effectiveness[type];
|
|
189
|
+
}
|
|
190
|
+
return effectiveness;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
exports.getMoveEffectiveness = getMoveEffectiveness;
|
|
194
|
+
function checkAirLock(pokemon, field) {
|
|
195
|
+
if (pokemon.hasAbility('Air Lock', 'Cloud Nine')) {
|
|
196
|
+
field.weather = undefined;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
exports.checkAirLock = checkAirLock;
|
|
200
|
+
function checkTeraformZero(pokemon, field) {
|
|
201
|
+
if (pokemon.hasAbility('Teraform Zero') && pokemon.abilityOn) {
|
|
202
|
+
field.weather = undefined;
|
|
203
|
+
field.terrain = undefined;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
exports.checkTeraformZero = checkTeraformZero;
|
|
207
|
+
function checkForecast(pokemon, weather) {
|
|
208
|
+
if (pokemon.hasAbility('Forecast') && pokemon.named('Castform')) {
|
|
209
|
+
switch (weather) {
|
|
210
|
+
case 'Sun':
|
|
211
|
+
case 'Harsh Sunshine':
|
|
212
|
+
pokemon.types = ['Fire'];
|
|
213
|
+
break;
|
|
214
|
+
case 'Rain':
|
|
215
|
+
case 'Heavy Rain':
|
|
216
|
+
pokemon.types = ['Water'];
|
|
217
|
+
break;
|
|
218
|
+
case 'Hail':
|
|
219
|
+
case 'Snow':
|
|
220
|
+
pokemon.types = ['Ice'];
|
|
221
|
+
break;
|
|
222
|
+
default:
|
|
223
|
+
pokemon.types = ['Normal'];
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
exports.checkForecast = checkForecast;
|
|
228
|
+
function checkItem(pokemon, magicRoomActive) {
|
|
229
|
+
if (pokemon.gen.num === 4 && pokemon.hasItem('Iron Ball'))
|
|
230
|
+
return;
|
|
231
|
+
if (pokemon.hasAbility('Klutz') && !EV_ITEMS.includes(pokemon.item) ||
|
|
232
|
+
magicRoomActive) {
|
|
233
|
+
pokemon.disabledItem = pokemon.item;
|
|
234
|
+
pokemon.item = '';
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
exports.checkItem = checkItem;
|
|
238
|
+
function checkWonderRoom(pokemon, wonderRoomActive) {
|
|
239
|
+
var _a;
|
|
240
|
+
if (wonderRoomActive) {
|
|
241
|
+
_a = __read([pokemon.rawStats.spd, pokemon.rawStats.def], 2), pokemon.rawStats.def = _a[0], pokemon.rawStats.spd = _a[1];
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
exports.checkWonderRoom = checkWonderRoom;
|
|
245
|
+
function checkIntimidate(gen, source, target) {
|
|
246
|
+
var blocked = target.hasAbility('Clear Body', 'White Smoke', 'Hyper Cutter', 'Full Metal Body') ||
|
|
247
|
+
(gen.num >= 8 && target.hasAbility('Inner Focus', 'Own Tempo', 'Oblivious', 'Scrappy')) ||
|
|
248
|
+
target.hasItem('Clear Amulet');
|
|
249
|
+
if (source.hasAbility('Intimidate') && source.abilityOn && !blocked) {
|
|
250
|
+
if (target.hasAbility('Contrary', 'Defiant', 'Guard Dog')) {
|
|
251
|
+
target.boosts.atk = Math.min(6, target.boosts.atk + 1);
|
|
252
|
+
}
|
|
253
|
+
else if (target.hasAbility('Simple')) {
|
|
254
|
+
target.boosts.atk = Math.max(-6, target.boosts.atk - 2);
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
target.boosts.atk = Math.max(-6, target.boosts.atk - 1);
|
|
258
|
+
}
|
|
259
|
+
if (target.hasAbility('Competitive')) {
|
|
260
|
+
target.boosts.spa = Math.min(6, target.boosts.spa + 2);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
exports.checkIntimidate = checkIntimidate;
|
|
265
|
+
function checkDownload(source, target, wonderRoomActive) {
|
|
266
|
+
var _a;
|
|
267
|
+
if (source.hasAbility('Download')) {
|
|
268
|
+
var def = target.stats.def;
|
|
269
|
+
var spd = target.stats.spd;
|
|
270
|
+
if (wonderRoomActive)
|
|
271
|
+
_a = __read([spd, def], 2), def = _a[0], spd = _a[1];
|
|
272
|
+
if (spd <= def) {
|
|
273
|
+
source.boosts.spa = Math.min(6, source.boosts.spa + 1);
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
source.boosts.atk = Math.min(6, source.boosts.atk + 1);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
exports.checkDownload = checkDownload;
|
|
281
|
+
function checkIntrepidSword(source, gen) {
|
|
282
|
+
if (source.hasAbility('Intrepid Sword') && gen.num > 7) {
|
|
283
|
+
source.boosts.atk = Math.min(6, source.boosts.atk + 1);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
exports.checkIntrepidSword = checkIntrepidSword;
|
|
287
|
+
function checkDauntlessShield(source, gen) {
|
|
288
|
+
if (source.hasAbility('Dauntless Shield') && gen.num > 7) {
|
|
289
|
+
source.boosts.def = Math.min(6, source.boosts.def + 1);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
exports.checkDauntlessShield = checkDauntlessShield;
|
|
293
|
+
function checkWindRider(source, attackingSide) {
|
|
294
|
+
if (source.hasAbility('Wind Rider') && attackingSide.isTailwind) {
|
|
295
|
+
source.boosts.atk = Math.min(6, source.boosts.atk + 1);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
exports.checkWindRider = checkWindRider;
|
|
299
|
+
function checkEmbody(source, gen) {
|
|
300
|
+
if (gen.num < 9)
|
|
301
|
+
return;
|
|
302
|
+
switch (source.ability) {
|
|
303
|
+
case 'Embody Aspect (Cornerstone)':
|
|
304
|
+
source.boosts.def = Math.min(6, source.boosts.def + 1);
|
|
305
|
+
break;
|
|
306
|
+
case 'Embody Aspect (Hearthflame)':
|
|
307
|
+
source.boosts.atk = Math.min(6, source.boosts.atk + 1);
|
|
308
|
+
break;
|
|
309
|
+
case 'Embody Aspect (Teal)':
|
|
310
|
+
source.boosts.spe = Math.min(6, source.boosts.spe + 1);
|
|
311
|
+
break;
|
|
312
|
+
case 'Embody Aspect (Wellspring)':
|
|
313
|
+
source.boosts.spd = Math.min(6, source.boosts.spd + 1);
|
|
314
|
+
break;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
exports.checkEmbody = checkEmbody;
|
|
318
|
+
function checkInfiltrator(pokemon, affectedSide) {
|
|
319
|
+
if (pokemon.hasAbility('Infiltrator')) {
|
|
320
|
+
affectedSide.isReflect = false;
|
|
321
|
+
affectedSide.isLightScreen = false;
|
|
322
|
+
affectedSide.isAuroraVeil = false;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
exports.checkInfiltrator = checkInfiltrator;
|
|
326
|
+
function checkSeedBoost(pokemon, field) {
|
|
327
|
+
if (!pokemon.item)
|
|
328
|
+
return;
|
|
329
|
+
if (field.terrain && pokemon.item.includes('Seed')) {
|
|
330
|
+
var terrainSeed = pokemon.item.substring(0, pokemon.item.indexOf(' '));
|
|
331
|
+
if (field.hasTerrain(terrainSeed)) {
|
|
332
|
+
if (terrainSeed === 'Grassy' || terrainSeed === 'Electric') {
|
|
333
|
+
pokemon.boosts.def = pokemon.hasAbility('Contrary')
|
|
334
|
+
? Math.max(-6, pokemon.boosts.def - 1)
|
|
335
|
+
: Math.min(6, pokemon.boosts.def + 1);
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
pokemon.boosts.spd = pokemon.hasAbility('Contrary')
|
|
339
|
+
? Math.max(-6, pokemon.boosts.spd - 1)
|
|
340
|
+
: Math.min(6, pokemon.boosts.spd + 1);
|
|
341
|
+
}
|
|
342
|
+
pokemon.item = '';
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
exports.checkSeedBoost = checkSeedBoost;
|
|
347
|
+
function checkMultihitBoost(gen, attacker, defender, move, field, desc, attackerUsedItem, defenderUsedItem) {
|
|
348
|
+
if (attackerUsedItem === void 0) { attackerUsedItem = false; }
|
|
349
|
+
if (defenderUsedItem === void 0) { defenderUsedItem = false; }
|
|
350
|
+
if (move.named('Gyro Ball', 'Electro Ball') && defender.hasAbility('Gooey', 'Tangling Hair')) {
|
|
351
|
+
if (attacker.hasItem('White Herb') && !attackerUsedItem) {
|
|
352
|
+
desc.attackerItem = attacker.item;
|
|
353
|
+
attackerUsedItem = true;
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
attacker.boosts.spe = Math.max(attacker.boosts.spe - 1, -6);
|
|
357
|
+
attacker.stats.spe = getFinalSpeed(gen, attacker, field, field.attackerSide);
|
|
358
|
+
desc.defenderAbility = defender.ability;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
else if (move.named('Power-Up Punch')) {
|
|
362
|
+
attacker.boosts.atk = Math.min(attacker.boosts.atk + 1, 6);
|
|
363
|
+
attacker.stats.atk = getModifiedStat(attacker.rawStats.atk, attacker.boosts.atk, gen);
|
|
364
|
+
}
|
|
365
|
+
var atkSimple = attacker.hasAbility('Simple') ? 2 : 1;
|
|
366
|
+
var defSimple = defender.hasAbility('Simple') ? 2 : 1;
|
|
367
|
+
if ((!defenderUsedItem) &&
|
|
368
|
+
(defender.hasItem('Luminous Moss') && move.hasType('Water')) ||
|
|
369
|
+
(defender.hasItem('Maranga Berry') && move.category === 'Special') ||
|
|
370
|
+
(defender.hasItem('Kee Berry') && move.category === 'Physical')) {
|
|
371
|
+
var defStat = defender.hasItem('Kee Berry') ? 'def' : 'spd';
|
|
372
|
+
if (attacker.hasAbility('Unaware')) {
|
|
373
|
+
desc.attackerAbility = attacker.ability;
|
|
374
|
+
}
|
|
375
|
+
else {
|
|
376
|
+
if (defender.hasAbility('Contrary')) {
|
|
377
|
+
desc.defenderAbility = defender.ability;
|
|
378
|
+
if (defender.hasItem('White Herb') && !defenderUsedItem) {
|
|
379
|
+
desc.defenderItem = defender.item;
|
|
380
|
+
defenderUsedItem = true;
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
defender.boosts[defStat] = Math.max(-6, defender.boosts[defStat] - defSimple);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
defender.boosts[defStat] = Math.min(6, defender.boosts[defStat] + defSimple);
|
|
388
|
+
}
|
|
389
|
+
if (defSimple === 2)
|
|
390
|
+
desc.defenderAbility = defender.ability;
|
|
391
|
+
defender.stats[defStat] = getModifiedStat(defender.rawStats[defStat], defender.boosts[defStat], gen);
|
|
392
|
+
desc.defenderItem = defender.item;
|
|
393
|
+
defenderUsedItem = true;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
if (defender.hasAbility('Seed Sower')) {
|
|
397
|
+
field.terrain = 'Grassy';
|
|
398
|
+
}
|
|
399
|
+
if (defender.hasAbility('Sand Spit')) {
|
|
400
|
+
field.weather = 'Sand';
|
|
401
|
+
}
|
|
402
|
+
if (defender.hasAbility('Stamina')) {
|
|
403
|
+
if (attacker.hasAbility('Unaware')) {
|
|
404
|
+
desc.attackerAbility = attacker.ability;
|
|
405
|
+
}
|
|
406
|
+
else {
|
|
407
|
+
defender.boosts.def = Math.min(defender.boosts.def + 1, 6);
|
|
408
|
+
defender.stats.def = getModifiedStat(defender.rawStats.def, defender.boosts.def, gen);
|
|
409
|
+
desc.defenderAbility = defender.ability;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
else if (defender.hasAbility('Water Compaction') && move.hasType('Water')) {
|
|
413
|
+
if (attacker.hasAbility('Unaware')) {
|
|
414
|
+
desc.attackerAbility = attacker.ability;
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
defender.boosts.def = Math.min(defender.boosts.def + 2, 6);
|
|
418
|
+
defender.stats.def = getModifiedStat(defender.rawStats.def, defender.boosts.def, gen);
|
|
419
|
+
desc.defenderAbility = defender.ability;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
else if (defender.hasAbility('Weak Armor')) {
|
|
423
|
+
if (attacker.hasAbility('Unaware')) {
|
|
424
|
+
desc.attackerAbility = attacker.ability;
|
|
425
|
+
}
|
|
426
|
+
else {
|
|
427
|
+
if (defender.hasItem('White Herb') && !defenderUsedItem && defender.boosts.def === 0) {
|
|
428
|
+
desc.defenderItem = defender.item;
|
|
429
|
+
defenderUsedItem = true;
|
|
430
|
+
}
|
|
431
|
+
else {
|
|
432
|
+
defender.boosts.def = Math.max(defender.boosts.def - 1, -6);
|
|
433
|
+
defender.stats.def = getModifiedStat(defender.rawStats.def, defender.boosts.def, gen);
|
|
434
|
+
}
|
|
435
|
+
desc.defenderAbility = defender.ability;
|
|
436
|
+
}
|
|
437
|
+
defender.boosts.spe = Math.min(defender.boosts.spe + 2, 6);
|
|
438
|
+
defender.stats.spe = getFinalSpeed(gen, defender, field, field.defenderSide);
|
|
439
|
+
}
|
|
440
|
+
if (move.dropsStats) {
|
|
441
|
+
if (attacker.hasAbility('Unaware')) {
|
|
442
|
+
desc.attackerAbility = attacker.ability;
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
var stat = move.category === 'Special' ? 'spa' : 'atk';
|
|
446
|
+
var boosts = attacker.boosts[stat];
|
|
447
|
+
if (attacker.hasAbility('Contrary')) {
|
|
448
|
+
boosts = Math.min(6, boosts + move.dropsStats);
|
|
449
|
+
desc.attackerAbility = attacker.ability;
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
boosts = Math.max(-6, boosts - move.dropsStats * atkSimple);
|
|
453
|
+
}
|
|
454
|
+
if (atkSimple === 2)
|
|
455
|
+
desc.attackerAbility = attacker.ability;
|
|
456
|
+
if (attacker.hasItem('White Herb') && attacker.boosts[stat] < 0 && !attackerUsedItem) {
|
|
457
|
+
boosts += move.dropsStats * atkSimple;
|
|
458
|
+
desc.attackerItem = attacker.item;
|
|
459
|
+
attackerUsedItem = true;
|
|
460
|
+
}
|
|
461
|
+
attacker.boosts[stat] = boosts;
|
|
462
|
+
attacker.stats[stat] = getModifiedStat(attacker.rawStats[stat], defender.boosts[stat], gen);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
if (defender.hasAbility('Mummy', 'Wandering Spirit', 'Lingering Aroma') && move.flags.contact) {
|
|
466
|
+
var oldAttackerAbility = attacker.ability;
|
|
467
|
+
attacker.ability = defender.ability;
|
|
468
|
+
if (desc.attackerAbility) {
|
|
469
|
+
desc.defenderAbility = defender.ability;
|
|
470
|
+
}
|
|
471
|
+
if (defender.hasAbility('Wandering Spirit')) {
|
|
472
|
+
defender.ability = oldAttackerAbility;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
return [attackerUsedItem, defenderUsedItem];
|
|
476
|
+
}
|
|
477
|
+
exports.checkMultihitBoost = checkMultihitBoost;
|
|
478
|
+
function chainMods(mods, lowerBound, upperBound) {
|
|
479
|
+
var e_3, _a;
|
|
480
|
+
var M = 4096;
|
|
481
|
+
try {
|
|
482
|
+
for (var mods_1 = __values(mods), mods_1_1 = mods_1.next(); !mods_1_1.done; mods_1_1 = mods_1.next()) {
|
|
483
|
+
var mod = mods_1_1.value;
|
|
484
|
+
if (mod !== 4096) {
|
|
485
|
+
M = (M * mod + 2048) >> 12;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
490
|
+
finally {
|
|
491
|
+
try {
|
|
492
|
+
if (mods_1_1 && !mods_1_1.done && (_a = mods_1["return"])) _a.call(mods_1);
|
|
493
|
+
}
|
|
494
|
+
finally { if (e_3) throw e_3.error; }
|
|
495
|
+
}
|
|
496
|
+
return Math.max(Math.min(M, upperBound), lowerBound);
|
|
497
|
+
}
|
|
498
|
+
exports.chainMods = chainMods;
|
|
499
|
+
function getBaseDamage(level, basePower, attack, defense) {
|
|
500
|
+
return Math.floor(OF32(Math.floor(OF32(OF32(Math.floor((2 * level) / 5 + 2) * basePower) * attack) / defense) / 50 + 2));
|
|
501
|
+
}
|
|
502
|
+
exports.getBaseDamage = getBaseDamage;
|
|
503
|
+
function getQPBoostedStat(pokemon, gen) {
|
|
504
|
+
var e_4, _a;
|
|
505
|
+
if (pokemon.boostedStat && pokemon.boostedStat !== 'auto') {
|
|
506
|
+
return pokemon.boostedStat;
|
|
507
|
+
}
|
|
508
|
+
var bestStat = 'atk';
|
|
509
|
+
try {
|
|
510
|
+
for (var _b = __values(['def', 'spa', 'spd', 'spe']), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
511
|
+
var stat = _c.value;
|
|
512
|
+
if (getModifiedStat(pokemon.rawStats[stat], pokemon.boosts[stat], gen) >
|
|
513
|
+
getModifiedStat(pokemon.rawStats[bestStat], pokemon.boosts[bestStat], gen)) {
|
|
514
|
+
bestStat = stat;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
519
|
+
finally {
|
|
520
|
+
try {
|
|
521
|
+
if (_c && !_c.done && (_a = _b["return"])) _a.call(_b);
|
|
522
|
+
}
|
|
523
|
+
finally { if (e_4) throw e_4.error; }
|
|
524
|
+
}
|
|
525
|
+
return bestStat;
|
|
526
|
+
}
|
|
527
|
+
exports.getQPBoostedStat = getQPBoostedStat;
|
|
528
|
+
function isQPActive(pokemon, field) {
|
|
529
|
+
if (!pokemon.boostedStat) {
|
|
530
|
+
return false;
|
|
531
|
+
}
|
|
532
|
+
var weather = field.weather || '';
|
|
533
|
+
var terrain = field.terrain;
|
|
534
|
+
return ((pokemon.hasAbility('Protosynthesis') &&
|
|
535
|
+
(weather.includes('Sun') || pokemon.hasItem('Booster Energy'))) ||
|
|
536
|
+
(pokemon.hasAbility('Quark Drive') &&
|
|
537
|
+
(terrain === 'Electric' || pokemon.hasItem('Booster Energy'))) ||
|
|
538
|
+
(pokemon.boostedStat !== 'auto'));
|
|
539
|
+
}
|
|
540
|
+
exports.isQPActive = isQPActive;
|
|
541
|
+
function getFinalDamage(baseAmount, i, effectiveness, isBurned, stabMod, finalMod, protect) {
|
|
542
|
+
var damageAmount = Math.floor(OF32(baseAmount * (85 + i)) / 100);
|
|
543
|
+
if (stabMod !== 4096)
|
|
544
|
+
damageAmount = OF32(damageAmount * stabMod) / 4096;
|
|
545
|
+
damageAmount = Math.floor(OF32(pokeRound(damageAmount) * effectiveness));
|
|
546
|
+
if (isBurned)
|
|
547
|
+
damageAmount = Math.floor(damageAmount / 2);
|
|
548
|
+
if (protect)
|
|
549
|
+
damageAmount = pokeRound(OF32(damageAmount * 1024) / 4096);
|
|
550
|
+
return OF16(pokeRound(Math.max(1, OF32(damageAmount * finalMod) / 4096)));
|
|
551
|
+
}
|
|
552
|
+
exports.getFinalDamage = getFinalDamage;
|
|
553
|
+
function getShellSideArmCategory(source, target) {
|
|
554
|
+
var physicalDamage = source.stats.atk / target.stats.def;
|
|
555
|
+
var specialDamage = source.stats.spa / target.stats.spd;
|
|
556
|
+
return physicalDamage > specialDamage ? 'Physical' : 'Special';
|
|
557
|
+
}
|
|
558
|
+
exports.getShellSideArmCategory = getShellSideArmCategory;
|
|
559
|
+
function getWeight(pokemon, desc, role) {
|
|
560
|
+
var weightHG = pokemon.weightkg * 10;
|
|
561
|
+
var abilityFactor = pokemon.hasAbility('Heavy Metal') ? 2
|
|
562
|
+
: pokemon.hasAbility('Light Metal') ? 0.5
|
|
563
|
+
: 1;
|
|
564
|
+
if (abilityFactor !== 1) {
|
|
565
|
+
weightHG = Math.max(Math.trunc(weightHG * abilityFactor), 1);
|
|
566
|
+
desc["".concat(role, "Ability")] = pokemon.ability;
|
|
567
|
+
}
|
|
568
|
+
if (pokemon.hasItem('Float Stone')) {
|
|
569
|
+
weightHG = Math.max(Math.trunc(weightHG * 0.5), 1);
|
|
570
|
+
desc["".concat(role, "Item")] = pokemon.item;
|
|
571
|
+
}
|
|
572
|
+
return weightHG / 10;
|
|
573
|
+
}
|
|
574
|
+
exports.getWeight = getWeight;
|
|
575
|
+
function getStabMod(pokemon, move, desc) {
|
|
576
|
+
var stabMod = 4096;
|
|
577
|
+
if (pokemon.hasOriginalType(move.type)) {
|
|
578
|
+
stabMod += 2048;
|
|
579
|
+
}
|
|
580
|
+
else if (pokemon.hasAbility('Protean', 'Libero') && !pokemon.teraType) {
|
|
581
|
+
stabMod += 2048;
|
|
582
|
+
desc.attackerAbility = pokemon.ability;
|
|
583
|
+
}
|
|
584
|
+
var teraType = pokemon.teraType;
|
|
585
|
+
if (teraType === move.type && teraType !== 'Stellar') {
|
|
586
|
+
stabMod += 2048;
|
|
587
|
+
desc.attackerTera = teraType;
|
|
588
|
+
}
|
|
589
|
+
if (pokemon.hasAbility('Adaptability') && pokemon.hasType(move.type)) {
|
|
590
|
+
stabMod += teraType && pokemon.hasOriginalType(teraType) ? 1024 : 2048;
|
|
591
|
+
desc.attackerAbility = pokemon.ability;
|
|
592
|
+
}
|
|
593
|
+
return stabMod;
|
|
594
|
+
}
|
|
595
|
+
exports.getStabMod = getStabMod;
|
|
596
|
+
function getStellarStabMod(pokemon, move, stabMod, turns) {
|
|
597
|
+
if (stabMod === void 0) { stabMod = 1; }
|
|
598
|
+
if (turns === void 0) { turns = 0; }
|
|
599
|
+
var isStellarBoosted = pokemon.teraType === 'Stellar' &&
|
|
600
|
+
((move.isStellarFirstUse && turns === 0) || pokemon.named('Terapagos-Stellar'));
|
|
601
|
+
if (isStellarBoosted) {
|
|
602
|
+
if (pokemon.hasOriginalType(move.type)) {
|
|
603
|
+
stabMod += 2048;
|
|
604
|
+
}
|
|
605
|
+
else {
|
|
606
|
+
stabMod = 4915;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
return stabMod;
|
|
610
|
+
}
|
|
611
|
+
exports.getStellarStabMod = getStellarStabMod;
|
|
612
|
+
function countBoosts(gen, boosts) {
|
|
613
|
+
var e_5, _a;
|
|
614
|
+
var sum = 0;
|
|
615
|
+
var STATS = gen.num === 1
|
|
616
|
+
? ['atk', 'def', 'spa', 'spe']
|
|
617
|
+
: ['atk', 'def', 'spa', 'spd', 'spe'];
|
|
618
|
+
try {
|
|
619
|
+
for (var STATS_1 = __values(STATS), STATS_1_1 = STATS_1.next(); !STATS_1_1.done; STATS_1_1 = STATS_1.next()) {
|
|
620
|
+
var stat = STATS_1_1.value;
|
|
621
|
+
var boost = boosts[stat];
|
|
622
|
+
if (boost && boost > 0)
|
|
623
|
+
sum += boost;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
627
|
+
finally {
|
|
628
|
+
try {
|
|
629
|
+
if (STATS_1_1 && !STATS_1_1.done && (_a = STATS_1["return"])) _a.call(STATS_1);
|
|
630
|
+
}
|
|
631
|
+
finally { if (e_5) throw e_5.error; }
|
|
632
|
+
}
|
|
633
|
+
return sum;
|
|
634
|
+
}
|
|
635
|
+
exports.countBoosts = countBoosts;
|
|
636
|
+
function getStatDescriptionText(gen, pokemon, stat, natureName) {
|
|
637
|
+
var nature = gen.natures.get((0, util_1.toID)(natureName));
|
|
638
|
+
var desc = pokemon.evs[stat] +
|
|
639
|
+
(stat === 'hp' || nature.plus === nature.minus ? ''
|
|
640
|
+
: nature.plus === stat ? '+'
|
|
641
|
+
: nature.minus === stat ? '-'
|
|
642
|
+
: '') + ' ' +
|
|
643
|
+
stats_1.Stats.displayStat(stat);
|
|
644
|
+
var iv = pokemon.ivs[stat];
|
|
645
|
+
if (iv !== 31)
|
|
646
|
+
desc += " ".concat(iv, " IVs");
|
|
647
|
+
return desc;
|
|
648
|
+
}
|
|
649
|
+
exports.getStatDescriptionText = getStatDescriptionText;
|
|
650
|
+
function handleFixedDamageMoves(attacker, move) {
|
|
651
|
+
if (move.named('Seismic Toss', 'Night Shade')) {
|
|
652
|
+
return attacker.level;
|
|
653
|
+
}
|
|
654
|
+
else if (move.named('Dragon Rage')) {
|
|
655
|
+
return 40;
|
|
656
|
+
}
|
|
657
|
+
else if (move.named('Sonic Boom')) {
|
|
658
|
+
return 20;
|
|
659
|
+
}
|
|
660
|
+
return 0;
|
|
661
|
+
}
|
|
662
|
+
exports.handleFixedDamageMoves = handleFixedDamageMoves;
|
|
663
|
+
function pokeRound(num) {
|
|
664
|
+
return num % 1 > 0.5 ? Math.ceil(num) : Math.floor(num);
|
|
665
|
+
}
|
|
666
|
+
exports.pokeRound = pokeRound;
|
|
667
|
+
function OF16(n) {
|
|
668
|
+
return n > 65535 ? n % 65536 : n;
|
|
669
|
+
}
|
|
670
|
+
exports.OF16 = OF16;
|
|
671
|
+
function OF32(n) {
|
|
672
|
+
return n > 4294967295 ? n % 4294967296 : n;
|
|
673
|
+
}
|
|
674
|
+
exports.OF32 = OF32;
|
|
675
|
+
//# sourceMappingURL=util.js.map
|