Added the battle fighting commands, restructured the way hp and mp are stored, and added weapons. NOTE: UPDATING THE HP AND MP DOES NOT WORK

This commit is contained in:
ION606
2022-05-29 20:59:39 +03:00
parent 7fa6b85f10
commit 69a5a2e18d
6 changed files with 288 additions and 185 deletions
+2 -1
View File
@@ -147,6 +147,7 @@ bot.on('interactionCreate', async interaction => {
const doc = result[1];
const threadname = doc.thread;
const dbo = client.db(interaction.guildId + '[ECON]').collection(id);
dbo.find({ 'state': {$exists: true} }).toArray(async function (err, docs) {
if (interaction.user.id == id) {
await interaction.deferReply();
@@ -154,7 +155,7 @@ bot.on('interactionCreate', async interaction => {
//Check State
if (docs[0].state == STATE.FIGHTING) {
//Do turn stuff
bot.commands.get('game').in_game_redirector(bot, interaction, threadname, doc, client, mongouri, items);
bot.commands.get('game').in_game_redirector(bot, interaction, threadname, doc, client, mongouri, items, xp_collection);
}
turnManager.changeTurn(client, bot, interaction);