kotori-plugin-penis 1.4.0 → 1.5.1
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/lib/index.js +34 -10
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @Package kotori-plugin-penis
|
|
3
|
-
* @Version 1.
|
|
3
|
+
* @Version 1.5.0
|
|
4
4
|
* @Author Himeno <me@hotaru.icu>
|
|
5
5
|
* @Copyright 2024-2025 Hotaru. All rights reserved.
|
|
6
6
|
* @License GPL-3.0
|
|
7
7
|
* @Link https://github.com/kotorijs/kotori
|
|
8
|
-
* @Date 2026/8/2 15:
|
|
8
|
+
* @Date 2026/8/2 15:59:01
|
|
9
9
|
*/
|
|
10
10
|
"use strict";
|
|
11
11
|
var __defProp = Object.defineProperty;
|
|
@@ -50,7 +50,11 @@ const config = import_kotori_bot.Tsu.Object({
|
|
|
50
50
|
});
|
|
51
51
|
function main(ctx, config2) {
|
|
52
52
|
const getNewLength = () => config2.min + Math.floor(Math.random() * (config2.max - config2.min + 1));
|
|
53
|
-
const getNewThickness = () =>
|
|
53
|
+
const getNewThickness = () => Number(
|
|
54
|
+
(config2.minThickness * 10 + Math.random() * (config2.maxThickness * 10 - config2.minThickness * 10) / 10).toFixed(
|
|
55
|
+
2
|
|
56
|
+
)
|
|
57
|
+
);
|
|
54
58
|
const getTodayPath = () => `${(/* @__PURE__ */ new Date()).getFullYear()}-${(/* @__PURE__ */ new Date()).getMonth() + 1}-${(/* @__PURE__ */ new Date()).getDay()}.json`;
|
|
55
59
|
const loadTodayData = () => ctx.file.load(getTodayPath(), "json", {});
|
|
56
60
|
const saveTodayData = (data) => ctx.file.save(getTodayPath(), data);
|
|
@@ -134,7 +138,11 @@ function main(ctx, config2) {
|
|
|
134
138
|
let num = 1;
|
|
135
139
|
for (const entry of entries) {
|
|
136
140
|
if (num > 20) continue;
|
|
137
|
-
list += session.format("newnew.msg.today_ranking.list", [
|
|
141
|
+
list += session.format("newnew.msg.today_ranking.list", [
|
|
142
|
+
num,
|
|
143
|
+
entry[0].slice(session.api.adapter.identity.length),
|
|
144
|
+
entry[1][0]
|
|
145
|
+
]);
|
|
138
146
|
num += 1;
|
|
139
147
|
}
|
|
140
148
|
return session.format("newnew.msg.today_ranking", [list]);
|
|
@@ -152,7 +160,7 @@ function main(ctx, config2) {
|
|
|
152
160
|
const targetId = args[0] ?? session.userId;
|
|
153
161
|
const params = [import_kotori_bot.Messages.mention(targetId), import_kotori_bot.Messages.mention(session.userId)];
|
|
154
162
|
if (senderRecord.given >= config2.maxCount) {
|
|
155
|
-
return session.quick(["{1} \u4F60\u4ECA\u5929\u5DF2\u7ECF
|
|
163
|
+
return session.quick(["{1} \u4F60\u4ECA\u5929\u5DF2\u7ECF {0} \u6B21\u4E86\uFF0C\u8EAB\u4F53\u8981\u88AB\u638F\u7A7A\u4E86\u54E6\uFF01\u4F11\u606F\u4E0B\u5427\u3002", [config2.maxCount, params[1]]]);
|
|
156
164
|
}
|
|
157
165
|
const lengthData = loadTodayData();
|
|
158
166
|
const targetFullId = `${session.api.adapter.identity}${targetId}`;
|
|
@@ -164,11 +172,28 @@ function main(ctx, config2) {
|
|
|
164
172
|
})()
|
|
165
173
|
);
|
|
166
174
|
if (senderLength === 0) return session.quick(["{1} \u4F60\u6CA1\u6709\u6B66\u5668\u554A\uFF01\u60F3\u4EC0\u4E48\u4E86\uFF01", params]);
|
|
175
|
+
if (targetId === session.userId) {
|
|
176
|
+
const cutFailed = Math.random() < config2.cutProbability;
|
|
177
|
+
if (targetLength > 0 && cut) {
|
|
178
|
+
session.quick([cutFailed ? "{1} \u4F60\u6CA1\u5FCD\u4F4F\uFF01\u793E\u4FDD\u4E86\uFF01" : "{1} \u4F60\u6210\u529F\u5BF8\u6B62\u4E86\uFF01", params]);
|
|
179
|
+
} else if (targetLength > 0) session.quick(["{1} \u8D77\u98DE\u6210\u529F\uFF01\u72B6\u6001\u826F\u597D\uFF01", params]);
|
|
180
|
+
else session.quick(["{1} \u6316\u5751\u6210\u529F\uFF01\u611F\u89C9\u826F\u597D\uFF01", params]);
|
|
181
|
+
if (!cut || cutFailed) {
|
|
182
|
+
senderRecord.given += 1;
|
|
183
|
+
senderRecord.lastTime = Date.now();
|
|
184
|
+
data[senderId] = senderRecord;
|
|
185
|
+
saveData(data);
|
|
186
|
+
}
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
167
189
|
if (targetLength === 0) return session.quick(["{0} \u662F\u5E73\u7684\u554A\uFF01\u4F60\u5E72\u4EC0\u4E48\u4E86\uFF01", params]);
|
|
168
|
-
if (targetLength * senderLength < 0)
|
|
169
|
-
|
|
190
|
+
if (targetLength * senderLength < 0)
|
|
191
|
+
return session.quick(["\u7FA4\u53CB {0} \u548C {1} \u4F60\u90FD\u662F\u53EF\u7231\u7684\u5973\u5B69\u5B50\u5662( \u2022\u0300 \u03C9 \u2022\u0301 )\u2727\uFF0C\u65E0\u6CD5\u8FDB\u884C\u793E\u4FDD\uFF01", params]);
|
|
192
|
+
if (targetLength > 0 && senderLength < 0)
|
|
193
|
+
return session.quick(["\u4F60\u5728\u60F3\u4EC0\u4E48\uFF1F\uFF1F{1} \u4F60\u662F\u53EF\u7231\u7684\u5973\u5B69\u5B50\u554A( \u2022\u0300 \u03C9 \u2022\u0301 )\u2727", params]);
|
|
170
194
|
if (targetLength * senderLength > 0) return session.quick(["\uFF1F\uFF1F\u6960\u6960\uFF1F\uFF1F\u7EDD\u5BF9\u4E0D\u884C\uFF01{1}", params]);
|
|
171
|
-
if (targetThickness < senderThickness)
|
|
195
|
+
if (targetThickness < senderThickness)
|
|
196
|
+
return session.quick(["\u7FA4\u53CB {0} \u7684OO\u592A\u5C0F\u4E86\uFF0C{1} \u4F60\u7684\u793E\u4FDD\u65E0\u6CD5\u8FDB\u5165\uFF01", params]);
|
|
172
197
|
const targetRecord = data[targetFullId] || { given: 0, received: 0, lastTime: 0 };
|
|
173
198
|
if (targetRecord.lastTime < todayStart) {
|
|
174
199
|
targetRecord.given = 0;
|
|
@@ -178,7 +203,6 @@ function main(ctx, config2) {
|
|
|
178
203
|
if (targetRecord.received >= config2.maxCount2) {
|
|
179
204
|
return session.quick(["\u7FA4\u53CB {0} \u7684\u5C0F\u809A\u809A\u5DF2\u7ECF\u88C5\u4E0D\u4E0B\u4E86\uFF0C{1} \u8BF7\u4E0D\u8981\u518D\u793E\u4E86\uFF01", params]);
|
|
180
205
|
}
|
|
181
|
-
const cutFailed = Math.random() < config2.cutProbability;
|
|
182
206
|
const noPregnancy = Math.random() < config2.probability;
|
|
183
207
|
const babyTypes = [
|
|
184
208
|
"\u4E00\u53EA\u7537\u5A03",
|
|
@@ -195,7 +219,7 @@ function main(ctx, config2) {
|
|
|
195
219
|
];
|
|
196
220
|
const pickBaby = () => babyTypes[Math.floor(Math.random() * babyTypes.length)];
|
|
197
221
|
if (cut) {
|
|
198
|
-
if (
|
|
222
|
+
if (Math.random() < config2.cutProbability) {
|
|
199
223
|
senderRecord.given++;
|
|
200
224
|
targetRecord.received++;
|
|
201
225
|
const babyStr = noPregnancy ? "\u5E86\u5E78\u7684\u662F\u6CA1\u6709\u6000\u5B55" : `\u7FA4\u53CB\u8BDE\u4E0B\u4E86 ${pickBaby()}`;
|