koishi-plugin-dicey-dungeons
Advanced tools
Comparing version 1.1.6 to 1.1.7
@@ -83,8 +83,26 @@ "use strict"; | ||
}); | ||
//判断是否有参加,并且消息等于骰子 序号 | ||
ctx.middleware(async (session, next) => { | ||
const a = /^[0-9]$/?.test(session.content.split(' ')[0]); | ||
const b = /^[0-9]$/?.test(session.content.split(' ')[1]); | ||
const { userId, guildId, username, platform, content } = session; | ||
const read = await ctx.database.get('dice_group', { guildId }); | ||
if (a == true && b == true && read?.[0]?.Play_1_userId == userId || read?.[0]?.Play_2_userId == userId) { | ||
session.execute(`点数 ${content.split('-')[0]} ${session.content.split('-')[1]}`); | ||
} | ||
else { | ||
return next(); | ||
} | ||
}); | ||
ctx.command('骰子地下城') | ||
.action(async ({ session }) => { | ||
const { userId, guildId, username } = session; | ||
return `══骰子地下城══\n加入对战 创建对战\n对战信息 重置对战\n结束对战 结束回合\n状态说明 BUG反馈\n游戏介绍 关于游戏\nTips:对战建议一个群聊一个对战`; | ||
const { userId, guildId, username, platform } = session; | ||
return `══骰子地下城══\n加入对战 创建对战\n对战信息 重置对战\n结束对战 结束回合\n状态说明 BUG反馈\n游戏介绍 关于游戏\n更新日志\nTips:对战建议一个群聊一个对战`; | ||
}); | ||
ctx.command('骰子地下城') | ||
.subcommand('更新公告') | ||
.action(async ({ session }) => { | ||
return `══骰子地下城══\n更新内容:\n加入对战的玩家可发送[点数] [序号]\n示例:1 2`; | ||
}); | ||
ctx.command('骰子地下城') | ||
.subcommand('BUG反馈') | ||
@@ -237,5 +255,4 @@ .action(async ({ session }) => { | ||
.subcommand('点数 <dice> <props>') | ||
// .middleware(/^[0-9] [0-9]/, { args: ['$1'] }) | ||
.action(async ({ session }, dice, props) => { | ||
const { userId, guildId, username } = session; | ||
const { userId, guildId, username, platform } = session; | ||
const dice_group = await ctx.database.get('dice_group', { guildId }); | ||
@@ -269,3 +286,3 @@ const dice_player = await ctx.database.get('dice_player', { userId }); | ||
await ctx.database.set('dice_player', { userId }, { skill, dice: dices }); | ||
return `诅咒生效!骰子使用失败`; | ||
return `诅咒生效!骰子使用失败\n此次使用的骰子和装备照样减少`; | ||
} | ||
@@ -363,3 +380,3 @@ else if (/^[0-9]+$/.test(dice) && /^[0-9]+$/.test(props)) { | ||
await ctx.database.set('dice_player', { userId }, { HP: dice_player?.[0]?.HP - (harm - dice_player?.[0]?.shield), shield: 0 }); | ||
return `护盾抵挡${dice_player?.[0]?.shield}伤害,承受了${(harm - dice_player?.[0]?.shield)}`; | ||
return `护盾抵挡${dice_player?.[0]?.shield}伤害,承受了${(harm - dice_player?.[0]?.shield)}伤害`; | ||
} | ||
@@ -420,5 +437,8 @@ } | ||
let msg = ''; | ||
let i = 1; | ||
let i = 0; | ||
skills.filter(pride => { | ||
msg += `${i++}.${pride}:${Introduction[pride].descriptions} x${skill[pride]} \n`; | ||
i++; | ||
if (skill[pride] !== 0) { | ||
msg += `${i}.${pride}:${Introduction[pride].descriptions} x${skill[pride]} \n`; | ||
} | ||
}); | ||
@@ -425,0 +445,0 @@ return msg; |
{ | ||
"name": "koishi-plugin-dicey-dungeons", | ||
"description": "中文名:骰子地下城 双人回合对战", | ||
"version": "1.1.6", | ||
"version": "1.1.7", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "typings": "lib/index.d.ts", |
36316
646