more deets
Browse files
src/lib/components/MonsterGenerator/MonsterGenerator.svelte
CHANGED
@@ -71,13 +71,13 @@ Here is the output schema:
|
|
71 |
"defence": {"type": "integer", "minimum": 0, "maximum": 100, "description": "Defensive capability (0=paper thin, 100=impenetrable)"},
|
72 |
"attack": {"type": "integer", "minimum": 0, "maximum": 100, "description": "Attack power (0=harmless, 100=devastating)"},
|
73 |
"speed": {"type": "integer", "minimum": 0, "maximum": 100, "description": "Movement speed (0=immobile, 100=lightning fast)"},
|
74 |
-
"
|
75 |
"attackActionDescription": {"type": "string", "description": "Description of a primary attack that deals damage"},
|
76 |
"boostActionDescription": {"type": "string", "description": "Description of an action that buffs the monster's own stats/status"},
|
77 |
"disparageActionDescription": {"type": "string", "description": "Description of an action that lowers enemy stats/status"},
|
78 |
"specialActionDescription": {"type": "string", "description": "Description of a powerful action with single use per battle"}
|
79 |
},
|
80 |
-
"required": ["name", "description", "rarity", "HP", "defence", "attack", "speed", "
|
81 |
}
|
82 |
\`\`\`
|
83 |
|
@@ -360,9 +360,16 @@ Assistant: \`\`\`json`;
|
|
360 |
}
|
361 |
}
|
362 |
|
|
|
|
|
|
|
|
|
|
|
|
|
363 |
const stats: MonsterStats = parsedStats;
|
364 |
state.monsterStats = stats;
|
365 |
console.log('Monster stats generated:', stats);
|
|
|
366 |
} catch (parseError) {
|
367 |
console.error('Failed to parse JSON:', parseError, 'Raw output:', cleanJson);
|
368 |
throw new Error('Failed to parse monster stats JSON');
|
@@ -416,27 +423,6 @@ Assistant: \`\`\`json`;
|
|
416 |
Generating your monster...
|
417 |
{/if}
|
418 |
</p>
|
419 |
-
|
420 |
-
{#if state.imageCaption && state.currentStep !== 'captioning'}
|
421 |
-
<div class="intermediate-result">
|
422 |
-
<h4>Image Description:</h4>
|
423 |
-
<p>{state.imageCaption}</p>
|
424 |
-
</div>
|
425 |
-
{/if}
|
426 |
-
|
427 |
-
{#if state.monsterConcept && state.currentStep !== 'captioning' && state.currentStep !== 'conceptualizing'}
|
428 |
-
<div class="intermediate-result">
|
429 |
-
<h4>Monster Concept:</h4>
|
430 |
-
<p>{state.monsterConcept}</p>
|
431 |
-
</div>
|
432 |
-
{/if}
|
433 |
-
|
434 |
-
{#if state.imagePrompt && state.currentStep === 'generating'}
|
435 |
-
<div class="intermediate-result">
|
436 |
-
<h4>Generation Prompt:</h4>
|
437 |
-
<p>{state.imagePrompt}</p>
|
438 |
-
</div>
|
439 |
-
{/if}
|
440 |
</div>
|
441 |
{/if}
|
442 |
</div>
|
@@ -478,24 +464,4 @@ Assistant: \`\`\`json`;
|
|
478 |
margin-bottom: 2rem;
|
479 |
}
|
480 |
|
481 |
-
.intermediate-result {
|
482 |
-
width: 100%;
|
483 |
-
max-width: 700px;
|
484 |
-
background: #f8f9fa;
|
485 |
-
padding: 1.5rem;
|
486 |
-
border-radius: 8px;
|
487 |
-
margin-bottom: 1.5rem;
|
488 |
-
text-align: left;
|
489 |
-
}
|
490 |
-
|
491 |
-
.intermediate-result h4 {
|
492 |
-
margin: 0 0 0.5rem 0;
|
493 |
-
color: #495057;
|
494 |
-
}
|
495 |
-
|
496 |
-
.intermediate-result p {
|
497 |
-
margin: 0;
|
498 |
-
line-height: 1.6;
|
499 |
-
color: #333;
|
500 |
-
}
|
501 |
</style>
|
|
|
71 |
"defence": {"type": "integer", "minimum": 0, "maximum": 100, "description": "Defensive capability (0=paper thin, 100=impenetrable)"},
|
72 |
"attack": {"type": "integer", "minimum": 0, "maximum": 100, "description": "Attack power (0=harmless, 100=devastating)"},
|
73 |
"speed": {"type": "integer", "minimum": 0, "maximum": 100, "description": "Movement speed (0=immobile, 100=lightning fast)"},
|
74 |
+
"specialPassiveTraitDescription": {"type": "string", "description": "Description of a passive trait that gives the monster a unique advantage in battle"},
|
75 |
"attackActionDescription": {"type": "string", "description": "Description of a primary attack that deals damage"},
|
76 |
"boostActionDescription": {"type": "string", "description": "Description of an action that buffs the monster's own stats/status"},
|
77 |
"disparageActionDescription": {"type": "string", "description": "Description of an action that lowers enemy stats/status"},
|
78 |
"specialActionDescription": {"type": "string", "description": "Description of a powerful action with single use per battle"}
|
79 |
},
|
80 |
+
"required": ["name", "description", "rarity", "HP", "defence", "attack", "speed", "specialPassiveTraitDescription", "attackActionDescription", "boostActionDescription", "disparageActionDescription", "specialActionDescription"]
|
81 |
}
|
82 |
\`\`\`
|
83 |
|
|
|
360 |
}
|
361 |
}
|
362 |
|
363 |
+
// Map specialPassiveTraitDescription to specialPassiveTrait
|
364 |
+
if (parsedStats.specialPassiveTraitDescription) {
|
365 |
+
parsedStats.specialPassiveTrait = parsedStats.specialPassiveTraitDescription;
|
366 |
+
delete parsedStats.specialPassiveTraitDescription;
|
367 |
+
}
|
368 |
+
|
369 |
const stats: MonsterStats = parsedStats;
|
370 |
state.monsterStats = stats;
|
371 |
console.log('Monster stats generated:', stats);
|
372 |
+
console.log('Monster stats JSON:', JSON.stringify(stats, null, 2));
|
373 |
} catch (parseError) {
|
374 |
console.error('Failed to parse JSON:', parseError, 'Raw output:', cleanJson);
|
375 |
throw new Error('Failed to parse monster stats JSON');
|
|
|
423 |
Generating your monster...
|
424 |
{/if}
|
425 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
426 |
</div>
|
427 |
{/if}
|
428 |
</div>
|
|
|
464 |
margin-bottom: 2rem;
|
465 |
}
|
466 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
467 |
</style>
|
src/lib/components/MonsterGenerator/MonsterResult.svelte
CHANGED
@@ -131,8 +131,8 @@
|
|
131 |
</div>
|
132 |
<div class="abilities-section">
|
133 |
<div class="ability-item">
|
134 |
-
<h5>Special
|
135 |
-
<p>{workflowState.monsterStats.
|
136 |
</div>
|
137 |
<div class="ability-item">
|
138 |
<h5>Attack</h5>
|
|
|
131 |
</div>
|
132 |
<div class="abilities-section">
|
133 |
<div class="ability-item">
|
134 |
+
<h5>Special Passive Trait</h5>
|
135 |
+
<p>{workflowState.monsterStats.specialPassiveTrait}</p>
|
136 |
</div>
|
137 |
<div class="ability-item">
|
138 |
<h5>Attack</h5>
|
src/lib/types/index.ts
CHANGED
@@ -111,7 +111,7 @@ export interface MonsterStats {
|
|
111 |
defence: number; // 0-100
|
112 |
attack: number; // 0-100
|
113 |
speed: number; // 0-100
|
114 |
-
|
115 |
attackActionDescription: string;
|
116 |
boostActionDescription: string;
|
117 |
disparageActionDescription: string;
|
|
|
111 |
defence: number; // 0-100
|
112 |
attack: number; // 0-100
|
113 |
speed: number; // 0-100
|
114 |
+
specialPassiveTrait: string;
|
115 |
attackActionDescription: string;
|
116 |
boostActionDescription: string;
|
117 |
disparageActionDescription: string;
|