Merge pull request #234 from unrealkakeman89/Develop

Various powercasting bugs
This commit is contained in:
CK 2021-07-02 20:46:59 -04:00 committed by GitHub
commit 7214e3d260
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 12 deletions

View file

@ -431,13 +431,6 @@ export default class Actor5e extends Actor {
const powers = ad.powers; const powers = ad.powers;
const isNPC = actorData.type === 'npc'; const isNPC = actorData.type === 'npc';
// Powercasting DC
// TODO: Consider an option for using the variant rule of all powers use the same value
ad.attributes.powerForceLightDC = 8 + ad.abilities.wis.mod + ad.attributes.prof ?? 10;
ad.attributes.powerForceDarkDC = 8 + ad.abilities.cha.mod + ad.attributes.prof ?? 10;
ad.attributes.powerForceUnivDC = Math.max(ad.attributes.powerForceLightDC,ad.attributes.powerForceDarkDC) ?? 10
ad.attributes.powerTechDC = 8 + ad.abilities.int.mod + ad.attributes.prof ?? 10;
// Translate the list of classes into force and tech power-casting progression // Translate the list of classes into force and tech power-casting progression
const forceProgression = { const forceProgression = {
classes: 0, classes: 0,
@ -661,7 +654,7 @@ export default class Actor5e extends Actor {
*/ */
_computeDerivedPowercasting (actorData) { _computeDerivedPowercasting (actorData) {
if ((actorData.type === 'actor') || (actorData.type === 'npc')) return; if (!(actorData.type === 'character' || actorData.type === 'npc')) return;
const ad = actorData.data; const ad = actorData.data;
@ -669,10 +662,10 @@ export default class Actor5e extends Actor {
// TODO: Consider an option for using the variant rule of all powers use the same value // TODO: Consider an option for using the variant rule of all powers use the same value
ad.attributes.powerForceLightDC = 8 + ad.abilities.wis.mod + ad.attributes.prof ?? 10; ad.attributes.powerForceLightDC = 8 + ad.abilities.wis.mod + ad.attributes.prof ?? 10;
ad.attributes.powerForceDarkDC = 8 + ad.abilities.cha.mod + ad.attributes.prof ?? 10; ad.attributes.powerForceDarkDC = 8 + ad.abilities.cha.mod + ad.attributes.prof ?? 10;
ad.attributes.powerForceUnivDC = Math.max(ad.attributes.powerForceLightDC,ad.attributes.powerForceDarkDC) ?? 10 ad.attributes.powerForceUnivDC = Math.max(ad.attributes.powerForceLightDC,ad.attributes.powerForceDarkDC) ?? 10;
ad.attributes.powerTechDC = 8 + ad.abilities.int.mod + ad.attributes.prof ?? 10; ad.attributes.powerTechDC = 8 + ad.abilities.int.mod + ad.attributes.prof ?? 10;
if (actorData.type !== 'actor') return; if (actorData.type !== 'character') return;
// Set Force and tech bonus points for PC Actors // Set Force and tech bonus points for PC Actors
if (!!ad.attributes.force.level){ if (!!ad.attributes.force.level){

View file

@ -2,7 +2,7 @@
"name": "sw5e", "name": "sw5e",
"title": "SW 5th Edition", "title": "SW 5th Edition",
"description": "A comprehensive game system for running games of SW 5th Edition in the Foundry VTT environment.", "description": "A comprehensive game system for running games of SW 5th Edition in the Foundry VTT environment.",
"version": "1.3.5.R1-A6", "version": "1.3.5.R1-A7",
"author": "Dev Team", "author": "Dev Team",
"scripts": [], "scripts": [],
"esmodules": ["sw5e.js"], "esmodules": ["sw5e.js"],