Added background and connection questions (#1109)

This commit is contained in:
WBHarry 2025-08-29 01:26:22 +02:00 committed by GitHub
parent 8fd63d5963
commit c6741b1c7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 201 additions and 39 deletions

View file

@ -170,7 +170,9 @@
"hint": "Add single words or short text as reminders and hints of what a character has advantage on."
},
"age": "Age",
"backgroundQuestions": "Backgrounds",
"companionFeatures": "Companion Features",
"connections": "Connections",
"contextMenu": {
"consume": "Consume Item",
"equip": "Equip",
@ -267,7 +269,8 @@
"experience": "Experience",
"traits": "Traits",
"domainCards": "Domain Cards",
"equipment": "Equipment"
"equipment": "Equipment",
"story": "Story"
},
"ancestryNamePlaceholder": "Your ancestry's name",
"buttonTitle": "Character Setup",
@ -288,6 +291,7 @@
"selectSubclass": "Select Subclass",
"startingItems": "Starting Items",
"story": "Story",
"storyExplanation": "Select which background and connection prompts you want to copy into your character's background.",
"suggestedArmor": "Suggested Armor",
"suggestedPrimaryWeapon": "Suggested Primary Weapon",
"suggestedSecondaryWeapon": "Suggested Secondary Weapon",
@ -1912,7 +1916,8 @@
"downtime": "Downtime",
"roll": "Roll",
"rules": "Rules",
"types": "Types"
"types": "Types",
"questions": "Questions"
},
"Tiers": {
"singular": "Tier",

View file

@ -46,6 +46,10 @@ export default class ClassSheet extends DHBaseItemSheet {
template: 'systems/daggerheart/templates/sheets/items/class/settings.hbs',
scrollable: ['.settings']
},
questions: {
template: 'systems/daggerheart/templates/sheets/items/class/questions.hbs',
scrollable: ['.questions']
},
effects: {
template: 'systems/daggerheart/templates/sheets/global/tabs/tab-effects.hbs',
scrollable: ['.effects']
@ -55,7 +59,13 @@ export default class ClassSheet extends DHBaseItemSheet {
/** @inheritdoc */
static TABS = {
primary: {
tabs: [{ id: 'description' }, { id: 'features' }, { id: 'settings' }, { id: 'effects' }],
tabs: [
{ id: 'description' },
{ id: 'features' },
{ id: 'settings' },
{ id: 'questions' },
{ id: 'effects' }
],
initial: 'description',
labelPrefix: 'DAGGERHEART.GENERAL.Tabs'
}

View file

@ -49,6 +49,8 @@ export default class DHClass extends BaseDataItem {
suggestedSecondaryWeapon: new ForeignDocumentUUIDField({ type: 'Item' }),
suggestedArmor: new ForeignDocumentUUIDField({ type: 'Item' })
}),
backgroundQuestions: new fields.ArrayField(new fields.StringField(), { initial: ['', '', ''] }),
connections: new fields.ArrayField(new fields.StringField(), { initial: ['', '', ''] }),
isMulticlass: new fields.BooleanField({ initial: false })
};
}
@ -96,6 +98,20 @@ export default class DHClass extends BaseDataItem {
}
}
}
if (!data.system.isMulticlass) {
const addQuestions = (base, questions) => {
return `${base}${questions.map(q => `<p><strong>${q}</strong></p>`).join('<br/>')}`;
};
const backgroundQuestions = data.system.backgroundQuestions.filter(x => x);
const connections = data.system.connections.filter(x => x);
await this.actor.update({
'system.biography': {
background: addQuestions(this.actor.system.biography.background, backgroundQuestions),
connections: addQuestions(this.actor.system.biography.connections, connections)
}
});
}
}
const allowed = await super._preCreate(data, options, user);

View file

@ -63,7 +63,17 @@
"source": "Daggerheart SRD",
"page": 9,
"artist": ""
}
},
"backgroundQuestions": [
"Who from your community taught you to have such confidence in yourself?",
"You were in love once. Who did you adore, and how did they hurt you?",
"Youve always looked up to another bard. Who are they, and why do you idolize them?"
],
"connections": [
"What made you realize we were going to be such good friends?",
"What do I do that annoys you?",
"Why do you grab my hand at night?"
]
},
"effects": [],
"ownership": {
@ -77,10 +87,10 @@
"exportSource": null,
"coreVersion": "13.347",
"systemId": "daggerheart",
"systemVersion": "1.1.0",
"systemVersion": "1.1.2",
"createdTime": 1754174600538,
"modifiedTime": 1755943467705,
"lastModifiedBy": "tt3PwMBXcTLCtIQU"
"modifiedTime": 1756399046200,
"lastModifiedBy": "gbAAZWyczKwejDNh"
},
"_id": "vegl3bFOq3pcFTWT",
"sort": 300000,

View file

