Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

koishi-plugin-dicey-dungeons

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koishi-plugin-dicey-dungeons - npm Package Compare versions

Comparing version 1.3.7 to 1.3.8

2

lib/index.d.ts

@@ -6,3 +6,3 @@ import { Context, Schema } from 'koishi';

};
export declare const usage = "# <center>\u3010\u9AB0\u5B50\u5730\u4E0B\u57CE\u3011</center><center>\u5168\u65B0\u7248\u672C\uFF01\uFF01</center><center>\u7092\u9E21\u597D\u73A9\u7684\u56DE\u5408\u5BF9\u6218\u6E38\u620F</center>\n\n# <center>\uD83D\uDC49[![alt \u7231\u53D1\u7535](https://static.afdiancdn.com/static/img/logo/logo.png) \u7231\u53D1\u7535](https://afdian.net/a/jiuzhichuan) \uD83D\uDC48</center>\n \u5982\u679C\u5BF9\u8FD9\u4E2A\u63D2\u4EF6\u611F\u5230\u6EE1\u610F\uFF0C\u53EF\u4EE5\u5C0F\u5C0F\u7684\u5145\u4E2A\u7535\uFF0C\u8BA9\u6211\u6709\u66F4\u5927\u5F00\u53D1\u52A8\u529B\n\n## \uD83D\uDCD5 \u5EFA\u8BAE\n\u5982\u679C\u6587\u56FE\u5408\u6210\u51FA\u73B0\u95EE\u9898\uFF0C\u53EF\u80FD\u662F\u4E24\u4E2A\u63D2\u4EF6\u51B2\u7A81\u4E86 \u628Apuppet\u8FD9\u4E2A\u63D2\u4EF6\u5173\u6389\uFF0C\u7136\u540E\u5728\u5F00canvas\u63D2\u4EF6\uFF0C\u5728\u5F00puppet\u63D2\u4EF6\n\n\u5B57\u4F53\u6587\u4EF6\uFF1Ahttps://wwp.lanzoue.com/i1M8R1tbs3sb\n\u4F7F\u7528\u5B57\u4F53\u6587\u4EF6\u53EF\u89C1\u56FE\u7247\u751F\u6210\u7684\u597D\u770B\u4E9B\uFF0C\u81EA\u613F\u9009\u62E9\n\n## \uD83C\uDF88 \u4ECB\u7ECD\n\u7531\u5076\u7136\u95F4\u73A9\u7684\u4E00\u6B3E\u6E38\u620F\u201C\u9AB0\u5B50\u5730\u4E0B\u57CE\u201D\u5F00\u53D1\u7684\u4E00\u6B3E\u63D2\u4EF6\uFF0C\n\u5C3D\u53EF\u80FD\u7684\u8FD8\u539F\u6E38\u620F\u91CC\u7684\u64CD\u4F5C\n\u63D2\u4EF6\u540D\u53EB\u2014\u2014\u2014`koishi-plugin-dicey-dungeons`\n\u76EE\u524D\u4EC5\u652F\u6301\u4E00\u7FA4\u4E00\u5BF9\u6218\u54E6~\n\n## \u2694\uFE0F\u5168\u65B0\u6587\u56FE\u5BF9\u6218\n![\u5BF9\u6218\u4FE1\u606F\u56FE](https://i0.hdslb.com/bfs/article/26c454d1829919c9da537d6b8a84e7d3486188624.png)\n\n## \uD83C\uDFAE \u4F7F\u7528\n\u6307\u4EE4|\u8BF4\u660E|\u4F8B\u5B50|\u4F18\u5316\u7248\u672C\n:-:|:-:|:-:|:-:\n\u521B\u5EFA\u89D2\u8272|\u521B\u5EFA\u81EA\u5DF1\u7684\u89D2\u8272|\u521B\u5EFA\u89D2\u8272 \u5C0F\u660E \u7537\n\u521B\u5EFA\u5BF9\u6218|\u521B\u5EFA\u5BF9\u6218\u8BA9\u522B\u4EBA\u52A0\u5165|\u521B\u5EFA\u5BF9\u6218\n\u52A0\u5165\u5BF9\u6218|\u52A0\u5165\u522B\u4EBA\u521B\u5EFA\u7684\u5BF9\u6218|\u52A0\u5165\u5BF9\u6218\n\u91CD\u7F6E\u5BF9\u6218|\u53EF\u4EE5\u5728\u7279\u6B8A\u60C5\u51B5\u4E0B\uFF0C\u91CD\u7F6E\u5F53\u524D\u5BF9\u6218|\u91CD\u7F6E\u5BF9\u6218\n\u5BF9\u6218\u4FE1\u606F|\u67E5\u770B\u5F53\u524D\u5BF9\u6218\u4FE1\u606F|\u5BF9\u6218\u4FE1\u606F\n\u7ED3\u675F\u56DE\u5408|\u67E5\u770B\u81EA\u5DF1\u7684\u4FEE\u4ED9\u9762\u677F\u72B6\u6001|\u7ED3\u675F\u56DE\u5408\n\u70B9\u6570 [\u9AB0\u5B50] [\u88C5\u5907\u5E8F\u53F7] | \u5BF9\u6218\u4E2D\u4F7F\u7528\u9053\u5177 | \u70B9\u6570 5 2 | 5 2 \u53EF\u7528\u8FD9\u79CD\u65B9\u5F0F\n\n## \uD83D\uDCC3 \u53CD\u9988\n [\u817E\u8BAF\u95EE\u5377](https://wj.qq.com/s2/14317315/1908/)\n\n## \uD83D\uDE4F \u81F4\u8C22\n- [Koishi](https://koishi.chat/) - \u673A\u5668\u4EBA\u6846\u67B6\n- [Dicey Dungeons](https://diceydungeons.com/) - \u7075\u611F\u6765\u6E90\n- [\u521D\u59CB\u4F5C\u8005](mqqapi://card/show_pslcard?src_type=internal&source=sharecard&version=1&uin=2413933494) 2413933494\n- [\u9EA6\u4F6C](mqqapi://card/show_pslcard?src_type=internal&source=sharecard&version=1&uin=1207108696) - 1207108696\n- [\u5851\u68A6](mqqapi://card/show_pslcard?src_type=internal&source=sharecard&version=1&uin=3523335883) - 3523335883";
export declare const usage = "# <center>\u3010\u9AB0\u5B50\u5730\u4E0B\u57CE\u3011</center><center>\u5168\u65B0\u7248\u672C\uFF01\uFF01</center><center>\u7092\u9E21\u597D\u73A9\u7684\u56DE\u5408\u5BF9\u6218\u6E38\u620F</center>\n\n# <center>\uD83D\uDC49[![alt \u7231\u53D1\u7535](https://static.afdiancdn.com/static/img/logo/logo.png) \u7231\u53D1\u7535](https://afdian.net/a/jiuzhichuan) \uD83D\uDC48</center>\n \u5982\u679C\u5BF9\u8FD9\u4E2A\u63D2\u4EF6\u611F\u5230\u6EE1\u610F\uFF0C\u53EF\u4EE5\u5C0F\u5C0F\u7684\u5145\u4E2A\u7535\uFF0C\u8BA9\u6211\u6709\u66F4\u5927\u5F00\u53D1\u52A8\u529B\n\n## \uD83D\uDD08\u66F4\u65B0\u516C\u544A \n1.6.8\u7248\u672C\u4FEE\u590Dpuppter\u63D2\u4EF6\u548Ccanvas\u4E0D\u80FD\u4E00\u8D77\u7528\n\n## \uD83D\uDCD5 \u5EFA\u8BAE\n\u5B57\u4F53\u6587\u4EF6\uFF1Ahttps://wwp.lanzoue.com/i1M8R1tbs3sb\n\u4F7F\u7528\u5B57\u4F53\u6587\u4EF6\u53EF\u89C1\u56FE\u7247\u751F\u6210\u7684\u597D\u770B\u4E9B\uFF0C\u81EA\u613F\u9009\u62E9\n\n## \uD83C\uDF88 \u4ECB\u7ECD\n\u7531\u5076\u7136\u95F4\u73A9\u7684\u4E00\u6B3E\u6E38\u620F\u201C\u9AB0\u5B50\u5730\u4E0B\u57CE\u201D\u5F00\u53D1\u7684\u4E00\u6B3E\u63D2\u4EF6\uFF0C\n\u5C3D\u53EF\u80FD\u7684\u8FD8\u539F\u6E38\u620F\u91CC\u7684\u64CD\u4F5C\n\u63D2\u4EF6\u540D\u53EB\u2014\u2014\u2014`koishi-plugin-dicey-dungeons`\n\u76EE\u524D\u4EC5\u652F\u6301\u4E00\u7FA4\u4E00\u5BF9\u6218\u54E6~\n\n## \u2694\uFE0F\u5168\u65B0\u6587\u56FE\u5BF9\u6218\n![\u5BF9\u6218\u4FE1\u606F\u56FE](https://i0.hdslb.com/bfs/article/26c454d1829919c9da537d6b8a84e7d3486188624.png)\n\n## \uD83C\uDFAE \u4F7F\u7528\n\u6307\u4EE4|\u8BF4\u660E|\u4F8B\u5B50|\u4F18\u5316\u7248\u672C\n:-:|:-:|:-:|:-:\n\u521B\u5EFA\u89D2\u8272|\u521B\u5EFA\u81EA\u5DF1\u7684\u89D2\u8272|\u521B\u5EFA\u89D2\u8272 \u5C0F\u660E \u7537\n\u521B\u5EFA\u5BF9\u6218|\u521B\u5EFA\u5BF9\u6218\u8BA9\u522B\u4EBA\u52A0\u5165|\u521B\u5EFA\u5BF9\u6218\n\u52A0\u5165\u5BF9\u6218|\u52A0\u5165\u522B\u4EBA\u521B\u5EFA\u7684\u5BF9\u6218|\u52A0\u5165\u5BF9\u6218\n\u91CD\u7F6E\u5BF9\u6218|\u53EF\u4EE5\u5728\u7279\u6B8A\u60C5\u51B5\u4E0B\uFF0C\u91CD\u7F6E\u5F53\u524D\u5BF9\u6218|\u91CD\u7F6E\u5BF9\u6218\n\u5BF9\u6218\u4FE1\u606F|\u67E5\u770B\u5F53\u524D\u5BF9\u6218\u4FE1\u606F|\u5BF9\u6218\u4FE1\u606F\n\u7ED3\u675F\u56DE\u5408|\u67E5\u770B\u81EA\u5DF1\u7684\u4FEE\u4ED9\u9762\u677F\u72B6\u6001|\u7ED3\u675F\u56DE\u5408\n\u70B9\u6570 [\u9AB0\u5B50] [\u88C5\u5907\u5E8F\u53F7] | \u5BF9\u6218\u4E2D\u4F7F\u7528\u9053\u5177 | \u70B9\u6570 5 2 | 5 2 \u53EF\u7528\u8FD9\u79CD\u65B9\u5F0F\n\n## \uD83D\uDCC3 \u53CD\u9988\n [\u817E\u8BAF\u95EE\u5377](https://wj.qq.com/s2/14317315/1908/)\n\n## \uD83D\uDE4F \u81F4\u8C22\n- [Koishi](https://koishi.chat/) - \u673A\u5668\u4EBA\u6846\u67B6\n- [Dicey Dungeons](https://diceydungeons.com/) - \u7075\u611F\u6765\u6E90\n- [\u521D\u59CB\u4F5C\u8005](mqqapi://card/show_pslcard?src_type=internal&source=sharecard&version=1&uin=2413933494) 2413933494\n- [\u9EA6\u4F6C](mqqapi://card/show_pslcard?src_type=internal&source=sharecard&version=1&uin=1207108696) - 1207108696\n- [\u5851\u68A6](mqqapi://card/show_pslcard?src_type=internal&source=sharecard&version=1&uin=3523335883) - 3523335883";
export interface Config {

@@ -9,0 +9,0 @@ 管理员: string[];

@@ -6,5 +6,6 @@ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.apply=exports.Config=exports.usage=exports.inject=exports.name=void 0;const koishi_1=require("koishi"),path_1=require("path"),url_1=require("url"),random=(exports.name="dicey-dungeons",new koishi_1.Random(()=>Math.random())),Introduction=(exports.inject={required:["canvas"]},exports.usage=`# <center>【骰子地下城】</center><center>全新版本!!</center><center>炒鸡好玩的回合对战游戏</center>

## 🔈更新公告
1.6.8版本修复puppter插件和canvas不能一起用
## 📕 建议
如果文图合成出现问题,可能是两个插件冲突了 把puppet这个插件关掉,然后在开canvas插件,在开puppet插件
字体文件:https://wwp.lanzoue.com/i1M8R1tbs3sb

@@ -41,13 +42,18 @@ 使用字体文件可见图片生成的好看些,自愿选择

- [麦佬](mqqapi://card/show_pslcard?src_type=internal&source=sharecard&version=1&uin=1207108696) - 1207108696
- [塑梦](mqqapi://card/show_pslcard?src_type=internal&source=sharecard&version=1&uin=3523335883) - 3523335883`,exports.Config=koishi_1.Schema.object({"管理员":koishi_1.Schema.array(String).required().role("table").description("填写QQ,用与重置对战")}),{"剑":{descriptions:"造成□伤害",trigge:0,austerity:3,dice:"",quantities:1,harm:"□",Category:["造成"]},"匕首":{descriptions:"[1-3]造成□伤害",trigge:0,austerity:1,dice:"1-3",quantities:9,harm:"□",Category:["造成"]},"回旋镖":{descriptions:"造成□*2伤害,自身受到□伤害",trigge:0,austerity:3,quantities:1,harm:"□*2",Category:["造成","自身"]},"火球":{descriptions:"[偶数]造成□伤害,燃烧1个骰子",trigge:0,austerity:2,dice:"偶数",quantities:1,harm:"□",Category:["造成","燃烧"]},"雪球":{descriptions:"[奇数]造成□伤害,冰冻1个骰子",trigge:0,austerity:2,dice:"奇数",quantities:1,harm:"□",Category:["造成","冰冻"]},"诅咒":{descriptions:"[1]造成□+1伤害,施加1层诅咒",trigge:0,austerity:0,dice:1,quantities:1,harm:"□+1",Category:["造成","诅咒"]},"毒药咒语":{descriptions:"[3]施加4层中毒",trigge:0,austerity:0,dice:3,quantities:1,harm:"□+1",Category:["中毒"]},"治愈水晶":{descriptions:"[1-3]回复□生命值",trigge:0,austerity:1,dice:"1-3",quantities:1,harm:"□",Category:["回复"]},"木质盾牌":{descriptions:"[1-4]获得□点护盾",trigge:0,austerity:1,dice:"1-4",quantities:1,harm:"□",Category:["护盾"]},"复制":{descriptions:"[4-6]复制1个骰子",trigge:0,austerity:1,dice:"4-6",quantities:1,harm:"□",Category:["复制"]},"铲":{descriptions:"颠倒1个骰子",trigge:0,austerity:3,dice:"",quantities:1,harm:"□",Category:["颠倒"]},"绝佳手气":{descriptions:"[1-5]重投1个点数更大的骰子",trigge:0,austerity:1,dice:"1-5",quantities:1,harm:"□",Category:["重投更大"]},"战斗翻滚":{descriptions:"重投1个骰子",trigge:0,austerity:3,dice:"",quantities:3,harm:"□",Category:["重投"]},"轻顶":{descriptions:"[1-5]□+1",trigge:0,austerity:1,dice:"1-5",quantities:1,harm:"□+1",Category:["轻顶"]},"干草叉":{descriptions:"[1-4]造成□伤害,燃烧&震慑骰子",trigge:0,austerity:1,dice:"1-4",quantities:1,harm:"□",Category:["造成","燃烧","震慑"]},"渔网":{descriptions:"[1-3]造成□伤害,点数3时锁定1个骰子",trigge:3,trigge_skill:["造成","锁定"],austerity:1,dice:"1-3",quantities:1,harm:"□",Category:["造成"]},"吸血":{descriptions:"[1-4]造成□伤害,回复□生命值",trigge:0,austerity:1,dice:"1-4",quantities:1,harm:"□",Category:["造成","回复"]}});async function apply(q,r){q.model.extend("dice_player",{userId:"string",username:"string",HP:{type:"unsigned",initial:0},dice:"list",skills:"list",skill:"json",burn:{type:"unsigned",initial:0},freeze:{type:"unsigned",initial:0},poison:{type:"unsigned",initial:0},curse:{type:"unsigned",initial:0},shield:{type:"unsigned",initial:0},awe:{type:"unsigned",initial:0},lock:{type:"unsigned",initial:0},counterparties:"string"},{primary:"userId"}),q.model.extend("dice_group",{guildId:"string",Play_1_userId:"string",Play_1_username:"string",Play_2_userId:"string",Play_2_username:"string",bout:"string",game_status:"unsigned",Round:"unsigned"},{primary:"guildId"}),q.model.extend("dice_data",{userId:"string",username:"string",usergender:"string",usersuite:"list"},{primary:"userId"});const v=[null,await q.canvas.loadImage(""+(0,path_1.resolve)(__dirname,"./img","dice_1.png")),await q.canvas.loadImage(""+(0,path_1.resolve)(__dirname,"./img","dice_2.png")),await q.canvas.loadImage(""+(0,path_1.resolve)(__dirname,"./img","dice_3.png")),await q.canvas.loadImage(""+(0,path_1.resolve)(__dirname,"./img","dice_4.png")),await q.canvas.loadImage(""+(0,path_1.resolve)(__dirname,"./img","dice_5.png")),await q.canvas.loadImage(""+(0,path_1.resolve)(__dirname,"./img","dice_6.png"))],x={"男":await q.canvas.loadImage(""+(0,path_1.resolve)(__dirname,"./img","nan.png")),"女":await q.canvas.loadImage(""+(0,path_1.resolve)(__dirname,"./img","nv.png"))};q.middleware(async(e,a)=>{var t=/^[1-6]$/.test(e.content.split(" ")[0]),i=/^[1-6]$/.test(e.content.split(" ")[1]),{userId:r,guildId:s,content:d}=e,n=await q.database.get("dice_group",{guildId:s}),s=n?.[0]?.Play_1_userId.replace(s,"")===r||n?.[0]?.Play_2_userId.replace(s,"")===r;if(1!=t||1!=i||2!=n?.[0]?.game_status||1!=s)return a();e.execute(`点数 ${d.split("-")[0]} `+e.content.split("-")[1])}),q.command("骰子地下城").subcommand("创建角色 <name> <genders>").action(async({session:e},a,t)=>{var{userId:e,platform:i}=e,r="qq"==i?"​\n":"";return a||t?/^[\u4e00-\u9fa5]{2,6}$/.test(a)&&/^(男|女)$/.test(t)?(await q.database.create("dice_data",{userId:e,username:a,usergender:t}),koishi_1.h.image(x[i])+r+`══骰子地下城══
- [塑梦](mqqapi://card/show_pslcard?src_type=internal&source=sharecard&version=1&uin=3523335883) - 3523335883`,exports.Config=koishi_1.Schema.object({"管理员":koishi_1.Schema.array(String).required().role("table").description("填写QQ,用与重置对战")}),{"剑":{descriptions:"造成□伤害",trigge:0,austerity:3,dice:"",quantities:1,harm:"□",Category:["造成"]},"匕首":{descriptions:"[1-3]造成□伤害",trigge:0,austerity:1,dice:"1-3",quantities:9,harm:"□",Category:["造成"]},"回旋镖":{descriptions:"造成□*2伤害,自身受到□伤害",trigge:0,austerity:3,quantities:1,harm:"□*2",Category:["造成","自身"]},"火球":{descriptions:"[偶数]造成□伤害,燃烧1个骰子",trigge:0,austerity:2,dice:"偶数",quantities:1,harm:"□",Category:["造成","燃烧"]},"雪球":{descriptions:"[奇数]造成□伤害,冰冻1个骰子",trigge:0,austerity:2,dice:"奇数",quantities:1,harm:"□",Category:["造成","冰冻"]},"诅咒":{descriptions:"[1]造成□+1伤害,施加1层诅咒",trigge:0,austerity:0,dice:1,quantities:1,harm:"□+1",Category:["造成","诅咒"]},"毒药咒语":{descriptions:"[3]施加4层中毒",trigge:0,austerity:0,dice:3,quantities:1,harm:"□+1",Category:["中毒"]},"治愈水晶":{descriptions:"[1-3]回复□生命值",trigge:0,austerity:1,dice:"1-3",quantities:1,harm:"□",Category:["回复"]},"木质盾牌":{descriptions:"[1-4]获得□点护盾",trigge:0,austerity:1,dice:"1-4",quantities:1,harm:"□",Category:["护盾"]},"复制":{descriptions:"[4-6]复制1个骰子",trigge:0,austerity:1,dice:"4-6",quantities:1,harm:"□",Category:["复制"]},"铲":{descriptions:"颠倒1个骰子",trigge:0,austerity:3,dice:"",quantities:1,harm:"□",Category:["颠倒"]},"绝佳手气":{descriptions:"[1-5]重投1个点数更大的骰子",trigge:0,austerity:1,dice:"1-5",quantities:1,harm:"□",Category:["重投更大"]},"战斗翻滚":{descriptions:"重投1个骰子",trigge:0,austerity:3,dice:"",quantities:3,harm:"□",Category:["重投"]},"轻顶":{descriptions:"[1-5]□+1",trigge:0,austerity:1,dice:"1-5",quantities:1,harm:"□+1",Category:["轻顶"]},"干草叉":{descriptions:"[1-4]造成□伤害,燃烧&震慑骰子",trigge:0,austerity:1,dice:"1-4",quantities:1,harm:"□",Category:["造成","燃烧","震慑"]},"渔网":{descriptions:"[1-3]造成□伤害,点数3时锁定1个骰子",trigge:3,trigge_skill:["造成","锁定"],austerity:1,dice:"1-3",quantities:1,harm:"□",Category:["造成"]},"吸血":{descriptions:"[1-4]造成□伤害,回复□生命值",trigge:0,austerity:1,dice:"1-4",quantities:1,harm:"□",Category:["造成","回复"]}});async function apply(q,r){q.model.extend("dice_player",{userId:"string",username:"string",HP:{type:"unsigned",initial:0},dice:"list",skills:"list",skill:"json",burn:{type:"unsigned",initial:0},freeze:{type:"unsigned",initial:0},poison:{type:"unsigned",initial:0},curse:{type:"unsigned",initial:0},shield:{type:"unsigned",initial:0},awe:{type:"unsigned",initial:0},lock:{type:"unsigned",initial:0},counterparties:"string"},{primary:"userId"}),q.model.extend("dice_group",{guildId:"string",Play_1_userId:"string",Play_1_username:"string",Play_2_userId:"string",Play_2_username:"string",bout:"string",game_status:"unsigned",Round:"unsigned"},{primary:"guildId"}),q.model.extend("dice_data",{userId:"string",username:"string",usergender:"string",usersuite:"list"},{primary:"userId"});let v;try{v="file://",await q.canvas.loadImage(""+v+(0,path_1.resolve)(__dirname,"./img","dice_1.png"))}catch(e){v=""}const x=[null,await q.canvas.loadImage(""+v+(0,path_1.resolve)(__dirname,"./img","dice_1.png")),await q.canvas.loadImage(""+v+(0,path_1.resolve)(__dirname,"./img","dice_2.png")),await q.canvas.loadImage(""+v+(0,path_1.resolve)(__dirname,"./img","dice_3.png")),await q.canvas.loadImage(""+v+(0,path_1.resolve)(__dirname,"./img","dice_4.png")),await q.canvas.loadImage(""+v+(0,path_1.resolve)(__dirname,"./img","dice_5.png")),await q.canvas.loadImage(""+v+(0,path_1.resolve)(__dirname,"./img","dice_6.png"))],k={"男":await q.canvas.loadImage(""+v+(0,path_1.resolve)(__dirname,"./img","nan.png")),"女":await q.canvas.loadImage(""+v+(0,path_1.resolve)(__dirname,"./img","nv.png"))};q.middleware(async(e,a)=>{var t=/^[1-6]$/.test(e.content.split(" ")[0]),i=/^[1-6]$/.test(e.content.split(" ")[1]),{userId:r,guildId:s,content:d}=e,n=await q.database.get("dice_group",{guildId:s}),s=n?.[0]?.Play_1_userId.replace(s,"")===r||n?.[0]?.Play_2_userId.replace(s,"")===r;if(1!=t||1!=i||2!=n?.[0]?.game_status||1!=s)return a();e.execute(`点数 ${d.split("-")[0]} `+e.content.split("-")[1])}),q.command("骰子地下城").action(async({session:e})=>{var{}=e;return""+koishi_1.h.image((0,url_1.pathToFileURL)((0,path_1.resolve)(__dirname,"./img/caid.png")).href)}),q.command("骰子地下城").subcommand("创建角色 <name> <genders>").action(async({session:e},a,t)=>{var{userId:e,platform:i}=e,i="qq"==i?"​\n":"",r=await q.database.get("dice_data",{userId:e});return a||t?0!=r.length?i+`══骰子地下城══
创建角色失败
你已经创建过角色了`:/^[\u4e00-\u9fa5]{2,6}$/.test(a)&&/^(男|女)$/.test(t)?(await q.database.create("dice_data",{userId:e,username:a,usergender:t}),i+`══骰子地下城══
创建角色成功
角色昵称:${a}
角色性别:${t}
Tips:性别可以在对战中显示图像`):r+`══骰子地下城══
Tips:性别可以在对战中显示图像`):i+`══骰子地下城══
姓名暂支持2-6长度的汉字
性别暂支持(男|女)
示例:注册 小红 女`:r+`══骰子地下城══
示例:注册 小红 女`:i+`══骰子地下城══
创建角色失败
格式错误
正确示例:创建角色 小明 男`}),q.command("骰子地下城").action(async({session:e})=>{var{}=e;return""+koishi_1.h.image((0,url_1.pathToFileURL)((0,path_1.resolve)(__dirname,"./img/caid.png")).href)}),q.command("骰子地下城").subcommand("关于教程").action(async({session:e})=>{e=e.platform;return("qq"==e?"​\n":"")+`══骰子地下城══
正确示例:创建角色 小明 男`}),q.command("骰子地下城").subcommand("角色信息").action(async({session:e})=>{var{userId:e,platform:a}=e,t="qq"==a?"​\n":"",e=await q.database.get("dice_data",{userId:e});return e?.length,koishi_1.h.image(k[a])+t+`══骰子地下城══
角色ID:${e?.[0]?.userId}
角色昵称:${e?.[0]?.username}
角色性别:`+e?.[0]?.usergender}),q.command("骰子地下城").subcommand("关于教程").action(async({session:e})=>{e=e.platform;return("qq"==e?"​\n":"")+`══骰子地下城══
游戏流程:创建对战后邀请他人加入,后开始对战,进行游戏后,发送【对战信息】查看自己装备和点数,使用点数和装备的指令是:【点数 1 2】这样是用点数1来使用装备序号为2的装备`}),q.command("骰子地下城").subcommand("更新公告").action(async({session:e})=>{e=e.platform;return("qq"==e?"​\n":"")+`══骰子地下城══

@@ -69,3 +75,4 @@ 更新内容:

⚄护盾:抵挡护盾层数的直接伤害
⚅震慑:按层数将对应的装备禁用一回合`}),q.command("骰子地下城").subcommand("关于游戏").action(async({session:e})=>{e=e.platform;return("qq"==e?"​\n":"")+`══骰子地下城══
⚅震慑:按层数将对应的装备禁用一回合
⚀锁定:将x个骰子锁定本回合无法使用`}),q.command("骰子地下城").subcommand("关于游戏").action(async({session:e})=>{e=e.platform;return("qq"==e?"​\n":"")+`══骰子地下城══
游戏灵感来自:Dicey Dungeons

@@ -106,4 +113,4 @@ 原作者:BridgeBuilder-2413933494

先手进攻
输入【对战信息】查看装备`}),q.command("骰子地下城").subcommand("对战信息").action(async({session:e})=>{var{userId:e,guildId:a}=e,t=await q.database.get("dice_group",{guildId:a}),i=await q.database.get("dice_player",{userId:""+(a+e)}),r=await q.database.get("dice_player",{userId:i?.[0]?.counterparties}),a=await Display_Status(q,""+(a+e)),e=await Display_Status(q,i?.[0]?.counterparties);return 0==i.length?"":(a=await async function(e,a,t,i,r,s,d,n,c,u,l,o,_){var p=await q.canvas.createCanvas(1546,1546);const m=p.getContext("2d");var g=await q.canvas.loadImage(""+(0,path_1.resolve)(__dirname,"./img","ditu.jpg")),g=(m.drawImage(g,0,0,1546,1546),await drawHPBar(q,r,50)),r=await drawHPBar(q,s,50),s=await q.canvas.loadImage(g),g=await q.canvas.loadImage(r);const y=[[15,658],[158,658],[301,658],[15,790],[158,790],[301,790]],I=[[1133,658],[1278,658],[1420,658],[1133,790],[1278,790],[1420,790]],w={1:[1e3,30],2:[1100,30],3:[1200,30],4:[1300,30],5:[1400,30]},h={1:[1e3,1130],2:[1100,1130],3:[1200,1130],4:[1300,1130],5:[1400,1130]};m.font="180px Unifont-JP",m.fillStyle="#9b9b9b",m.fillText("Round "+d,460,250),await Promise.all(n.map(async(e,a)=>{m.drawImage(v[e],y[a][0],y[a][1],100,100)})),await Promise.all(c.map(async(e,a)=>{m.drawImage(v[e],I[a][0],I[a][1],100,100)})),await Promise.all(u.map(async(e,a)=>{0<o[e]&&(m.font="60px Unifont-JP",m.fillStyle="white",m.fillText(a+1+`.${e}x`+o[e],w[a+1][1],w[a+1][0]))})),await Promise.all(l.map(async(e,a)=>{0<_[e]&&(m.font="60px Unifont-JP",m.fillStyle="white",m.fillText(a+1+`.${e}x`+_[e],h[a+1][1],h[a+1][0]))})),m.save(),m.scale(-1,1),m.drawImage(x["男"],-280,180),m.restore(),m.drawImage(x["男"],1270,180),m.font="50px Unifont-JP",r=t.match(/.{1,9}(\s|$)/g);let b=700,f=(r.forEach(e=>{m.fillText(e,420,b),b+=80}),m.font="50px Unifont-JP",d=i.match(/.{1,9}(\s|$)/g),700),P=(d.forEach(e=>{m.fillText(e,780,f),f+=80}),m.font="48px Unifont-JP",m.fillStyle="white",n=4<e.length?e.substring(0,4)+"..":e,c=4<a.length?a.substring(0,4)+"..":a,l=(n+`的装备描述:
`+await Show_equipment(u,o)).split("\n"),1045);return l.forEach(e=>{m.fillText(e,435,P),P+=80}),m.font="bold 60px Unifont-JP",m.fillStyle="white",t=m.measureText(n).width,r=m.measureText(n).width,i=(x["男"].width-t)/2,m.fillText(n,i,180),i=1270+(x["男"].width-r)/2,m.fillText(c,i,180),m.drawImage(s,0,0),m.drawImage(g,1230,0),p.toBuffer("image/png")}(i?.[0]?.username,r?.[0]?.username,a,e,i?.[0]?.HP,r?.[0]?.HP,String(t?.[0]?.Round),i?.[0]?.dice,r?.[0]?.dice,i?.[0]?.skills,r?.[0]?.skills,i?.[0]?.skill,r?.[0]?.skill),koishi_1.h.image(a,"image/png"))}),q.command("骰子地下城").subcommand("点数 <dice> <props>").action(async({session:e},a,t)=>{const{userId:i,guildId:r,username:s,platform:d}=e;var e="qq"==d?"​\n":"",n=await q.database.get("dice_group",{guildId:r}),c=await q.database.get("dice_player",{userId:""+(r+i)}),u=await q.database.get("dice_player",{userId:n?.[0]?.Play_1_userId}),l=await q.database.get("dice_player",{userId:n?.[0]?.Play_2_userId});const o=c?.[0]?.skills[Number(t)-1];var _=await 对战判定(q,r,""+(r+i),a,t);return 2!=n?.[0]?.game_status?e+`══骰子地下城══
输入【对战信息】查看装备`}),q.command("骰子地下城").subcommand("对战信息").action(async({session:e})=>{var{userId:e,guildId:a}=e,t=await q.database.get("dice_group",{guildId:a}),i=await q.database.get("dice_player",{userId:""+(a+e)}),r=await q.database.get("dice_player",{userId:i?.[0]?.counterparties}),a=await Display_Status(q,""+(a+e)),e=await Display_Status(q,i?.[0]?.counterparties);return 0==i.length?"":(a=await async function(e,a,t,i,r,s,d,n,c,u,l,o,_){var p=await q.canvas.createCanvas(1546,1546);const m=p.getContext("2d");var g=await q.canvas.loadImage(""+v+(0,path_1.resolve)(__dirname,"./img","ditu.jpg")),g=(m.drawImage(g,0,0,1546,1546),await drawHPBar(q,r,50)),r=await drawHPBar(q,s,50),s=await q.canvas.loadImage(g),g=await q.canvas.loadImage(r);const y=[[15,658],[158,658],[301,658],[15,790],[158,790],[301,790]],I=[[1133,658],[1278,658],[1420,658],[1133,790],[1278,790],[1420,790]],w={1:[1e3,30],2:[1100,30],3:[1200,30],4:[1300,30],5:[1400,30]},h={1:[1e3,1130],2:[1100,1130],3:[1200,1130],4:[1300,1130],5:[1400,1130]};m.font="180px Unifont-JP",m.fillStyle="#9b9b9b",m.fillText("Round "+d,460,250),await Promise.all(n.map(async(e,a)=>{m.drawImage(x[e],y[a][0],y[a][1],100,100)})),await Promise.all(c.map(async(e,a)=>{m.drawImage(x[e],I[a][0],I[a][1],100,100)})),await Promise.all(u.map(async(e,a)=>{0<o[e]&&(m.font="60px Unifont-JP",m.fillStyle="white",m.fillText(a+1+`.${e}x`+o[e],w[a+1][1],w[a+1][0]))})),await Promise.all(l.map(async(e,a)=>{0<_[e]&&(m.font="60px Unifont-JP",m.fillStyle="white",m.fillText(a+1+`.${e}x`+_[e],h[a+1][1],h[a+1][0]))})),m.save(),m.scale(-1,1),m.drawImage(k["男"],-280,180),m.restore(),m.drawImage(k["男"],1270,180),m.font="50px Unifont-JP",r=t.match(/.{1,9}(\s|$)/g);let b=700,f=(r.forEach(e=>{m.fillText(e,420,b),b+=80}),m.font="50px Unifont-JP",d=i.match(/.{1,9}(\s|$)/g),700),P=(d.forEach(e=>{m.fillText(e,780,f),f+=80}),m.font="48px Unifont-JP",m.fillStyle="white",n=4<e.length?e.substring(0,4)+"..":e,c=4<a.length?a.substring(0,4)+"..":a,l=(n+`的装备描述:
`+await Show_equipment(u,o)).split("\n"),1045);return l.forEach(e=>{m.fillText(e,435,P),P+=80}),m.font="bold 60px Unifont-JP",m.fillStyle="white",m.fillText(n,90,180),m.fillText(c,1330,180),m.drawImage(s,0,0),m.drawImage(g,1230,0),p.toBuffer("image/png")}(i?.[0]?.username,r?.[0]?.username,a,e,i?.[0]?.HP,r?.[0]?.HP,String(t?.[0]?.Round),i?.[0]?.dice,r?.[0]?.dice,i?.[0]?.skills,r?.[0]?.skills,i?.[0]?.skill,r?.[0]?.skill),koishi_1.h.image(a,"image/png"))}),q.command("骰子地下城").subcommand("点数 <dice> <props>").action(async({session:e},a,t)=>{const{userId:i,guildId:r,username:s,platform:d}=e;var e="qq"==d?"​\n":"",n=await q.database.get("dice_group",{guildId:r}),c=await q.database.get("dice_player",{userId:""+(r+i)}),u=await q.database.get("dice_player",{userId:n?.[0]?.Play_1_userId}),l=await q.database.get("dice_player",{userId:n?.[0]?.Play_2_userId});const o=c?.[0]?.skills[Number(t)-1];var _=await 对战判定(q,r,""+(r+i),a,t);return 2!=n?.[0]?.game_status?e+`══骰子地下城══
还没开始对战呢`:n?.[0]?.bout.replace(r,"")!=i?e+`══骰子地下城══

@@ -117,3 +124,3 @@ 还不是你的回合哦`:o?Number(c?.[0]?.skill?.[o])<=0?e+`══骰子地下城══

`+_):void 0:e+`══骰子地下城══
你没有这个骰子`:"══骰子地下城══\n你没这个装备"})}async function 血量判定(e,a,t,i){var a=await e.database.get("dice_player",{userId:a}),r=await e.database.get("dice_group",{guildId:i});return a?.[0]?.HP<=0?(await e.database.remove("dice_group",{guildId:i}),await e.database.remove("dice_player",{userId:r?.[0]?.Play_1_userId}),await e.database.remove("dice_player",{userId:r?.[0]?.Play_2_userId}),""+t+`
你没有这个骰子`:"══骰子地下城══\n你没这个装备"}),q.command("1").action(async()=>koishi_1.h.image(await drawHPBar(q,20,50),"image/png"))}async function 血量判定(e,a,t,i){var a=await e.database.get("dice_player",{userId:a}),r=await e.database.get("dice_group",{guildId:i});return a?.[0]?.HP<=0?(await e.database.remove("dice_group",{guildId:i}),await e.database.remove("dice_player",{userId:r?.[0]?.Play_1_userId}),await e.database.remove("dice_player",{userId:r?.[0]?.Play_2_userId}),""+t+`
血量清零

@@ -125,3 +132,3 @@ ${t!=r?.[0]?.Play_1_username?r?.[0]?.Play_1_username:r?.[0]?.Play_2_username}获胜`):""}async function 对战判定(a,t,i,r,e){var s=await a.database.get("dice_player",{userId:i});const d=s?.[0]?.skills[Number(e)-1];var n,c=s?.[0]?.skill,u=s?.[0]?.dice;return 0<s?.[0]?.curse&&1==koishi_1.Random.bool(.5)?(await a.database.set("dice_player",{userId:i},{curse:s?.[0]?.curse-1}),u.splice(u.indexOf(r),1),--c[d],await a.database.set("dice_player",{userId:i},{skill:c,dice:u}),{statu:!0,msg:`══骰子地下城══

燃烧生效!血量-2
`+(n+=(await Promise.all(Introduction[d][e].map(async e=>effect[e](a,""+(t+i),r,Introduction[d].harm)))).join("\n"))}):{statu:!1,msg:""}}async function drawHPBar(e,a,t){var e=await e.canvas.createCanvas(300,60),i=e.getContext("2d"),r=(i.clearRect(0,0,300,60),Math.floor(a/t*100)),r=Math.floor(r/100*300),r=(i.fillStyle="white",i.fillRect(13,13,300,40),i.fillStyle="red",i.fillRect(13,13,r,40),i.fillStyle="black",i.font="50px Unifont-JP","HP: "+a+"/"+t),a=i.measureText(r).width;return i.fillText(r,300-a-13,47),e.toBuffer()}async function 状态判定(e,a){const t=await e.database.get("dice_player",{userId:a});var i=t?.[0]?.dice;return 1<=t?.[0]?.freeze?(i=i.map((e,a)=>a<t?.[0]?.freeze?1:e),await e.database.set("dice_player",{userId:a},{dice:i,freeze:t?.[0]?.freeze-1}),`冰冻${t?.[0]?.freeze}骰子`):1<=t?.[0]?.poison?(await e.database.set("dice_player",{userId:a},{HP:t?.[0]?.HP-t?.[0]?.poison,poison:t?.[0]?.poison-1}),"中毒 血量-"+t?.[0]?.poison):""}async function 护盾判定(e,a,t){var i=await e.database.get("dice_player",{userId:a});return i?.[0]?.shield>t?(await e.database.set("dice_player",{userId:a},{shield:i?.[0]?.shield-t}),`护盾抵挡${t}伤害`):(await e.database.set("dice_player",{userId:a},{HP:i?.[0]?.HP-(t-i?.[0]?.shield),shield:0}),`护盾抵挡${i?.[0]?.shield}伤害,承受了${t-i?.[0]?.shield}伤害`)}function HP(e,a){e<0?e=0:a<e&&(e=a);a=Math.floor(e/a*100),a=Math.floor(a/10);return"["+"=".repeat(a)+" ".repeat(10-a)+"]"+e}async function Display_Status(e,a){e=await e.database.get("dice_player",{userId:a});const t=["燃烧","冰冻","中毒","诅咒","护盾","震撼","锁定"],i={0:e?.[0]?.burn,1:e?.[0]?.freeze,2:e?.[0]?.poison,3:e?.[0]?.curse,4:e?.[0]?.shield,5:e?.[0]?.awe,6:e?.[0]?.lock};return Object.keys(i).filter(e=>0<=parseInt(e)&&parseInt(e)<t.length&&0<i[e]).map(e=>t[parseInt(e)]+"x"+i[e]).join(" ")||"暂无"}function Show_Dice(e){let a="";const t=["0","⚀","⚁","⚂","⚃","⚄","⚅"];return e.filter(e=>{a+=t[e]+" "}),a}async function Show_equipment(e,a){let t="",i=0;return e.forEach(e=>{i++,0<a[e]&&(t+=`${i}.${Introduction[e].descriptions} \n`)}),t}async function Generating_equipment(e,a){var t=[random.pick(["剑","匕首","回旋镖","干草叉"]),random.pick(["毒药咒语","火球","吸血","雪球","诅咒","渔网"]),random.pick(["治愈水晶","木质盾牌"]),random.pick(["绝佳手气","复制","铲","轻顶"]),random.pick(["战斗翻滚"])],i={[t[0]]:Introduction[t[0]].quantities,[t[1]]:Introduction[t[1]].quantities,[t[2]]:Introduction[t[2]].quantities,[t[3]]:Introduction[t[3]].quantities,[t[4]]:Introduction[t[4]].quantities},r=[""+random.int(1,7),""+random.int(1,7),""+random.int(1,7),""+random.int(1,7)];await e.database.create("dice_player",{userId:a,HP:50,skills:t,skill:i,dice:r})}async function Generate_Dice(e,a){var t=new koishi_1.Random(()=>Math.random()),t=[""+t.int(1,7),""+t.int(1,7),""+t.int(1,7),""+t.int(1,7)];await e.database.set("dice_player",{userId:a},{dice:t})}async function Reset_times(e,a){var t=(await e.database.get("dice_player",{userId:a}))?.[0]?.skills,t={[t[0]]:Introduction[t[0]].quantities,[t[1]]:Introduction[t[1]].quantities,[t[2]]:Introduction[t[2]].quantities,[t[3]]:Introduction[t[3]].quantities,[t[4]]:Introduction[t[4]].quantities};await e.database.set("dice_player",{userId:a},{skill:t})}async function Dice_Decision(e,a,t){return 0==e&&a==t||1==e&&Number(a)>=Number(t.split("-")[0])&&Number(a)<=Number(t.split("-")[1])||2==e&&"偶数"==t&&a%2==0||2==e&&"奇数"==t&&a%2==1||3==e}exports.apply=apply;const effect={async"锁定"(e,a,t,i){a=await e.database.get("dice_player",{userId:a});return await e.database.set("dice_player",{userId:a?.[0]?.counterparties},{lock:a?.[0]?.lock+1}),"施加状态:锁定*1"},async"颠倒"(e,a,t,i){var r=await e.database.get("dice_player",{userId:a}),t=7-Number(t),r=r?.[0]?.dice;return r?.push(t),await e.database.set("dice_player",{userId:a},{dice:r}),"骰子点数变为"+t},async"轻顶"(ctx,userId,dice,harm){const dice_player=await ctx.database.get("dice_player",{userId:userId}),new_hanrm=eval(harm.replace("□",Number(dice))),dices=dice_player?.[0]?.dice;return dices?.push(new_hanrm),await ctx.database.set("dice_player",{userId:userId},{dice:dices}),`将骰子转为${new_hanrm}点`},async"重投更大"(e,a,t,i){var r=await e.database.get("dice_player",{userId:a}),t=random.int(Number(t)+1,6),r=r?.[0]?.dice;return r?.push(t),await e.database.set("dice_player",{userId:a},{dice:r}),`重投更大骰子${t}点`},async"重投"(e,a,t,i){var r=await e.database.get("dice_player",{userId:a}),s=random.int(1,6),r=r?.[0]?.dice;return r?.push(s),await e.database.set("dice_player",{userId:a},{dice:r}),`重投骰子${s}点`},async"复制"(ctx,userId,dice,harm){const dice_player=await ctx.database.get("dice_player",{userId:userId}),new_hanrm=eval(harm.replace("□",dice)),dices=dice_player?.[0]?.dice;return dices.push(new_hanrm),await ctx.database.set("dice_player",{userId:userId},{dice:dices}),"复制了一个骰子"},async"诅咒"(e,a,t,i=0){a=await e.database.get("dice_player",{userId:a});return await e.database.set("dice_player",{userId:a?.[0]?.counterparties},{curse:a?.[0]?.curse+1}),"施加状态:诅咒*1"},async"震慑"(e,a,t,i){a=await e.database.get("dice_player",{userId:a});return await e.database.set("dice_player",{userId:a?.[0]?.counterparties},{awe:a?.[0]?.awe+1}),"施加状态:震慑*1"},async"燃烧"(e,a,t,i=0){a=await e.database.get("dice_player",{userId:a});return await e.database.set("dice_player",{userId:a?.[0]?.counterparties},{burn:a?.[0]?.burn+1}),"施加状态:燃烧*1"},async"护盾"(ctx,userId,dice,harm){const dice_player=await ctx.database.get("dice_player",{userId:userId}),new_hanrm=eval(harm.replace("□",dice));return await ctx.database.set("dice_player",{userId:userId},{shield:dice_player?.[0]?.shield+new_hanrm}),"施加状态:护盾*"+new_hanrm},async"冰冻"(e,a,t,i=0){a=await e.database.get("dice_player",{userId:a});return await e.database.set("dice_player",{userId:a?.[0]?.counterparties},{freeze:a?.[0]?.freeze+1}),"施加状态:冰冻*1"},async"中毒"(ctx,userId,dice,harm=""){const dice_player=await ctx.database.get("dice_player",{userId:userId}),dice_player_2=await ctx.database.get("dice_player",{userId:dice_player?.[0]?.counterparties}),new_hanrm=eval(harm.replace("□",dice));return await ctx.database.set("dice_player",{userId:dice_player?.[0]?.counterparties},{poison:dice_player_2?.[0]?.poison+4}),"施加状态:中毒*"+new_hanrm},async"回复"(e,a,t,i=0){var r=await e.database.get("dice_player",{userId:a}),r=Number(t)+r?.[0]?.HP;return await e.database.set("dice_player",{userId:a},{HP:50<=r?50:r}),`回复${t}生命值
`+(n+=(await Promise.all(Introduction[d][e].map(async e=>effect[e](a,""+(t+i),r,Introduction[d].harm)))).join("\n"))}):{statu:!1,msg:""}}async function drawHPBar(e,a,t){var e=await e.canvas.createCanvas(300,60),i=e.getContext("2d"),r=(i.clearRect(0,0,300,60),Math.floor(a/t*100)),r=Math.floor(r/100*300),r=(i.fillStyle="white",i.fillRect(0,0,300,60),i.fillStyle="red",i.fillRect(0,0,r,60),i.fillStyle="black",i.font="50px Unifont-JP","HP: "+a+"/"+t);return i.fillText(r,0,43),e.toBuffer()}async function 状态判定(e,a){const t=await e.database.get("dice_player",{userId:a});var i=t?.[0]?.dice;return 1<=t?.[0]?.freeze?(i=i.map((e,a)=>a<t?.[0]?.freeze?1:e),await e.database.set("dice_player",{userId:a},{dice:i,freeze:t?.[0]?.freeze-1}),`冰冻${t?.[0]?.freeze}骰子`):1<=t?.[0]?.poison?(await e.database.set("dice_player",{userId:a},{HP:t?.[0]?.HP-t?.[0]?.poison,poison:t?.[0]?.poison-1}),"中毒 血量-"+t?.[0]?.poison):""}async function 护盾判定(e,a,t){var i=await e.database.get("dice_player",{userId:a});return i?.[0]?.shield>t?(await e.database.set("dice_player",{userId:a},{shield:i?.[0]?.shield-t}),`护盾抵挡${t}伤害`):(await e.database.set("dice_player",{userId:a},{HP:i?.[0]?.HP-(t-i?.[0]?.shield),shield:0}),`护盾抵挡${i?.[0]?.shield}伤害,承受了${t-i?.[0]?.shield}伤害`)}function HP(e,a){e<0?e=0:a<e&&(e=a);a=Math.floor(e/a*100),a=Math.floor(a/10);return"["+"=".repeat(a)+" ".repeat(10-a)+"]"+e}async function Display_Status(e,a){e=await e.database.get("dice_player",{userId:a});const t=["燃烧","冰冻","中毒","诅咒","护盾","震撼","锁定"],i={0:e?.[0]?.burn,1:e?.[0]?.freeze,2:e?.[0]?.poison,3:e?.[0]?.curse,4:e?.[0]?.shield,5:e?.[0]?.awe,6:e?.[0]?.lock};return Object.keys(i).filter(e=>0<=parseInt(e)&&parseInt(e)<t.length&&0<i[e]).map(e=>t[parseInt(e)]+"x"+i[e]).join(" ")||"暂无"}function Show_Dice(e){let a="";const t=["0","⚀","⚁","⚂","⚃","⚄","⚅"];return e.filter(e=>{a+=t[e]+" "}),a}async function Show_equipment(e,a){let t="",i=0;return e.forEach(e=>{i++,0<a[e]&&(t+=`${i}.${Introduction[e].descriptions} \n`)}),t}async function Generating_equipment(e,a){var t=[random.pick(["剑","匕首","回旋镖","干草叉"]),random.pick(["毒药咒语","火球","吸血","雪球","诅咒","渔网"]),random.pick(["治愈水晶","木质盾牌"]),random.pick(["绝佳手气","复制","铲","轻顶"]),random.pick(["战斗翻滚"])],i={[t[0]]:Introduction[t[0]].quantities,[t[1]]:Introduction[t[1]].quantities,[t[2]]:Introduction[t[2]].quantities,[t[3]]:Introduction[t[3]].quantities,[t[4]]:Introduction[t[4]].quantities},r=[""+random.int(1,7),""+random.int(1,7),""+random.int(1,7),""+random.int(1,7)];await e.database.create("dice_player",{userId:a,HP:50,skills:t,skill:i,dice:r})}async function Generate_Dice(e,a){var t=new koishi_1.Random(()=>Math.random()),t=[""+t.int(1,7),""+t.int(1,7),""+t.int(1,7),""+t.int(1,7)];await e.database.set("dice_player",{userId:a},{dice:t})}async function Reset_times(e,a){var t=(await e.database.get("dice_player",{userId:a}))?.[0]?.skills,t={[t[0]]:Introduction[t[0]].quantities,[t[1]]:Introduction[t[1]].quantities,[t[2]]:Introduction[t[2]].quantities,[t[3]]:Introduction[t[3]].quantities,[t[4]]:Introduction[t[4]].quantities};await e.database.set("dice_player",{userId:a},{skill:t})}async function Dice_Decision(e,a,t){return 0==e&&a==t||1==e&&Number(a)>=Number(t.split("-")[0])&&Number(a)<=Number(t.split("-")[1])||2==e&&"偶数"==t&&a%2==0||2==e&&"奇数"==t&&a%2==1||3==e}exports.apply=apply;const effect={async"锁定"(e,a,t,i){a=await e.database.get("dice_player",{userId:a});return await e.database.set("dice_player",{userId:a?.[0]?.counterparties},{lock:a?.[0]?.lock+1}),"施加状态:锁定*1"},async"颠倒"(e,a,t,i){var r=await e.database.get("dice_player",{userId:a}),t=7-Number(t),r=r?.[0]?.dice;return r?.push(t),await e.database.set("dice_player",{userId:a},{dice:r}),"骰子点数变为"+t},async"轻顶"(ctx,userId,dice,harm){const dice_player=await ctx.database.get("dice_player",{userId:userId}),new_hanrm=eval(harm.replace("□",Number(dice))),dices=dice_player?.[0]?.dice;return dices?.push(new_hanrm),await ctx.database.set("dice_player",{userId:userId},{dice:dices}),`将骰子转为${new_hanrm}点`},async"重投更大"(e,a,t,i){var r=await e.database.get("dice_player",{userId:a}),t=random.int(Number(t)+1,6),r=r?.[0]?.dice;return r?.push(t),await e.database.set("dice_player",{userId:a},{dice:r}),`重投更大骰子${t}点`},async"重投"(e,a,t,i){var r=await e.database.get("dice_player",{userId:a}),s=random.int(1,6),r=r?.[0]?.dice;return r?.push(s),await e.database.set("dice_player",{userId:a},{dice:r}),`重投骰子${s}点`},async"复制"(ctx,userId,dice,harm){const dice_player=await ctx.database.get("dice_player",{userId:userId}),new_hanrm=eval(harm.replace("□",dice)),dices=dice_player?.[0]?.dice;return dices.push(new_hanrm),await ctx.database.set("dice_player",{userId:userId},{dice:dices}),"复制了一个骰子"},async"诅咒"(e,a,t,i=0){a=await e.database.get("dice_player",{userId:a});return await e.database.set("dice_player",{userId:a?.[0]?.counterparties},{curse:a?.[0]?.curse+1}),"施加状态:诅咒*1"},async"震慑"(e,a,t,i){a=await e.database.get("dice_player",{userId:a});return await e.database.set("dice_player",{userId:a?.[0]?.counterparties},{awe:a?.[0]?.awe+1}),"施加状态:震慑*1"},async"燃烧"(e,a,t,i=0){a=await e.database.get("dice_player",{userId:a});return await e.database.set("dice_player",{userId:a?.[0]?.counterparties},{burn:a?.[0]?.burn+1}),"施加状态:燃烧*1"},async"护盾"(ctx,userId,dice,harm){const dice_player=await ctx.database.get("dice_player",{userId:userId}),new_hanrm=eval(harm.replace("□",dice));return await ctx.database.set("dice_player",{userId:userId},{shield:dice_player?.[0]?.shield+new_hanrm}),"施加状态:护盾*"+new_hanrm},async"冰冻"(e,a,t,i=0){a=await e.database.get("dice_player",{userId:a});return await e.database.set("dice_player",{userId:a?.[0]?.counterparties},{freeze:a?.[0]?.freeze+1}),"施加状态:冰冻*1"},async"中毒"(ctx,userId,dice,harm=""){const dice_player=await ctx.database.get("dice_player",{userId:userId}),dice_player_2=await ctx.database.get("dice_player",{userId:dice_player?.[0]?.counterparties}),new_hanrm=eval(harm.replace("□",dice));return await ctx.database.set("dice_player",{userId:dice_player?.[0]?.counterparties},{poison:dice_player_2?.[0]?.poison+4}),"施加状态:中毒*"+new_hanrm},async"回复"(e,a,t,i=0){var r=await e.database.get("dice_player",{userId:a}),r=Number(t)+r?.[0]?.HP;return await e.database.set("dice_player",{userId:a},{HP:50<=r?50:r}),`回复${t}生命值
`},async"造成"(ctx,userId,dice,harm){const dice_player=await ctx.database.get("dice_player",{userId:userId}),dice_player_2=await ctx.database.get("dice_player",{userId:dice_player?.[0]?.counterparties}),new_hanrm=eval(harm.replace("□",Number(dice)));return Number(dice_player_2?.[0]?.shield)<=0||!dice_player_2?.[0]?.shield?(await ctx.database.set("dice_player",{userId:dice_player?.[0]?.counterparties},{HP:dice_player_2?.[0]?.HP-new_hanrm}),`造成${new_hanrm}伤害`):护盾判定(ctx,dice_player?.[0]?.counterparties,new_hanrm)},async"自身"(e,a,t,i){var r=await e.database.get("dice_player",{userId:a});return Number(r?.[0]?.shield)<=0||!r?.[0]?.shield?(await e.database.set("dice_player",{userId:a},{HP:r?.[0]?.HP-t}),`自身受到${t}伤害`):护盾判定(e,a,t)}};
{
"name": "koishi-plugin-dicey-dungeons",
"description": "中文名:骰子地下城 双人回合对战",
"version": "1.3.7",
"version": "1.3.8",
"main": "lib/index.js",

@@ -6,0 +6,0 @@ "typings": "lib/index.d.ts",

@@ -10,2 +10,3 @@ # koishi-plugin-dicey-dungeons

## 🎈 介绍

@@ -12,0 +13,0 @@ 由偶然间玩的一款游戏“骰子地下城”开发的一款插件,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc