Skip to content

Commit

Permalink
Create-actor name generation -> DS IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
ben committed Aug 26, 2024
1 parent eb86c79 commit 794856e
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/module/applications/createActorDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ export class CreateActorDialog extends FormApplication<CreateActorDialogOptions>
ev.preventDefault()

// Roll an Ironlander name
const tables = await this._ironlanderNameTables()
const table = sample(tables)
const table = await OracleTable.getByDsId(
'oracle_rollable:classic/name/ironlander'
)
const drawResult = await table?.draw({ displayChat: false })

this._createWithFolder(
Expand Down Expand Up @@ -158,22 +159,11 @@ export class CreateActorDialog extends FormApplication<CreateActorDialogOptions>
await this.close()
}

async _ironlanderNameTables(): Promise<OracleTable[] | undefined> {
const tableA = (await OracleTable.getByDfId(
'Ironsworn/Oracles/Name/Ironlander/A'
)) as any
const tableB = (await OracleTable.getByDfId(
'Ironsworn/Oracles/Name/Ironlander/B'
)) as any
if (tableA && tableB) return [tableA, tableB]
return undefined
}

async _randomStarforgedName(): Promise<string | undefined> {
const [givenName, familyName] = await OracleTable.ask(
[
'Starforged/Oracles/Characters/Name/Given_Name',
'Starforged/Oracles/Characters/Name/Family_Name'
'oracle_rollable:starforged/character/name/given_name',
'oracle_rollable:starforged/character/name/family_name'
],
{ displayChat: false }
)
Expand Down

0 comments on commit 794856e

Please sign in to comment.