diff --git a/CHANGELOG.md b/CHANGELOG.md index b090c31..fc857f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # CHANGELOG +## [2.4.22] + +### Removed old settings not necessary with the new version using the spellpoints item + +- "Warlock use spell points" setting is gone. Just give them the spell points item or not. +- "Npc use spell points" setting is gone. Just give them the spell points item or not. +- "Mixed mode" checkbox is gone. Every actor can use spell points or slots depending on the presence of the item. +- "Enable module" checkbox is gone. If no actor has the item the module will do nothing. + ## [2.4.21] - bugfix for the forge import path diff --git a/README.md b/README.md index 8abb285..101944e 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,6 @@ This module uses the variant rules found in the DMG to allow character to cast s ## Features -- Warlock can use spellpoints (disabled by default). -- NPC can use spellpoints (disabled by default). - Configurable formulas. All numerical fields are powered by FoundryVTT's Roll class. This not only give you access to functions like `round` and `kh` but also data within the characters themselves such as `@details.level` or `@abilities.cha.mod`. See [Data Paths as Variables](https://foundryvtt.com/article/dice-advanced/) for more information. The following fields are formulas: - SpellPointMaximum Base Formula (applied only if the character has at least one spell slot) - SpellPointMaximum Slot Multiplier (multiplies the cost of all spell slots the character would have). To reproduce the formula in the DMG, leave this as `1`. diff --git a/lang/de.json b/lang/de.json index 77321e6..67ac09f 100644 --- a/lang/de.json +++ b/lang/de.json @@ -45,8 +45,6 @@ "dnd5e-spellpoints.leveledProgressionLevel": "Zaubererlevel", "dnd5e-spellpoints.leveledProgressionGained": "{SpellPoints} erhalten", "dnd5e-spellpoints.maxSpellPointsOverride": "Maximale {SpellPoints}", - "dnd5e-spellpoints.mixedLabel": "Gemischten Modus aktivieren", - "dnd5e-spellpoints.mixedMode": "Mit aktiviertem gemischten Modus erhält jeder Charakter die Möglichkeit, Zauberpunkte direkt in seinem Charakterbogen zu aktivieren.", "dnd5e-spellpoints.neededToCastHeader": "{SpellPoints} benötigt zum Gießen", "dnd5e-spellpoints.newV3ItemUsage": "Seit der D&D-Systemaktualisierung auf Version 3 wurde die Verwendung von 'Ressourcen' veraltet. Sie sollten jetzt das Objekt (enthalten im Compendium dieses Moduls) zu jedem Charakter hinzufügen, der Zauberpunkte anstelle von Zauberslots benötigt. Folgendes ist eine Verknüpfung zum Objekt:", "dnd5e-spellpoints.notEnoughSp": "{ActorName} hat nicht genügend {SpellPoints}, um diesen Zauber zu gießen.", @@ -76,8 +74,6 @@ "dnd5e-spellpoints.use-spellpoints": "Dieser Charakter verwendet Zauberpunkte", "dnd5e-spellpoints.useLeveledProgression": "Progression basierend auf Zaubererlevel?", "dnd5e-spellpoints.useLeveledProgressionNote": "Diese Einstellung funktioniert nicht für Zaubernde NSCs, da sie keine Klasse oder Zaubererlevel in Foundry haben. Wenn Sie eine Berechnung für Zaubernde NSCs wünschen, deaktivieren Sie diese Einstellung (Sie können dies nur für NSCs tun, indem Sie diese Einstellung auf ihrem spezifischen Zauberpunkte-Objekt außer Kraft setzen).", - "dnd5e-spellpoints.warlockUseSpLabel": "Hexenmeister verwenden Zauberpunkte", - "dnd5e-spellpoints.warlockUseSpNote": "Standardmäßig können Hexenmeister das Zauberpunktsystem nicht verwenden. Durch Aktivieren dieser Einstellung können sie es wie andere Zaubernde tun.", "dnd5e-spellpoints.youNotEnough": "Du hast nicht genug '{SpellPoints}', um diesen Zauber zu gießen.", "dnd5e-spellpoints.spGmOnlyNote": "Durch Deaktivieren dessen kann jeder Spieler den Zauberpunkte-Gegenstand auf seinem Charakterbogen außer Kraft setzen.", "dnd5e-spellpoints.spGmOnly": "Nur der SL darf das Zauberpunkte-Objekt bearbeiten.", diff --git a/lang/en.json b/lang/en.json index c9b61ef..440dd86 100644 --- a/lang/en.json +++ b/lang/en.json @@ -31,7 +31,7 @@ "dnd5e-spellpoints.enableModuleHint": "Enables or disables spell points for casting spells. This will override the slot cost for player tokens.", "dnd5e-spellpoints.enableVariantLabel": "Use HP as Spell Points (Gritty Variant).", "dnd5e-spellpoints.enableVariantNote": "Enabling this setting allows Player Characters to continue casting spells once they run out of spell points, using their own life at increased cost (see Advanced Magic System).", - "dnd5e-spellpoints.form": "Click the button to open Spell Points System 5e Configuration.", + "dnd5e-spellpoints.form": "Open the Spell Points System Configuration.", "dnd5e-spellpoints.form-hint": "Here you can configure module behavior, spell point cost, and more.", "dnd5e-spellpoints.form-title": "Spell Points Configuration.", "dnd5e-spellpoints.formulaBaseLabel": "Single Formula Progression.", @@ -48,8 +48,6 @@ "dnd5e-spellpoints.leveledProgressionLevel": "Caster Level.", "dnd5e-spellpoints.leveledProgressionGained": "Maximum {SpellPoints}.", "dnd5e-spellpoints.maxSpellPointsOverride": "Maximum {SpellPoints}.", - "dnd5e-spellpoints.mixedLabel": "Enable Mixed Mode.", - "dnd5e-spellpoints.mixedMode": "With Mixed Mode enabled, every character will get the option to enable Spell Points directly in the character sheet.", "dnd5e-spellpoints.neededToCastHeader": "{SpellPoints} Needed to Cast.", "dnd5e-spellpoints.newV3ItemUsage": "Since D&D system update to v3, the usage of 'resources' has been deprecated. You should now add the item (included with this module compendium) to any character that needs spell points instead of spell slots. The following is a shortcut to the item:", "dnd5e-spellpoints.notEnoughSp": "{ActorName} doesn't have enough {SpellPoints} to cast this spell.", @@ -79,8 +77,6 @@ "dnd5e-spellpoints.use-spellpoints": "This character uses Spell Points.", "dnd5e-spellpoints.useLeveledProgression": "Progression Based on Caster Level?", "dnd5e-spellpoints.useLeveledProgressionNote": "If you need calculation on NPC remeber that this setting won't work for casters NPCs since they have no class nor caster level in Foundry. If you want some kind of calculation for caster NPCs, use the single formula (you can do that just for NPCs by overriding this setting on their specific Spell Points item).", - "dnd5e-spellpoints.warlockUseSpLabel": "Warlocks Use Spell Points.", - "dnd5e-spellpoints.warlockUseSpNote": "By default, warlocks cannot use the spell points system. Enabling this allows them to do so like other casters. If using 'by level' progression you should also set the caster level progression for pact magic. (half, third, full...).", "dnd5e-spellpoints.youNotEnough": "You don't have enough '{SpellPoints}' to cast this spell.", "dnd5e-spellpoints.spGmOnlyNote": "Unchecking this allows every player to override the Spell Points item from their character sheet.", "dnd5e-spellpoints.spGmOnly": "Only the GM is allowed to edit the Spell Point Item.", diff --git a/lang/es.json b/lang/es.json index 6fac26b..8165adb 100644 --- a/lang/es.json +++ b/lang/es.json @@ -28,7 +28,7 @@ "dnd5e-spellpoints.enableModuleHint": "Habilita o deshabilita los puntos de conjuro para lanzar hechizos. Esto anulará el costo de las ranuras para los tokens de jugador.", "dnd5e-spellpoints.enableVariantLabel": "Usar PV como Puntos de Conjuro (Variante Realista).", "dnd5e-spellpoints.enableVariantNote": "Al habilitar esta configuración, los Personajes de Jugador podrán seguir lanzando hechizos una vez que se queden sin puntos de conjuro, usando su propia vida a un costo aumentado (ver Sistema de Magia Avanzada).", - "dnd5e-spellpoints.form": "Haz clic en el botón para abrir la Configuración del Sistema de Puntos de Conjuro 5e.", + "dnd5e-spellpoints.form": "Abre la Configuración del Sistema de Puntos de Conjuro.", "dnd5e-spellpoints.form-hint": "Aquí puedes configurar el comportamiento del módulo, el costo de los puntos de conjuro y más.", "dnd5e-spellpoints.form-title": "Configuración de Puntos de Conjuro.", "dnd5e-spellpoints.formulaBaseLabel": "Progresión de Fórmula Única.", @@ -45,8 +45,6 @@ "dnd5e-spellpoints.leveledProgressionLevel": "Nivel de Lanzador.", "dnd5e-spellpoints.leveledProgressionGained": "{SpellPoints} Ganados.", "dnd5e-spellpoints.maxSpellPointsOverride": "Máximo de {SpellPoints}.", - "dnd5e-spellpoints.mixedLabel": "Habilitar Modo Mixto.", - "dnd5e-spellpoints.mixedMode": "Con el Modo Mixto habilitado, cada personaje tendrá la opción de habilitar los Puntos de Conjuro directamente en la hoja de personaje.", "dnd5e-spellpoints.neededToCastHeader": "{SpellPoints} Necesarios para Lanzar.", "dnd5e-spellpoints.newV3ItemUsage": "Desde la actualización del sistema D&D a la versión 3, el uso de 'recursos' ha sido desaprobado. Ahora debes agregar el ítem (incluido con este compendio de módulos) a cualquier personaje que necesite puntos de conjuro en lugar de ranuras de hechizo. Lo siguiente es un acceso directo al ítem:", "dnd5e-spellpoints.notEnoughSp": "{ActorName} no tiene suficientes {SpellPoints} para lanzar este hechizo.", @@ -76,8 +74,6 @@ "dnd5e-spellpoints.use-spellpoints": "Este personaje usa Puntos de Conjuro.", "dnd5e-spellpoints.useLeveledProgression": "¿Progresión basada en el nivel de lanzador?", "dnd5e-spellpoints.useLeveledProgressionNote": "Esta configuración no funcionará para los NPC lanzadores ya que no tienen clase ni nivel de lanzador en Foundry. Si deseas algún tipo de cálculo para los NPC lanzadores, deshabilita esta configuración (puedes hacerlo solo para los NPC anulando esta configuración en su ítem de Puntos de Conjuro específico).", - "dnd5e-spellpoints.warlockUseSpLabel": "Los Brujos Usan Puntos de Conjuro.", - "dnd5e-spellpoints.warlockUseSpNote": "Por defecto, los brujos no pueden usar el sistema de puntos de conjuro. Al habilitar esto, podrán hacerlo como otros lanzadores.", "dnd5e-spellpoints.youNotEnough": "No tienes suficientes '{SpellPoints}' para lanzar este hechizo.", "dnd5e-spellpoints.spGmOnlyNote": "Al desmarcar esto, todos los jugadores podrán anular el ítem de Puntos de Conjuro de su hoja de personaje.", "dnd5e-spellpoints.spGmOnly": "Solo el DM puede editar el Ítem de Puntos de Conjuro.", diff --git a/lang/fr.json b/lang/fr.json index bb4a36b..87893e9 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -28,7 +28,7 @@ "dnd5e-spellpoints.enableModuleHint": "Active ou désactive les points de sort pour lancer des sorts, cela remplacera le coût des emplacements pour les jetons de joueur.", "dnd5e-spellpoints.enableVariantLabel": "Utiliser les PV comme Points de Sorts (Variante Realiste).", "dnd5e-spellpoints.enableVariantNote": "En activant cette option, les Personnages de Joueur pourront continuer à lancer des sorts une fois qu'ils auront épuisé leurs points de sort, en utilisant leur propre vie à un coût accru (voir Système de Magie Avancée).", - "dnd5e-spellpoints.form": "Cliquez sur le bouton pour ouvrir la Configuration du Système de Points de Sorts 5e.", + "dnd5e-spellpoints.form": "Ouvrir la Configuration du Système de Points de Sorts.", "dnd5e-spellpoints.form-hint": "Ici, vous pouvez configurer le comportement du module, le coût des points de sort et plus encore.", "dnd5e-spellpoints.form-title": "Configuration des Points de Sorts.", "dnd5e-spellpoints.formulaBaseLabel": "Progression de Formule Unique.", @@ -45,8 +45,6 @@ "dnd5e-spellpoints.leveledProgressionLevel": "Niveau de Lanceur.", "dnd5e-spellpoints.leveledProgressionGained": "{SpellPoints} Gagnés.", "dnd5e-spellpoints.maxSpellPointsOverride": "Maximum de {SpellPoints}.", - "dnd5e-spellpoints.mixedLabel": "Activer le Mode Mixte.", - "dnd5e-spellpoints.mixedMode": "Avec le Mode Mixte activé, chaque personnage aura la possibilité d'activer les Points de Sorts directement dans sa feuille de personnage.", "dnd5e-spellpoints.neededToCastHeader": "{SpellPoints} Nécessaires pour Lancer.", "dnd5e-spellpoints.newV3ItemUsage": "Depuis la mise à jour du système D&D en version 3, l'utilisation des 'ressources' a été dépréciée. Vous devez maintenant ajouter l'objet (inclus avec ce compendium de modules) à tout personnage ayant besoin de points de sort au lieu de fentes de sort. Ce qui suit est un raccourci vers l'objet :", "dnd5e-spellpoints.notEnoughSp": "{ActorName} n'a pas assez de {SpellPoints} pour lancer ce sort.", @@ -76,8 +74,6 @@ "dnd5e-spellpoints.use-spellpoints": "Ce personnage utilise des Points de Sorts.", "dnd5e-spellpoints.useLeveledProgression": "Progression basée sur le niveau de lanceur ?", "dnd5e-spellpoints.useLeveledProgressionNote": "Ce paramètre ne fonctionnera pas pour les PNJ lanceurs car ils n'ont pas de classe ni de niveau de lanceur dans Foundry. Si vous souhaitez un calcul pour les PNJ lanceurs, désactivez ce paramètre (vous pouvez le faire uniquement pour les PNJ en annulant ce paramètre sur leur objet spécifique de Points de Sorts).", - "dnd5e-spellpoints.warlockUseSpLabel": "Les Ensorceleurs Utilisent des Points de Sorts.", - "dnd5e-spellpoints.warlockUseSpNote": "Par défaut, les ensorceleurs ne peuvent pas utiliser le système de points de sort. En activant cette option, ils pourront le faire comme les autres lanceurs.", "dnd5e-spellpoints.youNotEnough": "Vous n'avez pas assez de '{SpellPoints}' pour lancer ce sort.", "dnd5e-spellpoints.spGmOnlyNote": "En décochant cela, tous les joueurs pourront annuler l'objet des Points de Sorts de leur feuille de personnage.", "dnd5e-spellpoints.spGmOnly": "Seul le MJ est autorisé à modifier l'Objet des Points de Sorts.", diff --git a/lang/it.json b/lang/it.json index 904ca00..c993df5 100644 --- a/lang/it.json +++ b/lang/it.json @@ -29,7 +29,7 @@ "dnd5e-spellpoints.enableModuleHint": "Abilità o disabilita la possibilità di lanciare incantesimi con i punti magia per i personaggi.", "dnd5e-spellpoints.enableVariantLabel": "Usare i Punti Ferita per lanciare gli incantesimi (Gritty Variant)", "dnd5e-spellpoints.enableVariantNote": "Abilitando questa opzione i Personaggi dei Giocatori potranno continuare a lanciare incantesimi anche se hanno terminato i Punti Magia utilizzando la propria vita (vedi l' Advanced Magic System)", - "dnd5e-spellpoints.form": "Clicca per aprire la configurazione Sistema di Punti Magia per 5e", + "dnd5e-spellpoints.form": "Apri la configurazione Sistema di Punti Magia", "dnd5e-spellpoints.form-hint": "Qui potrai configurare il comportamento del modulo, il costo degli incantesimi e altro.", "dnd5e-spellpoints.form-title": "Configurazioni Punti Magia", "dnd5e-spellpoints.formulaBaseLabel": "Formula di Base", @@ -44,8 +44,6 @@ "dnd5e-spellpoints.leveledNotes": "The spell points a character would have at any given caster level. Half caster will get the caster level halved. For Third casters the character's level in that class will be divided by three. You can use formulas, as: `5+@attributes.spellmod` If you want to add the spellcasting modifier to the fixed number of spell points.", "dnd5e-spellpoints.leveledProgressionTitle": "Progressione per Livelli", "dnd5e-spellpoints.maxSpellPointsOverride": "{SpellPoints} Massimi", - "dnd5e-spellpoints.mixedLabel": "Abilita Modalità Mista", - "dnd5e-spellpoints.mixedMode": "Con la Modalità Mista ogni personaggio avrà la possibilità di abilitare i Punti Magia o rimanere col sistema degli Slot direttamente dalla propria Scheda del Personaggio.", "dnd5e-spellpoints.neededToCastHeader": "{SpellPoints} necessari al lancio incantesimi", "dnd5e-spellpoints.newV3ItemUsage": "Dall'aggiornamento del sistema D&d alla versione 3 l'uso delle risorse è stato deprecato. Da ora dovresti aggiungere l'oggetto (incluso nel compendio di questo modulo) a tutti i pg che necessitano di punti magia al posto degli slot. Di seguito un link all'oggetto.", "dnd5e-spellpoints.notEnoughSp": "{ActorName} non ha abbastanza {SpellPoints} per lanciare l'incantesimo.", @@ -74,8 +72,6 @@ "dnd5e-spellpoints.spLifeCostNote": "Quanti Punti Ferita Massimi un personaggio perderà lanciando un incantesimo utilizzando la propria forza vitale. È un moltiplicatore. Es: se impostato a 2 un Personaggio che lanci un incantesimo dal costo di 2 PM perderà 4 PF Massimi. (default:2)", "dnd5e-spellpoints.use-spellpoints": "Questo Personaggio utilizza i Punti Magia", "dnd5e-spellpoints.useLeveledProgression": "Attiva la progressione basata sul livello da incantatore.", - "dnd5e-spellpoints.warlockUseSpLabel": "I Warlock usano i Punti Magia", - "dnd5e-spellpoints.warlockUseSpNote": "Di base i Warlock non possono usare il sistema dei Punti Magia, abilitando questa opzione essi potranno utilizzarli come tutti gli altri utenti di magia.", "dnd5e-spellpoints.youNotEnough": "Non hai abbastanza '{SpellPoints}' per lanciare l'incantesimo.", "dnd5e-spellpoints.updateSpellPointMax": "Ricalcola il massimo di {SpellPoints}", "dnd5e-spellpoints.updateSpellPointMaxTooltip": "Ricalcola il valore massimo in base alla tua configurazione.", diff --git a/lang/pt-BR.json b/lang/pt-BR.json index bb1309d..4dfb44a 100644 --- a/lang/pt-BR.json +++ b/lang/pt-BR.json @@ -31,7 +31,7 @@ "dnd5e-spellpoints.enableModuleHint": "Habilita ou desabilita Spell Points para conjurar magias. Isso desabilita o custo de espaço de magia para os tokens de jogadores.", "dnd5e-spellpoints.enableVariantLabel": "Usar PV como Spell Points (Variante Gritty)", "dnd5e-spellpoints.enableVariantNote": "Habilitando essa opção, os Jogadores poderão continuar conjurando mesmo que fiquem sem Spell Points, usando suas próprias vidas como custo (veja Advanced Magic System)", - "dnd5e-spellpoints.form": "Clique no botão para abrir as configurações do Spell Points System 5e", + "dnd5e-spellpoints.form": "Abrir as configurações do Spell Points System", "dnd5e-spellpoints.form-hint": "Aqui você pode configurar o comportamento do módulo, custo de Spell Points e mais.", "dnd5e-spellpoints.form-title": "Configuração de Spell Points", "dnd5e-spellpoints.formulaBaseLabel": "Fórmula Base", @@ -48,8 +48,6 @@ "dnd5e-spellpoints.leveledProgressionLevel": "Nível de Conjurador", "dnd5e-spellpoints.leveledProgressionGained": "{SpellPoints} Máximos.", "dnd5e-spellpoints.maxSpellPointsOverride": "{SpellPoints} Máximos.", - "dnd5e-spellpoints.mixedLabel": "Ativar Modo Misto", - "dnd5e-spellpoints.mixedMode": "Com o Modo Misto ativado, todos os personagens ganharão uma opção de ativar os {SpellPoints} diretamente de suas fichas.", "dnd5e-spellpoints.neededToCastHeader": "{SpellPoints} Necessários para Conjurar.", "dnd5e-spellpoints.newV3ItemUsage": "Desde que o sistema D&D atualizou para a v3, o uso de 'recursos' foi descontinuado. Você deve agora adicionar o item (incluído no compendium deste módulo) para todo personagem que precisa usar Spell Points ao invés de espaços de magia. O seguinte é um atalho para o item:", "dnd5e-spellpoints.notEnoughSp": "{ActorName} não tem {SpellPoints} suficiente para conjurar esta magia.", @@ -79,8 +77,6 @@ "dnd5e-spellpoints.use-spellpoints": "Este Personagem usa {SpellPoints}", "dnd5e-spellpoints.useLeveledProgression": "Progressão Baseada no Nível do Conjurador?", "dnd5e-spellpoints.useLeveledProgressionNote": "Se você precisar de cálculos de um PnJ, lembre-se que esa configuração não funciona para PnJs conjuradores, pois eles não possuem classe ou níveis de conjurador no Foundry. Se você quiser algum cálculo para PnJs conjuradores, use a fórmula única (você pode fazer isso apenas para PnJs, substituindo esta configuração no item específico de Spell Points deles).", - "dnd5e-spellpoints.warlockUseSpLabel": "Bruxos usam Spell Points", - "dnd5e-spellpoints.warlockUseSpNote": "Por padrão, bruxos não podem usar o sistema de Spell Points. Habilitando esta opção permite que ele faça isso, como outros conjuradores.", "dnd5e-spellpoints.youNotEnough": "Você não tem '{SpellPoints}' suficientes para conjurar esta magia.", "dnd5e-spellpoints.spGmOnlyNote": "Desmarcar isso permite que cada jogador substitua o item de Spell Points de suas fichas.", "dnd5e-spellpoints.spGmOnly": "Apenas o MJ pode editar o item de Spell Points", @@ -96,4 +92,4 @@ "dnd5e-spellpoints.updateSpellPointMax": "Calcular Máx. {SpellPoints}", "dnd5e-spellpoints.updateSpellPointMaxTooltip": "Redefine o valor máximo de acordo com sua configuração.", "dnd5e-spellpoints.spClassSubtype": "Spell Points" -} +} \ No newline at end of file diff --git a/module.json b/module.json index 8a96c82..ffd7884 100644 --- a/module.json +++ b/module.json @@ -2,7 +2,7 @@ "id": "dnd5e-spellpoints", "title": "Advanced Magic - Spell Points System 5e", "description": "FoundryVTT module for Spell Points System in D&D5e. This module use the optional rules found on DMG to allow character to cast spells using a resource named 'Spell Points'", - "version": "2.4.11", + "version": "2.4.21", "compatibility": { "minimum": "12", "verified": "12.331" @@ -22,7 +22,7 @@ }, "url": "https://github.com/misthero/dnd5e-spellpoints", "manifest": "https://github.com/misthero/dnd5e-spellpoints/releases/latest/download/module.json", - "download": "https://github.com/misthero/dnd5e-spellpoints/releases/download/v2.4.11/dnd5e-spellpoints.zip", + "download": "https://github.com/misthero/dnd5e-spellpoints/releases/download/v2.4.21/dnd5e-spellpoints.zip", "authors": [ { "name": "misthero", diff --git a/scripts/main.js b/scripts/main.js index ed309d3..c26eef5 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -60,16 +60,6 @@ Hooks.on('init', () => { default: null }) - /** should spellpoints be enabled */ - game.settings.register(SP_MODULE_NAME, "spEnableSpellpoints", { - name: game.i18n.format(SP_MODULE_NAME + ".enableModule"), - hint: game.i18n.format(SP_MODULE_NAME + ".enableModuleHint"), - scope: "world", - config: true, - default: false, - type: Boolean - }); - game.settings.registerMenu(SP_MODULE_NAME, SP_MODULE_NAME, { name: SP_MODULE_NAME + ".form", label: SP_MODULE_NAME + ".form-title", diff --git a/scripts/spellpoints.js b/scripts/spellpoints.js index 1dc4565..48b868a 100644 --- a/scripts/spellpoints.js +++ b/scripts/spellpoints.js @@ -14,18 +14,15 @@ export class SpellPoints { */ static get defaultSettings() { return { - spEnableSpellpoints: false, spResource: 'Spell Points', spAutoSpellpoints: true, spFormula: 'DMG', - warlockUseSp: false, enableForNpc: false, chatMessagePrivate: false, spellPointsByLevel: { 1: 4, 2: 6, 3: 14, 4: 17, 5: 27, 6: 32, 7: 38, 8: 44, 9: 57, 10: 64, 11: 73, 12: 73, 13: 83, 14: 83, 15: 94, 16: 94, 17: 107, 18: 114, 19: 123, 20: 133 }, spellPointsCosts: { 1: 2, 2: 3, 3: 5, 4: 6, 5: 7, 6: 9, 7: 10, 8: 11, 9: 13 }, spEnableVariant: false, spLifeCost: 2, - spMixedMode: false, isCustom: false, spCustomFormulaBase: '0', spCustomFormulaSlotMultiplier: '1', @@ -86,10 +83,6 @@ export class SpellPoints { } } - static isModuleActive() { - return game.settings.get(SP_MODULE_NAME, 'spEnableSpellpoints'); - } - static isActorCharacter(actor) { const isActor = foundry.utils.getProperty(actor, "type") == "character"; let isNPC = false; @@ -110,10 +103,6 @@ export class SpellPoints { || item.system.source?.custom === this.settings.spResource); } - static isMixedActorSpellPointEnabled(actor) { - return actor?.flags?.dnd5espellpoints?.enabled ?? false; - } - /** * Evaluates the given formula with the given actors data. Uses FoundryVTT's Roll * to make this evaluation. @@ -179,7 +168,7 @@ export class SpellPoints { const actor = item.actor; /** do nothing if module is not active **/ - if (!SpellPoints.isModuleActive() || !SpellPoints.isActorCharacter(actor)) + if (!SpellPoints.isActorCharacter(actor)) return [item, consume, options]; let spellPointItem = SpellPoints.getSpellPointsItem(actor); @@ -196,10 +185,6 @@ export class SpellPoints { /*if (item.type != 'spell') return [item, consume, options];*/ - /** if is a pact spell, but no mixed mode and warlocks do not use spell points: do nothing */ - if (item.parent.preparation.mode == 'pact' && !moduleSettings.warlockUseSp) - return [item, consume, options]; - if (consume.consume.spellSlot) { consume.consume.spellPoints = false; return [item, consume, options]; @@ -344,8 +329,6 @@ export class SpellPoints { * @returns the value of the variable `level` */ static async checkDialogSpellPoints(dialog, html) { - if (!SpellPoints.isModuleActive()) - return; var Appconfig = foundry.utils.getProperty(dialog, "config"); @@ -374,10 +357,6 @@ export class SpellPoints { const spell = dialog.item.system; const preparation = spell.preparation.mode; //prepared,pact,always,atwill,innate - const warlockCanCast = settings.warlockUseSp; - /* if is a warlock but mixed mode is disable and warlocks cannot use spellpoints, do nothing. */ - if (preparation == 'pact' && !warlockCanCast) - return; // spell level can change later if casting it with a greater slot, baseSpellLvl is the default const baseSpellLvl = spell.level; @@ -401,7 +380,7 @@ export class SpellPoints { $('select[name="spell.slot"] option', $(html)).each(function () { let selectValue = $(this).val(); - if (selectValue == 'pact' && warlockCanCast) { + if (selectValue == 'pact') { level = actor.system.spells.pact.level; } else { level = selectValue.replace('spell', ''); @@ -410,9 +389,8 @@ export class SpellPoints { cost = SpellPoints.withActorData(settings.spellPointsCosts[level], actor); let newText = `${CONFIG.DND5E.spellLevels[level]} (${game.i18n.format(SP_MODULE_NAME + ".spellCost", { amount: cost, SpellPoints: spellPointItem.name })})` - if ((selectValue == 'pact' && warlockCanCast) || selectValue != 'pact') { - $(this).text(newText); - } + $(this).text(newText); + }) let consumeInput = $('dnd5e-checkbox[name="consume.spellSlot"]', $(html)).parents('.form-group'); @@ -431,7 +409,7 @@ export class SpellPoints { let spellPointCost = 0; let actualSpellPoints = spellPointItem.system.uses.value; - if (preparation == 'pact' && warlockCanCast) + if (preparation == 'pact') spellPointCost = cost; else spellPointCost = SpellPoints.withActorData(settings.spellPointsCosts[baseSpellLvl], actor); @@ -594,7 +572,7 @@ export class SpellPoints { static calculateSpellPoints(item, updates, id) { const actor = item.parent; - if (!SpellPoints.isModuleActive() || !SpellPoints.isActorCharacter(actor)) + if (!SpellPoints.isActorCharacter(actor)) return [item, updates, id]; if (!SpellPoints.settings.spAutoSpellpoints) { @@ -786,7 +764,7 @@ export class SpellPoints { //console.log('alterCharacterSheet', data.actor); //console.log('alterCharacterSheet', html); //console.log('alterCharacterSheet type', type); - if (!this.isModuleActive() || (data.actor.type != "character" && data.actor.type != "npc")) { + if (data.actor.type != "character" && data.actor.type != "npc") { return; } const actor = data.actor; @@ -829,7 +807,7 @@ export class SpellPoints { const html_obj = $(html); const item = data?.item; - if (this.isModuleActive() && SpellPoints.isSpellPointsItem(item)) { + if (SpellPoints.isSpellPointsItem(item)) { // this option make the app a little more usable, we keep submit on close and submit on change for checkboxes and select app.options.submitOnChange = false; $('.item-properties', html_obj).hide(); diff --git a/templates/spellpoint-module-config.hbs b/templates/spellpoint-module-config.hbs index 81055a3..ca1eefc 100644 --- a/templates/spellpoint-module-config.hbs +++ b/templates/spellpoint-module-config.hbs @@ -232,29 +232,6 @@ <!-- Other Settings --> <h3>{{localize "dnd5e-spellpoints.otherSettingsTitle"}}</h3> <!-- Enable Warlock --> - <div class="form-group"> - <label><i class="fas fa-swords"></i> - {{localize "dnd5e-spellpoints.warlockUseSpLabel"}}</label> - <input - type="checkbox" - name="warlockUseSp" - data-dtype="Boolean" - {{checked warlockUseSp}} - /> - <p class="notes">{{localize "dnd5e-spellpoints.warlockUseSpNote"}}</p> - </div> - - <div class="form-group"> - <label><i class="fas fa-user"></i> - {{localize "dnd5e-spellpoints.enableForNpcLabel"}}</label> - <input - type="checkbox" - name="enableForNpc" - data-dtype="Boolean" - {{checked enableForNpc}} - /> - <!-- <p class="notes">{{localize "dnd5e-spellpoints.enableForNpcNote"}}</p> --> - </div> <!-- Private chat message switch --> <div class="form-group"> <label><i class="fas fa-comments"></i>