Skip to content

Commit

Permalink
Enabled the sheet to launch
Browse files Browse the repository at this point in the history
  • Loading branch information
eastcw committed May 22, 2024
1 parent dee02d1 commit d573da8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}

- name: Cache Node.js modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -43,15 +43,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}

- name: Cache Node.js modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
run: npm run build

- name: Archive production artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
Expand All @@ -93,10 +93,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Download production artifacts for publication
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dist
path: dist
Expand Down
12 changes: 9 additions & 3 deletions src/module/compact-beyond-5e-sheet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,22 @@ export class CompactBeyond5eSheet extends dnd5e.applications.actor.ActorSheet5eC

// apply the bonuses if they are equivalent
if (bonuses.msak.attack === bonuses.rsak.attack) {
spellAttackModFormula.push(bonuses.msak.attack);
if (bonuses.msak.attack) {
spellAttackModFormula.push(bonuses.msak.attack);
} else {
spellAttackModFormula.push(0);
}
} else if (!!bonuses.msak.attack && !!bonuses.rsak.attack) {
const formulaA = new Roll(bonuses.msak.attack);
const formulaB = new Roll(bonuses.rsak.attack);

// apply the lesser deterministic bonus
if (formulaA.isDeterministic && formulaB.isDeterministic) {
spellAttackModFormula.push(
Math.min(formulaA.evaluate({ async: false }).total, formulaB.evaluate({ async: false }.total))
let lesserBonus = Math.min(
formulaA.evaluate({ async: false }).total,
formulaB.evaluate({ async: false }.total)
);
spellAttackModFormula.push(lesserBonus ? lesserBonus : 0);
}
}

Expand Down

0 comments on commit d573da8

Please sign in to comment.