Restored HitPoints counting up

This commit is contained in:
WBHarry 2025-06-08 23:05:57 +02:00
parent 9fe29e5136
commit 1d9197748c
7 changed files with 61 additions and 550 deletions

View file

@ -346,7 +346,10 @@ export default class DhpActor extends Actor {
: 0;
const update = {
'system.resources.hitPoints.value': Math.max(this.system.resources.hitPoints.value - hpDamage, 0)
'system.resources.hitPoints.value': Math.min(
this.system.resources.hitPoints.value + hpDamage,
this.system.resources.hitPoints.max
)
};
if (game.user.isGM) {

View file

@ -2370,229 +2370,6 @@ div.daggerheart.views.multiclass {
align-items: center;
gap: 5px;
}
.daggerheart.sheet.adversary .adversary-header-container {
position: relative;
background-color: grey;
display: flex;
}
.daggerheart.sheet.adversary .adversary-header-container .adversary-header {
flex: 1;
}
.daggerheart.sheet.adversary .adversary-header-container .adversary-header img {
height: 60px;
width: 60px;
}
.daggerheart.sheet.adversary .adversary-header-container .adversary-header .adversary-title {
display: flex;
align-items: center;
text-align: center;
font-size: 28px;
}
.daggerheart.sheet.adversary .adversary-header-container .adversary-header .adversary-title .title-text {
width: 100%;
}
.daggerheart.sheet.adversary .adversary-header-container .adversary-header .adversary-title input {
font-size: 28px;
border: 0;
height: 100%;
}
.daggerheart.sheet.adversary .adversary-header-container .adversary-toggle {
position: absolute;
top: 0;
right: 0;
background-color: white;
color: black;
flex: 0;
}
.daggerheart.sheet.adversary .motive-container {
background: lightgrey;
margin-bottom: 8px;
padding-bottom: 4px;
}
.daggerheart.sheet.adversary .motive-container .motive-title {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
}
.daggerheart.sheet.adversary .motive-container .motive-title .motive-title-base {
font-size: 21px;
}
.daggerheart.sheet.adversary .motive-container .motive-title .motive-title-value {
font-style: italic;
position: relative;
top: 2px;
}
.daggerheart.sheet.adversary .motive-container .motive-title i {
margin-left: 4px;
cursor: pointer;
}
.daggerheart.sheet.adversary .motive-container .motive-title i:hover {
filter: drop-shadow(0 0 3px red);
}
.daggerheart.sheet.adversary .adversary-content-container {
display: flex;
align-items: baseline;
}
.daggerheart.sheet.adversary .adversary-statistics-container {
flex: 1;
margin-right: 24px;
display: flex;
flex-direction: column;
gap: 12px;
}
.daggerheart.sheet.adversary .adversary-statistics-container .statistic-title {
flex: 0;
white-space: nowrap;
font-weight: bold;
}
.daggerheart.sheet.adversary .adversary-statistics-container .statistic-row {
display: flex;
align-items: center;
}
.daggerheart.sheet.adversary .adversary-statistics-container .statistic-row .statistic-value {
flex: 0;
white-space: nowrap;
margin-left: 4px;
}
.daggerheart.sheet.adversary .adversary-statistics-container .statistic-row .adversary-roll {
border: 0;
width: 16px;
margin-left: 4px;
align-self: baseline;
transition: transform 0.2s;
}
.daggerheart.sheet.adversary .adversary-statistics-container .statistic-row .adversary-roll:hover {
transform: rotate(30deg);
filter: drop-shadow(0px 0px 3px red);
cursor: pointer;
}
.daggerheart.sheet.adversary .adversary-statistics-container .statistic-resource-container {
display: flex;
align-items: center;
}
.daggerheart.sheet.adversary .adversary-statistics-container .statistic-resource-container label {
min-width: 44px;
}
.daggerheart.sheet.adversary .adversary-statistics-container .statistic-resource-container .statistic-resource-inner-container {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 4px;
}
.daggerheart.sheet.adversary .adversary-statistics-container .statistic-resource-container .resource-title {
align-self: center;
font-weight: bold;
}
.daggerheart.sheet.adversary .adversary-statistics-container .statistic-resource-container .statistic-resource-input {
margin: 0;
flex: 0;
min-width: 16px;
}
.daggerheart.sheet.adversary .adversary-statistics-container .attack-container {
border: 1px solid black dotted;
}
.daggerheart.sheet.adversary .adversary-statistics-container .experience-row {
display: flex;
}
.daggerheart.sheet.adversary .adversary-statistics-container .experience-row * {
flex: 0;
white-space: nowrap;
}
.daggerheart.sheet.adversary .adversary-statistics-container .experience-container i {
margin-left: 4px;
cursor: pointer;
}
.daggerheart.sheet.adversary .adversary-statistics-container .experience-container i:hover {
filter: drop-shadow(0 0 3px red);
}
.daggerheart.sheet.adversary .adversary-statistics-container .experience-chip {
border: 2px solid #708090;
border-radius: 6px;
display: flex;
align-items: center;
padding: 4px;
margin-bottom: 6px;
}
.daggerheart.sheet.adversary .adversary-statistics-container .experience-chip .experience-text {
flex: 1;
}
.daggerheart.sheet.adversary .adversary-statistics-container .experience-chip .experience-value {
flex: 0;
min-width: 26px;
margin: 0 4px;
}
.daggerheart.sheet.adversary .adversary-statistics-container .experience-chip .experience-button {
flex: 0;
border-radius: 50%;
height: 20px;
width: 20px;
display: flex;
align-items: center;
justify-content: center;
padding: 12px;
}
.daggerheart.sheet.adversary .adversary-damage-threshold-container input {
min-width: 26px;
}
.daggerheart.sheet.adversary .adversary-moves-container {
flex: 2.5;
}
.daggerheart.sheet.adversary .adversary-moves-container .moves-title {
text-decoration: underline;
font-weight: bold;
}
.daggerheart.sheet.adversary .adversary-moves-container .move-container {
cursor: pointer;
}
.daggerheart.sheet.adversary .adversary-moves-container .move-container:hover {
background: #2f4f4f40;
}
.daggerheart.sheet.adversary .adversary-moves-container .move-container .moves-name {
font-weight: bold;
text-decoration: none;
}
.daggerheart.sheet.adversary .adversary-moves-container .move-container .move-description p {
margin-top: 0;
}
.daggerheart.sheet.adversary .adversary-moves-container .moves-edit-container i {
margin-left: 4px;
cursor: pointer;
}
.daggerheart.sheet.adversary .adversary-moves-container .moves-edit-container i:hover {
filter: drop-shadow(0 0 3px red);
}
.daggerheart.sheet.adversary .chip-container {
display: flex;
align-items: center;
justify-content: space-between;
background: #778899;
padding: 8px;
border: 2px solid black;
border-radius: 6px;
}
.daggerheart.sheet.adversary .chip-container:not(:last-child) {
margin-bottom: 8px;
}
.daggerheart.sheet.adversary .chip-container .chip-inner-container {
display: flex;
align-items: center;
}
.daggerheart.sheet.adversary .chip-container .chip-inner-container img {
height: 40px;
width: 40px;
margin-right: 8px;
}
.daggerheart.sheet.adversary .chip-container .chip-inner-container .chip-title {
font-size: 22px;
font-weight: bold;
font-style: italic;
}
.daggerheart.sheet.adversary .chip-container button {
height: 40px;
width: 40px;
background: white;
}
.daggerheart.sheet .title-container {
display: flex;
gap: 8px;
@ -3078,6 +2855,9 @@ div.daggerheart.views.multiclass {
#resources:has(.fear-bar) {
min-width: 200px;
}
.application.sheet.daggerheart.actor.dh-style.adversary .window-content {
overflow: auto;
}
.application.sheet.daggerheart.dh-style.feature .item-sheet-header {
display: flex;
}

View file

@ -13,6 +13,8 @@
@import './resources.less';
// new styles imports
@import './less/actors/adversary.less';
@import './less/items/feature.less';
@import './less/items/domainCard.less';
@import './less/items/class.less';

View file

@ -0,0 +1,5 @@
.application.sheet.daggerheart.actor.dh-style.adversary {
.window-content {
overflow: auto;
}
}

View file

@ -1,280 +0,0 @@
.daggerheart.sheet.adversary {
.adversary-header-container {
position: relative;
background-color: grey;
display: flex;
.adversary-header {
flex: 1;
img {
height: 60px;
width: 60px;
}
.adversary-title {
display: flex;
align-items: center;
text-align: center;
font-size: 28px;
.title-text {
width: 100%;
}
input {
font-size: 28px;
border: 0;
height: 100%;
}
}
}
.adversary-toggle {
position: absolute;
top: 0;
right: 0;
background-color: white;
color: black;
flex: 0;
}
}
.motive-container {
background: lightgrey;
margin-bottom: @fullMargin;
padding-bottom: @fullPadding;
.motive-title {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
.motive-title-base {
font-size: 21px;
}
.motive-title-value {
font-style: italic;
position: relative;
top: 2px;
}
i {
margin-left: 4px;
cursor: pointer;
&:hover {
filter: drop-shadow(0 0 3px red);
}
}
}
}
.adversary-content-container {
display: flex;
align-items: baseline;
}
.adversary-statistics-container {
flex: 1;
margin-right: 24px;
display: flex;
flex-direction: column;
gap: @mediumMargin;
.statistic-title {
flex: 0;
white-space: nowrap;
font-weight: bold;
}
.statistic-row {
display: flex;
align-items: center;
.statistic-value {
flex: 0;
white-space: nowrap;
margin-left: 4px;
}
.adversary-roll {
border: 0;
width: 16px;
margin-left: 4px;
align-self: baseline;
transition: transform 0.2s;
&:hover {
transform: rotate(30deg);
filter: drop-shadow(0px 0px 3px red);
cursor: pointer;
}
}
}
.statistic-resource-container {
display: flex;
align-items: center;
label {
min-width: 44px;
}
.statistic-resource-inner-container {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: @halfMargin;
}
.resource-title {
align-self: center;
font-weight: bold;
}
.statistic-resource-input {
margin: 0;
flex: 0;
min-width: 16px;
}
}
.attack-container {
border: 1px solid black dotted;
}
.experience-row {
display: flex;
* {
flex: 0;
white-space: nowrap;
}
}
.experience-container {
i {
margin-left: 4px;
cursor: pointer;
&:hover {
filter: drop-shadow(0 0 3px red);
}
}
}
.experience-chip {
border: 2px solid @secondaryAccent;
border-radius: 6px;
display: flex;
align-items: center;
padding: 4px;
margin-bottom: 6px;
.experience-text {
flex: 1;
}
.experience-value {
flex: 0;
min-width: @inputSingleMinWidth;
margin: 0 4px;
}
.experience-button {
flex: 0;
border-radius: 50%;
height: 20px;
width: 20px;
display: flex;
align-items: center;
justify-content: center;
padding: 12px;
}
}
}
.adversary-damage-threshold-container {
input {
min-width: @inputSingleMinWidth;
}
}
.adversary-moves-container {
flex: 2.5;
.moves-title {
text-decoration: underline;
font-weight: bold;
}
.move-container {
cursor: pointer;
&:hover {
background: @hoverBackground;
}
.moves-name {
font-weight: bold;
text-decoration: none;
}
.move-description {
p {
margin-top: 0;
}
}
}
.moves-edit-container {
i {
margin-left: 4px;
cursor: pointer;
&:hover {
filter: drop-shadow(0 0 3px red);
}
}
}
}
.chip-container {
display: flex;
align-items: center;
justify-content: space-between;
background: @primaryAccent;
padding: 8px;
border: 2px solid black;
border-radius: 6px;
&:not(:last-child) {
margin-bottom: 8px;
}
.chip-inner-container {
display: flex;
align-items: center;
img {
height: 40px;
width: 40px;
margin-right: 8px;
}
.chip-title {
font-size: 22px;
font-weight: bold;
font-style: italic;
}
}
button {
height: 40px;
width: 40px;
background: white;
}
}
}

View file

@ -1,6 +1,5 @@
@import './heritage.less';
@import './class.less';
@import './adversary.less';
.daggerheart.sheet {
.title-container {

View file

@ -3,56 +3,58 @@
data-tab='{{tabs.main.id}}'
data-group='{{tabs.main.group}}'
>
<fieldset class="two-columns even">
<legend>{{localize "DAGGERHEART.Sheets.Adversary.General"}}</legend>
<div class="adversary-container">
<fieldset class="two-columns even">
<legend>{{localize "DAGGERHEART.Sheets.Adversary.General"}}</legend>
{{formGroup systemFields.tier value=source.system.tier localize=true}}
{{formGroup systemFields.type value=source.system.type localize=true}}
<div class="full-width">{{formGroup systemFields.difficulty value=source.system.difficulty}}</div>
{{formGroup systemFields.tier value=source.system.tier localize=true}}
{{formGroup systemFields.type value=source.system.type localize=true}}
<div class="full-width">{{formGroup systemFields.difficulty value=source.system.difficulty}}</div>
<fieldset>
<legend>{{localize "DAGGERHEART.Sheets.Adversary.DamageThresholds"}}</legend>
<fieldset>
<legend>{{localize "DAGGERHEART.Sheets.Adversary.DamageThresholds"}}</legend>
{{formGroup systemFields.damageThresholds.fields.major value=source.system.damageThresholds.major}}
{{formGroup systemFields.damageThresholds.fields.severe value=source.system.damageThresholds.severe}}
</fieldset>
<fieldset>
<legend>{{localize "DAGGERHEART.Sheets.Adversary.HitPoints"}}</legend>
{{formGroup systemFields.damageThresholds.fields.major value=source.system.damageThresholds.major}}
{{formGroup systemFields.damageThresholds.fields.severe value=source.system.damageThresholds.severe}}
</fieldset>
<fieldset>
<legend>{{localize "DAGGERHEART.Sheets.Adversary.HitPoints"}}</legend>
{{formGroup systemFields.resources.fields.hitPoints.fields.value value=source.system.resources.hitPoints.value}}
{{formGroup systemFields.resources.fields.hitPoints.fields.max value=source.system.resources.hitPoints.max}}
{{formGroup systemFields.resources.fields.hitPoints.fields.value value=source.system.resources.hitPoints.value}}
{{formGroup systemFields.resources.fields.hitPoints.fields.max value=source.system.resources.hitPoints.max}}
</fieldset>
<fieldset>
<legend>{{localize "DAGGERHEART.Sheets.Adversary.Stress"}}</legend>
{{formGroup systemFields.resources.fields.stress.fields.value value=source.system.resources.stress.value}}
{{formGroup systemFields.resources.fields.stress.fields.max value=source.system.resources.stress.max}}
</fieldset>
<fieldset>
<legend>{{localize "DAGGERHEART.Sheets.Adversary.Experiences"}} <a><i class="fa-solid fa-plus icon-button" data-action="addExperience"></i></a></legend>
{{#each source.system.experiences}}
<fieldset class="one-column">
<legend>{{this.name}} <a><i class="fa-solid fa-trash icon-button" data-action="removeExperience" data-experience="{{@key}}"></i></a></legend>
{{formGroup @root.systemFields.experiences.element.fields.name name=(concat "system.experiences." @key ".name") value=this.name }}
{{formGroup @root.systemFields.experiences.element.fields.value name=(concat "system.experiences." @key ".value") value=this.value }}
</fieldset>
{{/each}}
</fieldset>
</fieldset>
<fieldset>
<legend>{{localize "DAGGERHEART.Sheets.Adversary.Stress"}}</legend>
<fieldset class="two-columns even">
<legend>{{localize "DAGGERHEART.Sheets.Adversary.Attack"}}</legend>
{{formGroup systemFields.resources.fields.stress.fields.value value=source.system.resources.stress.value}}
{{formGroup systemFields.resources.fields.stress.fields.max value=source.system.resources.stress.max}}
</fieldset>
<fieldset>
<legend>{{localize "DAGGERHEART.Sheets.Adversary.Experiences"}} <a><i class="fa-solid fa-plus icon-button" data-action="addExperience"></i></a></legend>
{{#each source.system.experiences}}
<fieldset class="one-column">
<legend>{{this.name}} <a><i class="fa-solid fa-trash icon-button" data-action="removeExperience" data-experience="{{@key}}"></i></a></legend>
{{formGroup @root.systemFields.experiences.element.fields.name name=(concat "system.experiences." @key ".name") value=this.name }}
{{formGroup @root.systemFields.experiences.element.fields.value name=(concat "system.experiences." @key ".value") value=this.value }}
</fieldset>
{{/each}}
</fieldset>
</fieldset>
<fieldset class="two-columns even">
<legend>{{localize "DAGGERHEART.Sheets.Adversary.Attack"}}</legend>
{{formGroup systemFields.attack.fields.name value=source.system.attack.name}}
<button data-action="attackRoll">Attack</button>
{{formGroup systemFields.attack.fields.modifier value=source.system.attack.modifier}}
{{formGroup systemFields.attack.fields.range value=source.system.attack.range localize=true}}
{{formGroup systemFields.attack.fields.damage.fields.value value=source.system.attack.damage.value}}
{{formGroup systemFields.attack.fields.damage.fields.type value=source.system.attack.damage.type localize=true}}
</fieldset>
{{formGroup systemFields.attack.fields.name value=source.system.attack.name}}
<button data-action="attackRoll">Attack</button>
{{formGroup systemFields.attack.fields.modifier value=source.system.attack.modifier}}
{{formGroup systemFields.attack.fields.range value=source.system.attack.range localize=true}}
{{formGroup systemFields.attack.fields.damage.fields.value value=source.system.attack.damage.value}}
{{formGroup systemFields.attack.fields.damage.fields.type value=source.system.attack.damage.type localize=true}}
</fieldset>
</div>
</section>