Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev -> Main Merge for 5.0.7 Release #129

Merged
merged 6 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions display/shared/styling/parts/actor-sheets.less
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,33 @@
}
}


/* Limited Sheet */
.limited-actor-header {
display: flex;
flex-grow: 0;
section[data-application-part="limited"] {
overflow-y: scroll;

.limited-actor-header {
display: flex;
flex-grow: 0;

.charname {
font-size: 20pt;
}

.charname {
font-size: 20pt;
.header-content {
flex-grow: 1;
text-align: center;
margin-top: auto;
}
}

.header-content {
flex-grow: 1;
text-align: center;
margin-top: auto;
.description-content {
align-self: flex-start;
}
}

.limited-description-body {
padding: 10px;
.limited-description-body {
padding: 10px;
}
}

/* Actor Header */
Expand Down
10 changes: 5 additions & 5 deletions display/shared/styling/themes/dark-theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
}
}

.content-link {
color: var(--system-dark-color-1);
background-color: #FFF;
}

/* All places that use a filter to apply the theme colour */
.app,
#sidebar,
Expand Down Expand Up @@ -233,11 +238,6 @@
background-color: var(--system-dark-color-2);
border-color: var(--system-dark-color-4);

.content-link {
color: var(--system-dark-color-1);
background-color: #FFF;
}

/* Power Descriptions */
.discipline-description,
.edge-description,
Expand Down
10 changes: 5 additions & 5 deletions display/shared/styling/themes/vampire-theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
}
}

.content-link {
color: var(--system-dark-color-1);
background-color: #FFF;
}

/* All places that use a filter to apply the theme colour */
.app,
#sidebar,
Expand Down Expand Up @@ -236,11 +241,6 @@
background-color: var(--system-dark-color-2);
border-color: var(--system-dark-color-4);

.content-link {
color: var(--system-dark-color-1);
background-color: #FFF;
}

/* Power Descriptions */
.discipline-description,
.edge-description,
Expand Down
10 changes: 5 additions & 5 deletions display/shared/styling/themes/werewolf-theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
}
}

.content-link {
color: var(--system-dark-color-1);
background-color: #FFF;
}

/* All places that use a filter to apply the theme colour */
.app,
#sidebar,
Expand Down Expand Up @@ -236,11 +241,6 @@
background-color: var(--system-dark-color-2);
border-color: var(--system-dark-color-4);

.content-link {
color: var(--system-dark-color-1);
background-color: #FFF;
}

/* Power Descriptions */
.discipline-description,
.edge-description,
Expand Down
38 changes: 22 additions & 16 deletions display/wod5e-styling.css
Original file line number Diff line number Diff line change
Expand Up @@ -1319,19 +1319,25 @@ body.uk .actor.sheet {
position: absolute;
right: 23px;
}
.actor.sheet .limited-actor-header {
.actor.sheet section[data-application-part="limited"] {
overflow-y: scroll;
}
.actor.sheet section[data-application-part="limited"] .limited-actor-header {
display: flex;
flex-grow: 0;
}
.actor.sheet .limited-actor-header .charname {
.actor.sheet section[data-application-part="limited"] .limited-actor-header .charname {
font-size: 20pt;
}
.actor.sheet .limited-actor-header .header-content {
.actor.sheet section[data-application-part="limited"] .limited-actor-header .header-content {
flex-grow: 1;
text-align: center;
margin-top: auto;
}
.actor.sheet .limited-description-body {
.actor.sheet section[data-application-part="limited"] .description-content {
align-self: flex-start;
}
.actor.sheet section[data-application-part="limited"] .limited-description-body {
padding: 10px;
}
.actor.sheet .actor-header {
Expand Down Expand Up @@ -2794,6 +2800,10 @@ prose-mirror .editor-menu button {
.wod-dark-theme .sheet .window-content {
background: var(--actor-background-dark) repeat;
}
.wod-dark-theme .content-link {
color: var(--system-dark-color-1);
background-color: #FFF;
}
.wod-dark-theme .app,
.wod-dark-theme #sidebar,
.wod-dark-theme #controls ol.control-tools > li,
Expand Down Expand Up @@ -2947,10 +2957,6 @@ prose-mirror .editor-menu button {
border-color: var(--system-dark-color-4);
/* Power Descriptions */
}
.wod-dark-theme .actor.sheet .item-list .category .content-link {
color: var(--system-dark-color-1);
background-color: #FFF;
}
.wod-dark-theme .actor.sheet .item-list .category .discipline-description,
.wod-dark-theme .actor.sheet .item-list .category .edge-description,
.wod-dark-theme .actor.sheet .item-list .category .gift-description {
Expand Down Expand Up @@ -3081,6 +3087,10 @@ prose-mirror .editor-menu button {
.wod-vampire-theme .sheet .window-content {
background: var(--actor-background-dark) repeat;
}
.wod-vampire-theme .content-link {
color: var(--system-dark-color-1);
background-color: #FFF;
}
.wod-vampire-theme .app,
.wod-vampire-theme #sidebar,
.wod-vampire-theme #controls ol.control-tools > li,
Expand Down Expand Up @@ -3241,10 +3251,6 @@ prose-mirror .editor-menu button {
border-color: var(--system-dark-color-4);
/* Power Descriptions */
}
.wod-vampire-theme .actor.sheet .item-list .category .content-link {
color: var(--system-dark-color-1);
background-color: #FFF;
}
.wod-vampire-theme .actor.sheet .item-list .category .discipline-description,
.wod-vampire-theme .actor.sheet .item-list .category .edge-description,
.wod-vampire-theme .actor.sheet .item-list .category .gift-description {
Expand Down Expand Up @@ -3333,6 +3339,10 @@ prose-mirror .editor-menu button {
.wod-werewolf-theme .sheet .window-content {
background: var(--actor-background-dark) repeat;
}
.wod-werewolf-theme .content-link {
color: var(--system-dark-color-1);
background-color: #FFF;
}
.wod-werewolf-theme .app,
.wod-werewolf-theme #sidebar,
.wod-werewolf-theme #controls ol.control-tools > li,
Expand Down Expand Up @@ -3493,10 +3503,6 @@ prose-mirror .editor-menu button {
border-color: var(--system-dark-color-4);
/* Power Descriptions */
}
.wod-werewolf-theme .actor.sheet .item-list .category .content-link {
color: var(--system-dark-color-1);
background-color: #FFF;
}
.wod-werewolf-theme .actor.sheet .item-list .category .discipline-description,
.wod-werewolf-theme .actor.sheet .item-list .category .edge-description,
.wod-werewolf-theme .actor.sheet .item-list .category .gift-description {
Expand Down
2 changes: 1 addition & 1 deletion packs/Macros.db
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{"name":"Basic Roll","type":"script","scope":"global","author":"0uQsagcnnkt56LRN","img":"icons/svg/dice-target.svg","command":"// This macro just prompts the user to roll a dice, and they can add additional dice if they need to.\n\n// Define the actor\nconst actor = game.actors.get(ChatMessage.getSpeaker().actor)\nconst data = actor.system\n\n// Send the roll to the API\nWOD5E.api.Roll({\n title: \"Rolling...\",\n basicDice: 1,\n disableAdvancedDice: true\n})","folder":null,"ownership":{"default":0,"OrOQ70SVPCGayvrw":3,"0uQsagcnnkt56LRN":3},"flags":{"core":{}},"_stats":{"systemId":"vtm5e","systemVersion":"4.1.1","coreVersion":"12.331","createdTime":1707614396503,"modifiedTime":1712928203350,"lastModifiedBy":"0uQsagcnnkt56LRN","compendiumSource":null,"duplicateSource":null},"_id":"RTbzoDnCvi7Y7oAe","sort":0}
{"name":"Adjust Rage","type":"script","scope":"global","author":"OrOQ70SVPCGayvrw","img":"systems/vtm5e/assets/icons/dice/werewolf/success.png","command":"// Grab the list of selected tokens and map them\nconst tokens = canvas.tokens.controlled\nconst actorsList = tokens.map(i=>i.actor)\nlet actorsAffected = 0\nlet actorsNameList = []\n\n// First input: Will prompt a number\nlet mod = await Dialog.prompt({content: 'Adjust Rage by (+ or -) <input type=\"number\">', callback: (err, html) => html.find('input').val()})\n\nfor (const actor of actorsList){\n // If the actor isn't a vampire, skip them\n if (actor.type === 'werewolf') {\n // Second input: The actor's current hunger\n const oldValue = Number(actor.system.rage.value)\n // Add the inputs together\n let newValue = oldValue + Number(mod)\n\n // Check to make sure the input doesn't go over or below max/min values\n if (newValue > 5) { newValue = 5; }\n if (newValue < 0) { newValue = 0; }\n\n await actor.update({ \"system.rage.value\": newValue })\n\n // Update the number of affected actors\n actorsAffected++\n // Add the actor to the list of displayed names in the chat message\n actorsNameList.push(actor.name)\n }\n}\n\nconst actorsListTextReadable = actorsNameList.join(', ')\nconst content = `${actorsAffected} characters had their Rage adjusted by ${mod}: ${actorsListTextReadable}`\n\nChatMessage.create({\n content\n})","folder":null,"ownership":{"default":0,"OrOQ70SVPCGayvrw":3},"flags":{"core":{}},"_stats":{"systemId":"vtm5e","systemVersion":"4.0.0-prerelease2","coreVersion":"12.331","createdTime":1701128014450,"modifiedTime":1708983861006,"lastModifiedBy":"OrOQ70SVPCGayvrw","compendiumSource":null,"duplicateSource":null},"_id":"msVZH2N9fH5emdEo","sort":0}
{"name":"Adjust Hunger","type":"script","scope":"global","author":"OrOQ70SVPCGayvrw","img":"systems/vtm5e/assets/icons/dice/vampire/success.png","command":"// Grab the list of selected tokens and map them\nconst tokens = canvas.tokens.controlled\nconst actorsList = tokens.map(i=>i.actor)\n\n// First input: Will prompt a number\nlet mod = await Dialog.prompt({content: 'Adjust Hunger by (+ or -) <input type=\"number\">', callback: (err, html) => html.find('input').val()})\n\nfor (const actor of actorsList){\n // If the actor isn't a vampire, skip them\n if (actor.type !== 'vampire') { return; }\n\n // Second input: The actor's current hunger\n const oldValue = Number(actor.system.hunger.value)\n // Add the inputs together\n let newValue = oldValue + Number(mod)\n\n // Check to make sure the input doesn't go over or below max/min values\n if (newValue > 5) { newValue = 5; }\n if (newValue < 0) { newValue = 0; }\n\n await actor.update({ \"system.hunger.value\": newValue })\n}","folder":null,"ownership":{"default":0,"OrOQ70SVPCGayvrw":3},"flags":{"core":{}},"_stats":{"systemId":"vtm5e","systemVersion":"4.0.0-prerelease1","coreVersion":"12.331","createdTime":1701128684097,"modifiedTime":1707813729386,"lastModifiedBy":"OrOQ70SVPCGayvrw","compendiumSource":null,"duplicateSource":null},"_id":"s3GbZTtgvLIpl4FP","sort":300000}
{"name":"Roll API Example","type":"script","scope":"global","author":"OrOQ70SVPCGayvrw","img":"icons/svg/dice-target.svg","command":"// This macro is an example of how you can access the WOD5E Roll API.\n// More documentation for the API will be released in the future.\n\n// Define the actor\nconst actor = game.actors.get(ChatMessage.getSpeaker().actor)\nconst data = actor.system\n\n// Get the value of any bonuses\nconst strength = data.attributes.strength.value\nconst animalism = data.disciplines.animalism.value\n\n// Define hunger dice\nconst advancedDice = Math.max(data.hunger.value, 0)\n// Define vampire dice\nconst basicDice = Math.max((strength + animalism) - advancedDice, 0)\n\n// Send the roll to the API\nWOD5E.api.Roll({\n title: \"Custom Roll\",\n basicDice,\n advancedDice\n})","folder":null,"ownership":{"default":0,"OrOQ70SVPCGayvrw":3},"flags":{"core":{}},"_stats":{"systemId":"vtm5e","systemVersion":"4.0.0-prerelease2","coreVersion":"12.331","createdTime":1707614396503,"modifiedTime":1708702777210,"lastModifiedBy":"OrOQ70SVPCGayvrw","compendiumSource":null,"duplicateSource":null},"_id":"xHe6LF89pUgEDxV3","sort":100000}
{"name":"Roll API Example","type":"script","scope":"global","author":"OrOQ70SVPCGayvrw","img":"icons/svg/dice-target.svg","command":"// This macro is an example of how you can access the WOD5E Roll API.\n\n// Define the actor\nconst actor = game.actors.get(ChatMessage.getSpeaker().actor)\n\n// Make sure we're only allowing vampires to roll this, since it includes hunger dice\nif (actor.type !== 'vampire') return ui.notifications.warn('Selected actor is not a vampire.')\n\n// Define any variables we need\nconst actorHunger = actor.system.hunger.value\nconst actorAttributes = actor.system.attributes\nconst actorDisciplines = actor.system.disciplines\n\n// Get the value of any bonuses\nconst strength = actorAttributes.strength.value\nconst animalism = actorDisciplines.animalism.value\n\n// Define hunger dice\nconst advancedDice = Math.max(actorHunger, 0)\n\n// Define vampire dice\n// \"Basic Dice\" is a calculation of what pool we're rolling, minus any \"Advanced Dice\"\nconst basicDice = Math.max((strength + animalism) - advancedDice, 0)\n\n// Send the roll to the API\nWOD5E.api.Roll({\ntitle: \"Custom Vampire Roll\",\nbasicDice,\nadvancedDice\n})","folder":null,"ownership":{"default":0,"OrOQ70SVPCGayvrw":3},"flags":{"core":{}},"_stats":{"systemId":"vtm5e","systemVersion":"4.0.0-prerelease2","coreVersion":"12.331","createdTime":1707614396503,"modifiedTime":1731184217275,"lastModifiedBy":"0uQsagcnnkt56LRN","compendiumSource":null,"duplicateSource":null},"_id":"xHe6LF89pUgEDxV3","sort":100000}
6 changes: 3 additions & 3 deletions system.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "vtm5e",
"title": "World of Darkness 5e",
"description": "World of Darkness 5e system for Foundry VTT",
"version": "5.0.6",
"version": "5.0.7",
"compatibility": {
"minimum": "12",
"verified": "12.331",
Expand Down Expand Up @@ -267,8 +267,8 @@
"url": "https://github.com/WoD5E-Developers/wod5e",
"bugs": "https://github.com/WoD5E-Developers/wod5e/issues",
"background": "systems/vtm5e/assets/images/wodcity.jpg",
"manifest": "https://github.com/WoD5E-Developers/wod5e/releases/download/5.0.6/system.json",
"download": "https://github.com/WoD5E-Developers/wod5e/releases/download/5.0.6/vtm5e.zip",
"manifest": "https://github.com/WoD5E-Developers/wod5e/releases/download/5.0.7/system.json",
"download": "https://github.com/WoD5E-Developers/wod5e/releases/download/5.0.7/vtm5e.zip",
"flags": {
"hotReload": {
"extensions": [
Expand Down
4 changes: 2 additions & 2 deletions system/actor/scripts/item-roll.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const _rollItem = async function (actor, item) {
const willpowerDamage = 0
const difficulty = 0
const disableBasicDice = false
const disableAdvancedDice = false
const disableAdvancedDice = ['ghoul', 'group'].includes(actor.type)
const quickRoll = false
const rerollHunger = false
const valuePaths = []
Expand Down Expand Up @@ -97,7 +97,7 @@ export const _rollItem = async function (actor, item) {
// Some quick modifications to vampire and werewolf rolls
// in order to properly display the dice in the dialog window
if (!disableBasicDice) {
if (system === 'vampire') {
if (system === 'vampire' && actor.type !== 'ghoul') {
// Ensure that the number of hunger dice doesn't exceed the
// total number of dice, unless it's a rouse check that needs
// rerolls, which requires twice the number of normal hunger
Expand Down
8 changes: 7 additions & 1 deletion system/actor/scripts/roll.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,26 @@ export const _onRoll = async function (event, target) {
*/
export const _onConfirmRoll = async function (dataset, actor) {
// Secondary variables
const { willpowerDamage, difficulty, disableBasicDice, disableAdvancedDice, quickRoll, rerollHunger, useAbsoluteValue, increaseHunger, decreaseRage } = dataset
const { willpowerDamage, difficulty, disableBasicDice, quickRoll, rerollHunger, useAbsoluteValue, increaseHunger, decreaseRage } = dataset
const title = dataset.label
const data = dataset.itemId ? actor.items.get(dataset.itemId).system : actor.system
const flavor = dataset.useFlavorPath ? await WOD5E.api.getFlavorDescription({ valuePath: dataset.flavorPath, data }) : dataset.flavor
const flatMod = parseInt(dataset.flatMod) || 0
const absoluteValue = parseInt(dataset.absoluteValue) || 0
const selectors = dataset.selectors ? dataset.selectors.split(' ') : []
const macro = dataset.itemId ? data.macroid : dataset.macroid
let disableAdvancedDice = dataset.disableAdvancedDice || false

// Add despair to the selectors if the Hunter is in despair
if (actor.type === 'hunter' && actor.system.despair.value === 1) {
selectors.push('despair')
}

// Disable advanced dice for ghouls, SPC, and group sheets
if (['ghoul', 'group'].includes(actor.type)) {
disableAdvancedDice = true
}

// Variables yet to be defined
let basicDice, advancedDice

Expand Down