@robsonbittencourt/calc 0.11.12 → 0.11.13

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.
@@ -0,0 +1,2 @@
1
+ import type * as I from './interface';
2
+ export declare const GenerationsVGC: I.Generations;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.GenerationsVGC = void 0;
4
+ var abilities_1 = require("./abilities");
5
+ var items_1 = require("./items");
6
+ var moves_vgc_1 = require("./moves-vgc");
7
+ var species_vgc_1 = require("./species-vgc");
8
+ var types_1 = require("./types");
9
+ var natures_1 = require("./natures");
10
+ exports.GenerationsVGC = new ((function () {
11
+ function class_1() {
12
+ }
13
+ class_1.prototype.get = function (gen) {
14
+ return new GenerationVGC(gen);
15
+ };
16
+ return class_1;
17
+ }()))();
18
+ var GenerationVGC = (function () {
19
+ function GenerationVGC(num) {
20
+ this.num = num;
21
+ this.abilities = new abilities_1.Abilities(num);
22
+ this.items = new items_1.Items(num);
23
+ this.moves = new moves_vgc_1.MovesVGC(num);
24
+ this.species = new species_vgc_1.SpeciesVGC(num);
25
+ this.types = new types_1.Types(num);
26
+ this.natures = new natures_1.Natures();
27
+ }
28
+ return GenerationVGC;
29
+ }());
30
+ //# sourceMappingURL=index-vgc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-vgc.js","sourceRoot":"","sources":["../../src/data/index-vgc.ts"],"names":[],"mappings":";;;AAEA,yCAAqC;AACrC,iCAA6B;AAC7B,yCAAoC;AACpC,6CAAwC;AACxC,iCAA6B;AAC7B,qCAAiC;AAEpB,QAAA,cAAc,GAAkB,IAAI;IAAC;IAIlD,CAAC;IAHC,qBAAG,GAAH,UAAI,GAAoB;QACtB,OAAO,IAAI,aAAa,CAAC,GAAG,CAAC,CAAA;IAC/B,CAAC;IACH,cAAC;AAAD,CAAC,AAJiD,IAIhD,EAAE,CAAA;AAEJ;IAUE,uBAAY,GAAoB;QAC9B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QAEd,IAAI,CAAC,SAAS,GAAG,IAAI,qBAAS,CAAC,GAAG,CAAC,CAAA;QACnC,IAAI,CAAC,KAAK,GAAG,IAAI,aAAK,CAAC,GAAG,CAAC,CAAA;QAC3B,IAAI,CAAC,KAAK,GAAG,IAAI,oBAAQ,CAAC,GAAG,CAAC,CAAA;QAC9B,IAAI,CAAC,OAAO,GAAG,IAAI,wBAAU,CAAC,GAAG,CAAC,CAAA;QAClC,IAAI,CAAC,KAAK,GAAG,IAAI,aAAK,CAAC,GAAG,CAAC,CAAA;QAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,iBAAO,EAAE,CAAA;IAC9B,CAAC;IACH,oBAAC;AAAD,CAAC,AApBD,IAoBC"}
@@ -0,0 +1,51 @@
1
+ import type * as I from './interface';
2
+ import type { MoveData } from './moves';
3
+ declare class Move implements I.Move {
4
+ readonly kind: 'Move';
5
+ readonly id: I.ID;
6
+ readonly name: I.MoveName;
7
+ readonly basePower: number;
8
+ readonly type: I.TypeName;
9
+ readonly category?: I.MoveCategory;
10
+ readonly flags: I.MoveFlags;
11
+ readonly secondaries?: boolean;
12
+ readonly target?: I.MoveTarget;
13
+ readonly recoil?: [number, number];
14
+ readonly hasCrashDamage?: boolean;
15
+ readonly mindBlownRecoil?: boolean;
16
+ readonly struggleRecoil?: boolean;
17
+ readonly willCrit?: boolean;
18
+ readonly drain?: [number, number];
19
+ readonly priority?: number;
20
+ readonly self?: I.SelfOrSecondaryEffect | null;
21
+ readonly ignoreDefensive?: boolean;
22
+ readonly overrideOffensiveStat?: I.StatIDExceptHP;
23
+ readonly overrideDefensiveStat?: I.StatIDExceptHP;
24
+ readonly overrideOffensivePokemon?: 'target' | 'source';
25
+ readonly overrideDefensivePokemon?: 'target' | 'source';
26
+ readonly breaksProtect?: boolean;
27
+ readonly isZ?: boolean;
28
+ readonly zMove?: {
29
+ basePower?: number;
30
+ };
31
+ readonly isMax?: boolean;
32
+ readonly maxMove?: {
33
+ basePower: number;
34
+ };
35
+ readonly zp?: number;
36
+ readonly maxPower?: number;
37
+ readonly multihit?: number | number[];
38
+ readonly multiaccuracy?: boolean;
39
+ private static readonly FLAGS;
40
+ constructor(name: string, data: MoveData, gen: number);
41
+ }
42
+ export declare const MOVES_VGC: {
43
+ [id: string]: Move;
44
+ }[];
45
+ export declare class MovesVGC implements I.Moves {
46
+ private readonly gen;
47
+ constructor(gen: I.GenerationNum);
48
+ get(id: I.ID): Move;
49
+ [Symbol.iterator](): Generator<Move, void, unknown>;
50
+ }
51
+ export {};
@@ -0,0 +1,155 @@
1
+ "use strict";
2
+ var __generator = (this && this.__generator) || function (thisArg, body) {
3
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
4
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
5
+ function verb(n) { return function (v) { return step([n, v]); }; }
6
+ function step(op) {
7
+ if (f) throw new TypeError("Generator is already executing.");
8
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
9
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
10
+ if (y = 0, t) op = [op[0] & 2, t.value];
11
+ switch (op[0]) {
12
+ case 0: case 1: t = op; break;
13
+ case 4: _.label++; return { value: op[1], done: false };
14
+ case 5: _.label++; y = op[1]; op = [0]; continue;
15
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
16
+ default:
17
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
18
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
19
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
20
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
21
+ if (t[2]) _.ops.pop();
22
+ _.trys.pop(); continue;
23
+ }
24
+ op = body.call(thisArg, _);
25
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
26
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
27
+ }
28
+ };
29
+ var __values = (this && this.__values) || function(o) {
30
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
31
+ if (m) return m.call(o);
32
+ if (o && typeof o.length === "number") return {
33
+ next: function () {
34
+ if (o && i >= o.length) o = void 0;
35
+ return { value: o && o[i++], done: !o };
36
+ }
37
+ };
38
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
39
+ };
40
+ var e_1, _a;
41
+ exports.__esModule = true;
42
+ exports.MovesVGC = exports.MOVES_VGC = void 0;
43
+ var util_1 = require("../util");
44
+ var sv_moves_1 = require("./vgc/sv-moves");
45
+ var champions_moves_1 = require("./vgc/champions-moves");
46
+ var MOVES_DATA = [champions_moves_1.CHAMPIONS_MOVES, sv_moves_1.SV_MOVES];
47
+ var Move = (function () {
48
+ function Move(name, data, gen) {
49
+ this.kind = 'Move';
50
+ this.id = (0, util_1.toID)(name);
51
+ this.name = name;
52
+ this.flags = {};
53
+ if (data.makesContact)
54
+ this.flags.contact = 1;
55
+ if (data.isPunch)
56
+ this.flags.punch = 1;
57
+ if (data.isBite)
58
+ this.flags.bite = 1;
59
+ if (data.isBullet)
60
+ this.flags.bullet = 1;
61
+ if (data.isSound)
62
+ this.flags.sound = 1;
63
+ if (data.isPulse)
64
+ this.flags.pulse = 1;
65
+ if (data.isSlicing)
66
+ this.flags.slicing = 1;
67
+ if (data.isWind)
68
+ this.flags.wind = 1;
69
+ (0, util_1.assignWithout)(this, data, Move.FLAGS);
70
+ this.basePower = data.bp;
71
+ if (data.zp)
72
+ this.zMove = { basePower: data.zp };
73
+ if (data.maxPower)
74
+ this.maxMove = { basePower: data.maxPower };
75
+ if (!this.category && gen >= 4)
76
+ this.category = 'Status';
77
+ if (this.struggleRecoil)
78
+ delete this.recoil;
79
+ }
80
+ Move.FLAGS = new Set([
81
+ 'bp',
82
+ 'makesContact',
83
+ 'isPunch',
84
+ 'isBite',
85
+ 'isBullet',
86
+ 'isSound',
87
+ 'isPulse',
88
+ 'zp',
89
+ 'maxPower',
90
+ 'isSlicing',
91
+ 'isWind',
92
+ ]);
93
+ return Move;
94
+ }());
95
+ var MOVES_BY_ID = [];
96
+ var genIdx = 0;
97
+ try {
98
+ for (var _b = __values([0, 9]), _c = _b.next(); !_c.done; _c = _b.next()) {
99
+ var genNum = _c.value;
100
+ var moves = MOVES_DATA[genIdx];
101
+ var map = {};
102
+ for (var move in moves) {
103
+ var m = new Move(move, moves[move], genNum);
104
+ map[m.id] = m;
105
+ }
106
+ MOVES_BY_ID[genNum] = map;
107
+ genIdx++;
108
+ }
109
+ }
110
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
111
+ finally {
112
+ try {
113
+ if (_c && !_c.done && (_a = _b["return"])) _a.call(_b);
114
+ }
115
+ finally { if (e_1) throw e_1.error; }
116
+ }
117
+ exports.MOVES_VGC = MOVES_BY_ID;
118
+ var MovesVGC = (function () {
119
+ function MovesVGC(gen) {
120
+ this.gen = gen;
121
+ }
122
+ MovesVGC.prototype.get = function (id) {
123
+ return MOVES_BY_ID[this.gen][id];
124
+ };
125
+ MovesVGC.prototype[Symbol.iterator] = function () {
126
+ var _a, _b, _c, _i, id;
127
+ return __generator(this, function (_d) {
128
+ switch (_d.label) {
129
+ case 0:
130
+ _a = MOVES_BY_ID[this.gen];
131
+ _b = [];
132
+ for (_c in _a)
133
+ _b.push(_c);
134
+ _i = 0;
135
+ _d.label = 1;
136
+ case 1:
137
+ if (!(_i < _b.length)) return [3, 4];
138
+ _c = _b[_i];
139
+ if (!(_c in _a)) return [3, 3];
140
+ id = _c;
141
+ return [4, this.get(id)];
142
+ case 2:
143
+ _d.sent();
144
+ _d.label = 3;
145
+ case 3:
146
+ _i++;
147
+ return [3, 1];
148
+ case 4: return [2];
149
+ }
150
+ });
151
+ };
152
+ return MovesVGC;
153
+ }());
154
+ exports.MovesVGC = MovesVGC;
155
+ //# sourceMappingURL=moves-vgc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moves-vgc.js","sourceRoot":"","sources":["../../src/data/moves-vgc.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,gCAA2C;AAE3C,2CAAuC;AACvC,yDAAqD;AAErD,IAAM,UAAU,GAAG,CAAC,iCAAe,EAAE,mBAAQ,CAAC,CAAA;AAE9C;IA+CE,cAAY,IAAY,EAAE,IAAc,EAAE,GAAW;QACnD,IAAI,CAAC,IAAI,GAAG,MAAM,CAAA;QAClB,IAAI,CAAC,EAAE,GAAG,IAAA,WAAI,EAAC,IAAI,CAAC,CAAA;QACpB,IAAI,CAAC,IAAI,GAAG,IAAkB,CAAA;QAE9B,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;QACf,IAAI,IAAI,CAAC,YAAY;YAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAA;QAC7C,IAAI,IAAI,CAAC,OAAO;YAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAA;QACtC,IAAI,IAAI,CAAC,MAAM;YAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAA;QACpC,IAAI,IAAI,CAAC,QAAQ;YAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;QACxC,IAAI,IAAI,CAAC,OAAO;YAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAA;QACtC,IAAI,IAAI,CAAC,OAAO;YAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAA;QACtC,IAAI,IAAI,CAAC,SAAS;YAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,CAA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,CAAC,EAAE,MAAM,CAAC,CAAA;YAC7C,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAA;SACd;QACD,WAAW,CAAC,MAAM,CAAC,GAAG,GAAG,CAAA;QACzB,MAAM,EAAE,CAAA;KACT;;;;;;;;;AAEY,QAAA,SAAS,GAAG,WAAW,CAAA;AAEpC;IAGE,kBAAY,GAAoB;QAC9B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;IAChB,CAAC;IAED,sBAAG,GAAH,UAAI,EAAQ;QACV,OAAO,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAA;IAClC,CAAC;IAEA,mBAAC,MAAM,CAAC,QAAQ,CAAC,GAAlB;;;;;yBACmB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC;;;;;;;;;;;oBACpC,WAAM,IAAI,CAAC,GAAG,CAAC,EAAU,CAAE,EAAA;;oBAA3B,SAA2B,CAAA;;;;;;;;KAE9B;IACH,eAAC;AAAD,CAAC,AAhBD,IAgBC;AAhBY,4BAAQ"}
@@ -838,7 +838,7 @@ var DPP_PATCH = {
838
838
  'Double Hit': {
839
839
  bp: 35,
840
840
  type: 'Normal',
841
- multihit: 2,
841
+ multihit: [1, 2],
842
842
  makesContact: true,
843
843
  category: 'Physical'
844
844
  },
@@ -1522,7 +1522,7 @@ var BW_PATCH = {
1522
1522
  'Dual Chop': {
1523
1523
  bp: 40,
1524
1524
  type: 'Dragon',
1525
- multihit: 2,
1525
+ multihit: [1, 2],
1526
1526
  makesContact: true,
1527
1527
  category: 'Physical'
1528
1528
  },
@@ -1558,7 +1558,7 @@ var BW_PATCH = {
1558
1558
  'Gear Grind': {
1559
1559
  bp: 50,
1560
1560
  type: 'Steel',
1561
- multihit: 2,
1561
+ multihit: [1, 2],
1562
1562
  makesContact: true,
1563
1563
  category: 'Physical'
1564
1564
  },
@@ -2437,7 +2437,7 @@ var SM_PATCH = {
2437
2437
  'Double Iron Bash': {
2438
2438
  bp: 60,
2439
2439
  type: 'Steel',
2440
- multihit: 2,
2440
+ multihit: [1, 2],
2441
2441
  makesContact: true,
2442
2442
  isPunch: true,
2443
2443
  category: 'Physical',
@@ -2950,7 +2950,7 @@ var SS_PATCH = {
2950
2950
  type: 'Flying',
2951
2951
  category: 'Physical',
2952
2952
  makesContact: true,
2953
- multihit: 2,
2953
+ multihit: [1, 2],
2954
2954
  zp: 100,
2955
2955
  maxPower: 130
2956
2956
  },
@@ -3577,7 +3577,7 @@ var SS_PATCH = {
3577
3577
  makesContact: true,
3578
3578
  willCrit: true,
3579
3579
  isPunch: true,
3580
- multihit: 3,
3580
+ multihit: [1, 3],
3581
3581
  zp: 140,
3582
3582
  maxPower: 130
3583
3583
  },
@@ -3594,7 +3594,7 @@ var SS_PATCH = {
3594
3594
  type: 'Ice',
3595
3595
  category: 'Physical',
3596
3596
  makesContact: true,
3597
- multihit: 3,
3597
+ multihit: [1, 3],
3598
3598
  multiaccuracy: true,
3599
3599
  zp: 120,
3600
3600
  maxPower: 140
@@ -4779,7 +4779,7 @@ var SV_PATCH = {
4779
4779
  category: 'Special',
4780
4780
  zp: 180,
4781
4781
  maxPower: 140,
4782
- multihit: 2,
4782
+ multihit: [1, 2],
4783
4783
  isSlicing: true
4784
4784
  },
4785
4785
  'Take Heart': {
@@ -4855,7 +4855,7 @@ var SV_PATCH = {
4855
4855
  zp: 100,
4856
4856
  maxPower: 90,
4857
4857
  makesContact: true,
4858
- multihit: 3
4858
+ multihit: [1, 3]
4859
4859
  },
4860
4860
  'Twin Beam': {
4861
4861
  bp: 40,
@@ -4863,7 +4863,7 @@ var SV_PATCH = {
4863
4863
  category: 'Special',
4864
4864
  zp: 100,
4865
4865
  maxPower: 90,
4866
- multihit: 2
4866
+ multihit: [1, 2]
4867
4867
  },
4868
4868
  'Upper Hand': {
4869
4869
  bp: 65,