Skip to content

Commit

Permalink
Finish refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
cswendrowski committed Jan 11, 2021
1 parent 33f42b6 commit a998851
Show file tree
Hide file tree
Showing 5 changed files with 248 additions and 156 deletions.
12 changes: 12 additions & 0 deletions scripts/thirteenth-age.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@

export default class ThirteenthAge {

getPlayerCharacters() {
return game.actors.entities.filter((x) => x.hasPlayerOwner && x.data.type == "character");
}

getNpcs() {
return game.actors.entities.filter((x) => x.data.type == "npc");
}

filterAvailableActors(availableActors, filters) {
if (filters.selectedSources.length > 0) {
availableActors = availableActors.filter(x => filters.selectedSources.includes(this.getActorSource(x).toLowerCase()));
Expand Down Expand Up @@ -51,6 +59,10 @@ export default class ThirteenthAge {
return source;
};

getUniqueKey(actor, partyInfo, encounterSettings) {
return actor._id + partyInfo.averagePartyLevel + partyInfo.numberOfPartyMembers;
}

getEncounterScore(actor, partyInfo) {
if (actor == undefined) return -30;
//console.log(actor);
Expand Down
Loading

0 comments on commit a998851

Please sign in to comment.