mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-23 19:09:55 +02:00
feat: add resource automatic cost modification on attack or action
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
This commit is contained in:
parent
eccab6ad64
commit
e9e8d2bd59
7 changed files with 25 additions and 4 deletions
|
|
@ -2654,6 +2654,7 @@
|
||||||
},
|
},
|
||||||
"Weapon": {
|
"Weapon": {
|
||||||
"weaponType": "Weapon Type",
|
"weaponType": "Weapon Type",
|
||||||
|
"configureAttack": "Configure Attack",
|
||||||
"primaryWeapon": {
|
"primaryWeapon": {
|
||||||
"full": "Primary Weapon",
|
"full": "Primary Weapon",
|
||||||
"short": "Primary"
|
"short": "Primary"
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2)
|
||||||
context.allDamageTypesUsed = !getUnusedDamageTypes(this.action.damage.parts).length;
|
context.allDamageTypesUsed = !getUnusedDamageTypes(this.action.damage.parts).length;
|
||||||
|
|
||||||
if (this.action.damage.hasOwnProperty('includeBase') && this.action.type === 'attack')
|
if (this.action.damage.hasOwnProperty('includeBase') && this.action.type === 'attack')
|
||||||
context.hasBaseDamage = !!this.action.parent.attack;
|
context.hasBaseDamage = !!this.action.parent.attack && !this.action.baseAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
context.costOptions = this.getCostOptions();
|
context.costOptions = this.getCostOptions();
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@ export default class WeaponSheet extends ItemAttachmentSheet(DHBaseItemSheet) {
|
||||||
/**@inheritdoc */
|
/**@inheritdoc */
|
||||||
static DEFAULT_OPTIONS = {
|
static DEFAULT_OPTIONS = {
|
||||||
classes: ['weapon'],
|
classes: ['weapon'],
|
||||||
|
actions: {
|
||||||
|
configureAttack: WeaponSheet.#configureAttack
|
||||||
|
},
|
||||||
tagifyConfigs: [
|
tagifyConfigs: [
|
||||||
{
|
{
|
||||||
selector: '.features-input',
|
selector: '.features-input',
|
||||||
|
|
@ -46,6 +49,13 @@ export default class WeaponSheet extends ItemAttachmentSheet(DHBaseItemSheet) {
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open the action configuration sheet for the weapon's base attack.
|
||||||
|
*/
|
||||||
|
static #configureAttack() {
|
||||||
|
this.document.system.attack.sheet.render({ force: true });
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback function used by `tagifyElement`.
|
* Callback function used by `tagifyElement`.
|
||||||
* @param {Array<Object>} selectedOptions - The currently selected tag objects.
|
* @param {Array<Object>} selectedOptions - The currently selected tag objects.
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@
|
||||||
"image": {},
|
"image": {},
|
||||||
"text": {
|
"text": {
|
||||||
"format": 1,
|
"format": 1,
|
||||||
"content": "<blockquote><p>This product includes materials from the Daggerheart System Reference Document 1.0, © Critical Role, LLC. under the terms of the Darrington Press Community Gaming (DPCGL) License. More information can be found at <a href=\"https://www.daggerheart.com/\" title=\"Daggerheart Official Website\">https://www.daggerheart.com</a>. There are no previous modifications by others.</p><p></p></blockquote><h1>The Foundryborne Team</h1><p></p><p>The Foundryborne Team consists of:</p><p></p><ul><li><p>@harryfuralle</p></li><li><p>@cptn_cosmo</p></li><li><p>@molilo</p></li><li><p>@joaquinp98</p></li><li><p>@dapoulp</p></li><li><p>@ikraik</p></li><li><p>@irktheimp</p></li><li><p>@jacobwojo</p></li><li><p>@vyrth</p></li><li><p>@.ontaro</p></li><li><p>@saatsin</p></li><li><p>@david.xyz</p></li><li><p>@lazjen</p></li></ul><p></p><p>With Art from:</p><p></p><ul><li><p>@molilo (Foundryborne User Interface & Domain Card Placeholder Artwork)</p></li><li><p>@UsernameIsInUse (Foundryborne Logo, Website Design, Duality Roll Icon</p></li><li><p>@CyrensMaps (Combat Wheelchair Icons)</p></li></ul><p></p><p>And special thanks to our hard working community testers:<br /></p><ul><li><p>@lazjen</p></li></ul><p></p><p>We would also like to thank the FoundryVTT team for their support in publishing this system, as well as providing countless Icons to be used in many places.</p><p>And, of course, special thanks to the teams at Critical Role and Darrington Press for making such a wonderful game and updating the license to allow a FoundryVTT version of the system.</p><p></p><h1>The Foundryborne Community</h1><p></p><p>Without our amazing community this project would not have been possible.</p><p>You kept us going with both direct contributions and just endless support!</p><p>We thank you with all our hearts.</p><p><a href=\"https://foundryborne.online/\" title=\"Foundryborne official website\">Come join us!</a></p>"
|
"content": "<blockquote><p>This product includes materials from the Daggerheart System Reference Document 1.0, © Critical Role, LLC. under the terms of the Darrington Press Community Gaming (DPCGL) License. More information can be found at <a href=\"https://www.daggerheart.com/\" title=\"Daggerheart Official Website\">https://www.daggerheart.com</a>. There are no previous modifications by others.</p><p></p></blockquote><h1>The Foundryborne Team</h1><p></p><p>The Foundryborne Team consists of:</p><p></p><ul><li><p>@harryfuralle</p></li><li><p>@cptn_cosmo</p></li><li><p>@molilo</p></li><li><p>@joaquinp98</p></li><li><p>@dapoulp</p></li><li><p>@ikraik</p></li><li><p>@irktheimp</p></li><li><p>@jacobwojo</p></li><li><p>@vyrth</p></li><li><p>@.ontaro</p></li><li><p>@saatsin</p></li><li><p>@david.xyz</p></li><li><p>@lazjen</p></li><li><p>@Skarlso</p></li></ul><p></p><p>With Art from:</p><p></p><ul><li><p>@molilo (Foundryborne User Interface & Domain Card Placeholder Artwork)</p></li><li><p>@UsernameIsInUse (Foundryborne Logo, Website Design, Duality Roll Icon</p></li><li><p>@CyrensMaps (Combat Wheelchair Icons)</p></li></ul><p></p><p>And special thanks to our hard working community testers:<br /></p><ul><li><p>@lazjen</p></li></ul><p></p><p>We would also like to thank the FoundryVTT team for their support in publishing this system, as well as providing countless Icons to be used in many places.</p><p>And, of course, special thanks to the teams at Critical Role and Darrington Press for making such a wonderful game and updating the license to allow a FoundryVTT version of the system.</p><p></p><h1>The Foundryborne Community</h1><p></p><p>Without our amazing community this project would not have been possible.</p><p>You kept us going with both direct contributions and just endless support!</p><p>We thank you with all our hearts.</p><p><a href=\"https://foundryborne.online/\" title=\"Foundryborne official website\">Come join us!</a></p>"
|
||||||
},
|
},
|
||||||
"video": {
|
"video": {
|
||||||
"controls": true,
|
"controls": true,
|
||||||
|
|
|
||||||
|
|
@ -4,3 +4,4 @@
|
||||||
@import './feature.less';
|
@import './feature.less';
|
||||||
@import './heritage.less';
|
@import './heritage.less';
|
||||||
@import './item-sheet-shared.less';
|
@import './item-sheet-shared.less';
|
||||||
|
@import './weapon.less';
|
||||||
6
styles/less/sheets/items/weapon.less
Normal file
6
styles/less/sheets/items/weapon.less
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
.application.sheet.daggerheart.dh-style.weapon {
|
||||||
|
section.tab {
|
||||||
|
height: 400px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -4,7 +4,10 @@
|
||||||
data-group='{{tabs.settings.group}}'
|
data-group='{{tabs.settings.group}}'
|
||||||
>
|
>
|
||||||
<fieldset class="two-columns">
|
<fieldset class="two-columns">
|
||||||
<legend>{{localize tabs.settings.label}}</legend>
|
<legend>
|
||||||
|
{{localize tabs.settings.label}}
|
||||||
|
<a data-action="configureAttack" data-tooltip="{{localize 'DAGGERHEART.ITEMS.Weapon.configureAttack'}}"><i class="fa-solid fa-wrench icon-button"></i></a>
|
||||||
|
</legend>
|
||||||
<span>{{localize "DAGGERHEART.GENERAL.Tiers.singular"}}</span>
|
<span>{{localize "DAGGERHEART.GENERAL.Tiers.singular"}}</span>
|
||||||
{{formInput systemFields.tier value=source.system.tier}}
|
{{formInput systemFields.tier value=source.system.tier}}
|
||||||
<span>{{localize "DAGGERHEART.ITEMS.Weapon.secondaryWeapon.full"}}</span>
|
<span>{{localize "DAGGERHEART.ITEMS.Weapon.secondaryWeapon.full"}}</span>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue