Skip to content

Commit

Permalink
Fix SI "set a course" and "resupply
Browse files Browse the repository at this point in the history
  • Loading branch information
ben committed Sep 8, 2024
1 parent 3cf85f4 commit 6b0077a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Cursed die support when rolling oracles ([#1026](https://github.com/ben/foundry-ironsworn/pull/1026))
- Fix an issue with the truths dialog resulting in blank outputs ([#1027](https://github.com/ben/foundry-ironsworn/pull/1027))
- Fix a move data issue that was preventing SI "Set A Course" from being rollable

## 1.24.2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
"Roll type": "Action roll",
"Method": "Any",
"Using": [
"Custom",
"Custom",
"Custom",
"Custom",
"Custom"
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"Roll type": "Action roll",
"Method": "Any",
"Using": [
"Asset Control"
"Supply"
]
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"Roll type": "Action roll",
"Method": "Any",
"Using": [
"Supply",
"Asset Control"
"Supply"
]
}
]
Expand Down
38 changes: 21 additions & 17 deletions src/module/datasworn2/import/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {
import { IdParser, DataswornTree } from '..'
import { writeFile, mkdir } from 'fs/promises'
import { existsSync } from 'fs'
import { capitalize, compact, flatten } from 'lodash-es'
import { capitalize, compact, flatten, uniq } from 'lodash-es'
import { ICON_MAP } from './images'
import {
renderText,
Expand Down Expand Up @@ -300,24 +300,28 @@ for (const collection of collections) {
progress_roll: 'Any',
all: 'All'
}[c.method],
Using: c.roll_options.map((r) => {
if (r.using === 'asset_control') {
if (r.assets?.[0]?.includes('companion')) {
return 'Companion Health'
Using: uniq(
c.roll_options.map((r) => {
if (r.using === 'asset_control') {
console.log('!!!!', r)
if (r.assets?.[0]?.includes('companion')) {
return 'Companion Health'
}
if (r.control === 'integrity') {
return 'Vehicle Integrity'
}
return titleCase(r.control)
}
if (r.control === 'integrity') {
return 'Vehicle Integrity'

if (r.using === 'condition_meter') {
return capitalize(r.condition_meter)
}
}

if (r.using === 'condition_meter') {
return capitalize(r.condition_meter)
}
if (r.stat) {
return capitalize(r.stat)
}
return titleCase(r.using.replace('_', ' '))
})
if (r.stat) {
return capitalize(r.stat)
}
return titleCase(r.using.replace('_', ' '))
})
)
}))
},
Outcomes: {
Expand Down

0 comments on commit 6b0077a

Please sign in to comment.