labag 2.0.1 → 2.0.2

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/dist/index.js CHANGED
@@ -1,208 +1,51 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  const labag_1 = require("./labag");
4
- const mode_1 = require("./mode");
5
- const randInt_1 = require("./utils/randInt");
37
+ const normal = __importStar(require("./modes/normal"));
38
+ const superhhh = __importStar(require("./modes/superhhh"));
39
+ const greenwei = __importStar(require("./modes/greenwei"));
40
+ const pikachu = __importStar(require("./modes/pikachu"));
6
41
  const labag = new labag_1.LaBaG();
7
- const modes = [
8
- [
9
- false,
10
- "superhhh",
11
- {
12
- gss: 19,
13
- hhh: 5,
14
- hentai: 19,
15
- handson: 19,
16
- kachu: 19,
17
- rrr: 19,
18
- },
19
- {
20
- gameStart: (_, mode) => {
21
- mode.active = false;
22
- mode.variable.times = 0;
23
- },
24
- roundStart: (_, mode) => {
25
- if (!mode.active)
26
- return;
27
- mode.variable.score = 0;
28
- mode.variable.times -= 1;
29
- },
30
- rollSlots: (_, mode) => {
31
- mode.variable.randNum = (0, randInt_1.randInt)(1, 100);
32
- },
33
- roundEnd: (game, mode) => {
34
- const { patterns } = game;
35
- const { variable } = mode;
36
- let hhhCount = 0;
37
- let allHHH = true;
38
- for (const p of patterns) {
39
- if (p?.name === "hhh")
40
- hhhCount++;
41
- else
42
- allHHH = false;
43
- }
44
- if (mode.active) {
45
- if (allHHH) {
46
- variable.times += 2;
47
- }
48
- if (variable.times <= 0) {
49
- mode.active = false;
50
- }
51
- }
52
- else {
53
- if (variable.randNum <= variable.rate && hhhCount > 0) {
54
- mode.active = true;
55
- variable.times += 6;
56
- for (let i = 0; i < patterns.length; i++) {
57
- if (patterns[i]?.name === "hhh") {
58
- patterns[i] = variable.pattern;
59
- }
60
- }
61
- }
62
- }
63
- },
64
- },
65
- {
66
- times: 0,
67
- rate: 15,
68
- score: 0,
69
- randNum: 0,
70
- pattern: {
71
- name: "superhhh",
72
- scores: [1500, 800, 300],
73
- },
74
- },
75
- ],
76
- [
77
- false,
78
- "greenwei",
79
- {
80
- gss: 36,
81
- hhh: 24,
82
- hentai: 17,
83
- handson: 12,
84
- kachu: 8,
85
- rrr: 3,
86
- },
87
- {
88
- gameStart: (_, mode) => {
89
- mode.active = false;
90
- mode.variable.times = 0;
91
- },
92
- roundStart: (_, mode) => {
93
- if (!mode.active)
94
- return;
95
- mode.variable.times -= 1;
96
- },
97
- rollSlots: (_, mode) => {
98
- mode.variable.randNum = (0, randInt_1.randInt)(1, 100);
99
- },
100
- calculateScore: (game, mode) => {
101
- if (mode.active) {
102
- game.marginScore = Math.round(game.marginScore * 3);
103
- }
104
- },
105
- roundEnd: (game, mode) => {
106
- const { patterns } = game;
107
- const { variable } = mode;
108
- let gssCount = 0;
109
- let allGSS = true;
110
- for (const p of patterns) {
111
- if (p?.name === "gss")
112
- gssCount++;
113
- else
114
- allGSS = false;
115
- }
116
- variable.count += gssCount;
117
- if (mode.active) {
118
- if (allGSS) {
119
- variable.times += 1;
120
- }
121
- if (variable.times <= 0) {
122
- mode.active = false;
123
- }
124
- }
125
- else {
126
- let activated = false;
127
- if (variable.randNum <= variable.rate && allGSS) {
128
- activated = true;
129
- variable.times += 2;
130
- }
131
- else if (variable.count >= 20) {
132
- activated = true;
133
- variable.times += 2;
134
- variable.count -= 20;
135
- }
136
- if (activated) {
137
- mode.active = true;
138
- for (let i = 0; i < patterns.length; i++) {
139
- if (patterns[i]?.name === "gss") {
140
- patterns[i] = variable.pattern;
141
- }
142
- }
143
- }
144
- }
145
- },
146
- },
147
- {
148
- times: 0,
149
- rate: 35,
150
- randNum: 0,
151
- count: 0,
152
- pattern: {
153
- name: "greenwei",
154
- scores: [800, 400, 180],
155
- },
156
- },
157
- ],
158
- [
159
- false,
160
- "pikachu",
161
- {
162
- gss: 36,
163
- hhh: 24,
164
- hentai: 17,
165
- handson: 12,
166
- kachu: 8,
167
- rrr: 3,
168
- },
169
- {
170
- gameStart: (_, mode) => {
171
- mode.active = false;
172
- mode.variable.times = 0;
173
- },
174
- roundEnd: (game, mode) => {
175
- if (!game.isRunning() &&
176
- game.patterns.some((p) => p && p.name === "kachu")) {
177
- mode.active = true;
178
- game.played -= 5;
179
- mode.variable.times += 1;
180
- }
181
- },
182
- },
183
- {
184
- times: 0,
185
- pattern: {
186
- name: "pikachu",
187
- scores: [12000, 8000, 1250],
188
- },
189
- },
190
- ],
191
- [
192
- true,
193
- "normal",
194
- {
195
- gss: 36,
196
- hhh: 24,
197
- hentai: 17,
198
- handson: 12,
199
- kachu: 8,
200
- rrr: 3,
201
- },
202
- ],
203
- ];
204
- for (const modeArgs of modes) {
205
- const mode = new mode_1.Mode(...modeArgs);
206
- labag.addMode(mode);
207
- }
42
+ [superhhh, greenwei, pikachu, normal].forEach((mode) => {
43
+ console.log(mode);
44
+ if (mode.default.active) {
45
+ labag.modes.push(mode.default);
46
+ }
47
+ else {
48
+ labag.addMode(mode.default);
49
+ }
50
+ });
208
51
  exports.default = labag;
