Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
PepijnMC authored Jan 15, 2023
1 parent bdf78a0 commit 6e697bd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
Binary file modified module.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions scripts/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ export function constructPrompt(language, system, world, subject, subjectType, k
for (const [key, value] of Object.entries(prompt_mapping)) {
prompt = prompt.replace(key, value);
}
//console.log(prompt);
console.log(prompt);

//Send the prompt.
sendPrompt(prompt, key)
//sendPrompt(prompt, key)
}

//Send a prompt the GPT-3.
Expand Down
20 changes: 19 additions & 1 deletion scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,25 @@ Hooks.on('getActorSheetHeaderButtons', (sheet, headerButtons) => {

//Add a new button the the header of the itme sheet. Spells are also considered items.
Hooks.on('getItemSheetHeaderButtons', (sheet, headerButtons) => {
const subjectTypeMapping = {'item': 'item', 'weapon': `attack from a ${sheet?.actor?.name || 'generic'} creature`, 'feat': `feature from a ${sheet?.actor?.name || 'generic'} creature`}
const actor = sheet?.actor
var actorContext = ''
if (actor) {
switch (actor.type) {
case 'character':
actorContext = ' from a player character';
break;
case 'npc':
actorContext = ` from a ${actor.name} creature`;
break;
case 'vehicle':
actorContext = ` from a ${actor.name} vehicle`;
break;
case 'group':
actorContext = ` from a group of ${actor.name}`;
break;
}
}
const subjectTypeMapping = {'item': 'item', 'weapon': `attack${actorContext}`, 'spell': `spell${actorContext}`, 'feat': `feature${actorContext}`};
var subjectType = sheet.object.type;
if (subjectType in subjectTypeMapping) {
headerButtons.unshift({
Expand Down

0 comments on commit 6e697bd

Please sign in to comment.