Skip to content

Commit e216eb5

Browse files
Party Sheet Fixes (#626)
* fix: Make bottom of names not cropped in party sheet * feat: Party backgrounds also account for class level
1 parent b9325f9 commit e216eb5

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

module/documents/actors/party/party-data-model.mjs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ export class PartyDataModel extends foundry.abstract.TypeDataModel {
192192
name: item.name,
193193
fuid: item.system.fuid,
194194
img: item.img,
195+
level: item.system.level.value,
195196
};
196197
});
197198

@@ -456,22 +457,24 @@ function deduceCharacterRole(actor, classes) {
456457

457458
for (const c of classes) {
458459
if (supportClasses.has(c.fuid)) {
459-
supportCount++;
460+
supportCount += c.level;
460461
} else if (damageClasses.has(c.fuid)) {
461-
damageCount++;
462+
damageCount += c.level;
462463
} else if (tankClasses.has(c.fuid)) {
463-
tankCount++;
464+
tankCount += c.level;
464465
}
465466
// It's all damage in the end
466467
else {
467-
damageCount++;
468+
damageCount += c.level;
468469
}
469470
}
470471

471-
if (supportCount > 0 && damageCount > 0 && tankCount > 0) {
472+
// Any, unless one class has more than the other two combined
473+
if (supportCount > 0 && damageCount > 0 && tankCount > 0 && damageCount + supportCount > tankCount && damageCount + tankCount > supportCount && supportCount + tankCount > damageCount) {
472474
return 'any';
473475
}
474476

477+
// Always prio tank
475478
if (tankCount > 0) {
476479
return 'tank';
477480
} else if (supportCount > Math.round(damageCount / 2)) {

styles/css/actor/actor-v1/actor.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,8 @@
806806

807807
.projectfu .party .overview .plate .name {
808808
margin-top: 4px;
809+
margin-bottom: -8px;
810+
padding-bottom: 8px;
809811
font-size: 2rem;
810812
text-align: center;
811813
font-weight: 800;

0 commit comments

Comments
 (0)