mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Action Save difficulty (#427)
* Action Save difficulty * Unequipped item icon opacity * Fix sheet header
This commit is contained in:
parent
33ac7d5ab7
commit
8cb4b7663e
13 changed files with 20 additions and 12 deletions
|
|
@ -110,6 +110,7 @@ export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) {
|
||||||
context.costOptions = this.getCostOptions();
|
context.costOptions = this.getCostOptions();
|
||||||
context.disableOption = this.disableOption.bind(this);
|
context.disableOption = this.disableOption.bind(this);
|
||||||
context.isNPC = this.action.actor?.isNPC;
|
context.isNPC = this.action.actor?.isNPC;
|
||||||
|
context.baseSaveDifficulty = this.action.actor?.baseSaveDifficulty;
|
||||||
context.hasRoll = this.action.hasRoll;
|
context.hasRoll = this.action.hasRoll;
|
||||||
|
|
||||||
const settingsTiers = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LevelTiers).tiers;
|
const settingsTiers = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LevelTiers).tiers;
|
||||||
|
|
|
||||||
|
|
@ -311,7 +311,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
icon: 'fa-solid fa-hands',
|
icon: 'fa-solid fa-hands',
|
||||||
condition: target => {
|
condition: target => {
|
||||||
const doc = getDocFromElementSync(target);
|
const doc = getDocFromElementSync(target);
|
||||||
return doc && system.equipped;
|
return doc && doc.system.equipped;
|
||||||
},
|
},
|
||||||
callback: (target, event) => CharacterSheet.#toggleEquipItem.call(this, event, target)
|
callback: (target, event) => CharacterSheet.#toggleEquipItem.call(this, event, target)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -305,7 +305,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
||||||
title: 'Roll Save',
|
title: 'Roll Save',
|
||||||
roll: {
|
roll: {
|
||||||
trait: this.save.trait,
|
trait: this.save.trait,
|
||||||
difficulty: this.save.difficulty,
|
difficulty: this.save.difficulty ?? this.actor?.baseSaveDifficulty,
|
||||||
type: 'reaction'
|
type: 'reaction'
|
||||||
},
|
},
|
||||||
data: target.actor.getRollData()
|
data: target.actor.getRollData()
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ export default class SaveField extends fields.SchemaField {
|
||||||
initial: null,
|
initial: null,
|
||||||
choices: CONFIG.DH.ACTOR.abilities
|
choices: CONFIG.DH.ACTOR.abilities
|
||||||
}),
|
}),
|
||||||
difficulty: new fields.NumberField({ nullable: true, initial: 10, integer: true, min: 0 }),
|
difficulty: new fields.NumberField({ nullable: true, initial: null, integer: true, min: 0 }),
|
||||||
damageMod: new fields.StringField({
|
damageMod: new fields.StringField({
|
||||||
initial: CONFIG.DH.ACTIONS.damageOnSave.none.id,
|
initial: CONFIG.DH.ACTIONS.damageOnSave.none.id,
|
||||||
choices: CONFIG.DH.ACTIONS.damageOnSave
|
choices: CONFIG.DH.ACTIONS.damageOnSave
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,7 @@ export default class TargetField extends fields.SchemaField {
|
||||||
type: new fields.StringField({
|
type: new fields.StringField({
|
||||||
choices: CONFIG.DH.ACTIONS.targetTypes,
|
choices: CONFIG.DH.ACTIONS.targetTypes,
|
||||||
initial: CONFIG.DH.ACTIONS.targetTypes.any.id,
|
initial: CONFIG.DH.ACTIONS.targetTypes.any.id,
|
||||||
nullable: true,
|
nullable: true
|
||||||
initial: null
|
|
||||||
}),
|
}),
|
||||||
amount: new fields.NumberField({ nullable: true, initial: null, integer: true, min: 0 })
|
amount: new fields.NumberField({ nullable: true, initial: null, integer: true, min: 0 })
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -385,6 +385,10 @@ export default class DhpActor extends Actor {
|
||||||
return CONFIG.Dice.daggerheart[['character', 'companion'].includes(this.type) ? 'DualityRoll' : 'D20Roll'];
|
return CONFIG.Dice.daggerheart[['character', 'companion'].includes(this.type) ? 'DualityRoll' : 'D20Roll'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get baseSaveDifficulty() {
|
||||||
|
return this.system.difficulty ?? 10;
|
||||||
|
}
|
||||||
|
|
||||||
getRollData() {
|
getRollData() {
|
||||||
const rollData = super.getRollData();
|
const rollData = super.getRollData();
|
||||||
rollData.system = this.system.getRollData();
|
rollData.system = this.system.getRollData();
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,10 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: end;
|
justify-content: end;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
|
|
||||||
|
.unequipped {
|
||||||
|
opacity: .5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 5px;
|
gap: 5px;
|
||||||
margin-top: 36px;
|
margin-top: var(--header-height);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,9 @@
|
||||||
|
|
||||||
// Window header styles
|
// Window header styles
|
||||||
.window-header {
|
.window-header {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: var(--header-height);
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
justify-content: end;
|
justify-content: end;
|
||||||
|
|
@ -41,11 +44,9 @@
|
||||||
.window-content {
|
.window-content {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
top: -36px;
|
|
||||||
min-height: -webkit-fill-available;
|
min-height: -webkit-fill-available;
|
||||||
transition: opacity 0.3s ease;
|
transition: opacity 0.3s ease;
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
margin-bottom: -36px;
|
|
||||||
|
|
||||||
.tab {
|
.tab {
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
.application.sheet.daggerheart.actor.dh-style.adversary {
|
.application.sheet.daggerheart.actor.dh-style.adversary {
|
||||||
.adversary-header-sheet {
|
.adversary-header-sheet {
|
||||||
padding: 0 15px;
|
padding: 0 15px;
|
||||||
padding-top: 36px;
|
padding-top: var(--header-height);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
.name-row {
|
.name-row {
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
.application.sheet.daggerheart.actor.dh-style.character {
|
.application.sheet.daggerheart.actor.dh-style.character {
|
||||||
.character-header-sheet {
|
.character-header-sheet {
|
||||||
padding: 0 15px;
|
padding: 0 15px;
|
||||||
padding-top: 36px;
|
padding-top: var(--header-height);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
.name-row {
|
.name-row {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
margin-bottom: 0;
|
|
||||||
|
|
||||||
.character-sidebar-sheet {
|
.character-sidebar-sheet {
|
||||||
grid-row: 1 / span 2;
|
grid-row: 1 / span 2;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<fieldset class="flex">
|
<fieldset class="flex">
|
||||||
<legend>{{localize "DAGGERHEART.GENERAL.save"}}</legend>
|
<legend>{{localize "DAGGERHEART.GENERAL.save"}}</legend>
|
||||||
{{formField fields.trait label="Trait" name="save.trait" value=source.trait localize=true}}
|
{{formField fields.trait label="Trait" name="save.trait" value=source.trait localize=true}}
|
||||||
{{formField fields.difficulty label="Difficulty" name="save.difficulty" value=source.difficulty disabled=(not source.trait)}}
|
{{formField fields.difficulty label="Difficulty" name="save.difficulty" value=source.difficulty disabled=(not source.trait) placeholder=@root.baseSaveDifficulty}}
|
||||||
{{formField fields.damageMod label="Damage on Save" name="save.damageMod" value=source.damageMod localize=true disabled=(not source.trait)}}
|
{{formField fields.damageMod label="Damage on Save" name="save.damageMod" value=source.damageMod localize=true disabled=(not source.trait)}}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue