Skip to content

Commit

Permalink
Powercasting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ikaguia committed Jul 25, 2024
1 parent 4b2d923 commit 8c733ba
Show file tree
Hide file tree
Showing 9 changed files with 674 additions and 70 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ Test module for the implementation of the sw5e system as a module for dnd5e.

## Changelog

### [0.13] - 2024-07-24

#### Added

- Powercasting

### [0.1] - 2024-07-22

#### Added
Expand Down
104 changes: 99 additions & 5 deletions languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -689,11 +689,105 @@
"SW5E.Mastery": "Mastery",
"SW5E.HighMastery": "High Mastery",
"SW5E.GrandMastery": "Grand Mastery",
"SW5E.SchoolDrk": "Dark",
"SW5E.SchoolEnh": "Enhancement",
"SW5E.SchoolLgt": "Light",
"SW5E.SchoolTec": "Tech",
"SW5E.SchoolUni": "Universal",
"SW5E.Powercasting": {
"Label": "Powercasting",
"Force": {
"Label": "Forcecasting",
"Focus": "Focus Generator",
"Known": {
"Value": "Known force powers",
"Max": "Max number of force powers",
"MaxOverride": "Override max number of force powers"
},
"Level": {
"Label": "Forcecasting Level",
"Override": "Forcecasting Level Override"
},
"Limit": {
"Label": "Forcecasting Limit",
"Override": "Forcecasting Limit Override"
},
"MaxPowerLevel": {
"Label": "Max Force Power Level",
"Override": "Max Force Power Level Override"
},
"Point": {
"Label": "Force Points",
"Value": "Current Force Points",
"Max": "Maximum Force Points",
"MaxOverride": "Maximum Force Points Override"
},
"Prog": {
"Label": "Forcecasting Progression",
"Full": "Full Forcecaster",
"3/4": "3/4 Forcecaster",
"Half": "Half Forcecaster",
"Arch": "Archetype Forcecaster"
},
"School": {
"Label": "Forcecasting School",
"Lgt": {
"Label": "Light",
"Dc": "Light Powers DC",
"Attr": "Light Powers Attribute"
},
"Uni": {
"Label": "Universal",
"Dc": "Universal Powers DC",
"Attr": "Universal Powers Attribute"
},
"Drk": {
"Label": "Dark",
"Dc": "Dark Powers DC",
"Attr": "Dark Powers Attribute"
}
},
"Used": "Used Force 'Slots'"
},
"Tech": {
"Label": "Techcasting",
"Focus": "Wristpad",
"Known": {
"Value": "Known tech powers",
"Max": "Max number of tech powers",
"MaxOverride": "Override max number of tech powers"
},
"Level": {
"Label": "Techcasting Level",
"Override": "Techcasting Level Override"
},
"Limit": {
"Label": "Techcasting Limit",
"Override": "Techcasting Limit Override"
},
"MaxPowerLevel": {
"Label": "Max Tech Power Level",
"Override": "Max Tech Power Level Override"
},
"Point": {
"Label": "Tech Points",
"Value": "Current Tech Points",
"Max": "Maximum Tech Points",
"MaxOverride": "Maximum Tech Points Override"
},
"Prog": {
"Label": "Techcasting Progression",
"Full": "Full Techcaster",
"3/4": "3/4 Techcaster",
"Half": "Half Techcaster",
"Arch": "Archetype Techcaster"
},
"School": {
"Label": "Techcasting School",
"Tec": {
"Label": "Tech",
"Dc": "Tech Powers DC",
"Attr": "Tech Powers Attribute"
}
},
"Used": "Used Tech 'Slots'"
}
},
"SW5E.ShieldDamImm": "Shield Damage Immunities",
"SW5E.ShieldDamRes": "Shield Damage Resistances",
"SW5E.ShieldDamVuln": "Shield Damage Vulnerabilities",
Expand Down
7 changes: 2 additions & 5 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "sw5e-module-test",
"title": "SW5E module test",
"description": "Test",
"version": "0.12",
"version": "0.13",
"library": "false",
"manifestPlusVersion": "1.2.0",
"compatibility": {
Expand Down Expand Up @@ -40,10 +40,7 @@
]
},
"esmodules": [
"scripts/module.js"
],
"scripts": [
"scripts/lib/lib.js"
"scripts/module.mjs"
],
"styles": [
"styles/module.css"
Expand Down
5 changes: 5 additions & 0 deletions scripts/module.js → scripts/module.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { patchConfig } from "./patch/config.mjs";
import { patchDataModels } from "./patch/dataModels.mjs";
import { patchPowercasting } from "./patch/powercasting.mjs";
import { patchProficiencyInit, patchProficiencyReady } from "./patch/proficiency.mjs";
import { patchProperties } from "./patch/properties.mjs";

const strict = true;

Hooks.once('init', async function() {
patchConfig(CONFIG.DND5E, strict);
patchDataModels();

patchPowercasting();
patchProficiencyInit();
patchProperties();
});
Expand Down
151 changes: 127 additions & 24 deletions scripts/patch/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1292,33 +1292,136 @@ export function patchConfig(config, strict=true) {
}
};
// Powercasting
if (strict) config.spellSchools = {};
config.powerSchoolsForce = {
lgt: {
label: "SW5E.SchoolLgt",
fullKey: "light"
},
uni: {
label: "SW5E.SchoolUni",
fullKey: "universal"
},
drk: {
label: "SW5E.SchoolDrk",
fullKey: "dark"
}
};
preLocalize( "powerSchoolsForce", { key: "label", sort: true } );
config.powerSchoolsTech = {
tec: {
label: "SW5E.SchoolTec",
fullKey: "tech"
config.spellPreparationModes.powerCasting = {
label: "SW5E.Powercasting.Label",
usesPoints: true
};
config.powerCasting = {
force: {
label: "SW5E.Powercasting.Force.Label",
img: "systems/dnd5e/icons/power-tiers/{id}.webp",
attr: ["wis", "cha"],
focus: {
label: "SW5E.Powercasting.Force.Focus",
id: "focusgenerator",
property: "bolstering"
},
progression: {
full: {
label: "SW5E.Powercasting.Force.Prog.Full",
powerPoints: 4,
powerMaxLevel: [0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 9, 9],
powerLimit: 6,
divisor: 1,
powersKnown: [0, 9, 11, 13, 15, 17, 19, 21, 23, 25, 26, 28, 29, 31, 32, 34, 35, 37, 38, 39, 40]
},
"3/4": {
label: "SW5E.Powercasting.Force.Prog.3/4",
powerPoints: 3,
powerMaxLevel: [0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7],
powerLimit: 5,
divisor: 9 / 7,
powersKnown: [0, 7, 9, 11, 13, 15, 17, 18, 19, 21, 22, 24, 25, 26, 28, 29, 30, 32, 33, 34, 35]
},
half: {
label: "SW5E.Powercasting.Force.Prog.Half",
powerPoints: 2,
powerMaxLevel: [0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5],
powerLimit: 4,
divisor: 9 / 5,
powersKnown: [0, 5, 7, 9, 10, 12, 13, 14, 15, 17, 18, 19, 20, 22, 23, 24, 25, 27, 28, 29, 30]
},
arch: {
label: "SW5E.Powercasting.Force.Prog.Arch",
powerPoints: 1,
powerMaxLevel: [0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4],
powerLimit: 4,
divisor: 9 / 4,
powersKnown: [0, 0, 0, 4, 6, 7, 8, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 22, 23, 24, 25]
}
},
schools: {
lgt: {
label: "SW5E.Powercasting.Force.School.Lgt.Label",
attr: ["wis"],
fullKey: "light"
},
uni: {
label: "SW5E.Powercasting.Force.School.Uni.Label",
attr: ["wis", "cha"],
fullKey: "universal"
},
drk: {
label: "SW5E.Powercasting.Force.School.Drk.Label",
attr: ["cha"],
fullKey: "dark"
}
}
},
tech: {
label: "SW5E.Powercasting.Tech.Label",
img: "systems/sw5e/icons/power-tiers/{id}.webp",
attr: ["int"],
focus: {
label: "SW5E.Powercasting.Tech.Focus",
id: "wristpad",
property: "surging"
},
progression: {
full: {
label: "SW5E.Powercasting.Tech.Prog.Full",
powerPoints: 2,
powerMaxLevel: [0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 9, 9],
powerLimit: 6,
divisor: 1,
powersKnown: [0, 6, 7, 9, 10, 12, 13, 15, 16, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]
},
"3/4": {
label: "SW5E.Powercasting.Tech.Prog.3/4",
powerPoints: 1.5,
powerMaxLevel: [0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7],
powerLimit: 5,
divisor: 9 / 4,
powersKnown: [0, 0, 0, 7, 8, 9, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
},
half: {
label: "SW5E.Powercasting.Tech.Prog.Half",
powerPoints: 1,
powerMaxLevel: [0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5],
powerLimit: 4,
divisor: 9 / 5,
powersKnown: [0, 0, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]
},
arch: {
label: "SW5E.Powercasting.Tech.Prog.Arch",
powerPoints: 0.5,
powerMaxLevel: [0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4],
powerLimit: 4,
divisor: 9 / 4,
powersKnown: [0, 0, 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
}
},
schools: {
tec: {
label: "SW5E.Powercasting.Tech.School.Tec.Label",
attr: ["int"],
fullKey: "tech"
}
},
shortRest: true
}
};
preLocalize( "powerSchoolsTech", { key: "label", sort: true } );
}
preLocalize( "powercasting", { key: "label", sort: true } );
preLocalize( "powercasting.force.progression", { key: "label" } );
preLocalize( "powercasting.tech.progression", { key: "label" } );
preLocalize( "powercasting.force.schools", { key: "label", sort: true } );
preLocalize( "powercasting.tech.schools", { key: "label", sort: true } );

if (strict) config.spellSchools = {};
config.spellSchools = {
...config.spellSchools,
...config.powerSchoolsForce,
...config.powerSchoolsTech
...config.powerCasting.force.schools,
...config.powerCasting.tech.schools
};
// Weapons
if (strict) {
Expand Down
Loading

0 comments on commit 8c733ba

Please sign in to comment.