Update to latest development branch (#6)
* fixing typos * merge Dynamic commands (#3) * Update README.md * Update README.md * fixing typos * dynamically read new commands inside folder. * eslint, update package.json due to moving files Co-authored-by: Marcus Netz <marcus.netz@godyo.com> * fix talent checking on empty arguments list * Origin/message embed (#4) * add first embedded message on tp.js * move db from message commands * fix missing arguments list, add need_args * add global Message Replies. * add more global Message Replies. * more embedded messages. fixing string * missing comma * adding a few more strings on talents. Co-authored-by: Marcus Netz <marcus.netz@godyo.com> * fixing creating from json file * bugfix: db not defined * possible fix for nonworking talent? * fix double msg * fix: aliases are now being used * change: show command displays now some character attributes * added various aliases to commands, added global strings. * added melee combat rolling. * removed purse from creation of character * added attack command to bring some combat features. * added weapons command, renamed some command files. * updated README for new commands Co-authored-by: Marcus Netz <marcus.netz@godyo.com>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,4 +2,5 @@ node_modules
|
||||
.env
|
||||
.eslintrc.js
|
||||
.eslintrc.json
|
||||
.vscode
|
||||
|
||||
|
@ -40,6 +40,14 @@ ie. `!ep Mut` or `!ep KK`
|
||||
### !skill [skillname]
|
||||
Returns the current level of the desired skill.
|
||||
|
||||
### !attack [weaponname] ([-Disadvantages/+Advantages])
|
||||
Rolls an attack by using the weapon based skillset. Calculates your combat technique value and takes into account for `MU` or `FF`.
|
||||
`caution`: It does not yet make use of any benefits or disadvantages your character possesses.
|
||||
|
||||
ie. `!attack Waqqif`
|
||||
|
||||
For a list of weapons to chose from, use `!weapons`
|
||||
|
||||
### !talent [skillname] ([-Disadvantages/+Advantages])
|
||||
Rolls 3 dice and compares the results of each with your current level of character attributes including your bonus on that particular skill.
|
||||
`caution`: It does not yet make use of any benefits or disadvantages your character has (at the moment).
|
||||
|
105
commands/Attack.js
Normal file
105
commands/Attack.js
Normal file
@ -0,0 +1,105 @@
|
||||
const globals = require('../globals')
|
||||
const db = globals.db
|
||||
const Random = require('random')
|
||||
|
||||
module.exports = {
|
||||
name: 'attack',
|
||||
description: 'Würfelt den Attackewert auf eine Nahkampfwaffe.',
|
||||
aliases: ['angriff','attacke'],
|
||||
usage: '<Waffe>',
|
||||
needs_args: true,
|
||||
|
||||
async exec(message, args) {
|
||||
try {
|
||||
db.find({
|
||||
user: message.author.tag,
|
||||
}, function(err, docs) {
|
||||
if (!docs.length > 0) {
|
||||
return message.reply(globals.Replies.find(r => r.id === 'NOENTRY').string);
|
||||
}
|
||||
else {
|
||||
|
||||
Random.use(message.author.tag);
|
||||
|
||||
const Player = docs[0].character
|
||||
const Weapon = globals.Weapons.find(w => w.id === args[0].toLowerCase())
|
||||
if(!Weapon) { return message.reply(globals.Replies.find(r => r.id === 'NO_SUCH_WEAPON').string)}
|
||||
|
||||
// Determining Both Attack and Ranged Attack Values.
|
||||
const CombatTechnique = globals.CombatTechniques.find(technique => technique.id === Weapon.combattechnique)
|
||||
let PlayerCombatTechnique = Player.combattechniques.find(technique => technique.id === CombatTechnique.id)
|
||||
let CombatTechniqueValue = null
|
||||
if (PlayerCombatTechnique) { CombatTechniqueValue = PlayerCombatTechnique.level }
|
||||
if(!CombatTechniqueValue) { CombatTechniqueValue = 6 }
|
||||
let Attribute
|
||||
let AttackValue = CombatTechniqueValue
|
||||
if (globals.MeleeWeapons.find(MeleeWeapon => MeleeWeapon.id === Weapon.id)) {
|
||||
// For melee combat, MU is used for determining the Attack Value. Also, any weapon-based attack modifiers apply.
|
||||
Attribute = Player.attributes.find(a => a.id === 'mut').level
|
||||
AttackValue += Weapon.at_mod
|
||||
}
|
||||
else {
|
||||
// For ranged combat, FF is used for determining Attack Value
|
||||
Attribute = Player.attributes.find(a => a.id === 'fingerfertigkeit').level
|
||||
}
|
||||
AttackValue += Math.floor((Attribute - 8)/3)
|
||||
|
||||
let dice = []
|
||||
let Bonus = 0
|
||||
if(args[1] && !isNaN(parseInt(args[1]))) { Bonus = parseInt(args[1]) }
|
||||
let Comparison = Math.floor(AttackValue + Bonus)
|
||||
let CriticalHit = false
|
||||
let Patzer = false
|
||||
let Ok = false
|
||||
let DoubleDamage = false
|
||||
|
||||
for (let i = 0; i < 2; i++) {
|
||||
dice.push(Random.int(1,20))
|
||||
}
|
||||
|
||||
// If there is a cleaner way to do these checks, I'm all into it.
|
||||
if((dice[0] == 1) && dice[1] <= Comparison) { CriticalHit = true; DoubleDamage = true; Ok = true }
|
||||
else if((dice[0] == 1) && dice[1] > Comparison) { CriticalHit = true; Ok = true }
|
||||
else if((dice[0] == 20) && dice[1] > Comparison) { Patzer = true }
|
||||
else if(dice[0] <= Comparison && !CriticalHit) { Ok = true; dice.pop(); }
|
||||
else if(dice[0] > Comparison ) { dice.pop(); }
|
||||
|
||||
|
||||
let Reply = 'Du greifst mit ' + globals.Declination[Weapon.article] + ' ' + Weapon.name + ' an.\n'
|
||||
Reply += 'Dein Angriffswert für ' + CombatTechnique.name + ' ist ' + Math.floor(((Attribute - 8)/3) + CombatTechniqueValue) + '. (KtW: ' + CombatTechniqueValue + ')\n'
|
||||
Reply += 'Deine 🎲: ` ' + dice.join(', ') + ' `.\n\n'
|
||||
|
||||
if(!Ok) {
|
||||
Reply += globals.Replies.find(reply => reply.id === 'COMBAT_FAIL').string
|
||||
if(Patzer) { Reply += globals.Replies.find(reply => reply.id === 'COMBAT_CRIT_FAIL').string }
|
||||
}
|
||||
else {
|
||||
if(CriticalHit) { Reply += globals.Replies.find(reply => reply.id === 'COMBAT_CRIT_SUCCESS').string }
|
||||
if(DoubleDamage) { Reply += globals.Replies.find(reply => reply.id === 'COMBAT_DOUBLEDAMAGE').string }
|
||||
if(!CriticalHit) { Reply += globals.Replies.find(reply => reply.id === 'COMBAT_SUCCESS').string }
|
||||
const DieModificator = Weapon.diemodificator
|
||||
let Damage = DieModificator
|
||||
let DamageDice = []
|
||||
for (let i = 0; i < Weapon.dice; i++) {
|
||||
DamageDice.push(Random.int(1,6))
|
||||
}
|
||||
DamageDice.forEach(result => {
|
||||
Damage += result
|
||||
})
|
||||
if(DoubleDamage) { Damage *= 2 }
|
||||
|
||||
Reply += '\n\nHier aufklappen, wenn der Gegner nicht parieren/Ausweichen konnte:\n'
|
||||
Reply += '||' + globals.Articles[Weapon.article] + ' ' + Weapon.name + ' (' + Weapon.dice + 'W6+' + Weapon.diemodificator +') erzielt ` ' + Damage + ' ` Schaden.'
|
||||
Reply += '\nDeine 🎲: ` ' + DamageDice.join(',') + ' `.||\n'
|
||||
}
|
||||
|
||||
return message.reply( Reply )
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
throw e;
|
||||
}
|
||||
},
|
||||
};
|
86
commands/Attribute.js
Normal file
86
commands/Attribute.js
Normal file
@ -0,0 +1,86 @@
|
||||
const globals = require('../globals');
|
||||
const Random = require('random');
|
||||
const db = globals.db
|
||||
|
||||
module.exports = {
|
||||
name: 'attribute',
|
||||
description: '',
|
||||
aliases: ['ap', 'ep'],
|
||||
usage: '<Eigenschaft> / <Eigenschaftswert>',
|
||||
needs_args: true,
|
||||
async exec(message, args) {
|
||||
try {
|
||||
let level = 8;
|
||||
let attributename;
|
||||
|
||||
await db.find({
|
||||
user: message.author.tag,
|
||||
}, async function(err, docs) {
|
||||
|
||||
// user calls with text. need to gather info from database
|
||||
if (isNaN(args[0])) {
|
||||
if (!docs.length > 0) {
|
||||
message.reply(globals.Replies.find(r => r.id === 'NOENTRY').string);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
// try to get id of short formatted attributes.
|
||||
if (args[0].length == 2) {
|
||||
for (const i in globals.Werte) {
|
||||
if (globals.Werte[i].kuerzel == args[0].toUpperCase()) {
|
||||
attributename = globals.Werte[i].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
attributename = args[0].toLowerCase();
|
||||
}
|
||||
for (const i in docs[0].character.attributes) {
|
||||
if (docs[0].character.attributes[i].id == attributename) level = docs[0].character.attributes[i].level;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
level = args[0];
|
||||
}
|
||||
Random.use(message.author.tag);
|
||||
const countOccurrences = (arr, val) => arr.reduce((a, v) => (v === val ? a + 1 : a), 0);
|
||||
const dice = [];
|
||||
dice.push(Random.int(1, 20));
|
||||
if (dice[0] == 1 || dice[0] == 20) {
|
||||
dice.push(Random.int(1, 20));
|
||||
}
|
||||
// handle crits
|
||||
if (countOccurrences(dice, 1) == 2) {
|
||||
message.reply('Du hast einen kritischen Erfolg erzielt (' + dice.join(', ') + ')! 🎉🥳🎆');
|
||||
return;
|
||||
}
|
||||
else if (countOccurrences(dice, 20) == 2) {
|
||||
message.reply('Du hast einen Patzer (' + dice.join(', ') + ')! 😭 Viel Erfolg beim nächsten mal!');
|
||||
return;
|
||||
}
|
||||
if ((dice.length == 2 && dice[0] != 20 && dice[1] <= level) || (dice.length == 1 && dice[0] <= level)) {
|
||||
if (attributename) {
|
||||
message.reply('Du hast die Probe auf ' + attributename + ' (Stufe ' + level + ') bestanden.\n' +
|
||||
'Deine 🎲: ' + dice.join(', '));
|
||||
}
|
||||
else {
|
||||
message.reply('Du hast die Probe (Stufe ' + level + ') bestanden.\n' +
|
||||
'Deine 🎲: ' + dice.join(', '));
|
||||
}
|
||||
}
|
||||
else if (attributename) {
|
||||
message.reply('Du hast die Probe auf ' + attributename + ' (Stufe ' + level + ') leider nicht bestanden 😢.\n' +
|
||||
'Deine 🎲: ' + dice.join(', '));
|
||||
}
|
||||
else {
|
||||
message.reply('Du hast die Probe (Stufe ' + level + ') leider nicht bestanden 😢.\n' +
|
||||
'Deine 🎲: ' + dice.join(', '));
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
throw e;
|
||||
}
|
||||
},
|
||||
};
|
77
commands/Help.js
Normal file
77
commands/Help.js
Normal file
@ -0,0 +1,77 @@
|
||||
const Discord = require('discord.js');
|
||||
const cmdprefix = process.env.CMDPREFIX || '!';
|
||||
|
||||
|
||||
module.exports = {
|
||||
name: 'help',
|
||||
description: '',
|
||||
aliases: ['hilfe'],
|
||||
usage: '',
|
||||
needs_args: false,
|
||||
async exec(message, args) {
|
||||
const Help = new Discord.MessageEmbed()
|
||||
.setColor('#0099ff')
|
||||
.setTitle('Hilfe')
|
||||
.setDescription('Das sind die Befehle, die du verwenden kannst.\n' +
|
||||
'Werte in Klammern müssen nicht mit angegeben werden.')
|
||||
|
||||
.addFields({
|
||||
name: cmdprefix + 'kopf',
|
||||
value: 'Wirf eine Münze. Kopf oder Zahl?',
|
||||
inline: false,
|
||||
}, {
|
||||
name: cmdprefix + 'roll <Anzahl> W <Augenzahl>',
|
||||
value: 'Lass die Würfel rollen. Benötigt wird die Anzahl sowie die Augenzahl auf den Würfeln.',
|
||||
inline: false,
|
||||
}, {
|
||||
name: cmdprefix + 'ep/ap <Eigenschaftswert>',
|
||||
value: ' Du machst eine Eigenschaftsprobe / Attributprobe.\n' +
|
||||
' Du würfelst mit einem W20 auf deinen Eigenschaftswert.\n' +
|
||||
' Bei einer 1 oder 20 wird der Bestätigungswurf ausgeführt.',
|
||||
inline: false,
|
||||
}, {
|
||||
name: cmdprefix + 'tp/fp <Eigenschaftswert1> <Eigenschaftswert2> <Eigenschaftswert3> (Fertigkeitswert) (+Erleichtert/-Erschwert)',
|
||||
value: ' Du machst eine Fertigkeitsprobe.\n' +
|
||||
' Es werden drei Würfel auf deine Eigenschaftswerte geworfen. Hast du Boni auf dein Talent und/oder' +
|
||||
' ist der Wurf erleichtert oder erschwert, wird dies in die Berechnung einbezogen.',
|
||||
inline: false,
|
||||
}, {
|
||||
name: cmdprefix + 'talents',
|
||||
value: ' Du erhälst eine Liste mit den Talentnamen, die du für ' +
|
||||
cmdprefix + 'talent/' + cmdprefix + 'skill nutzen kannst.',
|
||||
inline: false,
|
||||
}, {
|
||||
name: cmdprefix + 'weapons',
|
||||
value: ' Du erhälst eine Liste mit den Waffen, die du für ' +
|
||||
cmdprefix + 'attack/' + cmdprefix + 'angriff nutzen kannst.',
|
||||
inline: false,
|
||||
}, {
|
||||
name: '\u200B',
|
||||
value: '\u200B',
|
||||
}, {
|
||||
name: '\u200B',
|
||||
value: 'Wenn du mir deine .tdc Datei zusendest, kannst du folgendes nutzen:',
|
||||
}, {
|
||||
name: cmdprefix + 'attack [Waffe] (+Erleichtert/-Erschwert)',
|
||||
value: 'Du greifst mit deiner Waffe an. Es wird gleichzeitig Schaden gewürfelt, sofern dein Gegner den Schaden nicht abwenden kann.',
|
||||
inline: false,
|
||||
},{
|
||||
name: cmdprefix + 'ep/ap [Klugheit] oder ' + cmdprefix + 'ep/ap [FF]',
|
||||
value: 'siehe oben. Du brauchst deinen Wert nicht wissen.',
|
||||
inline: false,
|
||||
}, {
|
||||
name: cmdprefix + 'talent <Talentname> (+Erleichtert/-Erschwert)',
|
||||
value: 'siehe tp. Allerdings musst du deine Werte nicht wissen.',
|
||||
inline: false,
|
||||
}, {
|
||||
name: cmdprefix + 'skill <Talentname>',
|
||||
value: 'Zeigt dir deinen Fertigkeitswert im jeweiligen Talent.',
|
||||
inline: false,
|
||||
}, {
|
||||
name: cmdprefix + 'remove',
|
||||
value: 'Löscht deinen Charakter aus der Datenbank. Sinnvoll, wenn du mir eine neue zusenden möchtest.',
|
||||
inline: false,
|
||||
});
|
||||
message.author.send(Help);
|
||||
},
|
||||
};
|
64
commands/MeleeCombat.js
Normal file
64
commands/MeleeCombat.js
Normal file
@ -0,0 +1,64 @@
|
||||
const globals = require('../globals')
|
||||
const db = globals.db
|
||||
const Random = require('random')
|
||||
/*
|
||||
"meleeweapons": [{
|
||||
"amount": 1,
|
||||
"equipped": true,
|
||||
"handling": [],
|
||||
"ruleelement": {
|
||||
"id": "dolch",
|
||||
"type": "meleeweapon"
|
||||
}
|
||||
}, {
|
||||
"amount": 1,
|
||||
"equipped": true,
|
||||
"handling": [],
|
||||
"ruleelement": {
|
||||
"id": "waqqif",
|
||||
"type": "meleeweapon"
|
||||
}
|
||||
}],
|
||||
*/
|
||||
module.exports = {
|
||||
name: 'melee',
|
||||
description: 'Würfelt den Attackewert auf eine Nahkampfwaffe.',
|
||||
aliases: ['nahkampf'],
|
||||
usage: '<Waffe>',
|
||||
needs_args: true,
|
||||
|
||||
async exec(message, args) {
|
||||
try {
|
||||
db.find({
|
||||
user: message.author.tag,
|
||||
}, function(err, docs) {
|
||||
if (!docs.length > 0) {
|
||||
return message.reply(globals.Replies.find(r => r.id === 'NOENTRY').string);
|
||||
}
|
||||
else {
|
||||
|
||||
Random.use(message.author.tag);
|
||||
let dice = []
|
||||
/*for (i in docs[0].character.skills) {
|
||||
if (docs[0].character.skills[i].id == args[0]) level = docs[0].character.skills[i].level;
|
||||
}
|
||||
*/
|
||||
const Weapon = globals.MeleeWeapons.find(weapon => weapon.id === args[0])
|
||||
if(!Weapon) { return message.reply(globals.Replies.find(r => r.id === 'NO_SUCH_WEAPON').string)}
|
||||
const DieModificator = Weapon.diemodificator
|
||||
let sum = DieModificator
|
||||
for (let i = 0; i < Weapon.dice; i++) {
|
||||
dice.push(Random.int(1,6))
|
||||
}
|
||||
dice.forEach(result => {
|
||||
sum += result
|
||||
})
|
||||
message.reply('Deine 🎲: ' + dice.join(',') + '.\n' + Weapon.name + ' richtet ` ' + sum + ' ` Schaden an. (' + Weapon.dice + 'W6+' + Weapon.diemodificator +')');
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
throw e;
|
||||
}
|
||||
},
|
||||
};
|
64
commands/RangedCombat.js
Normal file
64
commands/RangedCombat.js
Normal file
@ -0,0 +1,64 @@
|
||||
const globals = require('../globals')
|
||||
const db = globals.db
|
||||
const Random = require('random')
|
||||
/*
|
||||
"meleeweapons": [{
|
||||
"amount": 1,
|
||||
"equipped": true,
|
||||
"handling": [],
|
||||
"ruleelement": {
|
||||
"id": "dolch",
|
||||
"type": "meleeweapon"
|
||||
}
|
||||
}, {
|
||||
"amount": 1,
|
||||
"equipped": true,
|
||||
"handling": [],
|
||||
"ruleelement": {
|
||||
"id": "waqqif",
|
||||
"type": "meleeweapon"
|
||||
}
|
||||
}],
|
||||
*/
|
||||
module.exports = {
|
||||
name: 'ranged',
|
||||
description: 'Würfelt den Attackewert auf eine Nahkampfwaffe.',
|
||||
aliases: ['fernkampf'],
|
||||
usage: '<Waffe>',
|
||||
needs_args: true,
|
||||
|
||||
async exec(message, args) {
|
||||
try {
|
||||
db.find({
|
||||
user: message.author.tag,
|
||||
}, function(err, docs) {
|
||||
if (!docs.length > 0) {
|
||||
return message.reply(globals.Replies.find(r => r.id === 'NOENTRY').string);
|
||||
}
|
||||
else {
|
||||
|
||||
Random.use(message.author.tag);
|
||||
let dice = []
|
||||
/*for (i in docs[0].character.skills) {
|
||||
if (docs[0].character.skills[i].id == args[0]) level = docs[0].character.skills[i].level;
|
||||
}
|
||||
*/
|
||||
const Weapon = globals.MeleeWeapons.find(weapon => weapon.id === args[0])
|
||||
if(!Weapon) { return message.reply(globals.Replies.find(r => r.id === 'NO_SUCH_WEAPON').string)}
|
||||
const DieModificator = Weapon.diemodificator
|
||||
let sum = DieModificator
|
||||
for (let i = 0; i < Weapon.dice; i++) {
|
||||
dice.push(Random.int(1,6))
|
||||
}
|
||||
dice.forEach(result => {
|
||||
sum += result
|
||||
})
|
||||
message.reply('Du schlägst mit ' + Weapon.name + ' zu. (' + Weapon.dice + 'W6+' + Weapon.diemodificator +')\nDeine 🎲: ' + dice.join(',') + '.\n' + 'Dein Angriff macht **' + sum + '** Schaden.');
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
throw e;
|
||||
}
|
||||
},
|
||||
};
|
16
commands/Remove.js
Normal file
16
commands/Remove.js
Normal file
@ -0,0 +1,16 @@
|
||||
const globals = require('../globals')
|
||||
const db = globals.db
|
||||
module.exports = {
|
||||
name: 'remove',
|
||||
description: 'Löscht deinen Charakter aus der Datenbank. Sinnvoll, wenn du mir eine neue zusenden möchtest.',
|
||||
aliases: [],
|
||||
usage: '',
|
||||
needs_args: false,
|
||||
async exec(message, args) {
|
||||
db.remove({
|
||||
user: message.author.tag,
|
||||
}, {}, function(err, numRemoved) {
|
||||
message.reply(globals.Replies.find(x => x.id === 'DELETED_DATA').string);
|
||||
});
|
||||
},
|
||||
};
|
36
commands/Roll.js
Normal file
36
commands/Roll.js
Normal file
@ -0,0 +1,36 @@
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const globals = require('../globals');
|
||||
const Random = require('random');
|
||||
|
||||
|
||||
module.exports = {
|
||||
name: 'roll',
|
||||
description: 'Lass die Würfel rollen. Benötigt wird die Anzahl sowie die Augenzahl auf den Würfeln.',
|
||||
aliases: ['r'],
|
||||
usage: '<Anzahl> w <Augenzahl>',
|
||||
needs_args: true,
|
||||
async exec(message, args) {
|
||||
|
||||
Random.use(message.author.tag);
|
||||
let msg;
|
||||
let arguments = args.join('');
|
||||
arguments = arguments.split(globals.DiceRegex);
|
||||
if (arguments.length == 2) {
|
||||
const numberOfDice = parseInt(arguments[0]);
|
||||
const diceValues = parseInt(arguments[1]);
|
||||
console.log(diceValues)
|
||||
const roll = [];
|
||||
for (let i = 0; i < numberOfDice; i++) {
|
||||
const a = Random.int(1, diceValues);
|
||||
roll.push(a);
|
||||
}
|
||||
if (numberOfDice == 1) {
|
||||
msg = 'n';
|
||||
}
|
||||
else {
|
||||
msg = ' ' + numberOfDice;
|
||||
}
|
||||
message.reply('Das sind deine Ergebnisse für deine' + msg + ' ' + diceValues + '-seitigen 🎲: ' + roll.join(', ') + '.');
|
||||
}
|
||||
},
|
||||
};
|
39
commands/Show.js
Normal file
39
commands/Show.js
Normal file
@ -0,0 +1,39 @@
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const globals = require('../globals')
|
||||
const Discord = require('discord.js')
|
||||
const db = globals.db
|
||||
|
||||
module.exports = {
|
||||
name: 'show',
|
||||
description: '',
|
||||
aliases: [],
|
||||
usage: '',
|
||||
needs_args: false,
|
||||
|
||||
async exec(message, args) {
|
||||
try {
|
||||
db.find({
|
||||
user: message.author.tag,
|
||||
}, function(err, docs) {
|
||||
if (!docs.length > 0) {
|
||||
return message.reply(globals.Replies.find(r => r.id === 'NOENTRY').string);
|
||||
}
|
||||
else {
|
||||
let gender
|
||||
if (docs[0].character.sex == 'female') { gender = '♀️' }
|
||||
else { gender = '♂️' }
|
||||
const Reply = new Discord.MessageEmbed()
|
||||
Reply.setColor('#0099ff')
|
||||
Reply.setTitle(gender + ' ' + docs[0].character.name)
|
||||
Reply.setDescription(docs[0].character.age + ' Jahre, ' + docs[0].character.race + '/' + docs[0].character.culture)
|
||||
Reply.addField(docs[0].character.professionname, docs[0].character.xp.startinglevel)
|
||||
|
||||
message.reply( Reply );
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
throw e;
|
||||
}
|
||||
},
|
||||
};
|
31
commands/Skill.js
Normal file
31
commands/Skill.js
Normal file
@ -0,0 +1,31 @@
|
||||
const globals = require('../globals')
|
||||
const db = globals.db
|
||||
module.exports = {
|
||||
name: 'skill',
|
||||
description: 'Zeigt dir deinen Fertigkeitswert im jeweiligen Talent.',
|
||||
aliases: [],
|
||||
usage: '<Fertigkeit>',
|
||||
needs_args: true,
|
||||
|
||||
async exec(message, args) {
|
||||
try {
|
||||
db.find({
|
||||
user: message.author.tag,
|
||||
}, function(err, docs) {
|
||||
if (!docs.length > 0) {
|
||||
return message.reply(globals.Replies.find(r => r.id === 'NOENTRY').string);
|
||||
}
|
||||
else {
|
||||
let level = 0;
|
||||
for (i in docs[0].character.skills) {
|
||||
if (docs[0].character.skills[i].id == args[0]) level = docs[0].character.skills[i].level;
|
||||
}
|
||||
message.reply('Du hast folgenden Talentwert in ' + args[0] + ': ' + level);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
throw e;
|
||||
}
|
||||
},
|
||||
};
|
123
commands/Talent.js
Normal file
123
commands/Talent.js
Normal file
@ -0,0 +1,123 @@
|
||||
const globals = require('../globals');
|
||||
const Random = require('random');
|
||||
const Discord = require('discord.js')
|
||||
const db = globals.db
|
||||
|
||||
module.exports = {
|
||||
name: 'talent',
|
||||
description: ' Du machst eine Fertigkeitsprobe.\n' +
|
||||
' Es werden drei Würfel auf deine Eigenschaftswerte geworfen. Hast du Boni auf dein Talent und/oder' +
|
||||
' ist der Wurf erleichtert oder erschwert, wird dies in die Berechnung einbezogen.',
|
||||
aliases: ['t'],
|
||||
usage: '<Talent> [<-Erschwernis> / <+Erleichterung>]',
|
||||
needs_args: true,
|
||||
async exec(message, args) {
|
||||
try {
|
||||
db.find({
|
||||
user: message.author.tag,
|
||||
}, function(err, docs) {
|
||||
if (!docs.length > 0) {
|
||||
return message.reply(globals.Replies.find(r => r.id === 'NOENTRY').string);
|
||||
}
|
||||
if(!isNaN(args[0])) {
|
||||
return message.reply(globals.Replies.find(x => x.id === 'WRONG_ARGUMENTS').string)
|
||||
}
|
||||
else {
|
||||
Random.use(message.author.tag);
|
||||
const values = [];
|
||||
const roll = [];
|
||||
let found = false;
|
||||
let talent;
|
||||
let bonus = 0;
|
||||
let ok = 0;
|
||||
let patzer = 0;
|
||||
let crit = 0;
|
||||
let erschwernis = 0
|
||||
|
||||
if (args[1]) {
|
||||
erschwernis = parseInt(args[1]);
|
||||
}
|
||||
|
||||
for (let i in globals.Talente) {
|
||||
if (globals.Talente[i].id.toLowerCase() == args[0].toLowerCase() || globals.Talente[i].name.toLowerCase() == args[0].toLowerCase()) {
|
||||
found = true;
|
||||
talent = globals.Talente[i].id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
message.reply(globals.Replies.find(x => x.id === 'TALENT_UNKNOWN').string);
|
||||
return;
|
||||
}
|
||||
for (let i in docs[0].character.skills) {
|
||||
if (docs[0].character.skills[i].id == talent) {
|
||||
bonus = docs[0].character.skills[i].level;
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
const bonus_orig = bonus;
|
||||
const result = globals.Talente.find(t => t.id === talent);
|
||||
|
||||
for (i in result.values) {
|
||||
const kuerzel = globals.Werte.find(wert => wert.kuerzel === result.values[i]);
|
||||
for (val in docs[0].character.attributes) {
|
||||
if (docs[0].character.attributes[val].id == kuerzel.id) values.push(docs[0].character.attributes[val].level);
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 1; i <= 3; i++) {
|
||||
roll.push(Random.int(1, 20));
|
||||
}
|
||||
// compare results
|
||||
for (let i = 0; i < 3; i++) {
|
||||
if (Math.floor(values[i] + parseInt(erschwernis)) >= roll[i]) {
|
||||
ok++;
|
||||
}
|
||||
else if ((Math.floor(values[i]) + parseInt(bonus) + parseInt(erschwernis)) >= roll[i]) {
|
||||
ok++;
|
||||
bonus = bonus - (roll[i] - parseInt(erschwernis) - values[i]);
|
||||
}
|
||||
if (roll[i] == 1) crit++;
|
||||
if (roll[i] == 20) patzer++;
|
||||
}
|
||||
const Reply = new Discord.MessageEmbed()
|
||||
Reply.setTitle('Du würfelst auf das Talent ' + result.name + '.')
|
||||
Reply.setDescription('Deine Werte für ' + result.values.join(', ') + ' sind ' + values.join(', ') + '. (Bonus: ' + bonus_orig + ')')
|
||||
Reply.addFields({
|
||||
name: 'Deine 🎲: ' + roll.join(', ') + '.',
|
||||
value: '\u200B', inline: false})
|
||||
if (patzer >= 2) {
|
||||
Reply.setColor('#900c3f')
|
||||
Reply.addFields({
|
||||
name: globals.Replies.find(x => x.id === 'TITLE_CRIT_FAILURE').string,
|
||||
value: globals.Replies.find(x => x.id === 'MSG_CRIT_FAILURE').string,
|
||||
inline: false})
|
||||
}
|
||||
else if (crit >= 2) {
|
||||
Reply.setColor('#1E8449')
|
||||
Reply.addFields({
|
||||
name: globals.Replies.find(x => x.id === 'TITLE_CRIT_SUCCESS').string,
|
||||
value:globals.Replies.find(x => x.id === 'MSG_CRIT_SUCCESS').string,
|
||||
inline: false})
|
||||
}
|
||||
else if (ok < 3) {
|
||||
Reply.addFields({name: globals.Replies.find(x => x.id === 'TITLE_FAILURE').string,
|
||||
value: 'nur ' + ok + '/3 Proben erfolgreich. 😪',
|
||||
inline: false});
|
||||
}
|
||||
else {
|
||||
Reply.addFields({name: globals.Replies.find(x => x.id === 'TITLE_SUCCESS').string,
|
||||
value: ok + '/3 Proben erfolgreich. Dein Bonus: ' + bonus + '/' + bonus_orig + '.',
|
||||
inline: false})
|
||||
}
|
||||
|
||||
message.reply(Reply)
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
throw e;
|
||||
}
|
||||
},
|
||||
};
|
36
commands/Talents.js
Normal file
36
commands/Talents.js
Normal file
@ -0,0 +1,36 @@
|
||||
const globals = require('../globals');
|
||||
const Discord = require('discord.js');
|
||||
|
||||
|
||||
module.exports = {
|
||||
name: 'talents',
|
||||
description: '',
|
||||
aliases: [],
|
||||
usage: '',
|
||||
needs_args: false,
|
||||
|
||||
async exec(message, args) {
|
||||
const fields = [];
|
||||
for (const i in globals.TalentKategorien) {
|
||||
const ability = [];
|
||||
for (const a in globals.Talente) {
|
||||
if (globals.Talente[a].categoryid == i) {
|
||||
ability.push(globals.Talente[a].id.charAt(0).toUpperCase() + globals.Talente[a].id.slice(1));
|
||||
}
|
||||
}
|
||||
ability.sort();
|
||||
fields.push(ability);
|
||||
}
|
||||
|
||||
const Embed = new Discord.MessageEmbed()
|
||||
.setColor('#0099ff')
|
||||
.setTitle('Talentübersicht')
|
||||
.setDescription('Das sind die Talente, die ich kenne:');
|
||||
for (const i in fields) {
|
||||
Embed.addField(globals.TalentKategorien[i], fields[i].join('\n'), true);
|
||||
}
|
||||
message.author.send(
|
||||
Embed,
|
||||
);
|
||||
},
|
||||
};
|
83
commands/Tp.js
Normal file
83
commands/Tp.js
Normal file
@ -0,0 +1,83 @@
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const Random = require('random');
|
||||
const globals = require('../globals')
|
||||
const Discord = require('discord.js')
|
||||
|
||||
module.exports = {
|
||||
name: 'tp',
|
||||
description: 'Du machst eine Fertigkeitsprobe.\n' +
|
||||
' Es werden drei Würfel auf deine Eigenschaftswerte geworfen. Hast du Boni auf dein Talent und/oder' +
|
||||
' ist der Wurf erleichtert oder erschwert, wird dies in die Berechnung einbezogen.',
|
||||
aliases: ['talentprobe'],
|
||||
usage: '<Eigenschaftswert1> <Eigenschaftswert2> <Eigenschaftswert3> [<Fertigkeitswert>] [<-Erschwernis> / <+Erleichterung>]',
|
||||
needs_args: true,
|
||||
|
||||
async exec(message, args) {
|
||||
|
||||
if(isNaN(args[0])) {
|
||||
return message.reply(globals.Replies.find(x => x.id === 'WRONG_ARGUMENTS').string)
|
||||
}
|
||||
|
||||
Random.use(message.author.tag);
|
||||
const roll = [];
|
||||
let bonus = 0
|
||||
let bonus_orig = 0
|
||||
let erschwernis = 0
|
||||
if (args[3]) {
|
||||
bonus_orig = parseInt(args[3]);
|
||||
bonus = bonus_orig
|
||||
}
|
||||
if (args[4]) {
|
||||
erschwernis = parseInt(args[4]);
|
||||
}
|
||||
for (let i = 1; i <= 3; i++) {
|
||||
roll.push(Random.int(1, 20));
|
||||
}
|
||||
let ok = 0;
|
||||
let patzer = 0;
|
||||
let crit = 0;
|
||||
for (let i = 0; i < 3; i++) {
|
||||
if (Math.floor(parseInt(args[i]) + parseInt(erschwernis)) >= roll[i]) {
|
||||
ok++;
|
||||
} else if (
|
||||
Math.floor(parseInt(args[i]) + parseInt(bonus) + parseInt(erschwernis)) >= roll[i]) {
|
||||
ok++;
|
||||
bonus = bonus - (roll[i] - parseInt(erschwernis) - parseInt(args[i]));
|
||||
}
|
||||
if (roll[i] == 1) crit++;
|
||||
if (roll[i] == 20) patzer++;
|
||||
}
|
||||
|
||||
const Reply = new Discord.MessageEmbed()
|
||||
//Reply.setTitle('Du würfelst auf ' + args[0] + ' ' + args[1] + ' ' + args[2] + ' (Bonus: ' + bonus_orig + ')')
|
||||
Reply.setTitle('Deine 🎲: ' + roll.join(', ') + '.')
|
||||
if (patzer >= 2) {
|
||||
Reply.setColor('#900c3f')
|
||||
Reply.addFields({
|
||||
name: globals.Replies.find(x => x.id === 'TITLE_CRIT_FAILURE').string,
|
||||
value: globals.Replies.find(x => x.id === 'MSG_CRIT_FAILURE').string,
|
||||
inline: false
|
||||
})
|
||||
} else if (crit >= 2) {
|
||||
Reply.setColor('#1E8449')
|
||||
Reply.addFields({
|
||||
name: globals.Replies.find(x => x.id === 'TITLE_CRIT_SUCCESS').string,
|
||||
value: globals.Replies.find(x => x.id === 'MSG_CRIT_SUCCESS').string,
|
||||
inline: false
|
||||
})
|
||||
} else if (ok < 3) {
|
||||
Reply.addFields({
|
||||
name: globals.Replies.find(x => x.id === 'TITLE_FAILURE').string,
|
||||
value: 'Nur ' + ok + '/3 Proben erfolgreich. 😪',
|
||||
inline: false
|
||||
})
|
||||
} else {
|
||||
Reply.addFields({
|
||||
name: globals.Replies.find(x => x.id === 'TITLE_SUCCESS').string,
|
||||
value: ok + '/3 Proben erfolgreich. Dein Bonus: ' + bonus + '/' + bonus_orig + '.',
|
||||
inline: false
|
||||
})
|
||||
}
|
||||
message.reply(Reply)
|
||||
}
|
||||
}
|
36
commands/Weapons.js
Normal file
36
commands/Weapons.js
Normal file
@ -0,0 +1,36 @@
|
||||
const globals = require('../globals');
|
||||
const Discord = require('discord.js');
|
||||
|
||||
|
||||
module.exports = {
|
||||
name: 'weapons',
|
||||
description: 'Listet eine Übersicht, welche für einen Angriff genutzt werden können.',
|
||||
aliases: ['waffen'],
|
||||
usage: '',
|
||||
needs_args: false,
|
||||
|
||||
async exec(message, args) {
|
||||
let fields = [];
|
||||
for (let CombatTechnique in globals.CombatTechniques) {
|
||||
let Weapons = [];
|
||||
for (let Weapon in globals.Weapons) {
|
||||
if (globals.Weapons[Weapon].combattechnique == globals.CombatTechniques[CombatTechnique].id) {
|
||||
Weapons.push(globals.Weapons[Weapon].id.charAt(0).toUpperCase() + globals.Weapons[Weapon].id.slice(1));
|
||||
}
|
||||
}
|
||||
Weapons.sort();
|
||||
fields.push(Weapons);
|
||||
}
|
||||
|
||||
const Embed = new Discord.MessageEmbed()
|
||||
.setColor('#0099ff')
|
||||
.setTitle('Waffenübersicht')
|
||||
.setDescription('Folgende Waffen können für einen Angriff genutzt werden:');
|
||||
for (let i in fields) {
|
||||
Embed.addField(globals.CombatTechniques[i].name, fields[i].join('\n'), true);
|
||||
}
|
||||
message.author.send(
|
||||
Embed,
|
||||
);
|
||||
},
|
||||
};
|
121
globals.js
121
globals.js
@ -93,6 +93,23 @@ const Talente = [
|
||||
|
||||
];
|
||||
|
||||
const CombatTechniques = [
|
||||
{ id: 'armbrueste', name: 'Armbrüste', Leiteigenschaft: ['FF'] },
|
||||
{ id: 'boegen', name: 'Bögen', Leiteigenschaft: ['FF']},
|
||||
{ id: 'dolche', name: 'Dolche', Leiteigenschaft: ['GE']},
|
||||
{ id: 'fechtwaffen', name: 'Fechtwaffen', Leiteigenschaft: ['GE']},
|
||||
{ id: 'hiebwaffen', name: 'Hiebwaffen', Leiteigenschaft: ['KK']},
|
||||
{ id: 'kettenwaffen', name: 'Kettenwaffen', Leiteigenschaft: ['KK']},
|
||||
{ id: 'lanzen', name: 'Lanzen', Leiteigenschaft: ['KK']},
|
||||
{ id: 'raufen', name: 'Raufen', Leiteigenschaft: ['GE', 'KK']},
|
||||
{ id: 'schilde', name: 'Schilde', Leiteigenschaft: ['KK']},
|
||||
{ id: 'schwerter', name: 'Schwerter', Leiteigenschaft: ['GE', 'KK']},
|
||||
{ id: 'stangenwaffen', name: 'Stangenwaffen', Leiteigenschaft: ['GE', 'KK']},
|
||||
{ id: 'wurfwaffen', name: 'Wurfwaffen', Leiteigenschaft: ['FF']},
|
||||
{ id: 'zweihandhiebwaffen', name: 'Zweihandhiebwaffen', Leiteigenschaft: ['KK']},
|
||||
{ id: 'zweihandschwerter', name: 'Zweihandschwerter', Leiteigenschaft: ['KK']}
|
||||
];
|
||||
|
||||
const Replies = [
|
||||
{ id: 'NOENTRY', string: 'Sorry, für dich habe ich leider keinen Eintrag 😥' },
|
||||
{ id: 'ERROR', string: 'Irgendwas ist schief gelaufen. 🤔'},
|
||||
@ -108,8 +125,108 @@ const Replies = [
|
||||
{ id: 'TOO_FEW_ARGS', string: 'Du hast zu wenig Angaben gemacht. Probiere es einmal so:\n'},
|
||||
{ id: 'SAVED_DATA', string: 'Ich habe deine Daten abgespeichert.'},
|
||||
{ id: 'DELETED_DATA', string: 'Ich habe deine Daten entfernt.'},
|
||||
{ id: 'TALENT_UNKNOWN', string: 'Das Talent ist mir unbekannt.'}
|
||||
{ id: 'TALENT_UNKNOWN', string: 'Das Talent ist mir unbekannt.'},
|
||||
{ id: 'NO_SUCH_WEAPON', string: 'Diese Waffe gibt es nicht.'},
|
||||
{ id: 'COMBAT_CRIT_SUCCESS',string: 'Kritischer Treffer 🎈✨🥳! Der Verteidigungswert deines Gegners halbiert sich!\n'},
|
||||
{ id: 'COMBAT_CRIT_FAIL', string: 'Patzer 😪! Du erleidest 1W6+2 Schadenspunkte.'},
|
||||
{ id: 'COMBAT_FAIL', string: 'Leider gelingt dir kein Treffer.'},
|
||||
{ id: 'COMBAT_SUCCESS', string: 'Dir gelingt ein Treffer.'},
|
||||
{ id: 'COMBAT_DOUBLEDAMAGE',string: 'Zusätzlich wird sämtlicher Schaden verdoppelt!\n'},
|
||||
{ id: 'TALENT_UNKNOWN', string: 'Das Talent ist mir unbekannt.'}
|
||||
]
|
||||
];
|
||||
const Declination = ['dem', 'der', 'dem', ''] // Maskulinum, Feminimum, Neutrum, None
|
||||
const Articles = ['Der','Die','Das','']
|
||||
const MeleeWeapons = [
|
||||
{ id: 'basiliskenzunge', name: 'Basiliskenzunge', dice: 1, diemodificator: 2, at_mod: 0, pa_mod: -1, article: 1, combattechnique: 'dolche' },
|
||||
{ id: 'dolch', name: 'Dolch', dice: 1, diemodificator: 1, at_mod: 0, pa_mod: 0, article: 0, combattechnique: 'dolche' },
|
||||
{ id: 'drachenzahn', name: 'Drachenzahn', dice: 1, diemodificator: 2, at_mod: 0, pa_mod: -1, article: 0, combattechnique: 'dolche' },
|
||||
{ id: 'linkhand', name: 'Linkhand', dice: 1, diemodificator: 1, at_mod: 0, pa_mod: 0, article: 3, combattechnique: 'dolche' },
|
||||
{ id: 'messer', name: 'Messer', dice: 1, diemodificator: 1, at_mod: 0, pa_mod: -2, article: 2, combattechnique: 'dolche' },
|
||||
{ id: 'schwererdolch', name: 'Schwerer Dolch', dice: 1, diemodificator: 2, at_mod: 0, pa_mod: -1, article: 0, combattechnique: 'dolche' },
|
||||
{ id: 'waqqif', name: 'Waqqif', dice: 1, diemodificator: 2, at_mod: 0, pa_mod: -1, article: 0, combattechnique: 'dolche' },
|
||||
|
||||
module.exports = { Werte, Talente, Coin, TalentKategorien, DiceRegex, Discord, MessageEmbed, db, Replies };
|
||||
{ id: 'florett', name: 'Florett', dice: 1, diemodificator: 2, at_mod: 1, pa_mod: 0, article: 2, combattechnique: 'fechtwaffen' },
|
||||
{ id: 'rapier', name: 'Rapier', dice: 1, diemodificator: 3, at_mod: 1, pa_mod: 0, article: 2, combattechnique: 'fechtwaffen' },
|
||||
{ id: 'wolfsmesser', name: 'Wolfsmesser', dice: 1, diemodificator: 3, at_mod: 1, pa_mod: 1, article: 2, combattechnique: 'fechtwaffen' },
|
||||
|
||||
{ id: 'brabakbengel', name: 'Brabakbengel', dice: 1, diemodificator: 5, at_mod: -1, pa_mod: -2, article: 0, combattechnique: 'hiebwaffen'},
|
||||
{ id: 'keule', name: 'Keule', dice: 1, diemodificator: 3, at_mod: 0, pa_mod: -1, article: 1, combattechnique: 'hiebwaffen'},
|
||||
{ id: 'knueppel', name: 'Knüppel', dice: 1, diemodificator: 2, at_mod: 0, pa_mod: -2, article: 0, combattechnique: 'hiebwaffen'},
|
||||
{ id: 'lindwurmschlaeger', name: 'Lindwurmschläger', dice: 1, diemodificator: 4, at_mod: 0, pa_mod: -1, article: 0, combattechnique: 'hiebwaffen'},
|
||||
{ id: 'magierstabkurz', name: 'Magierstab: Kurz', dice: 1, diemodificator: 1, at_mod: 0, pa_mod: -1, article: 0, combattechnique: 'hiebwaffen'},
|
||||
{ id: 'magierstabmittel', name: 'Magierstab: Lang', dice: 1, diemodificator: 2, at_mod: 0, pa_mod: -1, article: 0, combattechnique: 'hiebwaffen'},
|
||||
{ id: 'molokdeschnaja', name: 'Molokdeschnaja', dice: 1, diemodificator: 4, at_mod: 0, pa_mod: -1, article: 3, combattechnique: 'hiebwaffen'},
|
||||
{ id: 'orknase', name: 'Orknase', dice: 1, diemodificator: 5, at_mod: -1, pa_mod: -2, article: 1, combattechnique: 'hiebwaffen'},
|
||||
{ id: 'rabenschnabel', name: 'Rabenschnabel', dice: 1, diemodificator: 4, at_mod: 0, pa_mod: -1, article: 3, combattechnique: 'hiebwaffen'},
|
||||
{ id: 'sonnenzepter', name: 'Sonnenzepter', dice: 1, diemodificator: 3, at_mod: 0, pa_mod: -1, article: 2, combattechnique: 'hiebwaffen'},
|
||||
{ id: 'streitaxt', name: 'Streitaxt', dice: 1, diemodificator: 4, at_mod: 0, pa_mod: -1, article: 1, combattechnique: 'hiebwaffen'},
|
||||
{ id: 'streitkolben', name: 'Streitkolben', dice: 1, diemodificator: 4, at_mod: 0, pa_mod: -1, article: 0, combattechnique: 'hiebwaffen'},
|
||||
|
||||
{ id: 'morgenstern', name: 'Morgenstern', dice: 1, diemodificator: 5, at_mod: 0, pa_mod: null, article: 0, combattechnique: 'kettenwaffen' },
|
||||
|
||||
{ id: 'kriegslanze', name: 'Kriegslanze', dice: 2, diemodificator: 6, at_mod: null, pa_mod: null, article: 1, combattechnique: 'lanzen' },
|
||||
|
||||
{ id: 'schlagring', name: 'Schlagring', dice: 1, diemodificator: 1, at_mod: 0, pa_mod: 0, article: 0, combattechnique: 'raufen'},
|
||||
{ id: 'waffenlos', name: 'Waffenlos', dice: 1, diemodificator: 0, at_mod: 0, pa_mod: 0, article: 3, combattechnique: 'raufen'},
|
||||
|
||||
{ id: 'holzschild', name: 'Holzschild', dice: 1, diemodificator: 0, at_mod: -4, pa_mod: 1, article: 2, combattechnique: 'schilde'},
|
||||
{ id: 'lederschild', name: 'Lederschild', dice: 1, diemodificator: 0, at_mod: -4, pa_mod: 1, article: 2, combattechnique: 'schilde'},
|
||||
{ id: 'thorwalerschild', name: 'Thorwalerschild', dice: 1, diemodificator: 1, at_mod: -5, pa_mod: 2, article: 2, combattechnique: 'schilde'},
|
||||
{ id: 'grossschild', name: 'Großschild', dice: 1, diemodificator: 1, at_mod: -6, pa_mod: 3, article: 2, combattechnique: 'schilde'},
|
||||
|
||||
{ id: 'barbarenschwert', name: 'Barbarenschwert', dice: 1, diemodificator: 5, at_mod: -1, pa_mod: -1, article: 2, combattechnique: 'schwerter'},
|
||||
{ id: 'entermesser', name: 'Entermesser', dice: 1, diemodificator: 3, at_mod: 0, pa_mod: -1, article: 2, combattechnique: 'schwerter'},
|
||||
{ id: 'haumesser', name: 'Haumesser', dice: 1, diemodificator: 3, at_mod: 0, pa_mod: -1, article: 2, combattechnique: 'schwerter'},
|
||||
{ id: 'khunchomer', name: 'Khunchomer', dice: 1, diemodificator: 4, at_mod: 0, pa_mod: 0, article: 3, combattechnique: 'schwerter'},
|
||||
{ id: 'kurzschwert', name: 'Kurzschwert', dice: 1, diemodificator: 2, at_mod: 0, pa_mod: 0, article: 2, combattechnique: 'schwerter'},
|
||||
{ id: 'langschwert', name: 'Langschwert', dice: 1, diemodificator: 4, at_mod: 0, pa_mod: 0, article: 2, combattechnique: 'schwerter'},
|
||||
{ id: 'robbentoeter', name: 'Robbentöter', dice: 1, diemodificator: 4, at_mod: 0, pa_mod: 0, article: 0, combattechnique: 'schwerter'},
|
||||
{ id: 'saebel', name: 'Säbel', dice: 1, diemodificator: 3, at_mod: 0, pa_mod: 0, article: 0, combattechnique: 'schwerter'},
|
||||
{ id: 'sklaventod', name: 'Sklaventod', dice: 1, diemodificator: 4, at_mod: 0, pa_mod: 0, article: 3, combattechnique: 'schwerter'},
|
||||
|
||||
{ id: 'dreizack', name: 'Dreizack', dice: 1, diemodificator: 4, at_mod: 0, pa_mod: 0, article: 1, combattechnique: 'stangenwaffen'},
|
||||
{ id: 'dschadra', name: 'Dschadra', dice: 1, diemodificator: 5, at_mod: 0, pa_mod: -1, article: 3, combattechnique: 'stangenwaffen'},
|
||||
{ id: 'hellebarde', name: 'Hellebarde', dice: 1, diemodificator: 6, at_mod: 0, pa_mod: -1, article: 1, combattechnique: 'stangenwaffen'},
|
||||
{ id: 'holzspeer', name: 'Holzspeer', dice: 1, diemodificator: 2, at_mod: 0, pa_mod: 0, article: 0, combattechnique: 'stangenwaffen'},
|
||||
{ id: 'kampfstab', name: 'Kampfstab', dice: 1, diemodificator: 2, at_mod: 0, pa_mod: 2, article: 0, combattechnique: 'stangenwaffen'},
|
||||
{ id: 'magierstablang', name: 'Magierstab: Lang', dice: 1, diemodificator: 2, at_mod: -1, pa_mod: 2, article: 0, combattechnique: 'stangenwaffen'},
|
||||
{ id: 'speer', name: 'Speer', dice: 1, diemodificator: 4, at_mod: 0, pa_mod: 0, article: 0, combattechnique: 'stangenwaffen'},
|
||||
{ id: 'zweililien', name: 'Zweililien', dice: 1, diemodificator: 4, at_mod: 0, pa_mod: 0, article: 3, combattechnique: 'stangenwaffen'},
|
||||
|
||||
{ id: 'anderthalbhaender', name: 'Anderthalbhänder', dice: 1, diemodificator: 6, at_mod: 0, pa_mod: 0, article: 0, combattechnique: 'zweihandschwerter'},
|
||||
{ id: 'doppelkhunchomer', name: 'Doppelkhunchomer', dice: 2, diemodificator: 3, at_mod: 0, pa_mod: -2, article: 3, combattechnique: 'zweihandschwerter'},
|
||||
{ id: 'grossersklaventod', name: 'Großer Sklaventod', dice: 2, diemodificator: 6, at_mod: 0, pa_mod: -2, article: 3, combattechnique: 'zweihandschwerter'},
|
||||
{ id: 'tuzakmesser', name: 'Tuzakmesser', dice: 2, diemodificator: 2, at_mod: 0, pa_mod: -1, article: 2, combattechnique: 'zweihandschwerter'},
|
||||
{ id: 'rondrakamm', name: 'Rondrakamm', dice: 2, diemodificator: 6, at_mod: 0, pa_mod: 0, article: 3, combattechnique: 'zweihandschwerter'},
|
||||
{ id: 'zweihaender', name: 'Zweihänder', dice: 2, diemodificator: 4, at_mod: 0, pa_mod: -3, article: 0, combattechnique: 'zweihandschwerter'},
|
||||
|
||||
{ id: 'barbarenstreitaxt', name: 'Barbarenstreitaxt', dice: 2, diemodificator: 4, at_mod: 0, pa_mod: -4, article: 1, combattechnique: 'zweihandhiebwaffen'},
|
||||
{ id: 'felsspalter', name: 'Felsspalter', dice: 2, diemodificator: 2, at_mod: 0, pa_mod: -2, article: 0, combattechnique: 'zweihandhiebwaffen'},
|
||||
{ id: 'kriegshammer', name: 'Kriegshammer', dice: 2, diemodificator: 3, at_mod: 0, pa_mod: -3, article: 0, combattechnique: 'zweihandhiebwaffen'},
|
||||
{ id: 'zwergenschlaegel', name: 'Zwergenschlägel', dice: 1, diemodificator: 6, at_mod: 0, pa_mod: -1, article: 0, combattechnique: 'zweihandhiebwaffen'},
|
||||
]
|
||||
const RangedWeapons = [
|
||||
|
||||
{ id: 'balestrina', name: 'Balestrina', dice: 1, diemodificator: 4, article: 1, combattechnique: 'armbrueste'},
|
||||
{ id: 'eisenwalder', name: 'Eisenwalder', dice: 1, diemodificator: 4, article: 0, combattechnique: 'armbrueste'},
|
||||
{ id: 'handarmbrust', name: 'Handarmbrust', dice: 1, diemodificator: 3, article: 1, combattechnique: 'armbrueste'},
|
||||
{ id: 'leichtearmbrust', name: 'Leichte Armbrust', dice: 1, diemodificator: 6, article: 1, combattechnique: 'armbrueste'},
|
||||
{ id: 'schwerearmbrust', name: 'Schwere Armbrust', dice: 2, diemodificator: 6, article: 1, combattechnique: 'armbrueste'},
|
||||
{ id: 'elfenbogen', name: 'Elfenbogen', dice: 1, diemodificator: 5, article: 0, combattechnique: 'boegen'},
|
||||
{ id: 'kompositbogen', name: 'Kompositbogen', dice: 1, diemodificator: 7, article: 0, combattechnique: 'boegen'},
|
||||
{ id: 'kurzbogen', name: 'kurzbogen', dice: 1, diemodificator: 4, article: 0, combattechnique: 'boegen'},
|
||||
{ id: 'langbogen', name: 'langbogen', dice: 1, diemodificator: 8, article: 0, combattechnique: 'boegen'},
|
||||
{ id: 'schneidzahn', name: 'Schneidzahn', dice: 1, diemodificator: 4, article: 3, combattechnique: 'wurfwaffen'},
|
||||
{ id: 'stein', name: 'Stein', dice: 1, diemodificator: 0, article: 0, combattechnique: 'wurfwaffen'},
|
||||
{ id: 'wurfbeil', name: 'Wurfbeil', dice: 1, diemodificator: 3, article: 0, combattechnique: 'wurfwaffen'},
|
||||
{ id: 'wurfdolch', name: 'Wurfdolch', dice: 1, diemodificator: 1, article: 0, combattechnique: 'wurfwaffen'},
|
||||
{ id: 'wurfkeule', name: 'Wurfkeule', dice: 1, diemodificator: 2, article: 1, combattechnique: 'wurfwaffen'},
|
||||
{ id: 'wurfring', name: 'Wurfring', dice: 1, diemodificator: 1, article: 0, combattechnique: 'wurfwaffen'},
|
||||
{ id: 'wurfscheibe', name: 'Wurfscheibe', dice: 1, diemodificator: 1, article: 1, combattechnique: 'wurfwaffen'},
|
||||
{ id: 'wurfstern', name: 'Wurfstern', dice: 1, diemodificator: 1, article: 0, combattechnique: 'wurfwaffen'},
|
||||
{ id: 'wurfspeer', name: 'Wurfspeer', dice: 1, diemodificator: 2, article: 0, combattechnique: 'wurfwaffen'}
|
||||
]
|
||||
const Weapons = MeleeWeapons.concat(RangedWeapons)
|
||||
module.exports = { Werte, Talente, Coin, TalentKategorien, DiceRegex, Discord, MessageEmbed, db, Replies, MeleeWeapons, Weapons, RangedWeapons, CombatTechniques, Articles, Declination };
|
||||
|
||||
|
5
index.js
5
index.js
@ -72,11 +72,6 @@ async function CreateFromFile(message, data) {
|
||||
if (!docs.length > 0) {
|
||||
db.insert({
|
||||
user: message.author.tag,
|
||||
gold: 0,
|
||||
silver: 0,
|
||||
bronce: 0,
|
||||
iron: 0,
|
||||
hp: 0,
|
||||
character: data,
|
||||
}, function(err, docs) {
|
||||
message.reply(globals.Replies.find(r => r.id === 'SAVED_DATA').string);
|
||||
|
Reference in New Issue
Block a user