Skip to content

Commit

Permalink
Merge pull request #10 from jsavko/dev
Browse files Browse the repository at this point in the history
alliance checking
  • Loading branch information
jsavko authored Mar 21, 2024
2 parents b9b5dbb + 1672968 commit 2f2f3e6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.0.3
XP calculations will now only calcluate opposition npcs instead of all NPCs for combat auto calculated exp
Added check for Proficeny without Level Variaent xp calculations

1.0.2
Filter Eidolons and Minions from the XP award Menu

Expand Down
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "pf2e-award-xp",
"title": "pf2e award xp",
"version": "1.0.2",
"version": "1.0.3",
"compatibility": {
"minimum": "11",
"verified": "11"
Expand Down Expand Up @@ -37,5 +37,5 @@
}
],
"manifest": "https://github.com/jsavko/pf2e-award-xp/releases/latest/download/module.json",
"download": "https://github.com/jsavko/pf2e-award-xp/releases/download/1.0.2/module.zip"
"download": "https://github.com/jsavko/pf2e-award-xp/releases/download/1.0.3/module.zip"
}
7 changes: 4 additions & 3 deletions pf2e-awardxp.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@

Hooks.on('preDeleteCombat', (combat,html,id) => {
if (!game.user.isGM) return
const pcs = combat.combatants.filter(c => c.actor.type==='character' && !c.actor.traits.has('eidolon') && !c.actor.traits.has('minion')).map(c => c.actor)
const pcs = combat.combatants.filter(c => c.actor.type==='character' && c.actor.alliance === 'party' && !c.actor.traits.has('eidolon') && !c.actor.traits.has('minion')).map(c => c.actor)
const pwol = game.pf2e.settings.variants.pwol.enabled;
let calulatedXP = game.pf2e.gm.calculateXP(
pcs[0].system.details.level.value,
pcs.length,
combat.combatants.filter(c => c.actor.type === 'npc').map(c => c.actor.system.details.level.value),
combat.combatants.filter(c => c.actor.alliance === 'opposition').map(c => c.actor.system.details.level.value),
combat.combatants.filter(c => c.actor.type === "hazard").map(c => c.actor.system.details.level.value),
{}
{pwol}
)
const award = new game.pf2e_awardxp.Award(null,{destinations:pcs, description:'Encounter (' + calulatedXP.rating.charAt(0).toUpperCase() + calulatedXP.rating.slice(1) + ')', xp:calulatedXP.xpPerPlayer});
award.render(true);
Expand Down

0 comments on commit 2f2f3e6

Please sign in to comment.