@@ -0,0 +1,3 @@
1
+ import { Mode } from "../mode";
2
+ declare const _default: Mode;
3
+ export default _default;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mode_1 = require("../mode");
4
+ const randInt_1 = require("../utils/randInt");
5
+ exports.default = new mode_1.Mode(false, "greenwei", {
6
+ gss: 36,
7
+ hhh: 24,
8
+ hentai: 17,
9
+ handson: 12,
10
+ kachu: 8,
11
+ rrr: 3,
12
+ }, {
13
+ gameStart: (_, mode) => {
14
+ mode.active = false;
15
+ mode.variable.times = 0;
16
+ },
17
+ roundStart: (_, mode) => {
18
+ if (!mode.active)
19
+ return;
20
+ mode.variable.times -= 1;
21
+ },
22
+ rollSlots: (_, mode) => {
23
+ mode.variable.randNum = (0, randInt_1.randInt)(1, 100);
24
+ },
25
+ calculateScore: (game, mode) => {
26
+ if (mode.active) {
27
+ game.marginScore = Math.round(game.marginScore * 3);
28
+ }
29
+ },
30
+ roundEnd: (game, mode) => {
31
+ const { patterns } = game;
32
+ const { variable } = mode;
33
+ let gssCount = 0;
34
+ let allGSS = true;
35
+ for (const p of patterns) {
36
+ if (p?.name === "gss")
37
+ gssCount++;
38
+ else
39
+ allGSS = false;
40
+ }
41
+ variable.count += gssCount;
42
+ if (mode.active) {
43
+ if (allGSS) {
44
+ variable.times += 1;
45
+ }
46
+ if (variable.times <= 0) {
47
+ mode.active = false;
48
+ }
49
+ }
50
+ else {
51
+ let activated = false;
52
+ if (variable.randNum <= variable.rate && allGSS) {
53
+ activated = true;
54
+ variable.times += 2;
55
+ }
56
+ else if (variable.count >= 20) {
57
+ activated = true;
58
+ variable.times += 2;
59
+ variable.count -= 20;
60
+ }
61
+ if (activated) {
62
+ mode.active = true;
63
+ for (let i = 0; i < patterns.length; i++) {
64
+ if (patterns[i]?.name === "gss") {
65
+ patterns[i] = variable.pattern;
66
+ }
67
+ }
68
+ }
69
+ }
70
+ },
71
+ }, {
72
+ times: 0,
73
+ rate: 35,
74
+ randNum: 0,
75
+ count: 0,
76
+ pattern: {
77
+ name: "greenwei",
78
+ scores: [800, 400, 180],
79
+ },
80
+ });
@@ -0,0 +1,3 @@
1
+ import { Mode } from "../mode";
2
+ declare const _default: Mode;
3
+ export default _default;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mode_1 = require("../mode");
4
+ exports.default = new mode_1.Mode(true, "normal", {
5
+ gss: 36,
6
+ hhh: 24,
7
+ hentai: 17,
8
+ handson: 12,
9
+ kachu: 8,
10
+ rrr: 3,
11
+ });
@@ -0,0 +1,3 @@
1
+ import { Mode } from "../mode";
2
+ declare const _default: Mode;
3
+ export default _default;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mode_1 = require("../mode");
4
+ exports.default = new mode_1.Mode(false, "pikachu", {
5
+ gss: 36,
6
+ hhh: 24,
7
+ hentai: 17,
8
+ handson: 12,
9
+ kachu: 8,
10
+ rrr: 3,
11
+ }, {
12
+ gameStart: (_, mode) => {
13
+ mode.active = false;
14
+ mode.variable.times = 0;
15
+ },
16
+ roundEnd: (game, mode) => {
17
+ if (!game.isRunning() &&
18
+ game.patterns.some((p) => p && p.name === "kachu")) {
19
+ mode.active = true;
20
+ game.played -= 5;
21
+ mode.variable.times += 1;
22
+ }
23
+ },
24
+ }, {
25
+ times: 0,
26
+ pattern: {
27
+ name: "pikachu",
28
+ scores: [12000, 8000, 1250],
29
+ },
30
+ });
@@ -0,0 +1,3 @@
1
+ import { Mode } from "../mode";
2
+ declare const _default: Mode;
3
+ export default _default;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mode_1 = require("../mode");
4
+ const randInt_1 = require("../utils/randInt");
5
+ exports.default = new mode_1.Mode(false, "superhhh", {
6
+ gss: 19,
7
+ hhh: 5,
8
+ hentai: 19,
9
+ handson: 19,
10
+ kachu: 19,
11
+ rrr: 19,
12
+ }, {
13
+ gameStart: (_, mode) => {
14
+ mode.active = false;
15
+ mode.variable.times = 0;
16
+ },
17
+ roundStart: (_, mode) => {
18
+ if (!mode.active)
19
+ return;
20
+ mode.variable.score = 0;
21
+ mode.variable.times -= 1;
22
+ },
23
+ rollSlots: (_, mode) => {
24
+ mode.variable.randNum = (0, randInt_1.randInt)(1, 100);
25
+ },
26
+ roundEnd: (game, mode) => {
27
+ const { patterns } = game;
28
+ const { variable } = mode;
29
+ let hhhCount = 0;
30
+ let allHHH = true;
31
+ for (const p of patterns) {
32
+ if (p?.name === "hhh")
33
+ hhhCount++;
34
+ else
35
+ allHHH = false;
36
+ }
37
+ if (mode.active) {
38
+ if (allHHH) {
39
+ variable.times += 2;
40
+ }
41
+ if (variable.times <= 0) {
42
+ mode.active = false;
43
+ }
44
+ }
45
+ else {
46
+ if (variable.randNum <= variable.rate && hhhCount > 0) {
47
+ mode.active = true;
48
+ variable.times += 6;
49
+ for (let i = 0; i < patterns.length; i++) {
50
+ if (patterns[i]?.name === "hhh") {
51
+ patterns[i] = variable.pattern;
52
+ }
53
+ }
54
+ }
55
+ }
56
+ },
57
+ }, {
58
+ times: 0,
59
+ rate: 15,
60
+ score: 0,
61
+ randNum: 0,
62
+ pattern: {
63
+ name: "superhhh",
64
+ scores: [1500, 800, 300],
65
+ },
66
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "labag",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -1,211 +1,16 @@
1
1
  import { LaBaG } from "./labag";
2
- import { Mode } from "./mode";
3
- import { randInt } from "./utils/randInt";
2
+ import * as normal from "./modes/normal";
3
+ import * as superhhh from "./modes/superhhh";
4
+ import * as greenwei from "./modes/greenwei";
5
+ import * as pikachu from "./modes/pikachu";
4
6
 
5
7
  const labag = new LaBaG();
6
-
7
- const modes: ConstructorParameters<typeof Mode>[] = [
8
- [
9
- false,
10
- "superhhh",
11
- {
12
- gss: 19,
13
- hhh: 5,
14
- hentai: 19,
15
- handson: 19,
16
- kachu: 19,
17
- rrr: 19,
18
- },
19
- {
20
- gameStart: (_, mode) => {
21
- mode.active = false;
22
- mode.variable.times = 0;
23
- },
24
- roundStart: (_, mode) => {
25
- if (!mode.active) return;
26
- mode.variable.score = 0;
27
- mode.variable.times -= 1;
28
- },
29
- rollSlots: (_, mode) => {
30
- mode.variable.randNum = randInt(1, 100);
31
- },
32
- roundEnd: (game, mode) => {
33
- const { patterns } = game;
34
- const { variable } = mode;
35
-
36
- let hhhCount = 0;
37
- let allHHH = true;
38
- for (const p of patterns) {
39
- if (p?.name === "hhh") hhhCount++;
40
- else allHHH = false;
41
- }
42
-
43
- if (mode.active) {
44
- if (allHHH) {
45
- variable.times += 2;
46
- }
47
- if (variable.times <= 0) {
48
- mode.active = false;
49
- }
50
- } else {
51
- if (variable.randNum <= variable.rate && hhhCount > 0) {
52
- mode.active = true;
53
- variable.times += 6;
54
-
55
- for (let i = 0; i < patterns.length; i++) {
56
- if (patterns[i]?.name === "hhh") {
57
- patterns[i] = variable.pattern;
58
- }
59
- }
60
- }
61
- }
62
- },
63
- },
64
- {
65
- times: 0,
66
- rate: 15,
67
- score: 0,
68
- randNum: 0,
69
- pattern: {
70
- name: "superhhh",
71
- scores: [1500, 800, 300],
72
- },
73
- },
74
- ],
75
- [
76
- false,
77
- "greenwei",
78
- {
79
- gss: 36,
80
- hhh: 24,
81
- hentai: 17,
82
- handson: 12,
83
- kachu: 8,
84
- rrr: 3,
85
- },
86
- {
87
- gameStart: (_, mode) => {
88
- mode.active = false;
89
- mode.variable.times = 0;
90
- },
91
- roundStart: (_, mode) => {
92
- if (!mode.active) return;
93
- mode.variable.times -= 1;
94
- },
95
- rollSlots: (_, mode) => {
96
- mode.variable.randNum = randInt(1, 100);
97
- },
98
- calculateScore: (game, mode) => {
99
- if (mode.active) {
100
- game.marginScore = Math.round(game.marginScore * 3);
101
- }
102
- },
103
- roundEnd: (game, mode) => {
104
- const { patterns } = game;
105
- const { variable } = mode;
106
-
107
- let gssCount = 0;
108
- let allGSS = true;
109
- for (const p of patterns) {
110
- if (p?.name === "gss") gssCount++;
111
- else allGSS = false;
112
- }
113
-
114
- variable.count += gssCount;
115
-
116
- if (mode.active) {
117
- if (allGSS) {
118
- variable.times += 1;
119
- }
120
- if (variable.times <= 0) {
121
- mode.active = false;
122
- }
123
- } else {
124
- let activated = false;
125
- if (variable.randNum <= variable.rate && allGSS) {
126
- activated = true;
127
- variable.times += 2;
128
- } else if (variable.count >= 20) {
129
- activated = true;
130
- variable.times += 2;
131
- variable.count -= 20;
132
- }
133
-
134
- if (activated) {
135
- mode.active = true;
136
- for (let i = 0; i < patterns.length; i++) {
137
- if (patterns[i]?.name === "gss") {
138
- patterns[i] = variable.pattern;
139
- }
140
- }
141
- }
142
- }
143
- },
144
- },
145
- {
146
- times: 0,
147
- rate: 35,
148
- randNum: 0,
149
- count: 0,
150
- pattern: {
151
- name: "greenwei",
152
- scores: [800, 400, 180],
153
- },
154
- },
155
- ],
156
- [
157
- false,
158
- "pikachu",
159
- {
160
- gss: 36,
161
- hhh: 24,
162
- hentai: 17,
163
- handson: 12,
164
- kachu: 8,
165
- rrr: 3,
166
- },
167
- {
168
- gameStart: (_, mode) => {
169
- mode.active = false;
170
- mode.variable.times = 0;
171
- },
172
- roundEnd: (game, mode) => {
173
- if (
174
- !game.isRunning() &&
175
- game.patterns.some((p) => p && p.name === "kachu")
176
- ) {
177
- mode.active = true;
178
- game.played -= 5;
179
- mode.variable.times += 1;
180
- }
181
- },
182
- },
183
- {
184
- times: 0,
185
- pattern: {
186
- name: "pikachu",
187
- scores: [12000, 8000, 1250],
188
- },
189
- },
190
- ],
191
- [
192
- true,
193
- "normal",
194
- {
195
- gss: 36,
196
- hhh: 24,
197
- hentai: 17,
198
- handson: 12,
199
- kachu: 8,
200
- rrr: 3,
201
- },
202
- ],
203
- ];
204
-
205
- for (const modeArgs of modes) {
206
- const mode = new Mode(...modeArgs);
207
- labag.addMode(mode);
208
- }
209
-
8
+ [superhhh, greenwei, pikachu, normal].forEach((mode) => {
9
+ console.log(mode)
10
+ if (mode.default.active) {
11
+ labag.modes.push(mode.default);
12
+ } else {
13
+ labag.addMode(mode.default);
14
+ }
15
+ });
210
16
  export default labag;
211
-
@@ -0,0 +1,84 @@
1
+ import { Mode } from "../mode";
2
+ import { randInt } from "../utils/randInt";
3
+
4
+ export default new Mode(
5
+ false,
6
+ "greenwei",
7
+ {
8
+ gss: 36,
9
+ hhh: 24,
10
+ hentai: 17,
11
+ handson: 12,
12
+ kachu: 8,
13
+ rrr: 3,
14
+ },
15
+ {
16
+ gameStart: (_, mode) => {
17
+ mode.active = false;
18
+ mode.variable.times = 0;
19
+ },
20
+ roundStart: (_, mode) => {
21
+ if (!mode.active) return;
22
+ mode.variable.times -= 1;
23
+ },
24
+ rollSlots: (_, mode) => {
25
+ mode.variable.randNum = randInt(1, 100);
26
+ },
27
+ calculateScore: (game, mode) => {
28
+ if (mode.active) {
29
+ game.marginScore = Math.round(game.marginScore * 3);
30
+ }
31
+ },
32
+ roundEnd: (game, mode) => {
33
+ const { patterns } = game;
34
+ const { variable } = mode;
35
+
36
+ let gssCount = 0;
37
+ let allGSS = true;
38
+ for (const p of patterns) {
39
+ if (p?.name === "gss") gssCount++;
40
+ else allGSS = false;
41
+ }
42
+
43
+ variable.count += gssCount;
44
+
45
+ if (mode.active) {
46
+ if (allGSS) {
47
+ variable.times += 1;
48
+ }
49
+ if (variable.times <= 0) {
50
+ mode.active = false;
51
+ }
52
+ } else {
53
+ let activated = false;
54
+ if (variable.randNum <= variable.rate && allGSS) {
55
+ activated = true;
56
+ variable.times += 2;
57
+ } else if (variable.count >= 20) {
58
+ activated = true;
59
+ variable.times += 2;
60
+ variable.count -= 20;
61
+ }
62
+
63
+ if (activated) {
64
+ mode.active = true;
65
+ for (let i = 0; i < patterns.length; i++) {
66
+ if (patterns[i]?.name === "gss") {
67
+ patterns[i] = variable.pattern;
68
+ }
69
+ }
70
+ }
71
+ }
72
+ },
73
+ },
74
+ {
75
+ times: 0,
76
+ rate: 35,
77
+ randNum: 0,
78
+ count: 0,
79
+ pattern: {
80
+ name: "greenwei",
81
+ scores: [800, 400, 180],
82
+ },
83
+ }
84
+ );
@@ -0,0 +1,10 @@
1
+ import { Mode } from "../mode";
2
+
3
+ export default new Mode(true, "normal", {
4
+ gss: 36,
5
+ hhh: 24,
6
+ hentai: 17,
7
+ handson: 12,
8
+ kachu: 8,
9
+ rrr: 3,
10
+ });
@@ -0,0 +1,37 @@
1
+ import { Mode } from "../mode";
2
+
3
+ export default new Mode(
4
+ false,
5
+ "pikachu",
6
+ {
7
+ gss: 36,
8
+ hhh: 24,
9
+ hentai: 17,
10
+ handson: 12,
11
+ kachu: 8,
12
+ rrr: 3,
13
+ },
14
+ {
15
+ gameStart: (_, mode) => {
16
+ mode.active = false;
17
+ mode.variable.times = 0;
18
+ },
19
+ roundEnd: (game, mode) => {
20
+ if (
21
+ !game.isRunning() &&
22
+ game.patterns.some((p) => p && p.name === "kachu")
23
+ ) {
24
+ mode.active = true;
25
+ game.played -= 5;
26
+ mode.variable.times += 1;
27
+ }
28
+ },
29
+ },
30
+ {
31
+ times: 0,
32
+ pattern: {
33
+ name: "pikachu",
34
+ scores: [12000, 8000, 1250],
35
+ },
36
+ }
37
+ );
@@ -0,0 +1,70 @@
1
+ import { Mode } from "../mode";
2
+ import { randInt } from "../utils/randInt";
3
+
4
+ export default new Mode(
5
+ false,
6
+ "superhhh",
7
+ {
8
+ gss: 19,
9
+ hhh: 5,
10
+ hentai: 19,
11
+ handson: 19,
12
+ kachu: 19,
13
+ rrr: 19,
14
+ },
15
+ {
16
+ gameStart: (_, mode) => {
17
+ mode.active = false;
18
+ mode.variable.times = 0;
19
+ },
20
+ roundStart: (_, mode) => {
21
+ if (!mode.active) return;
22
+ mode.variable.score = 0;
23
+ mode.variable.times -= 1;
24
+ },
25
+ rollSlots: (_, mode) => {
26
+ mode.variable.randNum = randInt(1, 100);
27
+ },
28
+ roundEnd: (game, mode) => {
29
+ const { patterns } = game;
30
+ const { variable } = mode;
31
+
32
+ let hhhCount = 0;
33
+ let allHHH = true;
34
+ for (const p of patterns) {
35
+ if (p?.name === "hhh") hhhCount++;
36
+ else allHHH = false;
37
+ }
38
+
39
+ if (mode.active) {
40
+ if (allHHH) {
41
+ variable.times += 2;
42
+ }
43
+ if (variable.times <= 0) {
44
+ mode.active = false;
45
+ }
46
+ } else {
47
+ if (variable.randNum <= variable.rate && hhhCount > 0) {
48
+ mode.active = true;
49
+ variable.times += 6;
50
+
51
+ for (let i = 0; i < patterns.length; i++) {
52
+ if (patterns[i]?.name === "hhh") {
53
+ patterns[i] = variable.pattern;
54
+ }
55
+ }
56
+ }
57
+ }
58
+ },
59
+ },
60
+ {
61
+ times: 0,
62
+ rate: 15,
63
+ score: 0,
64
+ randNum: 0,
65
+ pattern: {
66
+ name: "superhhh",
67
+ scores: [1500, 800, 300],
68
+ },
69
+ }
70
+ );