added _some_ chants, restructuring data from spells

This commit is contained in:
2021-04-26 07:54:58 +02:00
parent e65715cce6
commit cee6fee5a3
11 changed files with 1854 additions and 555 deletions

17
.gitignore vendored
View File

@ -1,10 +1,15 @@
node_modules
/node_modules/
.env
.eslintrc.js
.eslintrc.json
.vscode
.github
data/dsabot.db
data/dsabot.db~
private
.jshint
.prettierrc
/.vscode/
/.github/
.DS_Store
Thumbs.db
/data/dsabot.db
!/data/*.js
!/data/*.json
/private

View File

@ -1,3 +1,4 @@
//const globals = require('../globals');
const globals = require('../globals');
const db = globals.db;
const { findMessage } = require('@dsabot/findMessage');
@ -22,8 +23,8 @@ module.exports = {
} else {
Character = docs[0].character;
if (args.length === 0) {
console.log(ReplySpellList(createSpellList(Character)));
return message.reply(ReplySpellList(createSpellList(Character)));
//console.log(ReplySpellList(createSpellList(Character)));
return message.reply(ReplySpellList(createSpellList(Character))); //?+
} else {
const Spell = getSpell({
Character: Character,
@ -32,9 +33,9 @@ module.exports = {
if (!Spell) {
return message.reply(findMessage('SPELL_UNKNOWN'));
}
return message.reply(
`Du hast folgenden Wert in **${Spell.Name}**: ${Spell.Level}`
);
return message.reply(ReplySpell(Spell));
// `Du hast folgenden Wert in **${Spell.Name}**: ${Spell.Level}`
//);
}
}
}
@ -52,8 +53,9 @@ const ReplySpellList = (SpellList = []) => {
const ReplySpell = (Spell = {}) => {
if (!Spell) return;
return `
${Spell.Name}
return `Deine Werte für ${Spell.Name} (${Spell.Level}) sind:
${Spell.Attributes.map(attribute => `${attribute.Name}: ${attribute.Level}`).join(' ')}
`;
};
@ -63,11 +65,12 @@ const createSpellList = (Character = {}) => {
Character.spells.forEach(spell =>
SpellList.push(getSpell({ Character: Character, spell_name: spell.id }))
);
return SpellList.filter(value => value !== undefined);
return SpellList.filter(value => value !== undefined); //?+
};
const s = require('./Spells');
const user = 'hmpf1992#1074';
//const user = 'Jens#5449';
const message = {
author: {
tag: user,
@ -76,5 +79,14 @@ const message = {
console.log(e);
},
};
const args = [];
const args = ['armatrutz'];
s.exec(message, args);
const createChantList = (Character = {}) => {
if (!Character || !Character.hasOwnProperty('chants')) return;
let ChantList = [];
Character.chants.forEach(chant =>
ChantList.push(getChant({ Character: Character, spell_name: chant.id }))
);
return ChantList.filter(value => value !== undefined); //?+
};

423
data/Chants.js Normal file
View File

@ -0,0 +1,423 @@
const Chants = [
{
id: 'bannderdunkelheit',
name: 'Bann der Dunkelheit',
attributes: ['MU', 'KL', 'CH'],
cost: {
initial: 4,
additional: { amount: 2, interval: 1, unit: 'Minute' },
},
effect: {
description:
'Aus der Hand des Geweihten strahlt ein helles Licht. Das Licht zählt regeltechnisch als Sonnenlicht.',
duration: { amount: 1, modifier: null, unit: 'Minute' },
unit: null,
},
chant: {
duration: { amount: 1, unit: 'Aktion' },
type: 'Chant',
property: '',
},
},
{
id: 'bannderfurcht',
name: 'Bann der Furcht',
attributes: ['IN', 'CH', 'CH'],
cost: {
initial: 8,
additional: {},
},
effect: {
description:
'Durch diese Liturgie wird pro QS eine Stufe des Zustands Furcht aufgehoben.',
duration: {},
unit: null,
},
chant: {
duration: { amount: 2, unit: 'Aktionen' },
type: 'Chant',
property: '',
},
},
{
id: 'banndeslichts',
name: 'Bann des Lichts',
attributes: ['MU', 'KL', 'CH'],
cost: {
initial: 16,
additional: { amount: 8, interval: 5, unit: 'Minuten' },
},
effect: {
description:
'Um den Geweihten herum bildet sich eine Kugel aus Dunkelheit mit einem Durchmesser von QS x 3 Schritt. Pro QS erschweren sich die Sichtverhältnisse um eine Stufe. Natürliche und magische Lichtquellen können die Dunkelheit nicht erhellen. Bei karmalen Lichtquellen entscheidet die höhere QS (wie bei einer Vergleichsprobe), ob das Licht zu sehen ist oder nicht. Hierbei gilt alles oder nichts Das Licht wird nicht um die QS der Liturgie gedämpft, sondern die höhere QS entscheidet darüber ob Licht zu sehen ist oder nicht. Für den Geweihten werden die Sichtverhältnisse durch die Liturgie nicht erschwert. Der Geweihte muss vor dem Wirken der Liturgie entscheiden, ob die Zone der Dunkelheit an Ort und Stelle verbleiben oder sich mit ihm als Zentrum bewegen soll.',
duration: { amount: 5, modifier: null, unit: 'Minuten' },
unit: null,
},
chant: {
duration: { amount: 4, unit: 'Aktionen' },
type: 'Chant',
property: '',
},
},
{
id: 'blendstrahl',
name: 'Blendstrahl',
attributes: ['MU', 'KL', 'IN'],
cost: {
initial: 4,
additional: {},
},
effect: {
description:
'Der Betroffene wird geblendet. Es erhält eine Stufe des Zustands Verwirrung.',
duration: { amount: 1, modifier: 'QS', unit: 'Kampfrunden' },
unit: null,
},
chant: {
duration: { amount: 1, unit: 'Aktion' },
type: 'Chant',
property: '',
},
},
{
id: 'ehrenhaftigkeit',
name: 'Ehrenhaftigkeit',
attributes: ['MU', 'IN', 'CH'],
cost: {
initial: 8,
additional: {},
},
effect: {
description:
'Ehrenhaft bedeutet in diesem Fall, dass der Betroffene sich an die Gebote des Geweihten hält. Dies kann je nach Auslegung und Kultur bedeuten, dass der Betroffene bei Patzern des Gegners auf weitere Angriffe verzichtet, nicht von hinten angreift, dem Gegner die Chance gibt, eine verlorene Waffe wieder aufzusammeln, auf Waffengifte verzichtet usw.',
duration: { amount: 3, modifier: 'QS', unit: 'Minuten' },
unit: null,
},
chant: {
duration: { amount: 4, unit: 'Aktionen' },
type: 'Chant',
property: '',
},
},
{
id: 'entzifferung',
name: 'Entzifferung',
attributes: ['KL', 'KL', 'IN'],
cost: {
initial: 4,
additional: {},
},
effect: {
description:
'Die Textmenge richtet sich nach der QS. Für jede QS kann er fünf Foliantenseiten in normaler Schriftgröße entziffern.',
duration: { amount: 3, modifier: 'QS', unit: 'Minuten' },
unit: null,
},
chant: {
duration: { amount: 8, unit: 'Aktionen' },
type: 'Chant',
property: '',
},
},
{
id: 'ermutigung',
name: 'Ermutigung',
attributes: ['MU', 'IN', 'CH'],
cost: {
initial: 4,
additional: {},
},
effect: {
description:
'Das Ziel wird zuversichtlicher und mutiger. Je nach QS erhält es verschiedene Boni. Die Boni sind kumulativ, d.h. bei QS 3 hat das Ziel insgesamt MU +2 und AT +1.',
duration: { amount: 3, modifier: 'QS', unit: 'Minuten' },
unit: null,
},
chant: {
duration: { amount: 8, unit: 'Aktionen' },
type: 'Chant',
property: '',
},
},
{
id: 'fallinsnichts',
name: 'Fall ins Nichts',
attributes: ['MU', 'IN', 'GE'],
cost: {
initial: 8,
additional: {},
},
effect: {
description: 'Für jede QS kann der Geweihte drei Schritt Fallschaden ignorieren.',
duration: { amount: 3, modifier: 'QS', unit: 'Kampfrunden' },
unit: null,
},
chant: {
duration: { amount: 1, unit: 'Aktion' },
type: 'Chant',
property: '',
},
},
{
id: 'friedvolleaura',
name: 'Friedvolle Aura',
attributes: ['MU', 'IN', 'CH'],
cost: {
initial: 8,
additional: {},
},
effect: {
description:
'Um den Geweihten anzugreifen, ist eine Probe auf Willenskraft (Bedrohungen standhalten) des Gegners notwendig, bei der er mehr QS haben muss als der Geweihte. Ist diese Probe nicht erfolgreich, kann der Angriff nicht ausgeführt werden. Gelingt sie, so ist die Attacke gegen den Geweihten dennoch um QS der Liturgie erschwert. Die Wirkung der Liturgie bezieht sich nur auf den Geweihten. Während der Wirkung der Liturgie kann der Geweihte keine Angriffe (Attacke, Fernkampf) oder sonstige offensive Handlungen gegen seine Feinde ausführen, wohl aber seine Kampfgefährten mit Handlungen unterstützen.',
duration: { amount: 3, modifier: 'QS', unit: 'Kampfrunden' },
unit: null,
},
chant: {
duration: { amount: 1, unit: 'Aktion' },
type: 'Chant',
property: '',
},
},
{
id: 'giftbann',
name: 'Giftbann',
attributes: ['KL', 'IN', 'CH'],
cost: {
initial: 2,
additional: { amount: 2, interval: 1, unit: 'Giftstufe(n)' },
},
effect: {
description:
'Der Giftbann neutralisiert ein Gift. Die maximale Giftstufe darf die QS nicht übersteigen, sonst wirkt die Liturgie nicht und gilt als misslungen.',
duration: { amount: 3, modifier: 'QS', unit: 'Kampfrunden' },
unit: null,
},
chant: {
duration: { amount: 4, unit: 'Aktionen' },
type: 'Chant',
property: '',
},
},
{
id: 'goettlicherfingerzeig',
name: 'Göttlicher Fingerzeig',
attributes: ['KL', 'IN', 'IN'],
cost: {
initial: 8,
additional: {},
},
effect: {
description:
'Voraussetzung ist, dass ein solcher Gegenstand überhaupt in Reichweite liegt. Dies kann z. B. ein verborgener Schlüssel für eine Truhe, ein Zettel mit Hinweisen oder ein benötigtes improvisiertes Werkzeug sein. Ist der Gegenstand durch Magie oder karmales Wirken verborgen, kann der Geweihte das Objekt nicht mittels dieser Liturgie entdecken. Der Gegenstand darf sich maximal QS Schritt vom Geweihten entfernt.',
duration: { amount: 1, modifier: null, unit: 'Minute' },
unit: null,
},
chant: {
duration: { amount: 4, unit: 'Aktionen' },
type: 'Chant',
property: '',
},
},
{
id: 'goettlicheszeichen',
name: 'Göttliches Zeichen',
attributes: ['IN', 'IN', 'CH'],
cost: {
initial: 4,
additional: {},
},
effect: {
description:
'Das Zeichen äußert sich z. B. als Donnergrollen, obwohl keine Wolken am Himmel zu sehen sind (Rondra), das Schnattern eines Storches (Peraine) oder als kurzer Moment der Stille (Boron). Innerhalb der Zone der Liturgie können Personen das göttliche Zeichen wahrnehmen. Der Radius der Zone beträgt QS x 10 in Schritt. Bei Proben auf Bekehren & Überzeugen kann der Meister eine Erleichterung von 1 gewähren, wenn der Geweihte das Zeichen bei der Anwendung miteinbezieht.',
duration: { amount: 3, modifier: 'QS', unit: 'Kampfrunden' },
unit: null,
},
chant: {
duration: { amount: 4, unit: 'Aktionen' },
type: 'Chant',
property: '',
},
},
{
id: 'heilsegen',
name: 'Heilsegen',
attributes: ['KL', 'IN', 'CH'],
cost: {
initial: 4,
additional: { amount: 1, interval: 1, unit: 'LeP' },
},
effect: {
description:
'Der Betroffene erhält innerhalb von 5 Minuten nach dem Wirken der Liturgie verlorene LeP in Höhe der verwendeten KaP zurück. Der Geweihte kann maximal so viele KaP einsetzen, wie er FW hat. Wird die Liturgie vor dem Ablauf der durch den Konstitutionswert angegebenen Frist für den Tod eines Helden begonnen, kann er gerettet werden. Wird die Liturgie jedoch unterbrochen, überlebt der Patient danach nur noch die verbliebenen Kampfrunden.',
duration: {},
unit: null,
},
chant: {
duration: { amount: 16, unit: 'Aktionen' },
type: 'Chant',
property: '',
},
},
{
id: 'kleinerbannwideruntote',
name: 'Kleiner Bann wider Untote',
attributes: ['MU', 'MU', 'CH'],
cost: {
initial: 4,
additional: {},
},
effect: {
description:
'Der Bann verursacht 2W6+(QS x2) SP gegen ein untotes Wesen. Der Bann trifft automatisch sein Ziel und dieses kann sich dagegen nicht verteidigen.',
duration: {},
unit: null,
},
chant: {
duration: { amount: 1, unit: 'Aktion' },
type: 'Chant',
property: '',
},
},
{
id: 'kleinerbannstrahl',
name: 'Kleiner Bannstrahl',
attributes: ['MU', 'IN', 'CH'],
cost: {
initial: 8,
additional: {},
},
effect: {
description:
'Der Bannstrahl richtet gegen einen Dämon 2W6+(QS x2) SP an. Gegen Dämonen aus Blakharaz Domäne wird der Schaden verdoppelt. Der Bannstrahl trifft automatisch sein Ziel und dieses kann sich dagegen nicht verteidigen. Der kleine Bannstrahl ist nicht davon abhängig, ob der Himmel zu sehen ist. Der Strahl entsteht direkt beim Dämon, auf den der Strahl wirken soll.',
duration: {},
unit: null,
},
chant: {
duration: { amount: 2, unit: 'Aktionen' },
type: 'Chant',
property: '',
},
},
{
id: 'krankheitsbann',
name: 'Krankheitsbann',
attributes: ['KL', 'IN', 'CH'],
cost: {
initial: 2,
additional: { amount: 2, interval: 1, unit: 'Krankheitsstufe(n)' },
},
effect: {
description:
'Diese Liturgie heilt Krankheiten (die bisher erlittenen Auswirkungen werden nicht geheilt). Die maximale Krankheitsstufe darf die QS nicht übersteigen, sonst wirkt die Liturgie nicht und gilt als misslungen. Die Liturgie heilt auch alle Symptome der Krankheit, aber keine bis dahin entstandenen Schäden (LeP-Verlust, Narben usw.).',
duration: {},
unit: null,
},
chant: {
duration: { amount: 16, unit: 'Aktionen' },
type: 'Chant',
property: '',
},
},
{
id: 'lautlos',
name: 'Lautlos',
attributes: ['IN', 'IN', 'GE'],
cost: {
initial: 4,
additional: { amount: 2, interval: 1, unit: 'Minute' },
},
effect: {
description: 'Proben auf Verbergen (Schleichen) sind um QS erleichtert.',
duration: { amount: 1, modifier: null, unit: 'Minute' },
unit: null,
},
chant: {
duration: { amount: 4, unit: 'Aktionen' },
type: 'Chant',
property: '',
},
},
{
id: 'magieschutz',
name: 'Magieschutz',
attributes: ['MU', 'IN', 'CH'],
cost: {
initial: 8,
additional: { amount: 4, interval: 10, unit: 'Minuten' },
},
effect: {
description:
'Er erhält einen Bonus von QS 1 auf SK und ZK (mindestens jedoch 1 Punkt) gegen magische Effekte.',
duration: { amount: 1, modifier: null, unit: 'Minute' },
unit: null,
},
chant: {
duration: { amount: 4, unit: 'Aktionen' },
type: 'Chant',
property: '',
},
},
{
id: 'magiesicht',
name: 'Magiesicht',
attributes: ['KL', 'IN', 'IN'],
cost: {
initial: 4,
additional: {},
},
effect: {
description:
'Mit dieser Liturgie lässt sich aktives magisches Wirken auf Gegenständen und Personen erkennen. Je nach Stärke der astralen Kräfte im Objekt kann die Probe erleichtert oder erschwert werden. Je nach QS können dabei nachfolgende Analysen mittels des Zaubers ANALYS oder entsprechenden Liturgien beeinflusst werden. Der Geweihte kann nur ein ausgewähltes Wesen oder Objekt in Reichweite untersuchen. Er hat keine Rundumsicht.',
duration: { amount: 1, modifier: null, unit: 'Minute' },
unit: null,
},
chant: {
duration: { amount: 2, unit: 'Aktionen' },
type: 'Chant',
property: '',
},
},
{
id: 'mondsicht',
name: 'Mondsicht',
attributes: ['KL', 'KL', 'IN'],
cost: {
initial: 2,
additional: { amount: 1, interval: 10, unit: 'Minuten' },
},
effect: {
description:
'Erschwernisse der Sichtverhältnisse durch Dunkelheit werden um QS 1 Stufen gesenkt (mindestens jedoch 1',
duration: { amount: 1, modifier: null, unit: 'Minute' },
unit: null,
},
chant: {
duration: { amount: 4, unit: 'Aktionen' },
type: 'Chant',
property: '',
},
},
{
id: 'mondsilberzunge',
name: 'Mondsilberzunge',
attributes: ['KL', 'IN', 'CH'],
cost: {
initial: 8,
additional: {},
},
effect: {
description:
'Der Held wirkt vertrauenerweckend. Er erhält eine Erleichterung von QS auf die Fertigkeiten Überreden und Handel (Feilschen).',
duration: { amount: 3, modifier: 'QS', unit: 'Minute' },
unit: null,
},
chant: {
duration: { amount: 1, unit: 'Aktionen' },
type: 'Chant',
property: '',
},
},
];
module.exports = { Chants };

1310
data/Spells.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,521 +0,0 @@
[
{
"id": "adlerauge",
"name": "Adlerauge",
"attributes": [
"KL",
"IN",
"FF"
],
"spellduration": 2,
"modified_by": []
},
{
"id": "analysarkanstruktur",
"name": "Analys Arkanstruktur",
"attributes": [
"KL",
"KL",
"IN"
],
"spellduration": 32,
"modified_by": []
},
{
"id": "armatrutz",
"name": "Armatrutz",
"attributes": [
"KL",
"IN",
"FF"
],
"spellduration": 1,
"modified_by": []
},
{
"id": "axxeleratus",
"name": "Axxeleratus",
"attributes": [
"KL",
"IN",
"FF"
],
"spellduration": 1,
"modified_by": []
},
{
"id": "balsamsalabunde",
"name": "Balsam Salabunde",
"attributes": [
"KL",
"IN",
"FF"
],
"spellduration": 16,
"modified_by": []
},
{
"id": "bannbaladin",
"name": "Bannbaladin",
"attributes": [
"MU",
"IN",
"CH"
],
"spellduration": 4,
"modified_by": [
"ZK"
]
},
{
"id": "blickindiegedanken",
"name": "Blick in die Gedanken",
"attributes": [
"MU",
"KL",
"IN"
],
"spellduration": 4,
"modified_by": [
"ZK"
]
},
{
"id": "blitzdichfind",
"name": "Blitz dich find",
"attributes": [
"MU",
"IN",
"CH"
],
"spellduration": 1,
"modified_by": [
"ZK"
]
},
{
"id": "corpofesso",
"name": "Corpofesso",
"attributes": [
"KL",
"IN",
"KO"
],
"spellduration": 2,
"modified_by": [
"ZK"
]
},
{
"id": "disruptivo",
"name": "Disruptivo",
"attributes": [
"MU",
"KL",
"CH"
],
"spellduration": 8,
"modified_by": []
},
{
"id": "duplicatus",
"name": "Duplicatus",
"attributes": [
"KL",
"IN",
"CH"
],
"spellduration": 2,
"modified_by": []
},
{
"id": "falkenauge",
"name": "Falkenauge",
"attributes": [
"MU",
"KL",
"IN"
],
"spellduration": 2,
"modified_by": []
},
{
"id": "flimflam",
"name": "Flim Flam",
"attributes": [
"MU",
"KL",
"CH"
],
"spellduration": 1,
"modified_by": []
},
{
"id": "fulminictus",
"name": "Fulminictus",
"attributes": [
"KL",
"IN",
"KO"
],
"spellduration": 1,
"modified_by": [
"ZK"
]
},
{
"id": "gardianum",
"name": "Gardianum",
"attributes": [
"MU",
"KL",
"CH"
],
"spellduration": 1,
"modified_by": []
},
{
"id": "grossegier",
"name": "Große Gier",
"attributes": [
"MU",
"IN",
"CH"
],
"spellduration": 2,
"modified_by": [
"SK"
]
},
{
"id": "harmlosegestalt",
"name": "Harmlose Gestalt",
"attributes": [
"KL",
"IN",
"CH"
],
"spellduration": 4,
"modified_by": []
},
{
"id": "hexengalle",
"name": "Hexengalle",
"attributes": [
"KL",
"IN",
"KO"
],
"spellduration": 1,
"modified_by": []
},
{
"id": "hexenkrallen",
"name": "Hexenkrallen",
"attributes": [
"KL",
"IN",
"KO"
],
"spellduration": 1,
"modified_by": []
},
{
"id": "horriphobos",
"name": "Horriphobos",
"attributes": [
"MU",
"IN",
"CH"
],
"spellduration": 2,
"modified_by": [
"SK"
]
},
{
"id": "ignifaxius",
"name": "Ignifaxius",
"attributes": [
"MU",
"KL",
"CH"
],
"spellduration": 2,
"modified_by": []
},
{
"id": "invocatiominima",
"name": "Invocatio Minima",
"attributes": [
"MU",
"CH",
"KO"
],
"spellduration": 4,
"modified_by": []
},
{
"id": "katzenaugen",
"name": "Katzenaugen",
"attributes": [
"KL",
"IN",
"KO"
],
"spellduration": 4,
"modified_by": []
},
{
"id": "kroetensprung",
"name": "Krötensprung",
"attributes": [
"KL",
"IN",
"KO"
],
"spellduration": 2,
"modified_by": []
},
{
"id": "manifesto",
"name": "Manifesto",
"attributes": [
"MU",
"KL",
"CH"
],
"spellduration": 4,
"modified_by": []
},
{
"id": "manusmiracula",
"name": "Manus Miracula",
"attributes": [
"KL",
"FF",
"KK"
],
"spellduration": 2,
"modified_by": []
},
{
"id": "motoricus",
"name": "Motoricus",
"attributes": [
"KL",
"FF",
"KK"
],
"spellduration": 2,
"modified_by": []
},
{
"id": "nebelwand",
"name": "Nebelwand",
"attributes": [
"MU",
"KL",
"CH"
],
"spellduration": 2,
"modified_by": []
},
{
"id": "oculusillusionis",
"name": "Oculus Illusionis",
"attributes": [
"KL",
"IN",
"CH"
],
"spellduration": 4,
"modified_by": []
},
{
"id": "odemarcanum",
"name": "Odem Arcanum",
"attributes": [
"MU",
"KL",
"IN"
],
"spellduration": 2,
"modified_by": []
},
{
"id": "paralys",
"name": "Paralys",
"attributes": [
"KL",
"IN",
"KO"
],
"spellduration": 2,
"modified_by": [
"ZK"
]
},
{
"id": "penetrizzel",
"name": "Penetrizzel",
"attributes": [
"MU",
"KL",
"IN"
],
"spellduration": 2,
"modified_by": []
},
{
"id": "psychostabilis",
"name": "Psychostabilis",
"attributes": [
"KL",
"IN",
"FF"
],
"spellduration": 8,
"modified_by": []
},
{
"id": "radau",
"name": "Radau",
"attributes": [
"KL",
"FF",
"KK"
],
"spellduration": 2,
"modified_by": []
},
{
"id": "respondami",
"name": "Respondami",
"attributes": [
"MU",
"IN",
"CH"
],
"spellduration": 2,
"modified_by": [
"SK"
]
},
{
"id": "salander",
"name": "Salander",
"attributes": [
"KL",
"IN",
"KO"
],
"spellduration": 8,
"modified_by": [
"ZK"
]
},
{
"id": "sanftmut",
"name": "Sanftmut",
"attributes": [
"MU",
"IN",
"CH"
],
"spellduration": 2,
"modified_by": [
"SK"
]
},
{
"id": "satuariasherrlichkeit",
"name": "Satuarias Herrlichkeit",
"attributes": [
"KL",
"IN",
"KO"
],
"spellduration": 4,
"modified_by": []
},
{
"id": "silentium",
"name": "Silentium",
"attributes": [
"KL",
"FF",
"KK"
],
"spellduration": 8,
"modified_by": []
},
{
"id": "somnigravis",
"name": "Somnigravis",
"attributes": [
"MU",
"IN",
"CH"
],
"spellduration": 8,
"modified_by": [
"SK"
]
},
{
"id": "spinnenlauf",
"name": "Spinnenlauf",
"attributes": [
"KL",
"IN",
"KO"
],
"spellduration": 4,
"modified_by": []
},
{
"id": "spurlos",
"name": "Spurlos",
"attributes": [
"KL",
"FF",
"KK"
],
"spellduration": 4,
"modified_by": []
},
{
"id": "transversalis",
"name": "Transversalis",
"attributes": [
"MU",
"CH",
"KO"
],
"spellduration": 8,
"modified_by": []
},
{
"id": "visibili",
"name": "Visibili",
"attributes": [
"KL",
"IN",
"KO"
],
"spellduration": 4,
"modified_by": []
},
{
"id": "wasseratem",
"name": "Wasseratem",
"attributes": [
"KL",
"IN",
"KO"
],
"spellduration": 8,
"modified_by": []
}
]

50
functions/getChant.js Normal file
View File

@ -0,0 +1,50 @@
const { getAttributeLevels } = require('@dsabot/getAttributeLevels');
//JSON.parse(require('fs').readFileSync('../data/Spells.json'))
const Chants = require('../data/Chants');
/* definition of attributes in chant database
{
id: 'adlerauge', // the id of the chant inside characters database.
name: 'Adlerauge', // the well-known name of the chant.
attributes: [ 'KL', 'IN', 'FF' ], // needed attribute checks when casting the chant
chantduration: 2, // the player needs this many actions to cast the chant.
modified_by: [], // the chant is modified by this character's attribute
cost: null, // how many units does the chant cost? (when activated)
cost_type: 'asp', // what kind of points does the character need?
// AsP = Astral Points, KaP = Karmal Points
effect: '', // What is the desired effect of this chant?
effectduration: '' // How long does the effect last?
talent: null //
},
*/
const getChant = ({ Character: Character = [], chant_name: chant_name = '' } = {}) => {
let chant_entry =
Chants.find(chant => chant.id.toLowerCase() === chant_name.toLowerCase()) ||
Chants.find(chant => chant.name.toLowerCase() === chant_name.toLowerCase());
if (!chant_entry) {
console.log(`getchant did not find entry for ${chant_name}`);
return;
}
let Level = 0; // This is the minimum attributes value.
let Chant = Character.chants.find(chant => chant.id === chant_entry.id) || {};
if (Chant) {
Level = Chant.level || 0;
}
let Name = Chant.name;
//let ModifiedBy = Chant.modified_by;
let Attributes = getAttributeLevels(chant_entry.attributes, Character);
return {
Name: Name,
Level: Level,
Attributes: Attributes,
//ModifiedBy: ModifiedBy,
};
};
module.exports = { getChant };

