Add optional specialty type field to boss battles
Gym leaders, Elite Four, and champions can now have a Pokemon type specialty (e.g. Rock, Water). Shown as a type image badge on boss cards in the run view, and editable via dropdown in the admin form. Includes migration, export, and seed pipeline support. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,12 @@ interface BossBattleFormModalProps {
|
||||
onEditTeam?: () => void
|
||||
}
|
||||
|
||||
const POKEMON_TYPES = [
|
||||
'normal', 'fire', 'water', 'electric', 'grass', 'ice',
|
||||
'fighting', 'poison', 'ground', 'flying', 'psychic', 'bug',
|
||||
'rock', 'ghost', 'dragon', 'dark', 'steel', 'fairy',
|
||||
]
|
||||
|
||||
const BOSS_TYPES = [
|
||||
{ value: 'gym_leader', label: 'Gym Leader' },
|
||||
{ value: 'elite_four', label: 'Elite Four' },
|
||||
@@ -37,6 +43,7 @@ export function BossBattleFormModal({
|
||||
}: BossBattleFormModalProps) {
|
||||
const [name, setName] = useState(boss?.name ?? '')
|
||||
const [bossType, setBossType] = useState(boss?.bossType ?? 'gym_leader')
|
||||
const [specialtyType, setSpecialtyType] = useState(boss?.specialtyType ?? '')
|
||||
const [badgeName, setBadgeName] = useState(boss?.badgeName ?? '')
|
||||
const [badgeImageUrl, setBadgeImageUrl] = useState(boss?.badgeImageUrl ?? '')
|
||||
const [levelCap, setLevelCap] = useState(String(boss?.levelCap ?? ''))
|
||||
@@ -51,6 +58,7 @@ export function BossBattleFormModal({
|
||||
onSubmit({
|
||||
name,
|
||||
bossType,
|
||||
specialtyType: specialtyType || null,
|
||||
badgeName: badgeName || null,
|
||||
badgeImageUrl: badgeImageUrl || null,
|
||||
levelCap: Number(levelCap),
|
||||
@@ -83,7 +91,7 @@ export function BossBattleFormModal({
|
||||
</button>
|
||||
) : undefined}
|
||||
>
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="grid grid-cols-3 gap-4">
|
||||
<div>
|
||||
<label className="block text-sm font-medium mb-1">Name</label>
|
||||
<input
|
||||
@@ -109,6 +117,21 @@ export function BossBattleFormModal({
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label className="block text-sm font-medium mb-1">Specialty</label>
|
||||
<select
|
||||
value={specialtyType}
|
||||
onChange={(e) => setSpecialtyType(e.target.value)}
|
||||
className="w-full px-3 py-2 border rounded-md dark:bg-gray-700 dark:border-gray-600 capitalize"
|
||||
>
|
||||
<option value="">None</option>
|
||||
{POKEMON_TYPES.map((t) => (
|
||||
<option key={t} value={t} className="capitalize">
|
||||
{t.charAt(0).toUpperCase() + t.slice(1)}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user