add move descriptions
Browse files
src/lib/components/PicletGenerator/PicletGenerator.svelte
CHANGED
@@ -579,11 +579,6 @@ The output should be formatted as a JSON instance that conforms to the schema be
|
|
579 |
"properties": {
|
580 |
"name": {"type": "string", "description": "Name of the special ability"},
|
581 |
"description": {"type": "string", "description": "Description of what the ability does"},
|
582 |
-
"effects": {
|
583 |
-
"type": "array",
|
584 |
-
"items": {"$ref": "#/definitions/Effect"},
|
585 |
-
"description": "Passive effects that are always active"
|
586 |
-
},
|
587 |
"triggers": {
|
588 |
"type": "array",
|
589 |
"items": {"$ref": "#/definitions/Trigger"},
|
@@ -632,6 +627,7 @@ The output should be formatted as a JSON instance that conforms to the schema be
|
|
632 |
"type": "object",
|
633 |
"properties": {
|
634 |
"name": {"type": "string", "description": "Name of the move"},
|
|
|
635 |
"type": {"type": "string", "enum": ["beast", "bug", "aquatic", "flora", "mineral", "space", "machina", "structure", "culture", "cuisine", "normal"], "description": "Move type for STAB and effectiveness"},
|
636 |
"power": {"type": "integer", "minimum": 0, "maximum": 250, "description": "Base power (0 for status moves)"},
|
637 |
"accuracy": {"type": "integer", "minimum": 30, "maximum": 100, "description": "Hit chance percentage"},
|
@@ -807,9 +803,29 @@ Write your response within \`\`\`json\`\`\``;
|
|
807 |
// Use tier from the JSON response
|
808 |
tier = parsedStats.tier || 'medium';
|
809 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
810 |
// Ensure the name from structured concept is used if available
|
811 |
if (monsterName && monsterName !== 'Unknown Monster') {
|
812 |
-
|
|
|
813 |
}
|
814 |
|
815 |
// Ensure baseStats are numbers within reasonable ranges
|
|
|
579 |
"properties": {
|
580 |
"name": {"type": "string", "description": "Name of the special ability"},
|
581 |
"description": {"type": "string", "description": "Description of what the ability does"},
|
|
|
|
|
|
|
|
|
|
|
582 |
"triggers": {
|
583 |
"type": "array",
|
584 |
"items": {"$ref": "#/definitions/Trigger"},
|
|
|
627 |
"type": "object",
|
628 |
"properties": {
|
629 |
"name": {"type": "string", "description": "Name of the move"},
|
630 |
+
"description": {"type": "string", "description": "Description of what the move does"},
|
631 |
"type": {"type": "string", "enum": ["beast", "bug", "aquatic", "flora", "mineral", "space", "machina", "structure", "culture", "cuisine", "normal"], "description": "Move type for STAB and effectiveness"},
|
632 |
"power": {"type": "integer", "minimum": 0, "maximum": 250, "description": "Base power (0 for status moves)"},
|
633 |
"accuracy": {"type": "integer", "minimum": 30, "maximum": 100, "description": "Hit chance percentage"},
|
|
|
803 |
// Use tier from the JSON response
|
804 |
tier = parsedStats.tier || 'medium';
|
805 |
|
806 |
+
// Clean asterisks from JSON-parsed name (qwen3 often adds them for markdown bold)
|
807 |
+
if (parsedStats.name) {
|
808 |
+
parsedStats.name = parsedStats.name.replace(/\*/g, '');
|
809 |
+
}
|
810 |
+
|
811 |
+
// Clean asterisks from special ability name
|
812 |
+
if (parsedStats.specialAbility?.name) {
|
813 |
+
parsedStats.specialAbility.name = parsedStats.specialAbility.name.replace(/\*/g, '');
|
814 |
+
}
|
815 |
+
|
816 |
+
// Clean asterisks from move names
|
817 |
+
if (parsedStats.movepool) {
|
818 |
+
for (const move of parsedStats.movepool) {
|
819 |
+
if (move.name) {
|
820 |
+
move.name = move.name.replace(/\*/g, '');
|
821 |
+
}
|
822 |
+
}
|
823 |
+
}
|
824 |
+
|
825 |
// Ensure the name from structured concept is used if available
|
826 |
if (monsterName && monsterName !== 'Unknown Monster') {
|
827 |
+
// Remove asterisk characters used for markdown bold formatting
|
828 |
+
parsedStats.name = monsterName.replace(/\*/g, '');
|
829 |
}
|
830 |
|
831 |
// Ensure baseStats are numbers within reasonable ranges
|
src/lib/components/Piclets/AbilityDisplay.svelte
CHANGED
@@ -124,13 +124,6 @@
|
|
124 |
</div>
|
125 |
</div>
|
126 |
|
127 |
-
{#if ability.triggers?.length}
|
128 |
-
<div class="ability-counts">
|
129 |
-
<span class="count-badge triggers">
|
130 |
-
{ability.triggers.length} trigger{ability.triggers.length !== 1 ? 's' : ''}
|
131 |
-
</span>
|
132 |
-
</div>
|
133 |
-
{/if}
|
134 |
</div>
|
135 |
|
136 |
{#if expanded && ability.triggers?.length}
|
|
|
124 |
</div>
|
125 |
</div>
|
126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
</div>
|
128 |
|
129 |
{#if expanded && ability.triggers?.length}
|
src/lib/db/piclets.ts
CHANGED
@@ -30,36 +30,6 @@ export async function monsterToPicletInstance(monster: Monster, level: number =
|
|
30 |
if (!validType) {
|
31 |
console.warn(`Invalid primaryType "${stats.primaryType}" from stats, falling back to concept detection`);
|
32 |
}
|
33 |
-
|
34 |
-
// Helper function to create meaningful move descriptions
|
35 |
-
function createMoveDescription(move: any): string {
|
36 |
-
if (!move.effects || move.effects.length === 0) {
|
37 |
-
return "No special effects";
|
38 |
-
}
|
39 |
-
|
40 |
-
const effectDescriptions = move.effects.map((effect: any) => {
|
41 |
-
switch (effect.type) {
|
42 |
-
case 'damage':
|
43 |
-
return `Deals ${effect.amount || 'normal'} damage`;
|
44 |
-
case 'modifyStats':
|
45 |
-
const statChanges = Object.entries(effect.stats || {}).map(([stat, change]) =>
|
46 |
-
`${change} ${stat}`
|
47 |
-
).join(', ');
|
48 |
-
return `Modifies stats: ${statChanges}`;
|
49 |
-
case 'applyStatus':
|
50 |
-
const chance = effect.chance && effect.chance < 100 ? ` (${effect.chance}%)` : '';
|
51 |
-
return `Inflicts ${effect.status}${chance}`;
|
52 |
-
case 'heal':
|
53 |
-
return `Heals ${effect.amount || 'moderate'} HP`;
|
54 |
-
case 'mechanicOverride':
|
55 |
-
return `Special: ${effect.mechanic}`;
|
56 |
-
default:
|
57 |
-
return effect.type;
|
58 |
-
}
|
59 |
-
});
|
60 |
-
|
61 |
-
return effectDescriptions.slice(0, 2).join(', ') + (effectDescriptions.length > 2 ? '...' : '');
|
62 |
-
}
|
63 |
|
64 |
// Create moves from battle-ready format
|
65 |
const moves: BattleMove[] = stats.movepool.map(move => ({
|
@@ -69,7 +39,7 @@ export async function monsterToPicletInstance(monster: Monster, level: number =
|
|
69 |
accuracy: move.accuracy,
|
70 |
pp: move.pp,
|
71 |
currentPp: move.pp,
|
72 |
-
description:
|
73 |
}));
|
74 |
|
75 |
// Field stats are variations of regular stats
|
|
|
30 |
if (!validType) {
|
31 |
console.warn(`Invalid primaryType "${stats.primaryType}" from stats, falling back to concept detection`);
|
32 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
// Create moves from battle-ready format
|
35 |
const moves: BattleMove[] = stats.movepool.map(move => ({
|
|
|
39 |
accuracy: move.accuracy,
|
40 |
pp: move.pp,
|
41 |
currentPp: move.pp,
|
42 |
+
description: move.description
|
43 |
}));
|
44 |
|
45 |
// Field stats are variations of regular stats
|
src/lib/types/index.ts
CHANGED
@@ -187,6 +187,7 @@ export interface AbilityTrigger {
|
|
187 |
|
188 |
export interface BattleMove {
|
189 |
name: string;
|
|
|
190 |
type: 'beast' | 'bug' | 'aquatic' | 'flora' | 'mineral' | 'space' | 'machina' | 'structure' | 'culture' | 'cuisine' | 'normal';
|
191 |
power: number;
|
192 |
accuracy: number;
|
|
|
187 |
|
188 |
export interface BattleMove {
|
189 |
name: string;
|
190 |
+
description: string;
|
191 |
type: 'beast' | 'bug' | 'aquatic' | 'flora' | 'mineral' | 'space' | 'machina' | 'structure' | 'culture' | 'cuisine' | 'normal';
|
192 |
power: number;
|
193 |
accuracy: number;
|