View File

@ -1,10 +1,27 @@
const globals = require('../globals');
const { getAttributeLevels } = require('@dsabot/getAttributeLevels');
const Spells = require('../data/Spells');
/* definition of attributes in spell database
{
id: 'adlerauge', // the id of the spell inside characters database.
name: 'Adlerauge', // the well-known name of the spell.
attributes: [ 'KL', 'IN', 'FF' ], // needed attribute checks when casting the spell
spellduration: 2, // the player needs this many actions to cast the spell.
modified_by: [], // the spell is modified by this character's attribute
cost: null, // how many units does the spell cost? (when activated)
cost_type: 'asp', // what kind of points does the character need?
// AsP = Astral Points, KaP = Karmal Points
effect: '', // What is the desired effect of this spell?
effectduration: '' // How long does the effect last?
talent: null //
},
*/
const getSpell = ({ Character: Character = [], spell_name: spell_name = '' } = {}) => {
let spell_entry =
globals.Spells.find(spell => spell.id.toLowerCase() === spell_name.toLowerCase()) ||
globals.Spells.find(spell => spell.name.toLowerCase() === spell_name.toLowerCase());
const spell_entry =
Spells.find(spell => spell.id.toLowerCase() === spell_name.toLowerCase()) ||
Spells.find(spell => spell.name.toLowerCase() === spell_name.toLowerCase());
if (!spell_entry) {
console.log(`getSpell did not find entry for ${spell_name}`);
@ -12,12 +29,12 @@ const getSpell = ({ Character: Character = [], spell_name: spell_name = '' } = {
}
let Level = 0; // This is the minimum attributes value.
let Spell = Character.spells.find(spell => spell.id === spell_entry.id) || {};
let Spell = Character.spells.find(spell => spell.id === spell_entry.id) || {}; //?+
if (Spell) {
Level = Spell.level || 0;
}
let Name = globals.Spells.find(spell => spell.id === spell_entry.id).name;
let ModifiedBy = globals.Spells.find(spell => spell.id === spell_entry.id).modified_by;
let Name = spell_entry.name;
let ModifiedBy = spell_entry.modified_by;
let Attributes = getAttributeLevels(spell_entry.attributes, Character);
return {

View File

@ -233,7 +233,5 @@ const Disadvantages = [
{}
];
const Spells = require('data/Spells.json');
module.exports = { Spells, Werte, Talente, Coin, TalentKategorien, DiceRegex, Discord, MessageEmbed, db, Replies, MeleeWeapons, Weapons, RangedWeapons, CombatTechniques, Articles, Declination };
module.exports = { Werte, Talente, Coin, TalentKategorien, DiceRegex, Discord, MessageEmbed, db, Replies, MeleeWeapons, Weapons, RangedWeapons, CombatTechniques, Articles, Declination };

View File

@ -1,8 +1,9 @@
module.exports = {
testEnvironment: 'node',
moduleNameMapper: {
"@dsabot/(.*)": "<rootDir>/functions/$1",
"@Commands/(.*)": "<rootDir>/commands/$1",
"@Root/(.*)": "<rootDir>/$1",
}
'@dsabot/(.*)': '<rootDir>/functions/$1',
'@Commands/(.*)': '<rootDir>/commands/$1',
'@Root/(.*)': '<rootDir>/$1',
'@data/(.*)': '<rootDir>/data/$i',
},
};

View File

@ -3,7 +3,9 @@
"baseUrl": ".",
"paths": {
"@dsabot/*": ["./functions/*"],
"@globals": ["./globals"]
"@globals": ["./globals"],
"@data": ["./data/*"],
"@Commands": ["./commands/*"]
},
},
"exclude": ["node_modules"],

View File

@ -9,7 +9,9 @@
"test": "jest"
},
"_moduleAliases": {
"@dsabot": "functions"
"@dsabot": "functions",
"@data": "data",
"@Commands": "commands"
},
"author": "",
"license": "ISC",