better display
Browse files
src/lib/components/Piclets/AbilityDisplay.svelte
CHANGED
@@ -124,88 +124,54 @@
|
|
124 |
</div>
|
125 |
</div>
|
126 |
|
127 |
-
{#if
|
128 |
<div class="ability-counts">
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
</span>
|
133 |
-
{/if}
|
134 |
-
{#if ability.triggers?.length}
|
135 |
-
<span class="count-badge triggers">
|
136 |
-
{ability.triggers.length} trigger{ability.triggers.length !== 1 ? 's' : ''}
|
137 |
-
</span>
|
138 |
-
{/if}
|
139 |
</div>
|
140 |
{/if}
|
141 |
</div>
|
142 |
|
143 |
-
{#if expanded &&
|
144 |
<div class="ability-details">
|
145 |
-
|
146 |
-
<
|
147 |
-
<
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
<div class="
|
154 |
-
<span
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
<div class="effect-details">
|
161 |
-
<span class="effect-type">{effect.type}</span>
|
162 |
-
<span class="effect-description">{formatEffectDescription(effect)}</span>
|
163 |
</div>
|
164 |
</div>
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
<div class="trigger-header">
|
180 |
-
<span class="trigger-icon">{getTriggerIcon(trigger.event)}</span>
|
181 |
-
<div class="trigger-info">
|
182 |
-
<span class="trigger-event">{trigger.event}</span>
|
183 |
-
{#if trigger.condition}
|
184 |
-
<span class="trigger-condition">when {trigger.condition}</span>
|
185 |
-
{/if}
|
186 |
-
</div>
|
187 |
</div>
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
{#each trigger.effects as effect}
|
192 |
-
<div class="trigger-effect">
|
193 |
-
<span
|
194 |
-
class="effect-icon small"
|
195 |
-
style="color: {getEffectColor(effect.type)}"
|
196 |
-
>
|
197 |
-
{getEffectIcon(effect.type)}
|
198 |
-
</span>
|
199 |
-
<span class="effect-summary">{formatEffectDescription(effect)}</span>
|
200 |
-
</div>
|
201 |
-
{/each}
|
202 |
-
</div>
|
203 |
-
{/if}
|
204 |
-
</div>
|
205 |
-
{/each}
|
206 |
-
</div>
|
207 |
</div>
|
208 |
-
|
209 |
</div>
|
210 |
{/if}
|
211 |
</div>
|
|
|
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}
|
137 |
<div class="ability-details">
|
138 |
+
<div class="triggers-section">
|
139 |
+
<h4 class="section-title">
|
140 |
+
<span class="section-icon">⚡</span>
|
141 |
+
Triggered Effects
|
142 |
+
</h4>
|
143 |
+
<div class="triggers-list">
|
144 |
+
{#each ability.triggers as trigger}
|
145 |
+
<div class="trigger-item">
|
146 |
+
<div class="trigger-header">
|
147 |
+
<span class="trigger-icon">{getTriggerIcon(trigger.event)}</span>
|
148 |
+
<div class="trigger-info">
|
149 |
+
<span class="trigger-event">{trigger.event}</span>
|
150 |
+
{#if trigger.condition}
|
151 |
+
<span class="trigger-condition">when {trigger.condition}</span>
|
152 |
+
{/if}
|
|
|
|
|
|
|
153 |
</div>
|
154 |
</div>
|
155 |
+
|
156 |
+
{#if trigger.effects?.length}
|
157 |
+
<div class="trigger-effects">
|
158 |
+
{#each trigger.effects as effect}
|
159 |
+
<div class="trigger-effect">
|
160 |
+
<span
|
161 |
+
class="effect-icon small"
|
162 |
+
style="color: {getEffectColor(effect.type)}"
|
163 |
+
>
|
164 |
+
{getEffectIcon(effect.type)}
|
165 |
+
</span>
|
166 |
+
<span class="effect-summary">{formatEffectDescription(effect)}</span>
|
167 |
+
</div>
|
168 |
+
{/each}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
</div>
|
170 |
+
{/if}
|
171 |
+
</div>
|
172 |
+
{/each}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
</div>
|
174 |
+
</div>
|
175 |
</div>
|
176 |
{/if}
|
177 |
</div>
|
src/lib/components/Piclets/PicletDetail.svelte
CHANGED
@@ -157,7 +157,7 @@
|
|
157 |
<div class="tab-content">
|
158 |
{#if selectedTab === 'about'}
|
159 |
<div class="content-card">
|
160 |
-
<p class="description">{instance.concept}</p>
|
161 |
</div>
|
162 |
{:else if selectedTab === 'stats'}
|
163 |
<div class="content-card">
|
|
|
157 |
<div class="tab-content">
|
158 |
{#if selectedTab === 'about'}
|
159 |
<div class="content-card">
|
160 |
+
<p class="description">{battleDefinition.description || instance.concept}</p>
|
161 |
</div>
|
162 |
{:else if selectedTab === 'stats'}
|
163 |
<div class="content-card">
|
src/lib/db/piclets.ts
CHANGED
@@ -31,6 +31,36 @@ export async function monsterToPicletInstance(monster: Monster, level: number =
|
|
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 => ({
|
36 |
name: move.name,
|
@@ -39,7 +69,7 @@ export async function monsterToPicletInstance(monster: Monster, level: number =
|
|
39 |
accuracy: move.accuracy,
|
40 |
pp: move.pp,
|
41 |
currentPp: move.pp,
|
42 |
-
description:
|
43 |
}));
|
44 |
|
45 |
// Field stats are variations of regular stats
|
|
|
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 => ({
|
66 |
name: move.name,
|
|
|
69 |
accuracy: move.accuracy,
|
70 |
pp: move.pp,
|
71 |
currentPp: move.pp,
|
72 |
+
description: createMoveDescription(move)
|
73 |
}));
|
74 |
|
75 |
// Field stats are variations of regular stats
|