@ -63,7 +63,17 @@
"source": "Daggerheart SRD",
"page": 10,
"artist": ""
}
},
"backgroundQuestions": [
"Why was the community you grew up in so reliant on nature and its creatures?",
"Who was the first wild animal you bonded with? Why did your bond end?",
"Who has been trying to hunt you down? What do they want from you?"
],
"connections": [
"What did you confide in me that makes me leap into danger for you every time?",
"What animal do I say you remind me of?",
"What affectionate nickname have you given me?"
]
},
"effects": [],
"folder": null,
@ -79,10 +89,10 @@
"exportSource": null,
"coreVersion": "13.347",
"systemId": "daggerheart",
"systemVersion": "1.1.0",
"systemVersion": "1.1.2",
"createdTime": 1754222247012,
"modifiedTime": 1755943479440,
"lastModifiedBy": "tt3PwMBXcTLCtIQU"
"modifiedTime": 1756399003725,
"lastModifiedBy": "gbAAZWyczKwejDNh"
},
"_key": "!items!ZNwUTCyGCEcidZFv"
}

View file

@ -59,7 +59,17 @@
"source": "Daggerheart SRD",
"page": 15,
"artist": ""
}
},
"backgroundQuestions": [
"Who from your community did you fail to protect, and why do you still think of them?",
"Youve been tasked with protecting something important and delivering\nit somewhere dangerous. What is it, and where does it need to go?",
"You consider an aspect of yourself to be a weakness. What is it, and how has it affected you?"
],
"connections": [
"How did I save your life the first time we met?",
"What small gift did you give me that you notice I always carry with me?",
"What lie have you told me about yourself that I absolutely believe?"
]
},
"effects": [],
"folder": null,
@ -75,10 +85,10 @@
"exportSource": null,
"coreVersion": "13.347",
"systemId": "daggerheart",
"systemVersion": "1.1.0",
"systemVersion": "1.1.2",
"createdTime": 1754246931974,
"modifiedTime": 1755943488697,
"lastModifiedBy": "tt3PwMBXcTLCtIQU"
"modifiedTime": 1756398951257,
"lastModifiedBy": "gbAAZWyczKwejDNh"
},
"_key": "!items!nRAyoC0fOzXPDa4z"
}

View file

@ -59,7 +59,17 @@
"source": "Daggerheart SRD",
"page": 16,
"artist": ""
}
},
"backgroundQuestions": [
"A terrible creature hurt your community, and youve vowed to hunt them down. What are they, and what unique trail or sign do they leave behind?",
"Your first kill almost killed you, too. What was it, and what part of you was never the same after that event?",
"Youve traveled many dangerous lands, but what is the one place you refuse to go?"
],
"connections": [
"What friendly competition do we have?",
"Why do you act differently when were alone than when others are around?",
"What threat have you asked me to watch for, and why are you worried about it?"
]
},
"effects": [],
"folder": null,
@ -75,10 +85,10 @@
"exportSource": null,
"coreVersion": "13.347",
"systemId": "daggerheart",
"systemVersion": "1.1.0",
"systemVersion": "1.1.2",
"createdTime": 1754268869310,
"modifiedTime": 1755943505024,
"lastModifiedBy": "tt3PwMBXcTLCtIQU"
"modifiedTime": 1756398897309,
"lastModifiedBy": "gbAAZWyczKwejDNh"
},
"_key": "!items!BTyfve69LKqoOi9S"
}

View file

@ -63,7 +63,17 @@
"source": "Daggerheart SRD",
"page": 19,
"artist": ""
}
},
"backgroundQuestions": [
"What did you get caught doing that got you exiled from your home community?",
"You used to have a different life, but youve tried to leave it behind. Who from your past is still chasing you?",
"Who from your past were you most sad to say goodbye to?"
],
"connections": [
"What did I recently convince you to do that got us both in trouble?",
"What have I discovered about your past that I hold secret from the others?",
"Who do you know from my past, and how have they influenced your feelings about me?"
]
},
"effects": [],
"folder": null,
@ -79,10 +89,10 @@
"exportSource": null,
"coreVersion": "13.347",
"systemId": "daggerheart",
"systemVersion": "1.1.0",
"systemVersion": "1.1.2",
"createdTime": 1754325275832,
"modifiedTime": 1755943515533,
"lastModifiedBy": "tt3PwMBXcTLCtIQU"
"modifiedTime": 1756398839983,
"lastModifiedBy": "gbAAZWyczKwejDNh"
},
"_key": "!items!CvHlkHZfpMiCz5uT"
}

View file

@ -59,7 +59,17 @@
"source": "Daggerheart SRD",
"page": 20,
"artist": ""
}
},
"backgroundQuestions": [
"Which god did you devote yourself to? What incredible feat did they perform for you in a moment of desperation?",
"How did your appearance change after taking your oath?",
"In what strange or unique way do you communicate with your god?"
],
"connections": [
"What promise did you make me agree to, should you die on the battlefield?",
"Why do you ask me so many questions about my god?",
"Youve told me to protect one member of our party above all others, even yourself. Who are they and why?"
]
},
"effects": [],
"folder": null,
@ -75,10 +85,10 @@
"exportSource": null,
"coreVersion": "13.347",
"systemId": "daggerheart",
"systemVersion": "1.1.0",
"systemVersion": "1.1.2",
"createdTime": 1754351482530,
"modifiedTime": 1755943523935,
"lastModifiedBy": "tt3PwMBXcTLCtIQU"
"modifiedTime": 1756398795596,
"lastModifiedBy": "gbAAZWyczKwejDNh"
},
"_key": "!items!5ZnlJ5bEoyOTkUJv"
}

View file

@ -67,7 +67,17 @@
"source": "Daggerheart SRD",
"page": 22,
"artist": ""
}
},
"backgroundQuestions": [
"What did you do that made the people in your community wary of you?",
"What mentor taught you to control your untamed magic, and why are they no longer able to guide you?",
"You have a deep fear you hide from everyone. What is it, and why does it scare you?"
],
"connections": [
"Why do you trust me so deeply?",
"What did I do that makes you cautious around me?",
"Why do we keep our shared past a secret?"
]
},
"effects": [],
"folder": null,
@ -83,10 +93,10 @@
"exportSource": null,
"coreVersion": "13.347",
"systemId": "daggerheart",
"systemVersion": "1.1.0",
"systemVersion": "1.1.2",
"createdTime": 1754349743129,
"modifiedTime": 1755943536635,
"lastModifiedBy": "tt3PwMBXcTLCtIQU"
"modifiedTime": 1756398741027,
"lastModifiedBy": "gbAAZWyczKwejDNh"
},
"_key": "!items!DchOzHcWIJE9FKcR"
}

View file

@ -63,7 +63,17 @@
"source": "Daggerheart SRD",
"page": 23,
"artist": ""
}
},
"backgroundQuestions": [
"Who taught you to fight, and why did they stay behind when you left home?",
"Somebody defeated you in battle years ago and left you to die. Who was it, and how did they betray you?",
"What legendary place have you always wanted to visit, and why is it so special?"
],
"connections": [
"We knew each other long before this party came together. How?",
"What mundane task do you usually help me with off the battlefield?",
"What fear am I helping you overcome?"
]
},
"effects": [],
"folder": null,
@ -79,10 +89,10 @@
"exportSource": null,
"coreVersion": "13.347",
"systemId": "daggerheart",
"systemVersion": "1.1.0",
"systemVersion": "1.1.2",
"createdTime": 1754255776706,
"modifiedTime": 1755943545980,
"lastModifiedBy": "tt3PwMBXcTLCtIQU"
"modifiedTime": 1756398696324,
"lastModifiedBy": "gbAAZWyczKwejDNh"
},
"_key": "!items!xCUWwJz4WSthvLfy"
}

View file

@ -63,7 +63,17 @@
"source": "Daggerheart SRD",
"page": 25,
"artist": ""
}
},
"backgroundQuestions": [
"What responsibilities did your community once count on you for?\nHow did you let them down?",
"Youve spent your life searching for a book or object of great\nsignificance. What is it, and why is it so important to you?",
"You have a powerful rival. Who are they, and why are you so determined to defeat them?"
],
"connections": [
"What favor have I asked of you that youre not sure you can fulfill?",
"What weird hobby or strange fascination do we both share?",
"What secret about yourself have you entrusted only to me?"
]
},
"effects": [],
"folder": null,
@ -79,10 +89,10 @@
"exportSource": null,
"coreVersion": "13.347",
"systemId": "daggerheart",
"systemVersion": "1.1.0",
"systemVersion": "1.1.2",
"createdTime": 1754253505323,
"modifiedTime": 1755943555087,
"lastModifiedBy": "tt3PwMBXcTLCtIQU"
"modifiedTime": 1756391897762,
"lastModifiedBy": "gbAAZWyczKwejDNh"
},
"_key": "!items!5LwX4m8ziY3F1ZGC"
}

View file

@ -43,4 +43,18 @@
}
}
}
.tab.questions {
.questions-container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
.questions-section {
display: flex;
flex-direction: column;
gap: 4px;
}
}
}
}

View file

@ -0,0 +1,27 @@
<section
class='tab {{tabs.questions.cssClass}} {{tabs.questions.id}}'
data-tab='{{tabs.questions.id}}'
data-group='{{tabs.questions.group}}'
>
<div class="questions-container">
<fieldset>
<legend>{{localize "DAGGERHEART.ACTORS.Character.backgroundQuestions"}}</legend>
<div class="questions-section">
{{#each source.system.backgroundQuestions as | question index |}}
<textarea name="{{concat "system.backgroundQuestions." index}}">{{question}}</textarea>
{{/each}}
</div>
</fieldset>
<fieldset>
<legend>{{localize "DAGGERHEART.ACTORS.Character.connections"}}</legend>
<div class="questions-section">
{{#each source.system.connections as | connection index |}}
<textarea name="{{concat "system.connections." index}}">{{connection}}</textarea>
{{/each}}
</div>
</fieldset>
</div>
</section>