File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
module/documents/actors/party
styles/css/actor/actor-v1 Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff 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 ) ) {
Original file line number Diff line number Diff line change 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 ;
You can’t perform that action at this time.
0 commit comments