fix: endurance regen 6min→3min dans combat/forge/craft + potions d'énergie
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 32s
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 32s
Bug: combat/forge/craft calculaient la regen à 1pt/6min (ancien) alors que character.service utilisait 1pt/3min (nouveau). Le joueur voyait 8 endurance dans le HUD mais le backend refusait le combat avec 4. Potions d'énergie: Potion (30 endurance, 20 or) + Grande (60 endurance, 45 or). Consommable instantané via la boutique — le joueur peut acheter du temps de jeu.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { characterApi } from '../api/endpoints';
|
||||
import { api } from '../api/client';
|
||||
import { Coins, ShoppingBag, Sword, Shield, Heart } from 'lucide-react';
|
||||
import { Coins, ShoppingBag, Sword, Shield, Heart, Zap } from 'lucide-react';
|
||||
|
||||
const RARITY_COLORS: Record<string, string> = {
|
||||
common: '#9ca3af',
|
||||
@@ -58,7 +58,10 @@ function ShopItemCard({ item, onBuy, buying }: { item: ShopItem; onBuy: () => vo
|
||||
<div style={{ display: 'flex', gap: 12, fontSize: 11, color: '#6b7a99' }}>
|
||||
{item.attackBonus > 0 && <span style={{ display: 'flex', alignItems: 'center', gap: 3 }}><Sword size={10} color="#f4c94e" /> +{item.attackBonus} ATK</span>}
|
||||
{item.defenseBonus > 0 && <span style={{ display: 'flex', alignItems: 'center', gap: 3 }}><Shield size={10} color="#5ba4f5" /> +{item.defenseBonus} DEF</span>}
|
||||
{item.type === 'consumable' && <span style={{ display: 'flex', alignItems: 'center', gap: 3 }}><Heart size={10} color="#e84040" /> +50% PV</span>}
|
||||
{item.type === 'consumable' && (item as any).forceBonus > 0
|
||||
? <span style={{ display: 'flex', alignItems: 'center', gap: 3 }}><Zap size={10} color="#5ba4f5" /> +{(item as any).forceBonus} endurance</span>
|
||||
: item.type === 'consumable' && <span style={{ display: 'flex', alignItems: 'center', gap: 3 }}><Heart size={10} color="#e84040" /> +50% PV</span>
|
||||
}
|
||||
{item.minLevel > 1 && <span>Niv. {item.minLevel}+</span>}
|
||||
</div>
|
||||
</div>
|
||||
@@ -131,8 +134,10 @@ export function ShopPage() {
|
||||
|
||||
{buyMut.isSuccess && (
|
||||
<div className="card card-gold" style={{ marginBottom: '1rem', padding: '0.5rem 1rem', fontSize: 13, textAlign: 'center' }}>
|
||||
{(buyMut.data as any)?.type === 'consumable'
|
||||
? `🧪 ${(buyMut.data as any)?.item} utilisé ! +${(buyMut.data as any)?.effect?.healed} PV`
|
||||
{(buyMut.data as any)?.effectType === 'endurance'
|
||||
? `⚡ ${(buyMut.data as any)?.item} — +${(buyMut.data as any)?.effect?.restored} endurance`
|
||||
: (buyMut.data as any)?.effectType === 'hp'
|
||||
? `🧪 ${(buyMut.data as any)?.item} — +${(buyMut.data as any)?.effect?.healed} PV`
|
||||
: `✅ ${(buyMut.data as any)?.item} acheté ! (-${(buyMut.data as any)?.goldSpent} or)`
|
||||
}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user