koishi-plugin-xxck-1 0.3.6 → 0.3.7

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 CHANGED
@@ -80,6 +80,8 @@ var zh_CN_default = {
80
80
  "tip.draw.upgrade": "✅ 原有卡片升级成功\n",
81
81
  "tip.draw.vapor": "💧 水汽 +{vapor}\n",
82
82
  "tip.draw.disturb": "🌪️ 热带扰动 +{disturbanceTotal}",
83
+ "tip.draw.left": "🔢 剩余普通抽数:{left}抽",
84
+ "tip.eventDraw.left": "🔢 剩余{star}星限时抽数:{left}抽",
83
85
  "tip.eventDraw.pityReset": "✨ 已获得当期限时{star}星卡,保底进度重置;",
84
86
  "tip.eventDraw.pityProgress": "📊 限时{star}星保底进度:{current}/{threshold}抽(再抽{left}抽必出);",
85
87
  // ==============================================
@@ -140,7 +142,7 @@ var zh_CN_default = {
140
142
  "image.warehouse.empty": "你的仓库暂无任何卡片,快去抽卡吧!",
141
143
  "image.shop.title": "WWC每日商店({date})",
142
144
  "image.shop.userInfo": "玩家:{name}",
143
- "image.shop.asset": "热带扰动: {disturb} | 水汽:{vapor}",
145
+ "image.shop.asset": "热带扰动: {disturb} | 水汽:{vapor} | 剩余抽数:{draw}",
144
146
  "image.shop.exchangeCount": "今日普通兑换:{used}/{limit}抽(单次最多40)",
145
147
  "image.shop.header.card": "卡片信息",
146
148
  "image.shop.header.price": "升格价格",
@@ -342,7 +344,7 @@ async function _warehouse_draw_image(ctx, user_cards, show_name, titleText, empt
342
344
  }
343
345
  }
344
346
  __name(_warehouse_draw_image, "_warehouse_draw_image");
345
- async function _shop_draw_image(ctx, session, userName, date, disturbance, vapor, usedExchange, limitExchange, shopCards) {
347
+ async function _shop_draw_image(ctx, session, userName, date, disturbance, vapor, drawLeft, usedExchange, limitExchange, shopCards) {
346
348
  ctx.logger.info("开始绘制店铺图片(最终稳定版)");
347
349
  try {
348
350
  if (!ctx.canvas) return null;
@@ -365,6 +367,7 @@ async function _shop_draw_image(ctx, session, userName, date, disturbance, vapor
365
367
  ctx2d.textAlign = "left";
366
368
  const distStr = String(disturbance ?? 0);
367
369
  const vaporStr = String(vapor ?? 0);
370
+ const drawStr = String(drawLeft ?? 0);
368
371
  ctx2d.save();
369
372
  ctx2d.textAlign = "center";
370
373
  ctx2d.fillStyle = "#E53E3E";
@@ -374,7 +377,7 @@ async function _shop_draw_image(ctx, session, userName, date, disturbance, vapor
374
377
  ctx2d.fillStyle = "#222";
375
378
  ctx2d.font = `20px ${FONT_FAMILY}`;
376
379
  ctx2d.fillText(`玩家:${userName}`, BASE_X, BASE_Y + 80);
377
- ctx2d.fillText(`热带扰动:${distStr}|水汽:${vaporStr}`, BASE_X, BASE_Y + 120);
380
+ ctx2d.fillText(`热带扰动:${distStr}|水汽:${vaporStr}|剩余抽数:${drawStr}`, BASE_X, BASE_Y + 120);
378
381
  const headerY = BASE_Y + 200;
379
382
  ctx2d.save();
380
383
  ctx2d.fillStyle = "#000";
@@ -966,6 +969,7 @@ async function _do_draw(ctx, session, draw_times, star7Threshold, star6Threshold
966
969
  if (isUpgrade) info += session.text("tip.draw.upgrade");
967
970
  info += session.text("tip.draw.vapor", { vapor: waterVaporTotal });
968
971
  info += session.text("tip.draw.disturb", { disturbanceTotal });
972
+ info += "\n" + session.text("tip.draw.left", { left: haveDraw - draw_times });
969
973
  if (info) msg += "\n" + info.replace(/;$/, "");
970
974
  await session.send(build_msg(session, msg));
971
975
  }
@@ -1361,6 +1365,7 @@ async function _do_shop(ctx, session, signResetHour, signResetMinute) {
1361
1365
  const userAsset = await ctx.database.get("gacha_user_draw_count", { qq });
1362
1366
  const dist = userAsset[0]?.tropical_disturbance ?? 0;
1363
1367
  const vapor = userAsset[0]?.water_vapor ?? 0;
1368
+ const drawLeft = userAsset[0]?.draw_count ?? 0;
1364
1369
  const img = await _shop_draw_image(
1365
1370
  ctx,
1366
1371
  session,
@@ -1368,6 +1373,7 @@ async function _do_shop(ctx, session, signResetHour, signResetMinute) {
1368
1373
  today,
1369
1374
  dist,
1370
1375
  vapor,
1376
+ drawLeft,
1371
1377
  0,
1372
1378
  0,
1373
1379
  shopCardList
@@ -1894,6 +1900,7 @@ async function _do_event_draw(ctx, session, data, event6Threshold, event7Thresho
1894
1900
  } else {
1895
1901
  info += session.text("tip.eventDraw.pityReset", { star: limitStar });
1896
1902
  }
1903
+ info += "\n" + session.text("tip.eventDraw.left", { star: limitStar, left: have - count });
1897
1904
  if (info) msg += "\n" + info.replace(/;$/, "");
1898
1905
  await session.send(build_msg(session, msg));
1899
1906
  if (true) {
@@ -41,6 +41,8 @@ declare const _default: {
41
41
  "tip.draw.upgrade": string;
42
42
  "tip.draw.vapor": string;
43
43
  "tip.draw.disturb": string;
44
+ "tip.draw.left": string;
45
+ "tip.eventDraw.left": string;
44
46
  "tip.eventDraw.pityReset": string;
45
47
  "tip.eventDraw.pityProgress": string;
46
48
  "error.common.noPermission": string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-xxck-1",
3
3
  "description": "抽卡系统|完整指令说明见readme|建议使用skia-canvas",
4
- "version": "0.3.6",
4
+ "version": "0.3.7",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [