Skip to content

Commit

Permalink
0.5.37 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisk123999 committed Jul 7, 2023
1 parent c17f7d1 commit 96f28b0
Show file tree
Hide file tree
Showing 33 changed files with 969 additions and 34 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# 0.5.37 Release:
## New Content:
- Spiritual Weapon
- Spiritual Weapon (Thanks Autumn)
## New Monster Content:
- Aarakocra: Dive Attack
## Update Notes:
- Added configuration option for custom names for summon spells and class features.
## Bug Fixes:
Expand Down
2 changes: 1 addition & 1 deletion packs/cpr-actions/LOG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023/07/05-16:12:32.301241 7f9a49fb0700 Delete type=3 #1
2023/07/07-00:27:09.577470 7f0ec15b0700 Delete type=3 #1
2 changes: 1 addition & 1 deletion packs/cpr-class-feature-items/LOG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023/07/05-16:12:31.777052 7f9a4b7e0700 Delete type=3 #1
2023/07/07-00:27:09.020463 7f0ec0590700 Delete type=3 #1
Binary file modified packs/cpr-class-features/000003.log
Binary file not shown.
2 changes: 1 addition & 1 deletion packs/cpr-class-features/LOG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023/07/05-16:12:31.776436 7f9a49fb0700 Delete type=3 #1
2023/07/07-00:27:09.018796 7f0ec1dc0700 Delete type=3 #1
2 changes: 1 addition & 1 deletion packs/cpr-feats/LOG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023/07/05-16:12:32.174218 7f9a4afd0700 Delete type=3 #1
2023/07/07-00:27:09.444837 7f0ec0590700 Delete type=3 #1
Binary file modified packs/cpr-item-features/000003.log
Binary file not shown.
2 changes: 1 addition & 1 deletion packs/cpr-item-features/LOG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023/07/05-16:12:32.102165 7f9a49fb0700 Delete type=3 #1
2023/07/07-00:27:09.365728 7f0ec0590700 Delete type=3 #1
Binary file modified packs/cpr-items/000003.log
Binary file not shown.
2 changes: 1 addition & 1 deletion packs/cpr-items/LOG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023/07/05-16:12:31.886842 7f9a4b7e0700 Delete type=3 #1
2023/07/07-00:27:09.155737 7f0ec0590700 Delete type=3 #1
2 changes: 1 addition & 1 deletion packs/cpr-miscellaneous/LOG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023/07/05-16:12:32.338745 7f9a4a7c0700 Delete type=3 #1
2023/07/07-00:27:09.634644 7f0ec1dc0700 Delete type=3 #1
2 changes: 1 addition & 1 deletion packs/cpr-monster-feature-items/LOG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023/07/05-16:12:32.065849 7f9a4b7e0700 Delete type=3 #1
2023/07/07-00:27:09.328010 7f0ec15b0700 Delete type=3 #1
6 changes: 4 additions & 2 deletions packs/cpr-monster-features.db

Large diffs are not rendered by default.

Binary file modified packs/cpr-monster-features/000003.log
Binary file not shown.
2 changes: 1 addition & 1 deletion packs/cpr-monster-features/LOG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023/07/05-16:12:31.906367 7f9a49fb0700 Delete type=3 #1
2023/07/07-00:27:09.179508 7f0ec0da0700 Delete type=3 #1
2 changes: 1 addition & 1 deletion packs/cpr-race-feature-items/LOG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023/07/05-16:12:32.135052 7f9a49fb0700 Delete type=3 #1
2023/07/07-00:27:09.405762 7f0ec0590700 Delete type=3 #1
Binary file modified packs/cpr-race-features/000003.log
Binary file not shown.
2 changes: 1 addition & 1 deletion packs/cpr-race-features/LOG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023/07/05-16:12:32.019150 7f9a4a7c0700 Delete type=3 #1
2023/07/07-00:27:09.283447 7f0ec1dc0700 Delete type=3 #1
Binary file modified packs/cpr-spell-features/000003.log
Binary file not shown.
2 changes: 1 addition & 1 deletion packs/cpr-spell-features/LOG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023/07/05-16:12:31.688596 7f9a4b7e0700 Delete type=3 #1
2023/07/07-00:27:08.906414 7f0ec0590700 Delete type=3 #1
Binary file modified packs/cpr-spells/000003.log
Binary file not shown.
2 changes: 1 addition & 1 deletion packs/cpr-spells/LOG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023/07/05-16:12:31.652001 7f9a4b7e0700 Delete type=3 #1
2023/07/07-00:27:08.879011 7f0ec0590700 Delete type=3 #1
Binary file modified packs/cpr-summon-features/000003.log
Binary file not shown.
2 changes: 1 addition & 1 deletion packs/cpr-summon-features/LOG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023/07/05-16:12:32.250462 7f9a49fb0700 Delete type=3 #1
2023/07/07-00:27:09.536375 7f0ec15b0700 Delete type=3 #1
Binary file modified packs/cpr-summons/000003.log
Binary file not shown.
2 changes: 1 addition & 1 deletion packs/cpr-summons/LOG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023/07/05-16:12:32.213558 7f9a4b7e0700 Delete type=3 #1
2023/07/07-00:27:09.486483 7f0ec0da0700 Delete type=3 #1
1 change: 0 additions & 1 deletion scripts/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ export async function fixSettings() {
let list = '';
if (changedSettings.includes('IM-CharSheet')) {
list += '- Item Macro: Character Sheet Hook: false<br>';
ui.notifications.warn('Do not press "Save Changes" if the settings dialog is still open!');
}
if (changedSettings.includes('MQ-EnableWorkflow')) list += '- Midi-Qol: Roll Automation Support: true<br>';
if (changedSettings.includes('MQ-autoCEEffects')) list += '- Midi-Qol: Apply Convenient Effects: Prefer Item Effect<br>';
Expand Down
46 changes: 46 additions & 0 deletions scripts/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -1338,6 +1338,52 @@ export function setConfig() {
}
}
},
'CPR - Randomizer': {
'checkbox': {
'humanoid': {
'label': 'Random Humanoid:',
'default': false
}
},
'select': {
'abilities': {
'label': 'Humanoid Ability Merge:',
'default': 'upgrade',
'values': [
{'value': 'source', 'html': 'Keep Source'},
{'value': 'target', 'html': 'Keep Target'},
{'value': 'upgrade', 'html': 'Upgrade'},
{'value': 'downgrade', 'html': 'Downgrade'}
]
},
'skills': {
'label': 'Humanoid Skill Merge:',
'default': 'upgrade',
'values': [
{'value': 'source', 'html': 'Keep Source'},
{'value': 'target', 'html': 'Keep Target'},
{'value': 'upgrade', 'html': 'Upgrade'},
{'value': 'downgrade', 'html': 'Downgrade'}
]
},
'avatar': {
'label': 'Humanoid Avatar Merge:',
'default': 'source',
'values': [
{'value': 'source', 'html': 'Use Source'},
{'value': 'target', 'html': 'Use Target'}
]
},
'token': {
'label': 'Humanoid Token Merge:',
'default': 'source',
'values': [
{'value': 'source', 'html': 'Use Source'},
{'value': 'target', 'html': 'Use Target'}
]
}
}
}
}
});
}
6 changes: 5 additions & 1 deletion scripts/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import {flanking} from './macros/generic/syntheticAttack.js';
import {constants} from './constants.js';
import {patching} from './patching.js';
import {runAsGM} from './runAsGM.js';
import {npcRandomizer} from './utility/npcRandomizer.js';
import {settingButton} from './settingsMenu.js';
export let socket;
Hooks.once('init', async function() {
registerSettings();
Expand Down Expand Up @@ -163,6 +165,7 @@ Hooks.once('ready', async function() {
if (game.user.isGM || game.settings.get('chris-premades', 'Item Replacer Access') || game.settings.get('chris-premades', 'Item Configuration Access')) {
Hooks.on('getItemSheetHeaderButtons', createHeaderButton);
}
if (game.settings.get('chris-premades', 'Use Randomizer')) Hooks.on('createToken', npcRandomizer);
});
globalThis['chrisPremades'] = {
helpers,
Expand All @@ -173,5 +176,6 @@ globalThis['chrisPremades'] = {
bab,
tashaSummon,
troubleshoot,
constants
constants,
settingButton
}
49 changes: 48 additions & 1 deletion scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ import {flanking} from './macros/generic/syntheticAttack.js';
import {removeDumbV10Effects} from './macros/mechanics/conditions.js';
import {tokenMoved, combatUpdate} from './movement.js';
import {patching} from './patching.js';
import {addMenuSetting, chrisSettingsClassFeats, chrisSettingsCompendiums, chrisSettingsFeats, chrisSettingsGeneral, chrisSettingsHomewbrew, chrisSettingsManualRolling, chrisSettingsMechanics, chrisSettingsModule, chrisSettingsMonsterFeats, chrisSettingsRaceFeats, chrisSettingsSpells, chrisSettingsSummons, chrisSettingsTroubleshoot} from './settingsMenu.js';
import {addMenuSetting, chrisSettingsClassFeats, chrisSettingsCompendiums, chrisSettingsFeats, chrisSettingsGeneral, chrisSettingsHomewbrew, chrisSettingsManualRolling, chrisSettingsMechanics, chrisSettingsModule, chrisSettingsMonsterFeats, chrisSettingsRaceFeats, chrisSettingsRandomizer, chrisSettingsRandomizerHumanoid, chrisSettingsSpells, chrisSettingsSummons, chrisSettingsTroubleshoot} from './settingsMenu.js';
import {fixOrigin, itemDC} from './utility/effect.js';
import {effectAuraHooks} from './utility/effectAuras.js';
import {allRaces, npcRandomizer, updateChanceTable} from './utility/npcRandomizer.js';
import {rest} from './utility/rest.js';
import {tashaSummon} from './utility/tashaSummon.js';
import {templates} from './utility/templateEffect.js';
import {vaeEffectDescription, vaeTempItemButton} from './vae.js';
let moduleName = 'chris-premades';
export let humanoidSettings = {};
export function registerSettings() {
game.settings.register(moduleName, 'Breaking Version Change', {
'name': 'Breaking Version Change',
Expand Down Expand Up @@ -305,6 +307,15 @@ export function registerSettings() {
'default': 'world.ddb-' + game.world.id + '-ddb-spells'
});
addMenuSetting('Spell Compendium', 'Compendiums');
game.settings.register(moduleName, 'Monster Compendium', {
'name': 'Personal Monster Compendium',
'hint': 'A compendium full of monsters to pick from (DDB monster compendium by default).',
'scope': 'world',
'config': false,
'type': String,
'default': 'world.ddb-' + game.world.id + '-ddb-monsters'
});
addMenuSetting('Monster Compendium', 'Compendiums');
game.settings.register(moduleName, 'Condition Resistance', {
'name': 'Condition Resistance Mechanic',
'hint': 'Enabling this allows the automation condition resistance via the use of Midi-Qol hooks.',
Expand Down Expand Up @@ -722,6 +733,34 @@ export function registerSettings() {
'default': true
});
addMenuSetting('Ignore GM', 'Manual Rolling');
game.settings.register(moduleName, 'Use Randomizer', {
'name': 'Randomizer',
'hint': 'Change this.',
'scope': 'world',
'config': false,
'type': Boolean,
'default': false,
'onChange': value => {
if (value) {
Hooks.on('createToken', npcRandomizer);
} else {
Hooks.off('createToken', npcRandomizer);
}
}
});
addMenuSetting('Use Randomizer', 'Randomizer');
game.settings.register(moduleName, 'Humanoid Randomizer Settings', {
'name': 'Humanoid Randomizer Settings',
'hint': 'Change this.',
'scope': 'world',
'config': false,
'type': Object,
'default': allRaces,
'onChange': value => {
if (value) updateChanceTable();
}
});
addMenuSetting('Humanoid Randomizer Settings', 'Randomizer');
game.settings.registerMenu(moduleName, 'General', {
name: 'General',
label: 'General',
Expand Down Expand Up @@ -818,6 +857,14 @@ export function registerSettings() {
type: chrisSettingsManualRolling,
restricted: true
});
// game.settings.registerMenu(moduleName, 'Randomizer', {
// name: 'Randomizer',
// label: 'Randomizer',
// hint: 'Optional settings for randomizer features.',
// icon: 'fas fa-dice',
// type: chrisSettingsRandomizer,
// restricted: true
// });
game.settings.registerMenu(moduleName, 'Troubleshooter', {
name: 'Troubleshooter',
label: 'Troubleshooter',
Expand Down
112 changes: 99 additions & 13 deletions scripts/settingsMenu.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import {fixSettings, troubleshoot} from './help.js';
import {allRaces} from './utility/npcRandomizer.js';
let settingCategories = {};
export function addMenuSetting(key, category) {
setProperty(settingCategories, key.split(' ').join('-'), category);
}
let labels = {
'Humanoid-Randomizer-Settings': 'Configure'
}
class chrisSettingsBase extends FormApplication {
constructor() {
super();
Expand Down Expand Up @@ -37,6 +41,8 @@ class chrisSettingsBase extends FormApplication {
s.isRange = (setting.type === Number) && s.range;
s.isNumber = setting.type === Number;
s.filePickerType = s.filePicker === true ? 'any' : s.filePicker;
s.isButton = setting.type instanceof Object && setting.type.name != 'String';
s.label = labels[key];
generatedOptions.push(s);
}
return {'settings': generatedOptions.sort(function (a, b) {
Expand Down Expand Up @@ -133,6 +139,12 @@ export class chrisSettingsManualRolling extends chrisSettingsBase {
this.category = 'Manual Rolling';
}
}
export class chrisSettingsRandomizer extends chrisSettingsBase {
constructor() {
super();
this.category = 'Randomizer';
}
}
export class chrisSettingsTroubleshoot extends FormApplication {
constructor() {
super();
Expand All @@ -142,29 +154,31 @@ export class chrisSettingsTroubleshoot extends FormApplication {
'classes': ['form'],
'popOut': true,
'template': 'modules/chris-premades/templates/config.html',
'id': 'chris-premades-settings',
'id': 'chris-troubleshoot-settings',
'title': 'Chris\'s Troubleshooter',
'width': 800,
'height': 'auto',
'closeOnSubmit': true
});
}
getData() {
return {'settings':
[
return {
'settings': [
{
'name': 'Run Troubleshooter?',
'name': 'Run Troubleshooter:',
'id': 'trouble',
'value': false,
'isCheckbox': true,
'hint': 'Checking this box will export a file used to help troubleshoot issues with this module on my Discord server.'
'value': {},
'isButton': true,
'hint': 'Will export a file used to help troubleshoot issues with this module on my Discord server.',
'label': 'Go'
},
{
'name': 'Apply recommended setting fixes?',
'name': 'Apply recommended setting fixes:',
'id': 'fix',
'value': false,
'isCheckbox': true,
'hint': 'Checking this will have the module automatically apply recommended setting changes.'
'value': {},
'isButton': true,
'hint': 'This will have the module automatically apply recommended setting changes.',
'label': 'Go'
}
]
}
Expand All @@ -173,7 +187,79 @@ export class chrisSettingsTroubleshoot extends FormApplication {
super.activateListeners(html);
}
async _updateObject(event, formData) {
if (formData.trouble) troubleshoot();
if (formData.fix) fixSettings();

}
}
export class chrisSettingsRandomizerHumanoid extends FormApplication {
constructor() {
super();
}
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
'classes': ['form'],
'popOut': true,
'template': 'modules/chris-premades/templates/config.html',
'id': 'chris-humanoid-randomizer-settings',
'title': 'Chris\'s Humanoid Randomizer Settings',
'width': 800,
'height': 'auto',
'closeOnSubmit': true
});
}
getData() {
let generatedOptions = [];
let humanoidSettings = game.settings.get('chris-premades', 'Humanoid Randomizer Settings');
for (let i of Object.values(allRaces)) {
let id = i.name.toLowerCase().split(' ').join('-');
generatedOptions.push(
{
'name': i.name + ' enabled:',
'id': id + '.enabled',
'value': humanoidSettings?.[id]?.enabled ?? allRaces[id].enabled,
'isCheckbox': true,
'hint': 'Enable use of the ' + i.name + ' race?'
},
{
'name': i.name + ' weight:',
'id': id + '.weight',
'value': humanoidSettings?.[id]?.weight ?? allRaces[id].weight,
'isRange': true,
'range': {
'min': 1,
'max': 100,
'step': 1
},
'hint': 'Weighted chance for ' + i.name + ' to be selected.'
}
);
}
return {'settings': generatedOptions};
}
activateListeners(html) {
super.activateListeners(html);
}
async _updateObject(event, formData) {
let updates = {};
for (let [key, value] of Object.entries(formData)) {
setProperty(updates, key, value);
}
let setting = mergeObject(allRaces, game.settings.get('chris-premades', 'Humanoid Randomizer Settings'));
mergeObject(setting, updates);
game.settings.set('chris-premades', 'Humanoid Randomizer Settings', setting);
}
}
export async function settingButton(id) {
switch (id) {
case 'Humanoid Randomizer Settings':
await new chrisSettingsRandomizerHumanoid().render(true);
break;
case 'trouble':
try {
troubleshoot();
} catch {}
break;
case 'fix':
fixSettings();
break;
}
}
Loading

0 comments on commit 96f28b0

Please sign in to comment.