feat: add weapon speed, attack bonus, melee defense columns
Backend: add weapon_time and melee_defense_bonus to search CTE. Frontend: show Speed, Attack Bonus (+%), Melee Def (+%) columns visible by default. Material/Workmanship hidden by default. Attack bonus and melee defense shown as percentage offset from 1.0. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
0b91f111ad
commit
5b706d45e0
2 changed files with 8 additions and 2 deletions
|
|
@ -3011,6 +3011,8 @@ async def search_items(
|
|||
COALESCE(cs.max_damage, -1) as max_damage,
|
||||
COALESCE(cs.armor_level, -1) as armor_level,
|
||||
COALESCE(cs.attack_bonus, -1.0) as attack_bonus,
|
||||
COALESCE(cs.melee_defense_bonus, -1.0) as melee_defense_bonus,
|
||||
COALESCE(cs.weapon_time, -1) as weapon_time,
|
||||
GREATEST(
|
||||
COALESCE((rd.int_values->>'314')::int, -1),
|
||||
COALESCE((rd.int_values->>'374')::int, -1)
|
||||
|
|
|
|||
|
|
@ -459,8 +459,12 @@ const RESULT_COLUMNS = [
|
|||
render: item => `<td class="text-right">${item.armor_level > 0 ? item.armor_level : '-'}</td>` },
|
||||
{ key: 'max_damage', label: 'Max Dmg', sort: 'max_damage', defaultVisible: true, cls: 'text-right',
|
||||
render: item => `<td class="text-right">${item.max_damage > 0 ? item.max_damage : '-'}</td>` },
|
||||
{ key: 'attack_bonus', label: 'Attack Bonus', sort: 'attack_bonus', defaultVisible: false, cls: 'text-right',
|
||||
render: item => `<td class="text-right">${item.attack_bonus > 0 ? (item.attack_bonus * 100).toFixed(0) + '%' : '-'}</td>` },
|
||||
{ key: 'weapon_time', label: 'Speed', sort: 'weapon_time', defaultVisible: true, cls: 'text-right',
|
||||
render: item => `<td class="text-right">${item.weapon_time > 0 ? item.weapon_time : '-'}</td>` },
|
||||
{ key: 'attack_bonus', label: 'Attack Bonus', sort: 'attack_bonus', defaultVisible: true, cls: 'text-right',
|
||||
render: item => `<td class="text-right">${item.attack_bonus > 0 ? '+' + ((item.attack_bonus - 1) * 100).toFixed(0) + '%' : '-'}</td>` },
|
||||
{ key: 'melee_defense_bonus', label: 'Melee Def', sort: 'melee_defense_bonus', defaultVisible: true, cls: 'text-right',
|
||||
render: item => `<td class="text-right">${item.melee_defense_bonus > 0 ? '+' + ((item.melee_defense_bonus - 1) * 100).toFixed(0) + '%' : '-'}</td>` },
|
||||
{ key: 'material_name', label: 'Material', sort: 'material_name', defaultVisible: false },
|
||||
{ key: 'workmanship', label: 'Wkm', sort: 'workmanship', defaultVisible: false, cls: 'text-right',
|
||||
render: item => `<td class="text-right">${item.workmanship > 0 ? item.workmanship : '-'}</td>` },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue